2014-04-29 10:54:20 +10:00
|
|
|
package codechicken.nei;
|
|
|
|
|
|
|
|
|
|
import codechicken.lib.render.CCRenderState;
|
2022-05-06 22:41:45 +03:00
|
|
|
import codechicken.lib.vec.Rectangle4i;
|
2014-04-29 10:54:20 +10:00
|
|
|
import codechicken.nei.api.INEIGuiHandler;
|
|
|
|
|
import codechicken.nei.api.TaggedInventoryArea;
|
2022-06-24 12:32:13 +01:00
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
2014-04-29 10:54:20 +10:00
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
|
import net.minecraft.inventory.Container;
|
2022-05-06 22:41:45 +03:00
|
|
|
import net.minecraft.inventory.Slot;
|
2014-04-29 10:54:20 +10:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
2022-06-24 12:32:13 +01:00
|
|
|
public class GuiExtendedCreativeInv extends GuiContainer implements INEIGuiHandler {
|
2014-04-29 10:54:20 +10:00
|
|
|
public GuiExtendedCreativeInv(Container par1Container) {
|
|
|
|
|
super(par1Container);
|
|
|
|
|
ySize = 198;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
|
|
|
|
|
GL11.glColor4f(1, 1, 1, 1);
|
|
|
|
|
CCRenderState.changeTexture("nei:textures/gui/inv.png");
|
|
|
|
|
|
|
|
|
|
int x = guiLeft;
|
|
|
|
|
int y = guiTop - 4;
|
|
|
|
|
|
|
|
|
|
drawTexturedModalRect(x - 23, y, 0, 0, 199, 204);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) {
|
|
|
|
|
return currentVisibility;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Iterable<Integer> getItemSpawnSlots(GuiContainer gui, ItemStack item) {
|
|
|
|
|
return NEIServerUtils.getRange(0, 54);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TaggedInventoryArea> getInventoryAreas(GuiContainer gui) {
|
2019-12-30 20:19:16 -08:00
|
|
|
return Collections.singletonList(new TaggedInventoryArea("ExtendedCreativeInv", 0, 54, inventorySlots));
|
2014-04-29 10:54:20 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-06-24 12:32:13 +01:00
|
|
|
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
|
2022-05-06 22:41:45 +03:00
|
|
|
return (new Rectangle4i(guiLeft - 15, guiTop + 18, 18, 18 * 4 + 4)).intersects(new Rectangle4i(x, y, w, h));
|
2014-04-29 10:54:20 +10:00
|
|
|
}
|
2022-05-06 22:41:45 +03:00
|
|
|
|
|
|
|
|
@Override
|
2022-06-24 12:32:13 +01:00
|
|
|
protected void handleMouseClick(Slot p_146984_1_, int p_146984_2_, int p_146984_3_, int p_146984_4_) {
|
2022-05-06 22:41:45 +03:00
|
|
|
|
2022-06-24 12:32:13 +01:00
|
|
|
// Hack for armor slots, because they are outside the container
|
2022-05-06 22:41:45 +03:00
|
|
|
if (p_146984_1_ != null && p_146984_4_ == 4 && p_146984_1_.xDisplayPosition < 0) {
|
|
|
|
|
p_146984_4_ = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
super.handleMouseClick(p_146984_1_, p_146984_2_, p_146984_3_, p_146984_4_);
|
|
|
|
|
}
|
2014-04-29 10:54:20 +10:00
|
|
|
}
|