Sets.difference is not working in 1.8.8

This commit is contained in:
fullwall 2022-08-17 23:33:29 +08:00
parent 8bee4c8b80
commit 9592de5716
5 changed files with 11 additions and 6 deletions

View File

@ -1483,7 +1483,7 @@ public class NPCCommands {
old = old.equals("hover") ? "true" : "" + !Boolean.parseBoolean(old);
}
npc.data().setPersistent(NPC.Metadata.NAMEPLATE_VISIBLE, old);
Messaging.sendTr(sender, Messages.NAMEPLATE_VISIBILITY_TOGGLED);
Messaging.sendTr(sender, Messages.NAMEPLATE_VISIBILITY_SET, old);
}
@Command(aliases = { "npc" }, desc = "Show basic NPC information", max = 0, permission = "citizens.npc.info")

View File

@ -701,12 +701,16 @@ public class CommandTrait extends Trait {
}
}
}
for (String key : Sets.difference(Sets.newHashSet(lastUsed.keySet()), commandKeys)) {
Set<String> diff = Sets.newHashSet(lastUsed.keySet());
diff.removeAll(commandKeys);
for (String key : diff) {
lastUsed.remove(key);
nUsed.remove(key);
}
if (globalCooldowns != null) {
for (String key : Sets.difference(Sets.newHashSet(globalCooldowns.keySet()), commandKeys)) {
diff = Sets.newHashSet(globalCooldowns.keySet());
diff.removeAll(commandKeys);
for (String key : diff) {
globalCooldowns.remove(key);
}
}

View File

@ -240,9 +240,10 @@ public class Text extends Trait implements Runnable, Listener, ConversationAband
boolean sendPage(CommandSender player, int page) {
Paginator paginator = new Paginator().header("Current Texts").enablePageSwitcher();
for (int i = 0; i < text.size(); i++)
for (int i = 0; i < text.size(); i++) {
paginator.addLine("<a>" + text.get(i) + " (<<&eedit:suggest(edit " + i + " )>>) (<<&c-:command(remove " + i
+ "):Remove this text>>)");
}
return paginator.sendPage(player, page);
}

View File

@ -231,7 +231,7 @@ public class Messages {
public static final String MOVETO_FORMAT = "citizens.commands.npc.moveto.format";
public static final String MOVETO_TELEPORTED = "citizens.commands.npc.moveto.teleported";
public static final String MUSHROOM_COW_VARIANT_SET = "citizens.commands.npc.mushroomcow.variant-set";
public static final String NAMEPLATE_VISIBILITY_TOGGLED = "citizens.commands.npc.nameplate.toggled";
public static final String NAMEPLATE_VISIBILITY_SET = "citizens.commands.npc.nameplate.set";
public static final String NO_HORSE_MODIFIERS_GIVEN = "citizens.commands.npc.horse.no-modifiers";
public static final String NO_NPC_WITH_ID_FOUND = "citizens.commands.npc.spawn.missing-npc-id";
public static final String NO_STORED_SPAWN_LOCATION = "citizens.commands.npc.spawn.no-location";

View File

@ -155,7 +155,7 @@ citizens.commands.npc.mount.mount-on-itself=Can''t mount NPC on itself.
citizens.commands.npc.moveto.teleported=[[{0}]] teleported to [[{1}]].
citizens.commands.npc.mushroomcow.invalid-variant=Invalid variant. Valid values are: [[{0}]].
citizens.commands.npc.mushroomcow.variant-set=[[{0}]]''s variant set to [[{1}]].
citizens.commands.npc.nameplate.toggled=Nameplate visibility toggled.
citizens.commands.npc.nameplate.set=Nameplate visibility set to [[{0}]].
citizens.commands.npc.ocelot.deprecated=Ocelot types don''t work in this version of Minecraft. Use [[/npc type cat]] if you want to change the colour.
citizens.commands.npc.ocelot.invalid-type=Invalid ocelot type. Valid types are: [[{0}]].
citizens.commands.npc.owner.already-owner={0} is already the owner of [[{1}]].