mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-22 21:09:43 +00:00
Universal GUI (#340)
Co-authored-by: Kogepan229 <[email protected]> Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
213 files changed
+1859
-19432
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
|
||||
import appeng.container.PrimaryGui;
|
||||
|
||||
public class FluidPrimaryGui extends PrimaryGui {
|
||||
|
||||
public FluidPrimaryGui(Object gui, ItemStack guiIcon, TileEntity te, ForgeDirection side) {
|
||||
super(gui, guiIcon, te, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(EntityPlayer p) {
|
||||
if (gui instanceof GuiType gt) {
|
||||
if (te != null) {
|
||||
InventoryHandler.openGui(p, te.getWorldObj(), new BlockPos(te), Objects.requireNonNull(side), gt);
|
||||
} else {
|
||||
InventoryHandler.openGui(
|
||||
p,
|
||||
p.worldObj,
|
||||
new BlockPos(
|
||||
this.slotIndex == Integer.MIN_VALUE ? p.inventory.currentItem : this.slotIndex,
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
0),
|
||||
Objects.requireNonNull(side),
|
||||
gt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,6 @@ public final class ModAndClassUtil {
|
||||
public static boolean NEW_HORIZONS_CORE_MOD = false;
|
||||
|
||||
public static boolean isV2;
|
||||
public static boolean isTypeFilter;
|
||||
public static boolean isDoubleButton;
|
||||
public static boolean isSaveText;
|
||||
public static boolean isSearchStringTooltip;
|
||||
@@ -120,12 +119,6 @@ public final class ModAndClassUtil {
|
||||
} catch (ClassNotFoundException e) {
|
||||
isV2 = false;
|
||||
}
|
||||
try {
|
||||
Class<?> filter = Class.forName("appeng.core.features.registries.ItemDisplayRegistry");
|
||||
isTypeFilter = true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
isTypeFilter = false;
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) {
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
public enum UltraTerminalModes {
|
||||
CRAFTING,
|
||||
PATTERN,
|
||||
PATTERN_EX,
|
||||
INTERFACE,
|
||||
LEVEL
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import static com.glodblock.github.client.UltraTerminalButtons.restockItems;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.infinityBoosterCard;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.infinityEnergyCard;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.restockItems;
|
||||
import static com.glodblock.github.util.Util.DimensionalCoordSide.hasEnergyCard;
|
||||
import static net.minecraft.init.Items.glass_bottle;
|
||||
|
||||
@@ -144,6 +144,13 @@ public final class Util {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void toggleRestock(ItemStack is) {
|
||||
if (is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
data.setBoolean(restockItems, !data.getBoolean(restockItems));
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasInfinityBoosterCard(ItemStack is) {
|
||||
if (is.getItem() instanceof ItemBaseWirelessTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
|
||||
Reference in new issue
Block a user