Skip to content

Commit

Permalink
The firestarter and drawbridge no longer place blocks client-side
Browse files Browse the repository at this point in the history
- This is done because Minecraft automatically syncs world changes
  • Loading branch information
fuj1n committed Jun 22, 2018
1 parent 9d6874d commit 1ed1321
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Expand Up @@ -126,12 +126,11 @@ public String getVariantName() {
}

public boolean placeBlock(BlockPos position) {
FakePlayer fakePlayer = getFakePlayer(position.getX(), position.getY(), position.getZ());

//TODO: refer to TODO in logic base
if (fakePlayer == null)
if(world.isRemote)
return false;

FakePlayer fakePlayer = getFakePlayer(position.getX(), position.getY(), position.getZ());

ItemStack stack = getNextBlock();

if (stack.isEmpty()) {
Expand Down Expand Up @@ -199,6 +198,9 @@ public boolean placeBlock(BlockPos position) {
}

public boolean breakBlock(BlockPos position) {
if(world.isRemote)
return false;

ItemStack stack = getLastBlock();

if (stack.isEmpty()) {
Expand Down
Expand Up @@ -14,7 +14,6 @@
import javax.annotation.Nonnull;
import java.util.List;

// TODO: Guess server place/retract success to avoid desync instead of straight up quitting
public abstract class DrawbridgeLogicBase extends RedstoneMachineLogicBase implements ITickable, IInventoryGui, IPlaceDirection {
private static final float TICK_TIME = 0.05F;

Expand Down
Expand Up @@ -32,6 +32,9 @@ public FirestarterLogic ()

public void setFire ()
{
if(world.isRemote)
return;

EnumFacing facing = getFacingDirection();

BlockPos loc = getPos();
Expand Down

0 comments on commit 1ed1321

Please sign in to comment.