Skip to content

Commit b3e70e5

Browse files
committed
Revert "Feature: PacketMine (#20)"
This reverts commit ec587e0.
1 parent ec587e0 commit b3e70e5

File tree

11 files changed

+7
-1685
lines changed

11 files changed

+7
-1685
lines changed

common/src/main/java/com/lambda/mixin/entity/ClientPlayInteractionManagerMixin.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import net.minecraft.util.ActionResult;
1212
import net.minecraft.util.Hand;
1313
import net.minecraft.util.hit.BlockHitResult;
14-
import net.minecraft.util.math.BlockPos;
15-
import net.minecraft.util.math.Direction;
1614
import org.spongepowered.asm.mixin.Final;
1715
import org.spongepowered.asm.mixin.Mixin;
1816
import org.spongepowered.asm.mixin.Shadow;
@@ -28,9 +26,6 @@ public class ClientPlayInteractionManagerMixin {
2826
@Shadow
2927
private MinecraftClient client;
3028

31-
@Shadow
32-
public float currentBreakingProgress;
33-
3429
@Inject(method = "interactBlock", at = @At("HEAD"))
3530
public void interactBlockHead(final ClientPlayerEntity player, final Hand hand, final BlockHitResult hitResult, final CallbackInfoReturnable<ActionResult> cir) {
3631
if (client.world == null) return;
@@ -46,27 +41,4 @@ void onAttackPre(PlayerEntity player, Entity target, CallbackInfo ci) {
4641
void onAttackPost(PlayerEntity player, Entity target, CallbackInfo ci) {
4742
EventFlow.post(new AttackEvent.Post(target));
4843
}
49-
50-
@Inject(method = "attackBlock", at = @At("HEAD"), cancellable = true)
51-
public void onAttackBlock(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
52-
if (EventFlow.post(new InteractionEvent.BlockAttack.Pre(pos, side)).isCanceled()) cir.cancel();
53-
}
54-
55-
@Inject(method = "attackBlock", at = @At("TAIL"))
56-
public void onAttackBlockPost(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
57-
EventFlow.post(new InteractionEvent.BlockAttack.Post(pos, side));
58-
}
59-
60-
@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"), cancellable = true)
61-
private void updateBlockBreakingProgressPre(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
62-
var event = EventFlow.post(new InteractionEvent.BreakingProgress.Pre(pos, side, currentBreakingProgress));
63-
if (event.isCanceled()) cir.cancel();
64-
65-
currentBreakingProgress = event.getProgress();
66-
}
67-
68-
@Inject(method = "updateBlockBreakingProgress", at = @At("TAIL"))
69-
private void updateBlockBreakingProgressPost(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
70-
EventFlow.post(new InteractionEvent.BreakingProgress.Post(pos, side, currentBreakingProgress));
71-
}
7244
}

common/src/main/java/com/lambda/mixin/entity/ClientPlayerEntityMixin.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import com.lambda.Lambda;
44
import com.lambda.event.EventFlow;
5-
import com.lambda.event.events.EntityEvent;
65
import com.lambda.event.events.MovementEvent;
76
import com.lambda.event.events.TickEvent;
87
import com.lambda.interaction.PlayerPacketManager;
98
import com.lambda.interaction.RotationManager;
109
import net.minecraft.client.input.Input;
1110
import net.minecraft.client.network.ClientPlayerEntity;
1211
import net.minecraft.entity.MovementType;
13-
import net.minecraft.util.Hand;
1412
import net.minecraft.util.math.Vec3d;
1513
import org.spongepowered.asm.mixin.Mixin;
1614
import org.spongepowered.asm.mixin.Shadow;
@@ -93,9 +91,4 @@ float fixHeldItemYaw(ClientPlayerEntity instance) {
9391
float fixHeldItemPitch(ClientPlayerEntity instance) {
9492
return Objects.requireNonNullElse(RotationManager.getHandPitch(), instance.getPitch());
9593
}
96-
97-
@Inject(method = "swingHand", at = @At("HEAD"), cancellable = true)
98-
void onSwingHandPre(Hand hand, CallbackInfo ci) {
99-
if (EventFlow.post(new EntityEvent.SwingHand(hand)).isCanceled()) ci.cancel();
100-
}
10194
}

common/src/main/kotlin/com/lambda/config/groups/RotationSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RotationSettings(
1616
vis
1717
)
1818

19-
override val keepTicks by c.setting("Keep Rotation", 3, 0..10, 1, "Ticks to keep rotation", " ticks", vis)
19+
override val keepTicks by c.setting("Keep Rotation", 3, 1..10, 1, "Ticks to keep rotation", " ticks", vis)
2020
override val resetTicks by c.setting("Reset Rotation", 3, 1..10, 1, "Ticks before rotation is reset", " ticks", vis)
2121

2222
/**

common/src/main/kotlin/com/lambda/event/events/EntityEvent.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ package com.lambda.event.events
33
import com.lambda.event.Event
44
import com.lambda.event.callback.Cancellable
55
import com.lambda.event.callback.ICancellable
6-
import net.minecraft.util.Hand
76

87
abstract class EntityEvent : Event {
98
class ChangeLookDirection(
109
val deltaYaw: Double,
1110
val deltaPitch: Double,
1211
) : EntityEvent(), ICancellable by Cancellable()
13-
14-
class SwingHand(
15-
val hand: Hand
16-
) : EntityEvent(), ICancellable by Cancellable()
1712
}
Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
11
package com.lambda.event.events
22

33
import com.lambda.event.Event
4-
import com.lambda.event.callback.Cancellable
5-
import com.lambda.event.callback.ICancellable
64
import net.minecraft.client.world.ClientWorld
75
import net.minecraft.util.hit.BlockHitResult
8-
import net.minecraft.util.math.BlockPos
9-
import net.minecraft.util.math.Direction
106

117
sealed class InteractionEvent : Event {
128
class Block(
139
val world: ClientWorld,
1410
val blockHitResult: BlockHitResult
1511
) : InteractionEvent()
16-
17-
sealed class BlockAttack : InteractionEvent() {
18-
class Pre(
19-
val pos: BlockPos,
20-
val side: Direction
21-
) : BlockAttack(), ICancellable by Cancellable()
22-
23-
class Post(
24-
val pos: BlockPos,
25-
val side: Direction
26-
) : BlockAttack()
27-
}
28-
29-
sealed class BreakingProgress : InteractionEvent() {
30-
class Pre(
31-
val pos: BlockPos,
32-
val side: Direction,
33-
var progress: Float,
34-
) : BreakingProgress(), ICancellable by Cancellable()
35-
36-
class Post(
37-
val pos: BlockPos,
38-
val side: Direction,
39-
val progress: Float,
40-
) : BreakingProgress()
41-
}
42-
}
12+
}

common/src/main/kotlin/com/lambda/interaction/RotationManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object RotationManager : Loadable {
3030
var currentRotation = Rotation.ZERO
3131
var prevRotation = Rotation.ZERO
3232

33-
var currentContext: RotationContext? = null
33+
private var currentContext: RotationContext? = null
3434

3535
private var keepTicks = 0
3636
private var pauseTicks = 0

common/src/main/kotlin/com/lambda/module/modules/player/FastBreak.kt

Lines changed: 0 additions & 182 deletions
This file was deleted.

common/src/main/kotlin/com/lambda/module/modules/player/Interact.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ object Interact : Module(
88
description = "Modify players interaction with the world",
99
defaultTags = setOf(ModuleTag.PLAYER)
1010
) {
11+
// ToDo: Is this fast place / fast use? Should it be relocated with more options?
1112
@JvmStatic val placeDelay by setting("Item Use / Place Delay", 4, 0..20, 1, "Sets the delay between placing blocks or using items")
13+
// @JvmStatic val breakDelay by setting("Attack / Break Delay", 10, 0..20, 1)
1214
@JvmStatic val multiAction by setting("Multi Action", false, "Allows to use many items while breaking blocks")
1315
}

0 commit comments

Comments
 (0)