Untitled
Never
package me.rubenio1.fabric; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; public class Fabric extends JavaPlugin { public void onEnable() { getCommand("logtowood1").setExecutor(new EventsClass()); getCommand("logtowood2").setExecutor(new EventsClass()); } public void onDisable() { } public class EventsClass implements Listener, CommandExecutor { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(sender instanceof Player) { if (cmd.getName().equalsIgnoreCase("logtowood1")) { Inventory i = ((HumanEntity) sender).getInventory(); for(ItemStack inven : i.getContents()){ if (inven == null) { continue; } if(inven.getType().equals(Material.LOG)){ sender.sendMessage("Dur." + inven.getDurability()); if(inven.getDurability() == (0)){ ((HumanEntity) sender).getInventory().remove(inven.getType()); //don't know how many logs there will be removed for (ItemStack is : ((HumanEntity) sender).getInventory().addItem(new ItemStack(Material.WOOD, 1 /*amount of items*/, (short) 0 /*damage value*/)).values()) { ((Entity) sender).getWorld().dropItem(((Entity) sender).getLocation(), is);//this is for when the player doesn't have space left, so it will be droped return true; } } if(inven.getDurability() == (1)){ Bukkit.getLogger().info("1"); ((HumanEntity) sender).getInventory().remove(inven.getType()); //don't know how many logs there will be removed for (ItemStack is : ((HumanEntity) sender).getInventory().addItem(new ItemStack(Material.WOOD, 1 /*amount of items*/, (short) 1 /*damage value*/)).values()) { ((Entity) sender).getWorld().dropItem(((Entity) sender).getLocation(), is);//this is for when the player doesn't have space left, so it will be droped return true; } } } } } } return true; } } }
Raw Text
-
¡¡Anderson cada día es más puta!! Sexo anal al aire libre
17 min ago
-
No Deposit Bonus
38 min ago
-
https://www.facebook.com/SuperiorCBDGummiesInCa/
38 min ago
-
Adult Telegram Channels
41 min ago
-
FGS TYFDGF
42 min ago
-
"Makers CBD Gummies: A Maker's Path to Tranquility"
47 min ago
-
FilthyMassage - Busty Blonde Milf Gets Her Huge Tits Oiled And Gets Fucked
50 min ago
-
Untitled
1 hour ago
-
~@~[[Official!]] Men's Basketball Championship Live Streams@ReddiT at Home?
1 hour ago
-
Phoenix SEO
1 hour ago