Author Topic: Plugin Requests/Help  (Read 28091 times)

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: Plugin Requests/Help
« Reply #15 on: May 18, 2012, 06:51:46 pm »
I know most Data Types, but you said 100%, and I can't remember all of them on the top of my head :I

Ad...

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #16 on: May 18, 2012, 07:07:48 pm »
I meant the concepts of it.


Okay, so, I want to get this out of the clear, I've never coded Bukkit pluggins. I've modded before and I know Java, but never developed a plugin. So, I've watched a good hour or so of youtube videos and I'm learning a lot and I've made a basic plugin. So here's how a VERY basic plugin will look. (All this plugin does is allow a player to type /sendme and it will say on the screen "Sent" in gold. I've added my own comments to help you guys understand. If you understand how everything works in this code, you're on a good track.)


--

package com.gmail.androidphoneeric.test;


import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.logging.Logger;


public class test extends JavaPlugin {
   //Short hand for my plugin type
   public static test plugin;
   //Creates log which is type Logger. Logger allows you to interact with the server
   public final Logger log=Logger.getLogger("Minecraft");
   
   //What occurs when the plugin is enabled
   public void onEnable(){
      //Creates pdffile which is type PluginDescriptionFile that gets the description of this specific object
      PluginDescriptionFile pdffile=this.getDescription();
      //Prints out to console that the plugin has been enabled.
      log.info(pdffile.getName()+"has been enabled!");
   }
   
   public void onDisable(){
      //Creates pdffile which is type PluginDescriptionFile that gets the description of this specific object
      PluginDescriptionFile pdffile=this.getDescription();
      //Prints out to console that the plugin has been disabled.
      log.info(pdffile.getName()+"has been disabled.");
      
   }
   //What occurs when a command has been called upon and what to do in such cases
   //@sender: The sender of the command
   //@cmd:
   //commandLabel: What command they called
   //args: Basic String args
   public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
      //Casts the sender to a player object
      Player player=(Player) sender;
      //Check if this is the command they called
      if(commandLabel.equalsIgnoreCase("sendme"))
      {
         player.sendMessage(ChatColor.GOLD+"sent");
         return true;
      }
      return false;
   }
   


}
------
Don't worry about knowing what the imports are and each one, and the comments should give you a run down of it all. But if you can read the code very well, you should be good for basic development!


liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: Plugin Requests/Help
« Reply #17 on: May 18, 2012, 07:14:00 pm »
I can read most of it, but I won't be able to type it from scratch :L. Basically just if the the public void is on, plugin enabled, vice versa. You put in a command (Like an event listener) and it will say "sent" I just don't get the logger package

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #18 on: May 19, 2012, 12:30:18 pm »
I can read most of it, but I won't be able to type it from scratch :L. Basically just if the the public void is on, plugin enabled, vice versa. You put in a command (Like an event listener) and it will say "sent" I just don't get the logger package


Liquid, I can't tell whether I'm understanding you or not but by the way it sounds, in no way do I mean to be mean, you have no idea what you're talking about. Public and void are java keywords, you do not put them on, one is to denote access and one is the return type. Also, you don't NEED to pass an evenlistener to activate the send. I may understanding your incorrectly though.

Prodigy39

  • Professor
  • Surfing south to SeaFoam
  • *****
  • Posts: 1969
  • Friendliness: 18
  • Live your life the way you want to
Re: Plugin Requests/Help
« Reply #19 on: May 19, 2012, 12:39:57 pm »
Para, I know squat but I'd be glad to help. I'm a really fast learner. PS I have a mac :/
"Tene likes her men like squirrels like their acorns... Buried." -Me, inspired from adult swim
I approve

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #20 on: May 19, 2012, 12:57:00 pm »
Para, I know squat but I'd be glad to help. I'm a really fast learner. PS I have a mac :/


Perfect, welcome to the team! A mac is fine, just install eclipse for the mac.

Prodigy39

  • Professor
  • Surfing south to SeaFoam
  • *****
  • Posts: 1969
  • Friendliness: 18
  • Live your life the way you want to
Re: Plugin Requests/Help
« Reply #21 on: May 19, 2012, 01:09:14 pm »
Which one? Theres like 10 of em
"Tene likes her men like squirrels like their acorns... Buried." -Me, inspired from adult swim
I approve

Rigby

  • Guest
Re: Plugin Requests/Help
« Reply #22 on: May 19, 2012, 01:35:28 pm »
Sooo what's the first day in which we can set up a date to learn shit...?

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: Plugin Requests/Help
« Reply #23 on: May 19, 2012, 05:41:06 pm »
Yeah...I'm pretty much shit at Java at the moment.

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #24 on: May 19, 2012, 06:05:20 pm »
@liquid, it's fine, you'll learn


So we had out first lesson today. WE covered basic data types and methods. PRetty helpful.


I've also finally compiled the basis of "MobsInGrass" plugin. Right now, if you go into tall grass and type the command, it has a fixed percent chance of spawning either a Spider or Zombie with a message saying "A WILD (what the name of the mob spawns) HAS APPEARED!". I'll need to make it so it happens when you walk into grass rather than by command but that's very easy. I'm also working on a repel and attract part so that you can increase/decrease the amount of percent chance that a mob will spawn, it's really easy.

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: Plugin Requests/Help
« Reply #25 on: May 19, 2012, 06:08:03 pm »

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #26 on: May 19, 2012, 06:23:42 pm »
That's a fine over view of data types. Keep reading that tutorial website and see how much you can learn.

Prodigy39

  • Professor
  • Surfing south to SeaFoam
  • *****
  • Posts: 1969
  • Friendliness: 18
  • Live your life the way you want to
Re: Plugin Requests/Help
« Reply #27 on: May 19, 2012, 06:29:25 pm »
Which Eclipse do i download? There's like 10. And after that is it 32 or 64 bit?
"Tene likes her men like squirrels like their acorns... Buried." -Me, inspired from adult swim
I approve

Rigby

  • Guest
Re: Plugin Requests/Help
« Reply #28 on: May 19, 2012, 06:30:36 pm »
Get Classic and you should get the mac version, not sure if they have 32/64-bits for Macs

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: Plugin Requests/Help
« Reply #29 on: May 19, 2012, 06:31:18 pm »
Download the classic one. And just download 32 to be safe. If you have a x64, get that. But if you don't know, use 32.