Skip to content

Commit 0a08d91

Browse files
committed
Include Warden and Creaking in PushableEntityClassGroup
Thanks to discord user _____________
1 parent 9d88579 commit 0a08d91

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

common/src/main/java/net/caffeinemc/mods/lithium/common/entity/pushable/PushableEntityClassGroup.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package net.caffeinemc.mods.lithium.common.entity.pushable;
22

3+
import java.util.function.Supplier;
4+
35
import net.caffeinemc.mods.lithium.common.entity.EntityClassGroup;
46
import net.caffeinemc.mods.lithium.common.reflection.ReflectionUtil;
57
import net.caffeinemc.mods.lithium.common.services.PlatformMappingInformation;
@@ -9,10 +11,10 @@
911
import net.minecraft.world.entity.ambient.Bat;
1012
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
1113
import net.minecraft.world.entity.decoration.ArmorStand;
14+
import net.minecraft.world.entity.monster.creaking.Creaking;
15+
import net.minecraft.world.entity.monster.warden.Warden;
1216
import net.minecraft.world.entity.player.Player;
1317

14-
import java.util.function.Supplier;
15-
1618
public class PushableEntityClassGroup {
1719

1820
/**
@@ -36,10 +38,13 @@ public class PushableEntityClassGroup {
3638
CACHABLE_UNPUSHABILITY = new EntityClassGroup(
3739
(Class<?> entityClass, Supplier<EntityType<?>> entityType) -> {
3840
if (LivingEntity.class.isAssignableFrom(entityClass) && !Player.class.isAssignableFrom(entityClass)) {
39-
if (!ReflectionUtil.hasMethodOverride(entityClass, LivingEntity.class, true, remapped_isPushable)) {
40-
if (!ReflectionUtil.hasMethodOverride(entityClass, LivingEntity.class, true, remapped_isClimbing)) {
41-
return true;
41+
if (!ReflectionUtil.hasMethodOverride(entityClass, LivingEntity.class, true, remapped_isClimbing)) {
42+
if (Creaking.class.isAssignableFrom(entityClass)) {
43+
return !ReflectionUtil.hasMethodOverride(entityClass, Creaking.class, true, remapped_isPushable);
44+
} else if (Warden.class.isAssignableFrom(entityClass)) {
45+
return !ReflectionUtil.hasMethodOverride(entityClass, Warden.class, true, remapped_isPushable);
4246
}
47+
return !ReflectionUtil.hasMethodOverride(entityClass, LivingEntity.class, true, remapped_isPushable);
4348
}
4449
}
4550
return false;

0 commit comments

Comments
 (0)