aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel
diff options
context:
space:
mode:
authorSiphalor <xyx0125@gmail.com>2019-01-10 20:48:37 +0100
committerSiphalor <xyx0125@gmail.com>2019-01-10 20:48:37 +0100
commitba1003c74974ba1f67c06566e0035e9430a76bdc (patch)
treebaa18035d08a9875d9878978666b018116925aba /src/main/java/me/shedaniel
parent8b89fff542fb941e209f0b25d3c6ea4f72518f70 (diff)
downloadRoughlyEnoughItems-ba1003c74974ba1f67c06566e0035e9430a76bdc.tar.gz
RoughlyEnoughItems-ba1003c74974ba1f67c06566e0035e9430a76bdc.tar.bz2
RoughlyEnoughItems-ba1003c74974ba1f67c06566e0035e9430a76bdc.zip
Updated to Minecraft and Fabric 19w02a
Fixed related crashes
Diffstat (limited to 'src/main/java/me/shedaniel')
-rwxr-xr-xsrc/main/java/me/shedaniel/gui/RecipeContainer.java13
-rwxr-xr-xsrc/main/java/me/shedaniel/gui/RecipeGui.java10
-rw-r--r--src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java7
3 files changed, 26 insertions, 4 deletions
diff --git a/src/main/java/me/shedaniel/gui/RecipeContainer.java b/src/main/java/me/shedaniel/gui/RecipeContainer.java
index 4477a10db..273a35154 100755
--- a/src/main/java/me/shedaniel/gui/RecipeContainer.java
+++ b/src/main/java/me/shedaniel/gui/RecipeContainer.java
@@ -1,14 +1,25 @@
package me.shedaniel.gui;
+import net.minecraft.class_3917;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
public class RecipeContainer extends Container {
+ public RecipeContainer() {
+ // Hacky senseless id to make it stop complaining
+ super(-1);
+ }
+
@Override
public boolean canUse(PlayerEntity playerEntity) {
return true;
}
+
+ @Override
+ public class_3917<?> method_17358() {
+ return null;
+ }
-}
+} \ No newline at end of file
diff --git a/src/main/java/me/shedaniel/gui/RecipeGui.java b/src/main/java/me/shedaniel/gui/RecipeGui.java
index 7e6acdef9..e2f169d1c 100755
--- a/src/main/java/me/shedaniel/gui/RecipeGui.java
+++ b/src/main/java/me/shedaniel/gui/RecipeGui.java
@@ -15,6 +15,9 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.render.GuiLighting;
import net.minecraft.client.util.Window;
import net.minecraft.container.Container;
+import net.minecraft.container.Slot;
+import net.minecraft.container.SlotActionType;
+import net.minecraft.text.TextComponent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
@@ -42,7 +45,7 @@ public class RecipeGui extends ContainerGui {
public Button btnRecipeLeft, btnRecipeRight;
public RecipeGui(Container p_i1072_1_, Gui prevScreen, Map<IDisplayCategory, List<IRecipe>> recipes) {
- super(new RecipeContainer());
+ super(new RecipeContainer(), MinecraftClient.getInstance().player.inventory, TextComponent.Serializer.fromJsonString("{\"text\":\"test\"}"));
this.container = p_i1072_1_;
this.prevScreen = prevScreen;
this.recipes = recipes;
@@ -228,6 +231,11 @@ public class RecipeGui extends ContainerGui {
}
@Override
+ protected void onMouseClick(Slot slot_1, int int_1, int int_2, SlotActionType slotActionType_1) {
+ // Disable mouse click on slot action (We don't want container slot interaction)
+ }
+
+ @Override
public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_) {
if (p_keyPressed_1_ == 256 && prevScreen != null) {
this.client.openGui(prevScreen);
diff --git a/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java b/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java
index 78389f51b..987cbc83a 100644
--- a/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java
+++ b/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java
@@ -7,7 +7,10 @@ import me.shedaniel.listenerdefinitions.GuiKeyDown;
import net.minecraft.client.gui.ingame.AbstractPlayerInventoryGui;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryGui;
import net.minecraft.container.Container;
+import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemGroup;
+import net.minecraft.text.TextComponent;
+
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@@ -24,8 +27,8 @@ public abstract class MixinCreativePlayerInventoryGui extends AbstractPlayerInve
@Shadow
private static int selectedTab;
- public MixinCreativePlayerInventoryGui(Container container_1) {
- super(container_1);
+ public MixinCreativePlayerInventoryGui(Container container_1, PlayerInventory playerInventory_1, TextComponent textComponent_1) {
+ super(container_1, playerInventory_1, textComponent_1);
}
@Inject(method = "keyPressed(III)Z", at = @At("HEAD"), cancellable = true)