Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Fix Unreachable Code; Add Armadillo to BUKKIT_NMS_MAP
Browse files Browse the repository at this point in the history
  • Loading branch information
gmitch215 committed May 4, 2024
1 parent c8df04b commit 1ab1ad9
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ public static Class<? extends EntityLiving> toNMS(Class<? extends LivingEntity>
// Sometimes we can get lucky...
nms = Class.forName(EntityInsentient.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(EntityLiving.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(EntityInsentient.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(EntityLiving.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
if (nms == null) nms = Class.forName(EntityInsentient.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(EntityLiving.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public void setFlag(Mob m, Pathfinder.PathfinderFlag flag, boolean target, boole
.put(Animals.class, Animal.class)
.put(Allay.class, net.minecraft.world.entity.animal.allay.Allay.class)
.put(Ambient.class, AmbientCreature.class)
.put(Armadillo.class, net.minecraft.world.entity.animal.armadillo.Armadillo.class)
.put(Axolotl.class, net.minecraft.world.entity.animal.axolotl.Axolotl.class)
.put(Bat.class, net.minecraft.world.entity.ambient.Bat.class)
.put(Bee.class, net.minecraft.world.entity.animal.Bee.class)
Expand Down Expand Up @@ -282,10 +283,12 @@ public static Class<? extends net.minecraft.world.entity.LivingEntity> toNMS(Cla
try {
// Sometimes we can get lucky...
nms = Class.forName(PathfinderMob.class.getPackageName() + "." + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);

// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored) {}
} catch (ClassNotFoundException ignored) {
try {
// Some Pre-Mojang Mapping Classes start with "Entity"
if (nms == null) nms = Class.forName(PathfinderMob.class.getPackageName() + ".Entity" + clazz.getSimpleName()).asSubclass(net.minecraft.world.entity.LivingEntity.class);
} catch (ClassNotFoundException ignored2) {}
}

if (nms == null) throw new AssertionError("Could not convert " + clazz.getName() + " to NMS class");

Expand Down

0 comments on commit 1ab1ad9

Please sign in to comment.