Compare commits

...
2 Commits
Author SHA1 Message Date
Harald Korneliussen 6523b26038 Fixes mooshroom infusion crash (#136) 2026-10-25 10:49:27 +01:00
Edgar Su 5a6b05f13c fix liquefaction focus not making lava (#147) 2026-10-03 20:23:20 -05:00
3 changed files with 39 additions and 33 deletions

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,
@@ -401,7 +401,27 @@ public class ItemFocusLiquefaction extends ItemFocusBasic {
final int meltable = this.isMeltableBlock(bi, md);
final boolean flammable = bi.isFlammable(p.worldObj, x, y, z, ForgeDirection.UNKNOWN);
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(bi, 1, md));
if (result != null && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
// Meltable blocks (e.g. stone) take priority over any furnace smelting recipe they may have,
// otherwise mods that add a smelting recipe for stone (such as Et Futurum Requiem's smooth
// stone) would prevent the stone -> lava transmutation.
if (meltable > 0 && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
if (meltable == 1) {
p.worldObj.setBlockToAir(x, y, z);
} else if (meltable == 2) {
if (p.worldObj.provider.dimensionId != -1) {
p.worldObj.setBlock(x, y, z, Blocks.water, 0, 3);
} else {
p.worldObj.setBlockToAir(x, y, z);
}
} else if (meltable == 3) {
p.worldObj.setBlock(x, y, z, Blocks.dirt, 0, 3);
} else if (meltable == 4) {
Blocks.tnt.onBlockDestroyedByPlayer(p.worldObj, x, y, z, 1);
p.worldObj.setBlockToAir(x, y, z);
} else if (meltable == 6) {
p.worldObj.setBlock(x, y, z, Blocks.lava, 0, 3);
}
} else if (result != null && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
if (this.getUpgradeLevel(wand.getFocusItem(stack), ItemFocusLiquefaction.purity) > 0
&& Utils.findSpecialMiningResult(new ItemStack(bi, 1, md), 9999.0f, p.worldObj.rand) != null) {
final ItemStack pure = Utils
@@ -433,23 +453,6 @@ public class ItemFocusLiquefaction extends ItemFocusBasic {
theItem.setEntityItemStack(result.copy());
p.worldObj.spawnEntityInWorld(theItem);
}
} else if (meltable > 0 && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
if (meltable == 1) {
p.worldObj.setBlockToAir(x, y, z);
} else if (meltable == 2) {
if (p.worldObj.provider.dimensionId != -1) {
p.worldObj.setBlock(x, y, z, Blocks.water, 0, 3);
} else {
p.worldObj.setBlockToAir(x, y, z);
}
} else if (meltable == 3) {
p.worldObj.setBlock(x, y, z, Blocks.dirt, 0, 3);
} else if (meltable == 4) {
Blocks.tnt.onBlockDestroyedByPlayer(p.worldObj, x, y, z, 1);
p.worldObj.setBlockToAir(x, y, z);
} else if (meltable == 6) {
p.worldObj.setBlock(x, y, z, Blocks.lava, 0, 3);
}
} else if (flammable && wand.consumeAllVis(stack, p, this.getVisCost(stack), true, true)) {
p.worldObj.setBlock(x, y, z, Blocks.fire);
}
@@ -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();