Skip to content

Commit

Permalink
Merge branch '1.20.1' into 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltMolnarrr committed Jan 14, 2024
2 parents 08cf4ad + b087715 commit 129a30b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.1

- Improve roll hotkey handling #40

# 1.3.0

- Show roll keybinding label on HUD (configurable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public abstract class MinecraftClientMixin implements MinecraftClientExtension {
@Shadow private int itemUseCooldown;
@Shadow @Nullable public ClientPlayerEntity player;
@Shadow @Nullable public Screen currentScreen;
private RollManager rollManager = new RollManager();
public RollManager getRollManager() {
return rollManager;
Expand Down Expand Up @@ -63,21 +64,24 @@ private void doItemUse_HEAD(CallbackInfo ci) {
}
}

@Inject(method = "handleInputEvents", at = @At("TAIL"))
private void handleInputEvents_TAIL(CallbackInfo ci) {
tryRolling();
}

@Inject(method = "tick", at = @At("TAIL"))
private void tick_TAIL(CallbackInfo ci) {
tryRolling();
if (player != null) {
rollManager.tick(player);
}
}

private void tryRolling() {
var client = (MinecraftClient) ((Object)this);
if (player == null || client.isPaused()) {
if (player == null || client.isPaused() || client.currentScreen != null) {
return;
}
rollManager.tick(player);
if (Keybindings.roll.isPressed()) {
if (Platform.Forge && client.currentScreen != null) {
return;
}
if(!rollManager.isRollAvailable(player)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ forge_version=48.0.4
# Mod
maven_group=net
archives_base_name=combatroll
mod_version=1.3.0
mod_version=1.3.1

# Dependencies
cloth_config_version=12.0.109
Expand Down

0 comments on commit 129a30b

Please sign in to comment.