diff --git a/animalrp-fabric/src/main/java/ovh/sad/animalrp/fabric/commands/TfCommand.java b/animalrp-fabric/src/main/java/ovh/sad/animalrp/fabric/commands/TfCommand.java index 630cf1e..8486840 100644 --- a/animalrp-fabric/src/main/java/ovh/sad/animalrp/fabric/commands/TfCommand.java +++ b/animalrp-fabric/src/main/java/ovh/sad/animalrp/fabric/commands/TfCommand.java @@ -36,6 +36,8 @@ public class TfCommand { AnimalRPFabric.users.remove(entity.getUuid()); context.getSource().sendFeedback( () -> Text.literal(Messages.get("animal_removed")), false); + + AnimalRPFabric.hashmapStore.save("users.json", AnimalRPFabric.users); return 0; } diff --git a/animalrp-paper/src/main/java/ovh/sad/animalrp/paper/commands/TfCommand.java b/animalrp-paper/src/main/java/ovh/sad/animalrp/paper/commands/TfCommand.java index fe282d9..3046e6c 100644 --- a/animalrp-paper/src/main/java/ovh/sad/animalrp/paper/commands/TfCommand.java +++ b/animalrp-paper/src/main/java/ovh/sad/animalrp/paper/commands/TfCommand.java @@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import ovh.sad.animalrp.common.util.Animal; +import ovh.sad.animalrp.common.util.Messages; import ovh.sad.animalrp.paper.AnimalRPPaper; public class TfCommand implements CommandExecutor { @@ -24,23 +25,26 @@ public class TfCommand implements CommandExecutor { player.sendMessage(AnimalRPPaper.mm.deserialize("" + Messages.get("your_options") + "\"" + String.join(", ", parts) + "\"")); } + @SuppressWarnings("rawtypes") @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if(!(sender instanceof Player)) { - sender.sendMessage(AnimalRPPaper.mm.deserialize("I'm sorry, but you have to be a player to become an animal. :(")); + sender.sendMessage(AnimalRPPaper.mm.deserialize("" + Messages.get("no_console"))); return true; } Player player = (Player)sender; if(args.length == 0) { - if(AnimalRP.users.get(player.getUniqueId()) != null) { + if(AnimalRPPaper.users.get(player.getUniqueId()) != null) { Animal previous = AnimalRPPaper.users.get(player.getUniqueId()); player.sendMessage(AnimalRPPaper.mm.deserialize("You start splitting apart, dropping your " + previous.name+"-like appearence..")); AnimalRPPaper.users.remove(player.getUniqueId()); - if(AnimalRPPaper.isChatModOff.get(player.getUniqueId()) != null) - AnimalRPPaper.isChatModOff.remove(player.getUniqueId()); - return true; + + if(AnimalRPPaper.noChat.get(player.getUniqueId()) != nul) + AnimalRPPaper.noChat.remove(player.getUniqueId()); + + return true; } else { options(player); return true; @@ -49,24 +53,24 @@ public class TfCommand implements CommandExecutor { String tf = args[0]; - AnimalRPPaper animal = AnimalRPPaper.animals.get(tf); + Animal animal = AnimalRPPaper.animals.get(tf); if(animal == null) { options(player); return true; } - if(AnimalRP.users.get(player.getUniqueId()) != null) { - Animal previous = AnimalRP.users.get(player.getUniqueId()); + if(AnimalRPPaper.users.get(player.getUniqueId()) != null) { + Animal previous = AnimalRPPaper.users.get(player.getUniqueId()); if(previous.name == animal.name) { - player.sendMessage(AnimalRP.mm.deserialize("You're " + previous.name + " already! " + animal.catchphrase)); + player.sendMessage(AnimalRPPaper.mm.deserialize("You're " + previous.name + " already! " + animal.catchphrase)); return true; } - player.sendMessage(AnimalRP.mm.deserialize("You slowly transform, from " + previous.name + " to.. " + animal.name + ". "+ animal.catchphrase)); + player.sendMessage(AnimalRPPaper.mm.deserialize("You slowly transform, from " + previous.name + " to.. " + animal.name + ". "+ animal.catchphrase)); } else { - player.sendMessage(AnimalRP.mm.deserialize("You slowly transform, to.. " + animal.name + ". "+ animal.catchphrase)); + player.sendMessage(AnimalRPPaper.mm.deserialize("You slowly transform, to.. " + animal.name + ". "+ animal.catchphrase)); } - AnimalRP.users.put(player.getUniqueId(), animal); + AnimalRPPaper.users.put(player.getUniqueId(), animal); return true; }