Port to 22w43a

This commit is contained in:
Motschen
2022-10-27 20:25:26 +02:00
parent 9cc5393703
commit 2d902bbf3c
8 changed files with 28 additions and 27 deletions

View File

@@ -34,6 +34,7 @@ import net.minecraft.client.gui.widget.PressableWidget;
import net.minecraft.client.input.Input;
import net.minecraft.client.util.ScreenshotRecorder;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemGroups;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.math.MathHelper;
@@ -88,10 +89,10 @@ public class InputHandlers {
int currentTab = CreativeInventoryScreenAccessor.getSelectedTab();
int nextTab = currentTab + (next ? 1 : -1);
if (nextTab < 0)
nextTab = ItemGroup.GROUPS.length - 1;
else if (nextTab >= ItemGroup.GROUPS.length)
nextTab = ItemGroups.GROUPS.length - 1;
else if (nextTab >= ItemGroups.GROUPS.length)
nextTab = 0;
inventory.midnightcontrols$setSelectedTab(ItemGroup.GROUPS[nextTab]);
inventory.midnightcontrols$setSelectedTab(ItemGroups.GROUPS[nextTab]);
return true;
} else if (client.currentScreen instanceof InventoryScreen || client.currentScreen instanceof CraftingScreen || client.currentScreen instanceof AbstractFurnaceScreen<?>) {
RecipeBookWidget recipeBook;

View File

@@ -38,7 +38,7 @@ import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Util;
import net.minecraft.util.math.Matrix4f;
import org.joml.Matrix4f;
import org.lwjgl.glfw.GLFW;
import java.awt.*;
@@ -290,8 +290,8 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
this.buildTabs();
this.addDrawableChild(this.resetOption.createWidget(Position.of(this.width / 2 - 155, this.height - 29), 150));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 160, this.height - 29, 150, 20, SpruceTexts.GUI_DONE,
btn -> this.client.setScreen(this.parent)));
this.addDrawableChild(ButtonWidget.method_46430(SpruceTexts.GUI_DONE, btn -> this.client.setScreen(this.parent))
.method_46434(this.width / 2 - 155 + 160, this.height - 29, 150, 20).method_46431());
}
public void buildTabs() {

View File

@@ -37,8 +37,8 @@ public class RingScreen extends Screen {
protected void init() {
super.init();
if (mod.ring.getMaxPages() > 1) {
this.addDrawableChild(new ButtonWidget(5, 5, 20, 20, Text.of(""), button -> this.mod.ring.cyclePage(false)));
this.addDrawableChild(new ButtonWidget(width - 25, 5, 20, 20, Text.of(""), button -> this.mod.ring.cyclePage(true)));
this.addDrawableChild(ButtonWidget.method_46430(Text.of(""), button -> this.mod.ring.cyclePage(false)).method_46434(5, 5, 20, 20).method_46431());
this.addDrawableChild(ButtonWidget.method_46430(Text.of(""), button -> this.mod.ring.cyclePage(true)).method_46434(width - 25, 5, 20, 20).method_46431());
}
}

View File

@@ -38,8 +38,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity {
private boolean midnightcontrols$driftingPrevented = false;
public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) {
super(world, profile, publicKey);
public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile) {
super(world, profile);
}
@Shadow

View File

@@ -48,9 +48,9 @@ public abstract class ControlsOptionsScreenMixin extends GameOptionsScreen {
int i = this.width / 2 - 155;
int j = i + 160;
int k = this.height / 6 - 12 + 48;
this.addDrawableChild(new ButtonWidget(j, k, 150, 20, Text.translatable("midnightcontrols.menu.title.controller").append("..."), (button) -> {
this.addDrawableChild(ButtonWidget.method_46430(Text.translatable("midnightcontrols.menu.title.controller").append("..."), (button) -> {
this.client.setScreen(new MidnightControlsSettingsScreen(this, false));
}));
}).method_46434(j, k, 150, 20).method_46431());
}
}
}

View File

@@ -22,8 +22,8 @@ import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.util.shape.VoxelShape;
import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;