aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2018-12-31 17:42:05 +0800
committerUnknown <shekwancheung0528@gmail.com>2018-12-31 17:42:05 +0800
commit1266857add2c1705f57141bfd4feacfc71bcc712 (patch)
tree4696fabf49f99728fc7ae066d151795ec5fd9bb2 /src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java
parentaaa031a36408b96b6eef5351fd60e979112f0cea (diff)
downloadRoughlyEnoughItems-1266857add2c1705f57141bfd4feacfc71bcc712.tar.gz
RoughlyEnoughItems-1266857add2c1705f57141bfd4feacfc71bcc712.tar.bz2
RoughlyEnoughItems-1266857add2c1705f57141bfd4feacfc71bcc712.zip
Fixed Crash + Downgraded Loom
Diffstat (limited to 'src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java')
-rw-r--r--src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java b/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java
deleted file mode 100644
index 455266c8d..000000000
--- a/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package me.shedaniel.mixins;
-
-import me.shedaniel.Core;
-import me.shedaniel.listenerdefinitions.GuiKeyDown;
-import net.minecraft.client.gui.ingame.AbstractPlayerInventoryGui;
-import net.minecraft.client.gui.ingame.CreativePlayerInventoryGui;
-import net.minecraft.client.gui.widget.TextFieldWidget;
-import net.minecraft.container.Container;
-import net.minecraft.container.Slot;
-import net.minecraft.item.ItemGroup;
-import net.minecraft.util.math.MathHelper;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Overwrite;
-import org.spongepowered.asm.mixin.Shadow;
-
-import java.util.Objects;
-
-@Mixin(CreativePlayerInventoryGui.class)
-public abstract class MixinGuiContainerCreative extends AbstractPlayerInventoryGui {
-
- @Shadow
- private boolean field_2888;
-
- @Shadow
- public abstract int method_2469();
-
- @Shadow
- protected abstract void setSelectedTab(ItemGroup itemGroup_1);
-
- @Shadow
- protected abstract boolean method_2470(Slot slot_1);
-
- @Shadow
- private TextFieldWidget searchBox;
-
- @Shadow
- protected abstract void method_2464();
-
- @Shadow
- protected abstract boolean doRenderScrollBar();
-
- @Shadow
- private float scrollPosition;
-
- public MixinGuiContainerCreative(Container container_1) {
- super(container_1);
- }
-
- @Overwrite
- public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_) {
- this.field_2888 = false;
- if (method_2469() != ItemGroup.SEARCH.getId()) {
- if (method_2469() != ItemGroup.INVENTORY.getId()) {
- if (this.client.options.keyChat.matches(p_keyPressed_1_, p_keyPressed_2_)) {
- this.field_2888 = true;
- this.setSelectedTab(ItemGroup.SEARCH);
- return true;
- }
- } else for(GuiKeyDown listener : Core.getListeners(GuiKeyDown.class))
- if (listener.keyDown(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_))
- return true;
- } else {
- boolean flag = !this.method_2470(this.focusedSlot) || this.focusedSlot != null && this.focusedSlot.hasStack();
- if (flag && this.handleHotbarKeyPressed(p_keyPressed_1_, p_keyPressed_2_)) {
- this.field_2888 = true;
- return true;
- } else {
- String s = this.searchBox.getText();
-
- if (this.searchBox.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_)) {
- if (!Objects.equals(s, this.searchBox.getText()))
- this.method_2464();
- return true;
- }
- }
- }
- return super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_);
- }
-
- @Overwrite
- public boolean mouseScrolled(double p_mouseScrolled_1_) {
- if (!this.doRenderScrollBar()) {
- return super.mouseScrolled(p_mouseScrolled_1_);
- } else {
- int i = (((CreativePlayerInventoryGui.CreativeContainer) this.container).itemList.size() + 9 - 1) / 9 - 5;
- this.scrollPosition = (float) ((double) this.scrollPosition - p_mouseScrolled_1_ / (double) i);
- this.scrollPosition = MathHelper.clamp(this.scrollPosition, 0.0F, 1.0F);
- ((CreativePlayerInventoryGui.CreativeContainer) this.container).method_2473(this.scrollPosition);
- return true;
- }
- }
-
-}