added invulnerable_time property for Wither

This commit is contained in:
D3v1s0m 2023-10-03 14:35:33 +05:30
parent 6ebc60c11e
commit 51f4f709f6
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1
2 changed files with 13 additions and 9 deletions

@ -102,14 +102,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
// Shulker
registerType("attach_direction", null); // TODO: make a direction enum
registerType("shield_height", 0); // TODO: figure this out
registerType("shulker_color", DyeColor.RED); // TODO
// Wither
registerType("invulnerable_time", 0); // TODO
*/
}
@ -366,6 +358,17 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
linkProperties("wolf_angry", "tamed", "sitting");
}
// Wither
int witherIndex;
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) witherIndex = 16; // using the first index, so we can add the other properties later if needed
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_15)) witherIndex = 15;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_14)) witherIndex = 14;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_10)) witherIndex = 12;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_9)) witherIndex = 11;
else witherIndex = 17;
witherIndex += 3; // skip the first 3 indexes, will be used for the other properties later
register(new IntegerProperty("invulnerable_time", witherIndex++, 0, false));
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_9)) return;
// Shulker
int shulkerIndex;

@ -153,7 +153,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
.addProperties("hand"));
register(builder(p, "wither", EntityTypes.WITHER)
.setHologramOffset(1.525));
.setHologramOffset(1.525)
.addProperties("invulnerable_time"));
register(builder(p, "wolf", EntityTypes.WOLF)
.setHologramOffset(-1.125)