Skip to content

Commit 86df328

Browse files
committed
workaround 2b2t chain break speed bug
1 parent 17d0ad2 commit 86df328

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/main/java/com/zenith/command/impl/DebugCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ public LiteralArgumentBuilder<CommandContext> register() {
288288
c.getSource().getEmbed()
289289
.title("Inventory Request Server Sync On Action " + toggleStrCaps(CONFIG.debug.inventoryRequestServerSyncOnAction));
290290
c.getSource().getData().put("noDefaultEmbed", true);
291+
})))
292+
.then(literal("chainBreakSpeed2b2tFix").then(argument("toggle", toggle()).executes(c -> {
293+
CONFIG.debug.chainBreakSpeed2b2tFix = getToggle(c, "toggle");
294+
c.getSource().getEmbed()
295+
.title("Chain Break Speed 2b2t Fix " + toggleStrCaps(CONFIG.debug.chainBreakSpeed2b2tFix));
291296
})));
292297
}
293298

src/main/java/com/zenith/feature/player/PlayerInteractionManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535

3636
import java.util.Objects;
3737

38-
import static com.zenith.Globals.BOT;
39-
import static com.zenith.Globals.CACHE;
38+
import static com.zenith.Globals.*;
4039

4140
@Getter
4241
public class PlayerInteractionManager {
@@ -233,6 +232,9 @@ public double blockBreakSpeed(Block block, ItemStack item) {
233232
}
234233

235234
public boolean hasCorrectToolForDrops(Block block, ItemStack item) {
235+
if (CONFIG.debug.chainBreakSpeed2b2tFix && block == BlockRegistry.CHAIN && Proxy.getInstance().isOn2b2t()) {
236+
return false;
237+
}
236238
if (!block.requiresCorrectToolForDrops()) return true;
237239
if (item == Container.EMPTY_STACK) return false;
238240
ItemData itemData = ItemRegistry.REGISTRY.get(item.getId());
@@ -335,6 +337,9 @@ public double getPlayerDestroySpeed(Block block, ItemStack item) {
335337

336338
public double getItemDestroySpeed(Block block, ItemStack item) {
337339
if (item == Container.EMPTY_STACK) return 1.0;
340+
if (CONFIG.debug.chainBreakSpeed2b2tFix && block == BlockRegistry.CHAIN && Proxy.getInstance().isOn2b2t()) {
341+
return 1.0;
342+
}
338343
var itemData = ItemRegistry.REGISTRY.get(item.getId());
339344
if (itemData == null) return 1.0f;
340345
var itemComponents = item.withAddedComponents(itemData.components()).getDataComponents();

src/main/java/com/zenith/util/config/Config.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ public static final class Debug {
693693
public boolean botPitchPrecisionClamping = true;
694694
public boolean botRotateBeforeInteract = true;
695695
public boolean inventoryRequestServerSyncOnAction = false;
696+
public boolean chainBreakSpeed2b2tFix = true;
696697

697698
public static final class PacketLog {
698699
public boolean enabled = false;

0 commit comments

Comments
 (0)