Skip to content

Commit

Permalink
Merge pull request #1034 from Qowyn/actcont-fix
Browse files Browse the repository at this point in the history
Restore ActiveContainer behavior. Fixes #1033
  • Loading branch information
bonii-xx committed Sep 28, 2014
2 parents 6a8c6f0 + e1cc9e6 commit 9d80633
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 2 additions & 0 deletions resources/META-INF/TConstruct_at.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public net.minecraft.block.BlockRailBase$Rail func_150650_a()I
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r
public net.minecraft.client.gui.inventory.GuiContainer field_147003_i
public net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V #renderSlot
public net.minecraft.client.gui.inventory.GuiContainer func_146981_a(Lnet/minecraft/inventory/Slot;II)Z #isMouseOverSlot
# GuiScreen
public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList
# ThreadDownloadImageData
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/tconstruct/smeltery/gui/ActiveContainerGui.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package tconstruct.smeltery.gui;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Slot;
import tconstruct.smeltery.inventory.ActiveContainer;
import tconstruct.smeltery.inventory.ActiveSlot;

public abstract class ActiveContainerGui extends GuiContainer
{

public ActiveContainerGui(ActiveContainer p_i1072_1_)
{
super(p_i1072_1_);
}

@Override
public void func_146977_a (Slot slot)
{
if (!(slot instanceof ActiveSlot) || ((ActiveSlot) slot).getActive())
{
super.func_146977_a(slot);
}
}

@Override
public boolean isMouseOverSlot (Slot slot, int mouseX, int mouseY)
{
if (!(slot instanceof ActiveSlot) || ((ActiveSlot) slot).getActive())
{
return super.isMouseOverSlot(slot, mouseX, mouseY);
}
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import tconstruct.smeltery.inventory.*;
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;

public class AdaptiveSmelteryGui extends GuiContainer
public class AdaptiveSmelteryGui extends ActiveContainerGui
{
public AdaptiveSmelteryLogic logic;
String username;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/smeltery/gui/SmelteryGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import tconstruct.smeltery.logic.SmelteryLogic;
import tconstruct.util.network.SmelteryPacket;

public class SmelteryGui extends GuiContainer
public class SmelteryGui extends ActiveContainerGui
{
public SmelteryLogic logic;
private boolean isScrolling = false;
Expand Down

0 comments on commit 9d80633

Please sign in to comment.