Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed search field in controls loosing the text when window is resized #44

Open
wants to merge 13 commits into
base: 1.17
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fixed vanilla drop item logic for mc 1.14
  • Loading branch information
Klotzi111 committed Sep 29, 2021
commit b9677201dc96c95d6ae5b438738cf3a945fd1130
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@ public DropEntireStackKeyBinding(String id, InputUtil.Type type, int code, Strin
super(id, type, code, category, defaultModifiers);
}

// TODO: check if it is really equal for all versions between 1.8 - 1.17.1
// from minecraft code: MinecraftClient with feedback addition

// only version 1.14 and above because we do not have mappings for lower versions of minecraft and fabric anyways
// the logic changed in 1.14 (compared to the newer versions)
@SuppressWarnings("unused") // used via reflection
private boolean dropEntireStackLogic$1_14(MinecraftClient client) {
ClientPlayerEntity player = client.player;

if (!player.isSpectator()) {
// true to always drop an entire stack
// in 1.14 this method returns 'ItemStack' but it is always null anyways
player.dropSelectedItem(true);
return true;
}
return false;
}

@SuppressWarnings("unused") // used via reflection
private boolean dropEntireStackLogic$1_8(MinecraftClient client) {
private boolean dropEntireStackLogic$1_15(MinecraftClient client) {
ClientPlayerEntity player = client.player;

// true to always drop an entire stack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public HotbarScrollKeyBinding(String id, InputUtil.Type type, int code, String c
this.scrollUp = scrollUp;
}

// TODO: check if it is really equal for all versions between 1.8 - 1.17.1
// from minecraft code: Mouse

// only version 1.14 and above because we do not have mappings for lower versions of minecraft and fabric anyways
@SuppressWarnings("unused") // used via reflection
private void scrollLogic$1_8(MinecraftClient client, int scrollCount) {
private void scrollLogic$1_14(MinecraftClient client, int scrollCount) {
if (client.player.isSpectator()) {
if (client.inGameHud.getSpectatorHud().isOpen()) {
client.inGameHud.getSpectatorHud().cycleSlot(-scrollCount);
Expand Down