Skip to content

Commit

Permalink
Don't execute smeltery-blocks rightclick-interactions clientside #1527
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Apr 11, 2015
1 parent 763b449 commit 7e0b9fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
15 changes: 9 additions & 6 deletions src/main/java/tconstruct/smeltery/blocks/SearedBlock.java
Expand Up @@ -87,8 +87,10 @@ else if (md == 1)
if (player.isSneaking())
return false;

FaucetLogic logic = (FaucetLogic) world.getTileEntity(x, y, z);
logic.setActive(true);
if(!world.isRemote) {
FaucetLogic logic = (FaucetLogic) world.getTileEntity(x, y, z);
logic.setActive(true);
}
return true;
}
else
Expand All @@ -97,10 +99,11 @@ else if (md == 1)

boolean activateCastingBlock (World world, int x, int y, int z, EntityPlayer player)
{

CastingBlockLogic logic = (CastingBlockLogic) world.getTileEntity(x, y, z);
logic.interact(player);
world.markBlockForUpdate(x, y, z);
if(!world.isRemote) {
CastingBlockLogic logic = (CastingBlockLogic) world.getTileEntity(x, y, z);
logic.interact(player);
world.markBlockForUpdate(x, y, z);
}
return true;
}

Expand Down
15 changes: 3 additions & 12 deletions src/main/java/tconstruct/smeltery/blocks/SmelteryBlock.java
Expand Up @@ -138,6 +138,7 @@ else if (meta == 11)

}


/*
* @Override public int getRenderBlockPass() { return 1; }
*/
Expand Down Expand Up @@ -215,20 +216,10 @@ public Object getModInstance ()
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ)
{
if (player.isSneaking() || world.getBlockMetadata(x, y, z) != 0)
if (world.getBlockMetadata(x, y, z) != 0)
return false;

Integer integer = getGui(world, x, y, z, player);
if (integer == null || integer == -1)
{
return false;
}
else
{
// world.markBlockForUpdate(x, y, z);
player.openGui(getModInstance(), integer, world, x, y, z);
return true;
}
return super.onBlockActivated(world, x,y,z, player, side, clickX, clickY, clickZ);
}

@Override
Expand Down

0 comments on commit 7e0b9fa

Please sign in to comment.