Fix #545 Client desync when breaking owned blocks

This commit is contained in:
mezz committed 2015-03-05 22:05:32 -08:00
1 parent 3de7766db6
commit 0aec8b65e9
9 files changed
+12 -12

No files matched your search

@@ -60,7 +60,7 @@ public class BlockBeehives extends BlockContainer {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
if (canHarvestBlock(player, world.getBlockMetadata(x, y, z))) {
// Handle TE'd beehives
TileEntity tile = world.getTileEntity(x, y, z);
@@ -67,7 +67,7 @@ public class BlockArbStairs extends BlockStairs {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
if (Proxies.common.isSimulating(world) && canHarvestBlock(player, meta)) {
if (!player.capabilities.isCreativeMode) {
@@ -65,7 +65,7 @@ public class BlockFruitPod extends BlockCocoa {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
if (Proxies.common.isSimulating(world)) {
TileFruitPod tile = getPodTile(world, x, y, z);
if (tile != null) {
@@ -75,7 +75,7 @@ public class BlockFruitPod extends BlockCocoa {
}
}
return super.removedByPlayer(world, player, x, y, z, willHarvest);
return super.removedByPlayer(world, player, x, y, z);
}
@Override
@@ -164,7 +164,7 @@ public class BlockSapling extends BlockTreeContainer {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
if (Proxies.common.isSimulating(world) && canHarvestBlock(player, world.getBlockMetadata(x, y, z))) {
if (!player.capabilities.isCreativeMode) {
dropAsSapling(world, x, y, z);
@@ -209,7 +209,7 @@ public class BlockBase extends BlockForestry {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
IOwnable tile = (IOwnable) world.getTileEntity(x, y, z);
if (tile == null) {
@@ -35,10 +35,10 @@ public abstract class BlockForestry extends BlockContainer {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
IOwnable tile = (IOwnable) world.getTileEntity(x, y, z);
if (!tile.isOwnable() || tile.allowsRemoval(player)) {
return super.removedByPlayer(world, player, x, y, z, willHarvest);
return super.removedByPlayer(world, player, x, y, z);
} else {
return false;
}
@@ -263,12 +263,12 @@ public abstract class TileForestry extends TileEntity implements INetworkedEntit
@Override
public final boolean allowsRemoval(EntityPlayer player) {
return Config.disablePermissions || !isOwnable() || !isOwned() || isOwner(player) || Proxies.common.isOp(player);
return Config.disablePermissions || getAccess() == EnumAccess.SHARED || !isOwnable() || !isOwned() || isOwner(player) || Proxies.common.isOp(player);
}
@Override
public final boolean allowsAlteration(EntityPlayer player) {
return allowsRemoval(player) || getAccess() == EnumAccess.SHARED;
return allowsRemoval(player);
}
@Override
@@ -87,7 +87,7 @@ public class ClientProxyCommon extends ProxyCommon {
@Override
public boolean isOp(EntityPlayer player) {
return true;
return false;
}
@Override
@@ -89,7 +89,7 @@ public class BlockFarm extends BlockStructure {
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
if (Proxies.common.isSimulating(world) && canHarvestBlock(player, meta)) {
List<ItemStack> drops = getDrops(world, x, y, z, 0, 0);