fixed ghost blocks

This commit is contained in:
loenaaaa committed 2025-12-25 15:41:58 +08:00
1 parent 9121ced00e
commit 07d59e9cc6
3 files changed
+11 -4

No files matched your search

@@ -69,7 +69,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import fox.spiteful.avaritia.items.ItemMatterCluster;
import xonin.backhand.api.core.BackhandUtils;
public class BlockDrawers extends BlockContainer implements INetworked {
public class BlockDrawers extends BlockContainer implements INetworked, IExtendedBlockClickHandler {
private static final ResourceLocation blockConfig = new ResourceLocation(
StorageDrawers.MOD_ID + ":textures/blocks/block_config.mcmeta");
@@ -496,6 +496,13 @@ public class BlockDrawers extends BlockContainer implements INetworked {
return true;
}
@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY,
float hitZ, boolean invertShift) {
TileEntityDrawers ted = getTileEntitySafe(world, x, y, z);
ted.onClick(player, x, y, z, side, world, hitX, hitY, hitZ, invertShift);
}
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
if (halfDepth) return false;
@@ -394,8 +394,9 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
downgraded = state;
}
public void onClick(BlockDrawers block, EntityPlayer player, int x, int y, int z, int face, World world, float hitX,
float hitY, float hitZ, boolean invertShift) {
public void onClick(EntityPlayer player, int x, int y, int z, int face, World world, float hitX, float hitY,
float hitZ, boolean invertShift) {
BlockDrawers block = (BlockDrawers) world.getBlock(x, y, z);
int dir = getDirection();
if (dir == face) {
int slot = block.getDrawerSlot(face, hitX, hitY, hitZ);
@@ -50,7 +50,6 @@ public abstract class MixinPlayerControllerMP {
boolean invertShift = StorageDrawers.config.cache.invertShift;
StorageDrawers.network
.sendToServer(new BlockClickMessage(x, y, z, side, hitX, hitY, hitZ, invertShift));
ted.onClick(bd, mc.thePlayer, x, y, z, side, mc.theWorld, hitX, hitY, hitZ, invertShift);
}
}
}