Skip to content

Commit

Permalink
change: clarify remapped methods (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
radiok authored Mar 15, 2023
1 parent 16f3980 commit 86e29be
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class EntityClassGroup {
public static final EntityClassGroup MINECART_BOAT_LIKE_COLLISION; //aka entities that will attempt to collide with all other entities when moving

static {
String remapped_method_30949 = FabricLoader.getInstance().getMappingResolver().mapMethodName("intermediary", "net.minecraft.class_1297", "method_30949", "(Lnet/minecraft/class_1297;)Z");
String remapped_collidesWith = FabricLoader.getInstance().getMappingResolver().mapMethodName("intermediary", "net.minecraft.class_1297", "method_30949", "(Lnet/minecraft/class_1297;)Z");
MINECART_BOAT_LIKE_COLLISION = new EntityClassGroup(
(Class<?> entityClass) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_method_30949, Entity.class));
(Class<?> entityClass) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_collidesWith, Entity.class));

//sanity check: in case intermediary mappings changed, we fail
if ((!MINECART_BOAT_LIKE_COLLISION.contains(MinecartEntity.class))) {
Expand Down Expand Up @@ -86,9 +86,9 @@ public static class NoDragonClassGroup extends EntityClassGroup {
public static final NoDragonClassGroup BOAT_SHULKER_LIKE_COLLISION; //aka entities that other entities will do block-like collisions with when moving

static {
String remapped_method_30948 = FabricLoader.getInstance().getMappingResolver().mapMethodName("intermediary", "net.minecraft.class_1297", "method_30948", "()Z");
String remapped_isCollidable = FabricLoader.getInstance().getMappingResolver().mapMethodName("intermediary", "net.minecraft.class_1297", "method_30948", "()Z");
BOAT_SHULKER_LIKE_COLLISION = new NoDragonClassGroup(
(Class<?> entityClass) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_method_30948));
(Class<?> entityClass) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_isCollidable));

if ((!BOAT_SHULKER_LIKE_COLLISION.contains(ShulkerEntity.class))) {
throw new AssertionError();
Expand Down

0 comments on commit 86e29be

Please sign in to comment.