ceilinginteract
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m8s

This commit is contained in:
Jess H 2024-06-17 09:28:53 +01:00
parent b386c0c710
commit d743896454
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19
2 changed files with 39 additions and 0 deletions

View file

@ -59,6 +59,7 @@ public class Setup {
new HUD(),
//new HUD.ShowTPS(),
new InteractionTweaks(),
new InteractionTweaks.CeilingInteract(),
new InteractionTweaks.FastBreak(),
new InteractionTweaks.FastUse(),
new MidClick(),

View file

@ -1,6 +1,7 @@
package de.com.baseband.client.feature.modules.ingame;
import de.com.baseband.client.event.events.DamageBlockEvent;
import de.com.baseband.client.event.events.PacketEvent;
import de.com.baseband.client.feature.Feature;
import de.com.baseband.client.feature.Features;
import de.com.baseband.client.feature.category.Ingame;
@ -10,6 +11,8 @@ import de.com.baseband.client.registry.annotation.Config;
import de.com.baseband.client.registry.annotation.Range;
import net.minecraft.client.Minecraft;
import net.minecraft.network.play.client.CPacketPlayerDigging;
import net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
@ -22,10 +25,43 @@ public class InteractionTweaks extends Feature {
@Override
protected void setup() {
Features.ifFeaturePresent(CeilingInteract.class, subComponents::add);
Features.ifFeaturePresent(FastUse.class, subComponents::add);
Features.ifFeaturePresent(FastBreak.class, subComponents::add);
}
@Ingame
public static class CeilingInteract extends Feature {
@Override
public String toString() {
return "CeilingInteract";
}
@Config("Show On HUD")
public boolean showOnHUD;
public void onPacketSend(PacketEvent.Send event) {
if (event.getPacket() instanceof CPacketPlayerTryUseItemOnBlock) {
CPacketPlayerTryUseItemOnBlock packet2 = (CPacketPlayerTryUseItemOnBlock) event.getPacket();
if (packet2.getPos().getY() >= 255 && packet2.getDirection() == EnumFacing.UP) {
mc.player.connection.sendPacket(new CPacketPlayerTryUseItemOnBlock(packet2.getPos(), EnumFacing.DOWN, packet2.getHand(), packet2.getFacingX(), packet2.getFacingY(), packet2.getFacingZ()));
event.setCancelled(true);
}
}
}
@Override
public boolean displayOnClickGUI() {
return false;
}
@Override
public boolean displayOnHUD() {
return showOnHUD;
}
}
@Ingame
public static class FastUse extends Feature {
@Override
@ -56,6 +92,8 @@ public class InteractionTweaks extends Feature {
}
}
@Ingame
public static class FastBreak extends Feature {