Fix /npc metadata remove and forward getOptional call to avoid default entity type issue

This commit is contained in:
fullwall 2019-12-23 11:03:08 +09:00
parent 5972e3dffc
commit 1a0282d970
2 changed files with 4 additions and 4 deletions

View File

@ -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));
}
}

View File

@ -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() {