Added puff_state property
This commit is contained in:
parent
7d1772236a
commit
41cccf419f
4 changed files with 20 additions and 4 deletions
7
api/src/main/java/lol/pyr/znpcsplus/util/PuffState.java
Normal file
7
api/src/main/java/lol/pyr/znpcsplus/util/PuffState.java
Normal file
|
@ -0,0 +1,7 @@
|
|||
package lol.pyr.znpcsplus.util;
|
||||
|
||||
public enum PuffState {
|
||||
DEFLATED,
|
||||
HALF_INFLATED,
|
||||
FULLY_INFLATED,
|
||||
}
|
|
@ -274,6 +274,7 @@ public class ZNpcsPlus extends JavaPlugin {
|
|||
registerEnumParser(manager, MooshroomVariant.class, incorrectUsageMessage);
|
||||
registerEnumParser(manager, OcelotType.class, incorrectUsageMessage);
|
||||
registerEnumParser(manager, PandaGene.class, incorrectUsageMessage);
|
||||
registerEnumParser(manager, PuffState.class, incorrectUsageMessage);
|
||||
|
||||
manager.registerCommand("npc", new MultiCommand(loadHelpMessage("root"))
|
||||
.addSubcommand("create", new CreateCommand(npcRegistry, typeRegistry))
|
||||
|
|
|
@ -71,6 +71,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
registerEnumSerializer(MooshroomVariant.class);
|
||||
registerEnumSerializer(OcelotType.class);
|
||||
registerEnumSerializer(PandaGene.class);
|
||||
registerEnumSerializer(PuffState.class);
|
||||
|
||||
/*
|
||||
registerType("using_item", false); // TODO: fix it for 1.8 and add new property to use offhand item and riptide animation
|
||||
|
@ -87,9 +88,6 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
// Guardian
|
||||
registerType("is_elder", false); // TODO: ensure it only works till 1.10. Note: index is wrong on wiki.vg
|
||||
|
||||
// Pufferfish
|
||||
registerType("puff_state", null); // TODO: Make a puff state enum class
|
||||
|
||||
// Tropical Fish
|
||||
registerType("tropical_fish_variant", null); // TODO: Maybe make an enum class for this? its just an int on wiki.vg
|
||||
|
||||
|
@ -384,6 +382,15 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
register(new NBTProperty<>("shoulder_entity_left", ParrotVariant.class, shoulderIndex++, parrotVariantDecoder));
|
||||
register(new NBTProperty<>("shoulder_entity_right", ParrotVariant.class, shoulderIndex, parrotVariantDecoder));
|
||||
|
||||
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_13)) return;
|
||||
// Pufferfish
|
||||
int pufferfishIndex;
|
||||
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) pufferfishIndex = 17;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_15)) pufferfishIndex = 16;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_14)) pufferfishIndex = 15;
|
||||
else pufferfishIndex = 13;
|
||||
register(new EncodedIntegerProperty<>("puff_state", PuffState.DEFLATED, pufferfishIndex, Enum::ordinal));
|
||||
|
||||
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_14)) return;
|
||||
// Pose
|
||||
register(new NpcPoseProperty());
|
||||
|
|
|
@ -250,7 +250,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
|
|||
.setHologramOffset(-1.475));
|
||||
|
||||
register(builder(p, "pufferfish", EntityTypes.PUFFERFISH)
|
||||
.setHologramOffset(-1.625));
|
||||
.setHologramOffset(-1.625)
|
||||
.addProperties("puff_state"));
|
||||
|
||||
register(builder(p, "salmon", EntityTypes.SALMON)
|
||||
.setHologramOffset(-1.575));
|
||||
|
|
Loading…
Reference in a new issue