From c6ce5ea160a0efc7ab57802c63d67ce161e353e7 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 24 Dec 2018 12:19:09 -0600 Subject: [PATCH] Nobody cares about creative mode --- .../bot/spec/BotPlayerController.java | 41 +++++-------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/src/main/java/baritone/bot/spec/BotPlayerController.java b/src/main/java/baritone/bot/spec/BotPlayerController.java index 7a5985273..0fc08cab6 100644 --- a/src/main/java/baritone/bot/spec/BotPlayerController.java +++ b/src/main/java/baritone/bot/spec/BotPlayerController.java @@ -74,13 +74,6 @@ public class BotPlayerController implements IPlayerController { return true; } - if (this.gameType.isCreative() && world.getWorldBorder().contains(pos)) { - player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, pos, side)); - handleCreativeBreak(pos, side); - this.blockHitDelay = 5; - return true; - } - if (!this.isHittingPosition(pos)) { return this.clickBlock(pos, side); } @@ -159,11 +152,7 @@ public class BotPlayerController implements IPlayerController { return false; } - if (this.gameType.isCreative()) { - player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, pos, side)); - handleCreativeBreak(pos, side); - this.blockHitDelay = 5; - } else if (!this.hittingBlock || !this.isHittingPosition(pos)) { + if (!this.hittingBlock || !this.isHittingPosition(pos)) { if (this.hittingBlock) { player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.ABORT_DESTROY_BLOCK, this.currentBlock, side)); } @@ -194,10 +183,6 @@ public class BotPlayerController implements IPlayerController { EntityBot player = this.user.getEntity(); World world = player.world; - if (this.gameType.isCreative() && !player.getHeldItemMainhand().isEmpty() && player.getHeldItemMainhand().getItem() instanceof ItemSword) { - return; - } - IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); @@ -217,31 +202,27 @@ public class BotPlayerController implements IPlayerController { this.currentBlock = new BlockPos(this.currentBlock.getX(), -1, this.currentBlock.getZ()); - if (!this.gameType.isCreative()) { - ItemStack stack = player.getHeldItemMainhand(); + ItemStack stack = player.getHeldItemMainhand(); - if (!stack.isEmpty()) { - stack.onBlockDestroyed(world, state, pos, player); + if (!stack.isEmpty()) { + stack.onBlockDestroyed(world, state, pos, player); - if (stack.isEmpty()) { - player.setHeldItem(EnumHand.MAIN_HAND, ItemStack.EMPTY); - } + if (stack.isEmpty()) { + player.setHeldItem(EnumHand.MAIN_HAND, ItemStack.EMPTY); } } } - private void handleCreativeBreak(BlockPos pos, EnumFacing side) { - EntityPlayer player = this.user.getEntity(); - if (!player.world.extinguishFire(player, pos, side)) { - this.handleBreak(pos); - } - } - private boolean canBreak(EntityPlayer player, BlockPos pos) { if (!player.world.getWorldBorder().contains(pos)) { return false; } + // Get OUTTA HERE + if (this.gameType.isCreative()) { + return false; + } + if (this.gameType.hasLimitedInteractions()) { if (this.gameType == GameType.SPECTATOR) { return false;