Fixes mooshroom infusion crash (#136)

This commit is contained in:
Harald Korneliussen authored and GitHub committed 2026-10-25 10:49:27 +01:00
1 parent 5a6b05f13c
commit 6523b26038
2 files changed
+18 -15

No files matched your search

@@ -3243,7 +3243,7 @@ public class ThaumicHorizons {
critterRecipes.add(
new CreatureInfusionRecipe(
"cowInfusion",
EntityList.getEntityID(new EntityMooshroom(null)),
-EntityList.getEntityID(new EntityMooshroom(null)),
2,
(new AspectList()).add(Aspect.PLANT, 8).add(Aspect.BEAST, 4),
EntityCow.class,
@@ -1239,22 +1239,25 @@ public class TileVat extends TileThaumcraft implements IAspectContainer, IEssent
EntityLivingBase created = null;
if ((Integer) out < 0) {
created = (EntityLivingBase) EntityList.createEntityByID(-(Integer) out, this.worldObj);
} else {
final ModContainer mc = Loader.instance().getIndexedModList().get("ThaumicHorizons");
try {
created = (EntityLivingBase) EntityRegistry.instance().lookupModSpawn(mc, (Integer) out)
.getEntityClass().getConstructor(World.class).newInstance(this.worldObj);
} catch (InvocationTargetException e) {
e.getCause().printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
}
final ModContainer mc = Loader.instance().getIndexedModList().get("ThaumicHorizons");
try {
created = (EntityLivingBase) EntityRegistry.instance().lookupModSpawn(mc, (Integer) out)
.getEntityClass().getConstructor(World.class).newInstance(this.worldObj);
} catch (InvocationTargetException e) {
e.getCause().printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
if (created != null) {
created.copyLocationAndAnglesFrom(this.getEntityContained());
created.copyDataFrom(this.getEntityContained(), true);
if (created instanceof IEntityInfusedStats) {
((IEntityInfusedStats) created).resetStats();
}
this.setEntityContained(created);
}
created.copyLocationAndAnglesFrom(this.getEntityContained());
created.copyDataFrom(this.getEntityContained(), true);
if (created instanceof IEntityInfusedStats) {
((IEntityInfusedStats) created).resetStats();
}
this.setEntityContained(created);
} else if (out instanceof NBTBase) {
final NBTTagCompound tagMods = (NBTTagCompound) out;
final Multimap map = HashMultimap.create();