mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-23 09:37:35 +01:00
Fix /npc metadata remove and forward getOptional call to avoid default entity type issue
This commit is contained in:
parent
5972e3dffc
commit
1a0282d970
@ -928,16 +928,16 @@ public class NPCCommands {
|
||||
npc.data().setPersistent(args.getString(2), args.getString(3));
|
||||
}
|
||||
Messaging.sendTr(sender, Messages.METADATA_SET, args.getString(2), args.getString(3));
|
||||
} else if (args.equals("get")) {
|
||||
} else if (command.equals("get")) {
|
||||
if (args.argsLength() != 3) {
|
||||
throw new CommandException();
|
||||
}
|
||||
Messaging.send(sender, npc.data().get(args.getString(2), "null"));
|
||||
} else if (args.equals("remove")) {
|
||||
} else if (command.equals("remove")) {
|
||||
if (args.argsLength() != 3) {
|
||||
throw new CommandException();
|
||||
}
|
||||
npc.data().remove(args.getString(3));
|
||||
npc.data().remove(args.getString(2));
|
||||
Messaging.sendTr(sender, Messages.METADATA_UNSET, args.getString(2));
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class CustomEntityRegistry extends RegistryBlocks {
|
||||
return Optional.of(entities.get(var0));
|
||||
}
|
||||
|
||||
return Optional.ofNullable(this.wrapped.get(var0));
|
||||
return this.wrapped.getOptional(var0);
|
||||
}
|
||||
|
||||
public RegistryMaterials<EntityTypes<?>> getWrapped() {
|
||||
|
Loading…
Reference in New Issue
Block a user