|
4 | 4 | import com.denizenscript.denizen.nms.NMSHandler; |
5 | 5 | import com.denizenscript.denizen.nms.interfaces.EntityHelper; |
6 | 6 | import com.denizenscript.denizen.nms.v26_1.Handler; |
7 | | -import com.denizenscript.denizen.nms.v26_1.ReflectionMappingsInfo; |
8 | 7 | import com.denizenscript.denizen.nms.v26_1.impl.network.handlers.DenizenNetworkManagerImpl; |
9 | 8 | import com.denizenscript.denizen.objects.EntityTag; |
10 | 9 | import com.denizenscript.denizen.objects.properties.entity.EntityState; |
|
92 | 91 |
|
93 | 92 | public class EntityHelperImpl extends EntityHelper { |
94 | 93 |
|
95 | | - public static final MethodHandle ENTITY_ONGROUND_SETTER = ReflectionHelper.getFinalSetter(net.minecraft.world.entity.Entity.class, ReflectionMappingsInfo.Entity_onGround, boolean.class); |
| 94 | + public static final MethodHandle ENTITY_ONGROUND_SETTER = ReflectionHelper.getFinalSetter(net.minecraft.world.entity.Entity.class, "onGround", boolean.class); |
96 | 95 |
|
97 | | - public static final EntityDataAccessor<Boolean> ENDERMAN_DATA_ACCESSOR_SCREAMING = ReflectionHelper.getFieldValue(EnderMan.class, ReflectionMappingsInfo.EnderMan_DATA_CREEPY, null); |
| 96 | + public static final EntityDataAccessor<Boolean> ENDERMAN_DATA_ACCESSOR_SCREAMING = ReflectionHelper.getFieldValue(EnderMan.class, "DATA_CREEPY", null); |
98 | 97 |
|
99 | 98 | @Override |
100 | 99 | public void setInvisible(Entity entity, boolean invisible) { |
@@ -152,8 +151,8 @@ public double getDamageTo(LivingEntity attacker, Entity target) { |
152 | 151 | return damage; |
153 | 152 | } |
154 | 153 |
|
155 | | - public static final MethodHandle LIVINGENTITY_AUTOSPINATTACK_SETTER = ReflectionHelper.getFinalSetter(net.minecraft.world.entity.LivingEntity.class, ReflectionMappingsInfo.LivingEntity_autoSpinAttackTicks); |
156 | | - public static final MethodHandle LIVINGENTITY_SETLIVINGENTITYFLAG = ReflectionHelper.getMethodHandle(net.minecraft.world.entity.LivingEntity.class, ReflectionMappingsInfo.LivingEntity_setLivingEntityFlag_method, int.class, boolean.class); |
| 154 | + public static final MethodHandle LIVINGENTITY_AUTOSPINATTACK_SETTER = ReflectionHelper.getFinalSetter(net.minecraft.world.entity.LivingEntity.class, "autoSpinAttackTicks"); |
| 155 | + public static final MethodHandle LIVINGENTITY_SETLIVINGENTITYFLAG = ReflectionHelper.getMethodHandle(net.minecraft.world.entity.LivingEntity.class, "setLivingEntityFlag", int.class, boolean.class); |
157 | 156 |
|
158 | 157 | @Override |
159 | 158 | public void setRiptide(Entity entity, boolean state) { |
@@ -548,7 +547,7 @@ public void setBoundingBox(Entity entity, BoundingBox box) { |
548 | 547 | ((CraftEntity) entity).getHandle().setBoundingBox(new AABB(box.getMinX(), box.getMinY(), box.getMinZ(), box.getMaxX(), box.getMaxY(), box.getMaxZ())); |
549 | 548 | } |
550 | 549 |
|
551 | | - public static final Field EXPERIENCE_ORB_AGE = ReflectionHelper.getFields(net.minecraft.world.entity.ExperienceOrb.class).get(ReflectionMappingsInfo.ExperienceOrb_age, int.class); |
| 550 | + public static final Field EXPERIENCE_ORB_AGE = ReflectionHelper.getFields(net.minecraft.world.entity.ExperienceOrb.class).get("age", int.class); |
552 | 551 |
|
553 | 552 | @Override |
554 | 553 | public void setTicksLived(Entity entity, int ticks) { |
@@ -687,7 +686,7 @@ public EntityTag getMobSpawnerDisplayEntity(CreatureSpawner spawner) { |
687 | 686 | return new EntityTag(nmsEntity.getBukkitEntity()); |
688 | 687 | } |
689 | 688 |
|
690 | | - public static final Field ZOMBIE_INWATERTIME = ReflectionHelper.getFields(net.minecraft.world.entity.monster.zombie.Zombie.class).get(ReflectionMappingsInfo.Zombie_inWaterTime, int.class); |
| 689 | + public static final Field ZOMBIE_INWATERTIME = ReflectionHelper.getFields(net.minecraft.world.entity.monster.zombie.Zombie.class).get("inWaterTime", int.class); |
691 | 690 |
|
692 | 691 | @Override |
693 | 692 | public int getInWaterTime(Zombie zombie) { |
@@ -767,7 +766,7 @@ public void setUUID(Entity entity, UUID id) { |
767 | 766 | } |
768 | 767 | } |
769 | 768 |
|
770 | | - public static final Field SynchedEntityData_itemsById = ReflectionHelper.getFields(SynchedEntityData.class).get(ReflectionMappingsInfo.SynchedEntityData_itemsById); |
| 769 | + public static final Field SynchedEntityData_itemsById = ReflectionHelper.getFields(SynchedEntityData.class).get("itemsById"); |
771 | 770 |
|
772 | 771 | public static Int2ObjectMap<SynchedEntityData.DataItem<Object>> getDataItems(Entity entity) { |
773 | 772 | try { |
|
0 commit comments