Because potatoes
This commit is contained in:
parent
4b731bf20d
commit
a6c354e97c
3 changed files with 65 additions and 0 deletions
|
@ -11,5 +11,7 @@ public class Hello extends Component{
|
||||||
this.registerCommand(plugin, new HelloCommand(plugin));
|
this.registerCommand(plugin, new HelloCommand(plugin));
|
||||||
this.registerListener(plugin, new HelloBedsplode());
|
this.registerListener(plugin, new HelloBedsplode());
|
||||||
this.registerCommand(plugin, new HelloCow());
|
this.registerCommand(plugin, new HelloCow());
|
||||||
|
this.registerCommand(plugin, new HelloItem());
|
||||||
|
this.registerCommand(plugin, new HelloMagicPotato());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
28
src/main/java/buttondevteam/presents/hello/HelloItem.java
Normal file
28
src/main/java/buttondevteam/presents/hello/HelloItem.java
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
package buttondevteam.presents.hello;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import buttondevteam.presents.architecture.commands.PlayerCommand;
|
||||||
|
|
||||||
|
public class HelloItem extends PlayerCommand {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean OnCommand(Player player, String alias, String[] args) {
|
||||||
|
ItemStack potato = new ItemStack(Material.BAKED_POTATO);
|
||||||
|
player.getInventory().addItem(potato);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean GetModOnly() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String GetCommandPath(){
|
||||||
|
return "hello item";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package buttondevteam.presents.hello;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import buttondevteam.presents.architecture.commands.ModCommand;
|
||||||
|
|
||||||
|
public class HelloMagicPotato extends ModCommand {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean OnCommand(Player player, String alias, String[] args) {
|
||||||
|
ItemStack potato = new ItemStack(Material.BAKED_POTATO);
|
||||||
|
ItemMeta meta = potato.getItemMeta();
|
||||||
|
|
||||||
|
potato.addUnsafeEnchantment(Enchantment.DURABILITY, 10);
|
||||||
|
|
||||||
|
ArrayList<String> lore = new ArrayList<String>();
|
||||||
|
lore.add("Once upon a time");
|
||||||
|
lore.add("There was a beautiful potato that ruled a fantastic kingdom. With its armies of french"
|
||||||
|
+ "fries and cannons of hash browns, it was unstopple.");
|
||||||
|
lore.add("Until one fateful day...");
|
||||||
|
meta.setLore(lore);
|
||||||
|
|
||||||
|
player.getInventory().addItem(potato);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public String GetCommandPath(){
|
||||||
|
return "hello magicpotato";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue