Added Piglin properties

This commit is contained in:
D3v1s0m 2023-09-13 00:03:08 +05:30
parent b1f87d12bd
commit 5f5ed6ccb5
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1
2 changed files with 10 additions and 6 deletions

@ -128,10 +128,6 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
registerType("shield_height", 0); // TODO: figure this out registerType("shield_height", 0); // TODO: figure this out
registerType("shulker_color", DyeColor.RED); // TODO registerType("shulker_color", DyeColor.RED); // TODO
// Piglin
registerType("piglin_dancing", false); // TODO
registerType("piglin_charging_crossbow", false); // TODO
// Vindicator // Vindicator
registerType("celebrating", false); // TODO registerType("celebrating", false); // TODO
@ -440,12 +436,19 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_16)) return; if (!ver.isNewerThanOrEquals(ServerVersion.V_1_16)) return;
// Hoglin and Piglin Zombification
final int zombificationIndex; final int zombificationIndex;
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) zombificationIndex = 17; if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) zombificationIndex = 17; // Change piglinIndex if you change this
else zombificationIndex = 16; else zombificationIndex = 16;
register(new BooleanProperty("hoglin_immune_to_zombification", zombificationIndex, false, legacyBooleans)); register(new BooleanProperty("hoglin_immune_to_zombification", zombificationIndex, false, legacyBooleans));
register(new BooleanProperty("piglin_immune_to_zombification", zombificationIndex-1, false, legacyBooleans)); register(new BooleanProperty("piglin_immune_to_zombification", zombificationIndex-1, false, legacyBooleans));
// Piglin
int piglinIndex = zombificationIndex;
register(new BooleanProperty("piglin_baby", piglinIndex++, false, legacyBooleans));
register(new BooleanProperty("piglin_charging_crossbow", piglinIndex++, false, legacyBooleans));
register(new BooleanProperty("piglin_dancing", piglinIndex, false, legacyBooleans));
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_17)) return; if (!ver.isNewerThanOrEquals(ServerVersion.V_1_17)) return;
// Axolotl // Axolotl
register(new EncodedIntegerProperty<>("axolotl_variant", AxolotlVariant.LUCY, 17, Enum::ordinal)); register(new EncodedIntegerProperty<>("axolotl_variant", AxolotlVariant.LUCY, 17, Enum::ordinal));

@ -302,7 +302,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
register(builder(p, "piglin", EntityTypes.PIGLIN) register(builder(p, "piglin", EntityTypes.PIGLIN)
.setHologramOffset(-1.0) .setHologramOffset(-1.0)
.addEquipmentProperties()); .addEquipmentProperties()
.addProperties("piglin_baby", "piglin_charging_crossbow", "piglin_dancing"));
register(builder(p, "piglin_brute", EntityTypes.PIGLIN_BRUTE) register(builder(p, "piglin_brute", EntityTypes.PIGLIN_BRUTE)
.setHologramOffset(-0.025) .setHologramOffset(-0.025)