Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 63834fc

Browse files
committed
0.10.2 - Minecraft 1.21
1 parent 6f98ab0 commit 63834fc

File tree

32 files changed

+1675
-94
lines changed

32 files changed

+1675
-94
lines changed

1.20.1/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ minecraft_version=1.20.1
77
parchment_version=2023.09.03
88

99
# Plugin Properties
10-
plugin_version=0.10.1
10+
plugin_version=0.10.2
1111
maven_group=com.shaybox.rusher
1212
archives_base_name=shays-rusher-plugin

1.20.1/src/main/java/com/shaybox/rusher/modules/AntiCrawl.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public class AntiCrawl extends ToggleableModule {
2323

2424
/* Minecraft */
2525
private final Minecraft minecraft = Minecraft.getInstance();
26-
private final Level level = this.minecraft.level;
27-
private final LocalPlayer player = this.minecraft.player;
28-
private final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
29-
private final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) this.gameMode;
3026

3127
/* Settings */
3228
private final BooleanSetting packetOnly = new BooleanSetting("PacketMine", false);
@@ -41,47 +37,57 @@ public AntiCrawl() {
4137

4238
@Subscribe
4339
private void onPacket(EventPacket.Receive event) {
44-
if (this.level == null || this.player == null || this.gameMode == null) return;
40+
final Level level = this.minecraft.level;
41+
final LocalPlayer player = this.minecraft.player;
42+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
43+
if (level == null || player == null || gameMode == null) return;
4544

4645
final Packet<?> packet = event.getPacket();
4746

4847
// Start breaking the block your head is in if the block your feet are in starts to get mined to keep you from crawling
4948
if (this.pearlPhase.getValue() && packet instanceof ClientboundBlockDestructionPacket destructionPacket) {
50-
final BlockPos playerFeetPos = this.player.blockPosition();
49+
final BlockPos playerFeetPos = player.blockPosition();
5150
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
5251
final BlockPos blockPos = destructionPacket.getPos();
53-
final BlockState blockState = this.level.getBlockState(blockPos);
52+
final BlockState blockState = level.getBlockState(blockPos);
5453
final Block block = blockState.getBlock();
5554
if (!blockPos.equals(playerFeetPos) || block.equals(Blocks.AIR)) return;
5655

57-
this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
56+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
5857
}
5958
}
6059

6160
@Subscribe
6261
private void onPlayerUpdate(EventPlayerUpdate event) {
63-
if (this.level == null || this.player == null || this.gameMode == null) return;
62+
final Level level = this.minecraft.level;
63+
final LocalPlayer player = this.minecraft.player;
64+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
65+
final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) gameMode;
66+
if (level == null || player == null || gameMode == null) return;
6467

65-
final BlockPos destroyBlockPos = this.gameModeMixin.getDestroyBlockPos();
68+
final BlockPos destroyBlockPos = gameModeMixin.getDestroyBlockPos();
6669
final BlockPos playerFeetPos = player.blockPosition();
6770

6871
// Finish vanilla breaking the block in your head to keep you from crawling
6972
if (this.pearlPhase.getValue() && !this.packetOnly.getValue()) {
7073
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
71-
final BlockState blockState = this.level.getBlockState(playerHeadPos);
74+
final BlockState blockState = level.getBlockState(playerHeadPos);
7275
final Block block = blockState.getBlock();
7376

7477
if (destroyBlockPos.equals(playerHeadPos) && !block.equals(Blocks.AIR)) {
75-
this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
78+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
7679
}
7780
}
7881

7982
// Finish vanilla breaking the block above your head to stop you from crawling
80-
if (this.crawlBreak.getValue() && this.player.isVisuallyCrawling()) {
83+
if (this.crawlBreak.getValue() && player.isVisuallyCrawling()) {
8184
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
8285

83-
if (!destroyBlockPos.equals(playerHeadPos)) this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
84-
else if (!this.packetOnly.getValue()) this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
86+
if (!destroyBlockPos.equals(playerHeadPos)) {
87+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
88+
} else if (!this.packetOnly.getValue()) {
89+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
90+
}
8591
}
8692
}
8793

1.20.1/src/main/java/com/shaybox/rusher/tweaks/Durability101.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
import org.rusherhack.client.api.RusherHackAPI;
1313
import org.rusherhack.client.api.events.render.EventRender2D;
1414
import org.rusherhack.client.api.feature.hud.HudElement;
15-
import org.rusherhack.client.api.feature.hud.TextHudElement;
15+
import org.rusherhack.client.api.feature.module.IModule;
16+
import org.rusherhack.client.api.feature.module.ToggleableModule;
1617
import org.rusherhack.client.api.render.IRenderer2D;
1718
import org.rusherhack.client.api.render.font.IFontRenderer;
1819
import org.rusherhack.client.api.system.IHudManager;
1920
import org.rusherhack.client.api.ui.theme.IThemeManager;
2021
import org.rusherhack.core.event.listener.EventListener;
2122
import org.rusherhack.core.event.stage.Stage;
2223
import org.rusherhack.core.event.subscribe.Subscribe;
24+
import org.rusherhack.core.feature.IFeatureManager;
2325
import org.rusherhack.core.setting.BooleanSetting;
2426
import org.rusherhack.core.setting.EnumSetting;
2527
import org.rusherhack.core.setting.NumberSetting;
@@ -36,23 +38,20 @@ public class Durability101 implements EventListener {
3638
/* RusherHackAPI Managers & Screens */
3739
private final IHudManager hudManager = RusherHackAPI.getHudManager();
3840
private final IThemeManager themeManager = RusherHackAPI.getThemeManager();
41+
private final IFeatureManager<IModule> moduleManager = RusherHackAPI.getModuleManager();
3942
private final Screen hudEditorScreen = themeManager.getHudEditorScreen();
43+
private final ToggleableModule hudModule = (ToggleableModule) moduleManager.getFeature("Hud").orElseThrow();
4044

4145
/* Armor Hud Element & Settings */
4246
private final HudElement armor = hudManager.getFeature("Armor").orElseThrow();
4347
private final EnumSetting<?> axis = (EnumSetting<?>) armor.getSetting("Axis");
4448
private final EnumSetting<?> durability = (EnumSetting<?>) armor.getSetting("Durability");
45-
private final BooleanSetting hotbarLock = (BooleanSetting) armor.getSetting("HotbarLock");
46-
private final BooleanSetting autoAdjust = (BooleanSetting) hotbarLock.getSubSetting("AutoAdjust");
4749

4850
/* Custom Settings */
4951
private final BooleanSetting durability101 = new BooleanSetting("Durability101", "Durability101 Mod for Armor HUD", false);
5052
private final BooleanSetting unbreaking = new BooleanSetting("Unbreaking", "Estimates Unbreaking Durability", false);
5153
private final NumberSetting<Integer> yOffset = new NumberSetting<>("Y Offset", "Manual Y Offset", 0, -15, 15);
5254

53-
/* Temporary */
54-
private final TextHudElement watermark = (TextHudElement) hudManager.getFeature("Watermark").orElseThrow();
55-
5655
/* Initialize */
5756
public Durability101() {
5857
this.durability101.addSubSettings(this.unbreaking, this.yOffset);
@@ -61,7 +60,7 @@ public Durability101() {
6160

6261
@Override
6362
public boolean isListening() {
64-
return this.armor.isToggled() && this.durability101.getValue();
63+
return this.hudModule.isToggled() && this.armor.isToggled() && this.durability101.getValue();
6564
}
6665

6766
@Subscribe(priority = -10000, stage = Stage.ALL)

1.20.2/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ minecraft_version=1.20.2
77
parchment_version=2023.12.10
88

99
# Plugin Properties
10-
plugin_version=0.10.1
10+
plugin_version=0.10.2
1111
maven_group=com.shaybox.rusher
1212
archives_base_name=shays-rusher-plugin

1.20.2/src/main/java/com/shaybox/rusher/modules/AntiCrawl.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public class AntiCrawl extends ToggleableModule {
2323

2424
/* Minecraft */
2525
private final Minecraft minecraft = Minecraft.getInstance();
26-
private final Level level = this.minecraft.level;
27-
private final LocalPlayer player = this.minecraft.player;
28-
private final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
29-
private final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) this.gameMode;
3026

3127
/* Settings */
3228
private final BooleanSetting packetOnly = new BooleanSetting("PacketMine", false);
@@ -41,47 +37,57 @@ public AntiCrawl() {
4137

4238
@Subscribe
4339
private void onPacket(EventPacket.Receive event) {
44-
if (this.level == null || this.player == null || this.gameMode == null) return;
40+
final Level level = this.minecraft.level;
41+
final LocalPlayer player = this.minecraft.player;
42+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
43+
if (level == null || player == null || gameMode == null) return;
4544

4645
final Packet<?> packet = event.getPacket();
4746

4847
// Start breaking the block your head is in if the block your feet are in starts to get mined to keep you from crawling
4948
if (this.pearlPhase.getValue() && packet instanceof ClientboundBlockDestructionPacket destructionPacket) {
50-
final BlockPos playerFeetPos = this.player.blockPosition();
49+
final BlockPos playerFeetPos = player.blockPosition();
5150
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
5251
final BlockPos blockPos = destructionPacket.getPos();
53-
final BlockState blockState = this.level.getBlockState(blockPos);
52+
final BlockState blockState = level.getBlockState(blockPos);
5453
final Block block = blockState.getBlock();
5554
if (!blockPos.equals(playerFeetPos) || block.equals(Blocks.AIR)) return;
5655

57-
this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
56+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
5857
}
5958
}
6059

6160
@Subscribe
6261
private void onPlayerUpdate(EventPlayerUpdate event) {
63-
if (this.level == null || this.player == null || this.gameMode == null) return;
62+
final Level level = this.minecraft.level;
63+
final LocalPlayer player = this.minecraft.player;
64+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
65+
final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) gameMode;
66+
if (level == null || player == null || gameMode == null) return;
6467

65-
final BlockPos destroyBlockPos = this.gameModeMixin.getDestroyBlockPos();
68+
final BlockPos destroyBlockPos = gameModeMixin.getDestroyBlockPos();
6669
final BlockPos playerFeetPos = player.blockPosition();
6770

6871
// Finish vanilla breaking the block in your head to keep you from crawling
6972
if (this.pearlPhase.getValue() && !this.packetOnly.getValue()) {
7073
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
71-
final BlockState blockState = this.level.getBlockState(playerHeadPos);
74+
final BlockState blockState = level.getBlockState(playerHeadPos);
7275
final Block block = blockState.getBlock();
7376

7477
if (destroyBlockPos.equals(playerHeadPos) && !block.equals(Blocks.AIR)) {
75-
this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
78+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
7679
}
7780
}
7881

7982
// Finish vanilla breaking the block above your head to stop you from crawling
80-
if (this.crawlBreak.getValue() && this.player.isVisuallyCrawling()) {
83+
if (this.crawlBreak.getValue() && player.isVisuallyCrawling()) {
8184
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
8285

83-
if (!destroyBlockPos.equals(playerHeadPos)) this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
84-
else if (!this.packetOnly.getValue()) this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
86+
if (!destroyBlockPos.equals(playerHeadPos)) {
87+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
88+
} else if (!this.packetOnly.getValue()) {
89+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
90+
}
8591
}
8692
}
8793

1.20.2/src/main/java/com/shaybox/rusher/tweaks/Durability101.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
import org.rusherhack.client.api.RusherHackAPI;
1313
import org.rusherhack.client.api.events.render.EventRender2D;
1414
import org.rusherhack.client.api.feature.hud.HudElement;
15-
import org.rusherhack.client.api.feature.hud.TextHudElement;
15+
import org.rusherhack.client.api.feature.module.IModule;
16+
import org.rusherhack.client.api.feature.module.ToggleableModule;
1617
import org.rusherhack.client.api.render.IRenderer2D;
1718
import org.rusherhack.client.api.render.font.IFontRenderer;
1819
import org.rusherhack.client.api.system.IHudManager;
1920
import org.rusherhack.client.api.ui.theme.IThemeManager;
2021
import org.rusherhack.core.event.listener.EventListener;
2122
import org.rusherhack.core.event.stage.Stage;
2223
import org.rusherhack.core.event.subscribe.Subscribe;
24+
import org.rusherhack.core.feature.IFeatureManager;
2325
import org.rusherhack.core.setting.BooleanSetting;
2426
import org.rusherhack.core.setting.EnumSetting;
2527
import org.rusherhack.core.setting.NumberSetting;
@@ -37,23 +39,20 @@ public class Durability101 implements EventListener {
3739
/* RusherHackAPI Managers & Screens */
3840
private final IHudManager hudManager = RusherHackAPI.getHudManager();
3941
private final IThemeManager themeManager = RusherHackAPI.getThemeManager();
42+
private final IFeatureManager<IModule> moduleManager = RusherHackAPI.getModuleManager();
4043
private final Screen hudEditorScreen = themeManager.getHudEditorScreen();
44+
private final ToggleableModule hudModule = (ToggleableModule) moduleManager.getFeature("Hud").orElseThrow();
4145

4246
/* Armor Hud Element & Settings */
4347
private final HudElement armor = hudManager.getFeature("Armor").orElseThrow();
4448
private final EnumSetting<?> axis = (EnumSetting<?>) armor.getSetting("Axis");
4549
private final EnumSetting<?> durability = (EnumSetting<?>) armor.getSetting("Durability");
46-
private final BooleanSetting hotbarLock = (BooleanSetting) armor.getSetting("HotbarLock");
47-
private final BooleanSetting autoAdjust = (BooleanSetting) hotbarLock.getSubSetting("AutoAdjust");
4850

4951
/* Custom Settings */
5052
private final BooleanSetting durability101 = new BooleanSetting("Durability101", "Durability101 Mod for Armor HUD", false);
5153
private final BooleanSetting unbreaking = new BooleanSetting("Unbreaking", "Estimates Unbreaking Durability", false);
5254
private final NumberSetting<Integer> yOffset = new NumberSetting<>("Y Offset", "Manual Y Offset", 0, -15, 15);
5355

54-
/* Temporary */
55-
private final TextHudElement watermark = (TextHudElement) hudManager.getFeature("Watermark").orElseThrow();
56-
5756
/* Initialize */
5857
public Durability101() {
5958
this.durability101.addSubSettings(this.unbreaking, this.yOffset);
@@ -62,7 +61,7 @@ public Durability101() {
6261

6362
@Override
6463
public boolean isListening() {
65-
return this.armor.isToggled() && this.durability101.getValue();
64+
return this.hudModule.isToggled() && this.armor.isToggled() && this.durability101.getValue();
6665
}
6766

6867
@Subscribe(priority = -10000, stage = Stage.ALL)

1.20.4/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ minecraft_version=1.20.4
77
parchment_version=2024.04.14
88

99
# Plugin Properties
10-
plugin_version=0.10.1
10+
plugin_version=0.10.2
1111
maven_group=com.shaybox.rusher
1212
archives_base_name=shays-rusher-plugin

1.20.4/src/main/java/com/shaybox/rusher/modules/AntiCrawl.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public class AntiCrawl extends ToggleableModule {
2323

2424
/* Minecraft */
2525
private final Minecraft minecraft = Minecraft.getInstance();
26-
private final Level level = this.minecraft.level;
27-
private final LocalPlayer player = this.minecraft.player;
28-
private final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
29-
private final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) this.gameMode;
3026

3127
/* Settings */
3228
private final BooleanSetting packetOnly = new BooleanSetting("PacketMine", false);
@@ -41,47 +37,57 @@ public AntiCrawl() {
4137

4238
@Subscribe
4339
private void onPacket(EventPacket.Receive event) {
44-
if (this.level == null || this.player == null || this.gameMode == null) return;
40+
final Level level = this.minecraft.level;
41+
final LocalPlayer player = this.minecraft.player;
42+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
43+
if (level == null || player == null || gameMode == null) return;
4544

4645
final Packet<?> packet = event.getPacket();
4746

4847
// Start breaking the block your head is in if the block your feet are in starts to get mined to keep you from crawling
4948
if (this.pearlPhase.getValue() && packet instanceof ClientboundBlockDestructionPacket destructionPacket) {
50-
final BlockPos playerFeetPos = this.player.blockPosition();
49+
final BlockPos playerFeetPos = player.blockPosition();
5150
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
5251
final BlockPos blockPos = destructionPacket.getPos();
53-
final BlockState blockState = this.level.getBlockState(blockPos);
52+
final BlockState blockState = level.getBlockState(blockPos);
5453
final Block block = blockState.getBlock();
5554
if (!blockPos.equals(playerFeetPos) || block.equals(Blocks.AIR)) return;
5655

57-
this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
56+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
5857
}
5958
}
6059

6160
@Subscribe
6261
private void onPlayerUpdate(EventPlayerUpdate event) {
63-
if (this.level == null || this.player == null || this.gameMode == null) return;
62+
final Level level = this.minecraft.level;
63+
final LocalPlayer player = this.minecraft.player;
64+
final MultiPlayerGameMode gameMode = this.minecraft.gameMode;
65+
final IMixinMultiPlayerGameMode gameModeMixin = (IMixinMultiPlayerGameMode) gameMode;
66+
if (level == null || player == null || gameMode == null) return;
6467

65-
final BlockPos destroyBlockPos = this.gameModeMixin.getDestroyBlockPos();
68+
final BlockPos destroyBlockPos = gameModeMixin.getDestroyBlockPos();
6669
final BlockPos playerFeetPos = player.blockPosition();
6770

6871
// Finish vanilla breaking the block in your head to keep you from crawling
6972
if (this.pearlPhase.getValue() && !this.packetOnly.getValue()) {
7073
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
71-
final BlockState blockState = this.level.getBlockState(playerHeadPos);
74+
final BlockState blockState = level.getBlockState(playerHeadPos);
7275
final Block block = blockState.getBlock();
7376

7477
if (destroyBlockPos.equals(playerHeadPos) && !block.equals(Blocks.AIR)) {
75-
this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
78+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
7679
}
7780
}
7881

7982
// Finish vanilla breaking the block above your head to stop you from crawling
80-
if (this.crawlBreak.getValue() && this.player.isVisuallyCrawling()) {
83+
if (this.crawlBreak.getValue() && player.isVisuallyCrawling()) {
8184
final BlockPos playerHeadPos = playerFeetPos.offset(0, 1, 0);
8285

83-
if (!destroyBlockPos.equals(playerHeadPos)) this.gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
84-
else if (!this.packetOnly.getValue()) this.gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
86+
if (!destroyBlockPos.equals(playerHeadPos)) {
87+
gameMode.startDestroyBlock(playerHeadPos, Direction.DOWN);
88+
} else if (!this.packetOnly.getValue()) {
89+
gameMode.continueDestroyBlock(playerHeadPos, Direction.DOWN);
90+
}
8591
}
8692
}
8793

0 commit comments

Comments
 (0)