more changes..
This commit is contained in:
parent
d715042bc7
commit
fa79090614
2 changed files with 18 additions and 12 deletions
|
@ -36,6 +36,8 @@ public class TfCommand {
|
||||||
AnimalRPFabric.users.remove(entity.getUuid());
|
AnimalRPFabric.users.remove(entity.getUuid());
|
||||||
context.getSource().sendFeedback(
|
context.getSource().sendFeedback(
|
||||||
() -> Text.literal(Messages.get("animal_removed")), false);
|
() -> Text.literal(Messages.get("animal_removed")), false);
|
||||||
|
|
||||||
|
AnimalRPFabric.hashmapStore.save("users.json", AnimalRPFabric.users);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import ovh.sad.animalrp.common.util.Animal;
|
import ovh.sad.animalrp.common.util.Animal;
|
||||||
|
import ovh.sad.animalrp.common.util.Messages;
|
||||||
import ovh.sad.animalrp.paper.AnimalRPPaper;
|
import ovh.sad.animalrp.paper.AnimalRPPaper;
|
||||||
|
|
||||||
public class TfCommand implements CommandExecutor {
|
public class TfCommand implements CommandExecutor {
|
||||||
|
@ -24,22 +25,25 @@ public class TfCommand implements CommandExecutor {
|
||||||
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>" + Messages.get("your_options") + "<dark_green>\"" + String.join(", ", parts) + "\"<green>"));
|
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>" + Messages.get("your_options") + "<dark_green>\"" + String.join(", ", parts) + "\"<green>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if(!(sender instanceof Player)) {
|
if(!(sender instanceof Player)) {
|
||||||
sender.sendMessage(AnimalRPPaper.mm.deserialize("<gray>I'm sorry, but you have to be a player to become an animal. :("));
|
sender.sendMessage(AnimalRPPaper.mm.deserialize("<gray>" + Messages.get("no_console")));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = (Player)sender;
|
Player player = (Player)sender;
|
||||||
|
|
||||||
if(args.length == 0) {
|
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());
|
Animal previous = AnimalRPPaper.users.get(player.getUniqueId());
|
||||||
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>You start splitting apart, dropping your <blue>" + previous.name+"-like<green> appearence.."));
|
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>You start splitting apart, dropping your <blue>" + previous.name+"-like<green> appearence.."));
|
||||||
AnimalRPPaper.users.remove(player.getUniqueId());
|
AnimalRPPaper.users.remove(player.getUniqueId());
|
||||||
if(AnimalRPPaper.isChatModOff.get(player.getUniqueId()) != null)
|
|
||||||
AnimalRPPaper.isChatModOff.remove(player.getUniqueId());
|
if(AnimalRPPaper.noChat.get(player.getUniqueId()) != nul)
|
||||||
|
AnimalRPPaper.noChat.remove(player.getUniqueId());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
options(player); return true;
|
options(player); return true;
|
||||||
|
@ -49,24 +53,24 @@ public class TfCommand implements CommandExecutor {
|
||||||
|
|
||||||
String tf = args[0];
|
String tf = args[0];
|
||||||
|
|
||||||
AnimalRPPaper animal = AnimalRPPaper.animals.get(tf);
|
Animal animal = AnimalRPPaper.animals.get(tf);
|
||||||
|
|
||||||
if(animal == null) {
|
if(animal == null) {
|
||||||
options(player); return true;
|
options(player); return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AnimalRP.users.get(player.getUniqueId()) != null) {
|
if(AnimalRPPaper.users.get(player.getUniqueId()) != null) {
|
||||||
Animal previous = AnimalRP.users.get(player.getUniqueId());
|
Animal previous = AnimalRPPaper.users.get(player.getUniqueId());
|
||||||
if(previous.name == animal.name) {
|
if(previous.name == animal.name) {
|
||||||
player.sendMessage(AnimalRP.mm.deserialize("<gray>You're <blue>" + previous.name + "</blue> already! " + animal.catchphrase));
|
player.sendMessage(AnimalRPPaper.mm.deserialize("<gray>You're <blue>" + previous.name + "</blue> already! " + animal.catchphrase));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.sendMessage(AnimalRP.mm.deserialize("<green>You slowly transform, from <blue>" + previous.name + "<green> to.. <blue>" + animal.name + ". "+ animal.catchphrase));
|
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>You slowly transform, from <blue>" + previous.name + "<green> to.. <blue>" + animal.name + ". "+ animal.catchphrase));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(AnimalRP.mm.deserialize("<green>You slowly transform, to.. <blue>" + animal.name + "<green>. "+ animal.catchphrase));
|
player.sendMessage(AnimalRPPaper.mm.deserialize("<green>You slowly transform, to.. <blue>" + animal.name + "<green>. "+ animal.catchphrase));
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimalRP.users.put(player.getUniqueId(), animal);
|
AnimalRPPaper.users.put(player.getUniqueId(), animal);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue