Les joueurs peuvent maintenant gérer l'appartenance des animaux domestiquable avec /animal
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.mc_pandacraft.java.plugin.pandacraftutils.modules.cheat_protect;
|
||||
|
||||
import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
|
||||
import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
@@ -54,7 +55,7 @@ public class TamedEntityProtectManager implements Listener {
|
||||
|
||||
event.setCancelled(true);
|
||||
Player p = (Player) event.getEntered();
|
||||
p.sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(tameableEntity)+", vous ne pouvez pas y toucher");
|
||||
p.sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(tameableEntity)+ChatColor.RED+", vous ne pouvez pas y toucher");
|
||||
|
||||
|
||||
}
|
||||
@@ -72,7 +73,7 @@ public class TamedEntityProtectManager implements Listener {
|
||||
if (animal.getOwner().equals(p)) return;
|
||||
|
||||
event.setCancelled(true);
|
||||
p.sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(animal)+", vous ne pouvez pas y toucher");
|
||||
p.sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(animal)+ChatColor.RED+", vous ne pouvez pas y toucher");
|
||||
|
||||
}
|
||||
|
||||
@@ -86,10 +87,15 @@ public class TamedEntityProtectManager implements Listener {
|
||||
|
||||
Tameable animal = (Tameable) event.getRightClicked();
|
||||
|
||||
boolean selected = OnlinePlayerManager.get(event.getPlayer()).setSelectedAnimal(animal);
|
||||
if (selected) {
|
||||
event.getPlayer().sendMessage(ChatColor.GREEN+"Vous venez de sélectionner cet animal");
|
||||
}
|
||||
|
||||
if (animal.getOwner().equals(event.getPlayer())) return;
|
||||
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(animal)+", vous ne pouvez pas y toucher");
|
||||
event.getPlayer().sendMessage(ChatColor.RED+"Cet animal est à "+getOwnerDisplayName(animal)+ChatColor.RED+", vous ne pouvez pas y toucher");
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user