Fix bad block breaking that NCP doesn't agree with
This commit is contained in:
		| @@ -452,10 +452,6 @@ public class Settings { | ||||
|  | ||||
|     /** | ||||
|      * {@code true}: can mine blocks when in inventory, chat, or tabbed away in ESC menu | ||||
|      * <p> | ||||
|      * {@code false}: works on cosmic prisons | ||||
|      * <p> | ||||
|      * LOL | ||||
|      */ | ||||
|     public Setting<Boolean> leftClickWorkaround = new Setting<>(true); | ||||
|  | ||||
|   | ||||
| @@ -30,8 +30,6 @@ import net.minecraft.world.GameType; | ||||
|  */ | ||||
| public interface IPlayerController { | ||||
|  | ||||
|     boolean clickBlock(BlockPos pos, EnumFacing side); | ||||
|  | ||||
|     boolean onPlayerDamageBlock(BlockPos pos, EnumFacing side); | ||||
|  | ||||
|     void resetBlockRemoving(); | ||||
|   | ||||
| @@ -31,11 +31,6 @@ import net.minecraft.util.math.RayTraceResult; | ||||
|  */ | ||||
| public final class BlockBreakHelper implements Helper { | ||||
|  | ||||
|     /** | ||||
|      * The last block that we tried to break, if this value changes | ||||
|      * between attempts, then we re-initialize the breaking process. | ||||
|      */ | ||||
|     private BlockPos lastBlock; | ||||
|     private boolean didBreakLastTick; | ||||
|  | ||||
|     private IPlayerContext playerContext; | ||||
| @@ -45,13 +40,9 @@ public final class BlockBreakHelper implements Helper { | ||||
|     } | ||||
|  | ||||
|     public void tryBreakBlock(BlockPos pos, EnumFacing side) { | ||||
|         if (!pos.equals(lastBlock)) { | ||||
|             playerContext.playerController().clickBlock(pos, side); | ||||
|         } | ||||
|         if (playerContext.playerController().onPlayerDamageBlock(pos, side)) { | ||||
|             playerContext.player().swingArm(EnumHand.MAIN_HAND); | ||||
|         } | ||||
|         lastBlock = pos; | ||||
|     } | ||||
|  | ||||
|     public void stopBreakingBlock() { | ||||
| @@ -59,7 +50,6 @@ public final class BlockBreakHelper implements Helper { | ||||
|         if (playerContext.player() != null) { | ||||
|             playerContext.playerController().resetBlockRemoving(); | ||||
|         } | ||||
|         lastBlock = null; | ||||
|     } | ||||
|  | ||||
|     private boolean fakeBreak() { | ||||
|   | ||||
| @@ -34,11 +34,6 @@ public enum PrimaryPlayerController implements IPlayerController, Helper { | ||||
|  | ||||
|     INSTANCE; | ||||
|  | ||||
|     @Override | ||||
|     public boolean clickBlock(BlockPos pos, EnumFacing side) { | ||||
|         return mc.playerController.clickBlock(pos, side); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean onPlayerDamageBlock(BlockPos pos, EnumFacing side) { | ||||
|         return mc.playerController.onPlayerDamageBlock(pos, side); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user