Trigger the press fix automatically

This commit is contained in:
abel1502 2025-06-29 01:44:31 +03:00
parent 0eb87524ab
commit 3b36807242
No known key found for this signature in database
GPG Key ID: 076926596A536338
2 changed files with 24 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import java.util.HashMap;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.UpgradeManagerNT;
import com.hbm.inventory.container.ContainerMachineEPress;
@ -64,6 +65,17 @@ public class TileEntityMachineEPress extends TileEntityMachineBase implements IE
if(!worldObj.isRemote) {
// Triggers the legacy monoblock fix
if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) < BlockDummyable.offset) {
// Does nothing
// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
BlockDummyable block = (BlockDummyable)worldObj.getBlock(xCoord, yCoord, zCoord);
if (block != null) {
block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord, null);
}
}
this.updateConnections();
power = Library.chargeTEFromItems(slots, 0, power, maxPower);

View File

@ -1,5 +1,6 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.container.ContainerMachinePress;
import com.hbm.inventory.gui.GUIMachinePress;
@ -53,6 +54,17 @@ public class TileEntityMachinePress extends TileEntityMachineBase implements IGU
if(!worldObj.isRemote) {
// Triggers the legacy monoblock fix
if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) < BlockDummyable.offset) {
// Does nothing
// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
BlockDummyable block = (BlockDummyable)worldObj.getBlock(xCoord, yCoord, zCoord);
if (block != null) {
block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord, null);
}
}
boolean preheated = false;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {