mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2024-11-26 22:42:09 +00:00
feat: added Bulldozer Modifier
parent
5bd5e48f0d
commit
7ab5a7c72f
4 changed files with 64 additions and 1 deletions
|
@ -13,7 +13,7 @@ This project aims to improve the experience of creating structures in Minecraft.
|
|||
- **Replace** Replace blocks in the world [x]
|
||||
|
||||
## Modifiers
|
||||
- **Bulldozer** Basically an auto-clicker
|
||||
- **Bulldozer** Basically an auto-clicker [x]
|
||||
- **Force Place** Ignore block placing restrictions [x]
|
||||
- **No Clip** Walk and fly through blocks [x]
|
||||
- **No Updates** Prevent block updates [x]
|
||||
|
|
35
src/main/java/net/moonleay/gimble/mixin/BulldozerMixin.java
Normal file
35
src/main/java/net/moonleay/gimble/mixin/BulldozerMixin.java
Normal file
|
@ -0,0 +1,35 @@
|
|||
package net.moonleay.gimble.mixin;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.moonleay.gimble.client.editor.ClientEditor;
|
||||
import net.moonleay.gimble.editor.state.mode.ModeModifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public abstract class BulldozerMixin {
|
||||
|
||||
@Shadow protected int attackCooldown;
|
||||
|
||||
@Inject(method = "doAttack", at = @At(value = "HEAD"))
|
||||
private void func(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!ClientEditor.INSTANCE.containsModifier(ModeModifier.BULLDOZER)){
|
||||
return;
|
||||
}
|
||||
this.attackCooldown = 0;
|
||||
}
|
||||
|
||||
@Inject(method = "handleBlockBreaking", at = @At(value = "HEAD"))
|
||||
private void func2(boolean breaking, CallbackInfo ci) {
|
||||
if (!ClientEditor.INSTANCE.containsModifier(ModeModifier.BULLDOZER) || !breaking){
|
||||
return;
|
||||
}
|
||||
this.attackCooldown = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
26
src/main/java/net/moonleay/gimble/mixin/BulldozerMixin2.java
Normal file
26
src/main/java/net/moonleay/gimble/mixin/BulldozerMixin2.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package net.moonleay.gimble.mixin;
|
||||
|
||||
import net.minecraft.client.network.ClientPlayerInteractionManager;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.moonleay.gimble.client.editor.ClientEditor;
|
||||
import net.moonleay.gimble.editor.state.mode.ModeModifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ClientPlayerInteractionManager.class)
|
||||
public class BulldozerMixin2 {
|
||||
|
||||
@Shadow private int blockBreakingCooldown;
|
||||
|
||||
@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"))
|
||||
private void func(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!ClientEditor.INSTANCE.containsModifier(ModeModifier.BULLDOZER)) {
|
||||
return;
|
||||
}
|
||||
this.blockBreakingCooldown = 0;
|
||||
}
|
||||
}
|
|
@ -9,6 +9,8 @@
|
|||
"NoClipMixin"
|
||||
],
|
||||
"client": [
|
||||
"BulldozerMixin",
|
||||
"BulldozerMixin2",
|
||||
"HudMixin",
|
||||
"NoClipCameraFixMixin",
|
||||
"NormalModeMixin",
|
||||
|
|
Loading…
Reference in a new issue