diff --git a/dependencies.gradle b/dependencies.gradle index 31274d5412e..8261c0eedf2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -21,8 +21,8 @@ */ dependencies { // Hard Dependencies - //api files("libs/modularui-2.1.0-dev.jar") - implementation "curse.maven:modularui-624243:4692437" + implementation files("libs/modularui-2.2.2-dev.jar") + //implementation 'curse.maven:modularui-624243:4779301-sources-4779302' // the CCL deobf jar uses very old MCP mappings, making it error at runtime in runClient/runServer // therefore we manually deobf the regular jar diff --git a/libs/modularui-2.1.0-dev.jar b/libs/modularui-2.1.0-dev.jar deleted file mode 100644 index eb2ecf0077c..00000000000 Binary files a/libs/modularui-2.1.0-dev.jar and /dev/null differ diff --git a/libs/modularui-2.2.2-dev.jar b/libs/modularui-2.2.2-dev.jar new file mode 100644 index 00000000000..8108b94718c Binary files /dev/null and b/libs/modularui-2.2.2-dev.jar differ diff --git a/libs/modularui-2.2.2-sources.jar b/libs/modularui-2.2.2-sources.jar new file mode 100644 index 00000000000..908a50254da Binary files /dev/null and b/libs/modularui-2.2.2-sources.jar differ diff --git a/src/main/java/gregtech/GregTechMod.java b/src/main/java/gregtech/GregTechMod.java index 3f6b844486c..375b9bf0a7e 100644 --- a/src/main/java/gregtech/GregTechMod.java +++ b/src/main/java/gregtech/GregTechMod.java @@ -26,7 +26,7 @@ + "after:forestry;" + "after:jei@[4.15.0,);" + "after:crafttweaker@[4.1.20,);" - + "after:groovyscript@[0.6.0,);" + + "after:groovyscript@[0.5.1,);" + "after:theoneprobe;" + "after:hwyla;") public class GregTechMod { diff --git a/src/main/java/gregtech/api/cover/CoverWithUI.java b/src/main/java/gregtech/api/cover/CoverWithUI.java index bfaead9acd5..bc816eb57f4 100644 --- a/src/main/java/gregtech/api/cover/CoverWithUI.java +++ b/src/main/java/gregtech/api/cover/CoverWithUI.java @@ -35,7 +35,7 @@ default ModularScreen createScreen(GuiCreationContext guiCreationContext, Modula } @Override - default ModularPanel buildUI(GuiCreationContext guiCreationContext, GuiSyncManager guiSyncManager, boolean isClient) { + default ModularPanel buildUI(GuiCreationContext creationContext, GuiSyncManager syncManager, boolean isClient) { return null; } } diff --git a/src/main/java/gregtech/api/cover/filter/Filter.java b/src/main/java/gregtech/api/cover/filter/Filter.java new file mode 100644 index 00000000000..4d9cb97c248 --- /dev/null +++ b/src/main/java/gregtech/api/cover/filter/Filter.java @@ -0,0 +1,76 @@ +package gregtech.api.cover.filter; + +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.widgets.CycleButtonWidget; +import gregtech.api.newgui.GuiTextures; +import gregtech.api.util.IDirtyNotifiable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import org.jetbrains.annotations.NotNull; + +public abstract class Filter { + + private IDirtyNotifiable dirtyNotifiable; + private boolean inverted = false; + + public abstract boolean matches(T t, boolean ignoreInverted); + + public boolean matches(T t) { + return matches(t, false); + } + + /** + * Determines how much can transferred based on t. + * + * @param object by default an instance of T, but can be different fe. in {@link gregtech.common.covers.filter.item.ItemFilter} + * @param globalTransferLimit transferLimit of the holder + * @return transfer limit + */ + public abstract int getTransferLimit(Object object, int globalTransferLimit); + + /** + * Creates the filter ui. + * Ideally you manually set the size of the resulting widgets, so that covers can auto size themselves properly. + * + * @return the non-null filter ui widget + */ + @NotNull + public abstract IWidget createFilterUI(ModularPanel mainPanel, GuiSyncManager syncManager); + + public IWidget createBlacklistButton(ModularPanel mainPanel, GuiSyncManager syncManager) { + return new CycleButtonWidget() + .value(new BooleanSyncValue(this::isInverted, this::setInverted)) + .texture(GuiTextures.BUTTON_BLACKLIST) + .size(18, 18) + .pos(121, 0); + } + + public void writeToNBT(NBTTagCompound nbt) { + nbt.setBoolean("Inverted", this.inverted); + } + + public void readFromNBT(NBTTagCompound nbt) { + this.inverted = nbt.getBoolean("Inverted"); + } + + public boolean isInverted() { + return inverted; + } + + public void setInverted(boolean inverted) { + this.inverted = inverted; + } + + public final void setDirtyNotifiable(IDirtyNotifiable dirtyNotifiable) { + this.dirtyNotifiable = dirtyNotifiable; + } + + public final void markDirty() { + if (dirtyNotifiable != null) { + dirtyNotifiable.markAsDirty(); + } + } +} diff --git a/src/main/java/gregtech/api/cover/filter/FilterHolder.java b/src/main/java/gregtech/api/cover/filter/FilterHolder.java new file mode 100644 index 00000000000..e49a69af3b5 --- /dev/null +++ b/src/main/java/gregtech/api/cover/filter/FilterHolder.java @@ -0,0 +1,207 @@ +package gregtech.api.cover.filter; + +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.manager.GuiCreationContext; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.utils.Color; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.widget.ParentWidget; +import com.cleanroommc.modularui.widgets.ButtonWidget; +import com.cleanroommc.modularui.widgets.ItemSlot; +import com.cleanroommc.modularui.widgets.slot.ModularSlot; +import gregtech.api.newgui.FilterPanelSyncHandler; +import gregtech.api.newgui.GTGuis; +import gregtech.api.newgui.GuiTextures; +import gregtech.api.util.IDirtyNotifiable; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.INBTSerializable; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemStackHandler; +import org.jetbrains.annotations.Nullable; + +public abstract class FilterHolder> implements INBTSerializable { + + @Nullable + private F currentFilter; + protected final IDirtyNotifiable dirtyNotifiable; + private FilterMode mode = FilterMode.BOTH; + protected final IItemHandlerModifiable filterInventory; + protected final int filterSlotIndex; + private final boolean saveFilterInventory; + + protected FilterHolder(IDirtyNotifiable dirtyNotifiable) { + this(new ItemStackHandler() { + @Override + public int getSlotLimit(int slot) { + return 1; + } + }, 0, dirtyNotifiable); + } + + protected FilterHolder(IItemHandlerModifiable filterInventory, int filterSlotIndex, IDirtyNotifiable dirtyNotifiable) { + this.filterInventory = filterInventory; + this.filterSlotIndex = filterSlotIndex; + this.dirtyNotifiable = dirtyNotifiable; + this.saveFilterInventory = filterInventory instanceof INBTSerializable; + } + + public IWidget createFilterUI(ModularPanel mainPanel, GuiCreationContext creationContext, GuiSyncManager syncManager) { + ButtonWidget openFilterConfigButton = new ButtonWidget<>(); + FilterPanelSyncHandler filterPanelSyncHandler = new FilterPanelSyncHandler(mainPanel, this); + syncManager.syncValue("filter_config", filterPanelSyncHandler); + return new ParentWidget<>() + .height(18).widthRel(1f) + .child(IKey.lang("cover.filter.label").asWidget().height(18).left(0)) + .child(new ItemSlot() + .slot(new ModularSlot(this.filterInventory, this.filterSlotIndex) + .singletonSlotGroup() + .filter(item -> getFilterOf(item) != null) + .changeListener((stack, onlyAmountChanged, client, init) -> { + checkFilter(stack); + if (!init && client) { + openFilterConfigButton.setEnabled(hasFilter()); + if (!hasFilter() || filterPanelSyncHandler.isPanelOpen()) { + filterPanelSyncHandler.closePanel(); + } else { + filterPanelSyncHandler.openPanel(); + } + } + })) + .pos(60, 0)) + .child(openFilterConfigButton + .onMousePressed(mouseButton -> { + if (hasFilter() && !filterPanelSyncHandler.isPanelOpen()) { + filterPanelSyncHandler.openPanel(); + } + return true; + }) + .overlay(IKey.lang("cover.filter.settings_open.label")) + .pos(80, 0) + .size(82, 18)); + } + + public ModularPanel buildFilterPanel(ModularPanel mainPanel, GuiSyncManager syncManager, FilterPanelSyncHandler filterPanelSyncHandler) { + ModularPanel panel; + if (!hasFilter()) { + return (panel = GTGuis.createPanel("error", 32, 30)) + .background(GuiTextures.BACKGROUND) + .child(IKey.lang("An Error occurred!").color(Color.RED.normal).asWidget() + .size(130, 20)) + .child(ButtonWidget.panelCloseButton(filterPanelSyncHandler)); + } + + IWidget filterUI = this.currentFilter.createFilterUI(mainPanel, syncManager); + filterUI.flex().pos(5, 20).margin(5); + panel = new ModularPanel("filter_config") + .coverChildren() + .relative(mainPanel) + .top(0) + .rightRel(1f) + .padding(5) + .child(IKey.lang("cover.filter.settings.label").asWidget().pos(5, 5)); + panel.child(ButtonWidget.panelCloseButton(filterPanelSyncHandler)) + .child(filterUI); + return panel; + } + + @Nullable + public F getFilterOf(ItemStack stack) { + if (stack == null || stack.isEmpty()) { + return null; + } + Filter filter = FilterRegistry.createFilter(stack); + if (filter == null) { + return null; + } + if (getFilterClass().isAssignableFrom(filter.getClass())) { + return (F) filter; + } + return null; + } + + public abstract Class getFilterClass(); + + public void checkFilter(ItemStack itemStack) { + F filter = getFilterOf(itemStack); + if (currentFilter == null ^ filter == null || (currentFilter != null && currentFilter.getClass() != filter.getClass())) { + setCurrentFilter(filter); + } + } + + public void onFilterChanged(@Nullable F oldFilter, @Nullable F newFilter) { + } + + public void setCurrentFilter(@Nullable F currentFilter) { + if (this.currentFilter != currentFilter) { + F oldFilter = this.currentFilter; + this.currentFilter = currentFilter; + if (this.currentFilter != null) { + this.currentFilter.setDirtyNotifiable(dirtyNotifiable); + } + onFilterChanged(oldFilter, this.currentFilter); + } + } + + @Nullable + public F getCurrentFilter() { + return currentFilter; + } + + public boolean hasFilter() { + return currentFilter != null; + } + + public void setFilterMode(FilterMode mode) { + this.mode = mode; + } + + public FilterMode getFilterMode() { + return mode; + } + + public IItemHandlerModifiable getFilterInventory() { + return filterInventory; + } + + public boolean test(T t, boolean ignoresInverted) { + return currentFilter == null || currentFilter.matches(t, ignoresInverted); + } + + public boolean test(T t) { + return currentFilter == null || currentFilter.matches(t); + } + + @Override + public NBTTagCompound serializeNBT() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setByte("Mode", (byte) mode.ordinal()); + if (currentFilter != null) { + NBTTagCompound filterInventory = new NBTTagCompound(); + currentFilter.writeToNBT(filterInventory); + nbt.setTag("Filter", filterInventory); + } + if (saveFilterInventory) { + nbt.setTag("FilterInventory", ((INBTSerializable) filterInventory).serializeNBT()); + } + return nbt; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) { + this.mode = FilterMode.values()[nbt.getByte("Mode")]; + if (saveFilterInventory) { + ((INBTSerializable) filterInventory).deserializeNBT(nbt.getCompoundTag("FilterInventory")); + } + if (currentFilter == null) { + checkFilter(filterInventory.getStackInSlot(filterSlotIndex)); + } + if (currentFilter != null) { + this.currentFilter.readFromNBT(nbt.getCompoundTag("Filter")); + if (nbt.hasKey("IsBlacklist")) { + this.currentFilter.setInverted(nbt.getBoolean("IsBlacklist")); + } + } + } +} diff --git a/src/main/java/gregtech/api/cover/filter/FilterMode.java b/src/main/java/gregtech/api/cover/filter/FilterMode.java new file mode 100644 index 00000000000..86b0d425c9f --- /dev/null +++ b/src/main/java/gregtech/api/cover/filter/FilterMode.java @@ -0,0 +1,6 @@ +package gregtech.api.cover.filter; + +public enum FilterMode { + + INSERT, EXTRACT, BOTH +} diff --git a/src/main/java/gregtech/api/cover/filter/FilterRegistry.java b/src/main/java/gregtech/api/cover/filter/FilterRegistry.java new file mode 100644 index 00000000000..f54c244f996 --- /dev/null +++ b/src/main/java/gregtech/api/cover/filter/FilterRegistry.java @@ -0,0 +1,40 @@ +package gregtech.api.cover.filter; + +import gregtech.api.util.ItemStackHashStrategy; +import gregtech.common.covers.filter.fluid.SimpleFluidFilter; +import gregtech.common.covers.filter.item.SimpleItemFilter; +import gregtech.common.items.MetaItems; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.function.Supplier; + +public class FilterRegistry { + + public static void init() { + register(MetaItems.ITEM_FILTER.getStackForm(), SimpleItemFilter::new); + //register(MetaItems.ORE_DICTIONARY_FILTER.getStackForm(), OreDictFilter::new); + //register(MetaItems.SMART_FILTER.getStackForm(), SmartFilter::new); + register(MetaItems.FLUID_FILTER.getStackForm(), SimpleFluidFilter::new); + } + + private static final Map>> REGISTRY = new Object2ObjectOpenCustomHashMap<>(ItemStackHashStrategy.builder() + .compareItem(true) + .compareDamage(true) + .build()); + + public static void register(ItemStack item, Supplier> filterCreator) { + REGISTRY.put(item.copy(), filterCreator); + } + + @Nullable + public static Filter createFilter(ItemStack item) { + Supplier> filterCreator = REGISTRY.get(item); + if (filterCreator == null) { + return null; + } + return filterCreator.get(); + } +} diff --git a/src/main/java/gregtech/api/newgui/FilterPanelSyncHandler.java b/src/main/java/gregtech/api/newgui/FilterPanelSyncHandler.java new file mode 100644 index 00000000000..a1381013757 --- /dev/null +++ b/src/main/java/gregtech/api/newgui/FilterPanelSyncHandler.java @@ -0,0 +1,21 @@ +package gregtech.api.newgui; + +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.value.sync.PanelSyncHandler; +import gregtech.api.cover.filter.FilterHolder; + +public class FilterPanelSyncHandler extends PanelSyncHandler { + + private final FilterHolder filterHolder; + + public FilterPanelSyncHandler(ModularPanel mainPanel, FilterHolder filterHolder) { + super(mainPanel); + this.filterHolder = filterHolder; + } + + @Override + public ModularPanel createUI(ModularPanel mainPanel, GuiSyncManager syncManager) { + return this.filterHolder.buildFilterPanel(mainPanel, syncManager, this); + } +} diff --git a/src/main/java/gregtech/api/newgui/GTGuis.java b/src/main/java/gregtech/api/newgui/GTGuis.java index 7b4e000d415..86e623900ec 100644 --- a/src/main/java/gregtech/api/newgui/GTGuis.java +++ b/src/main/java/gregtech/api/newgui/GTGuis.java @@ -5,6 +5,8 @@ import com.cleanroommc.modularui.manager.GuiInfo; import com.cleanroommc.modularui.screen.ModularPanel; import com.cleanroommc.modularui.theme.ReloadThemeEvent; +import com.cleanroommc.modularui.theme.Theme; +import com.cleanroommc.modularui.utils.Color; import com.cleanroommc.modularui.utils.JsonBuilder; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.cover.CoverBehavior; @@ -14,6 +16,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GTUtility; import gregtech.common.ConfigHolder; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -79,6 +82,10 @@ public static GuiInfo getCoverUiInfo(EnumFacing facing) { return COVERS.get(facing); } + public static void openCoverUi(T cover, EntityPlayer player) { + getCoverUiInfo(cover.getAttachedSide()).open(player, cover.coverHolder.getWorld(), cover.coverHolder.getPos()); + } + public static ModularPanel createPanel(String name, int width, int height) { return ModularPanel.defaultPanel(name, width, height); } @@ -144,8 +151,26 @@ public static void initThemes() { @SubscribeEvent public static void onReloadThemes(ReloadThemeEvent.Pre event) { - gregtechTheme.add("color", ConfigHolder.client.defaultUIColor); + // make sure class is loaded + GuiTextures.init(); + gregtechTheme.add("color", ConfigHolder.client.defaultUIColor) + .addObject(Theme.TOGGLE_BUTTON, json -> json + .add("selectedColor", 0xFFFFFFFF) + .add("color", 0xFFFFFFFF) + .addObject("background", json1 -> json1 + .add("type", "texture") + .add("id", "cover_button")) + .addObject("hoverBackground", json1 -> json1 + .add("type", "texture") + .add("id", "cover_button_hover")) + .addObject("selectedBackground", json1 -> json1 + .add("type", "texture") + .add("id", "cover_button_disabled"))); bronzeTheme.add("parent", "gregtech") .add("color", 0xFA9D23); } + + private static int darker(int color, float percent) { + return Color.argb(Color.getRedF(color) * percent, Color.getGreenF(color) * percent, Color.getBlueF(color) * percent, Color.getAlphaF(color)); + } } diff --git a/src/main/java/gregtech/api/newgui/GuiFunctions.java b/src/main/java/gregtech/api/newgui/GuiFunctions.java new file mode 100644 index 00000000000..28f90a9dfdb --- /dev/null +++ b/src/main/java/gregtech/api/newgui/GuiFunctions.java @@ -0,0 +1,41 @@ +package gregtech.api.newgui; + +import com.cleanroommc.modularui.api.drawable.IDrawable; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.value.sync.IServerMouseAction; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.utils.MouseData; +import net.minecraft.util.IStringSerializable; + +import java.util.function.*; + +public class GuiFunctions { + + public static IServerMouseAction getIncrementer(int normal, int shift, int ctrl, int shiftCtrl, IntConsumer consumer) { + return (clickData) -> { + int amount = normal; + if (clickData.shift) { + if (clickData.ctrl) + amount = shiftCtrl; + else + amount = shift; + } else if (clickData.ctrl) + amount = ctrl; + consumer.accept(amount); + }; + } + + public static & IStringSerializable> IntFunction enumStringTextureGetter(Class clazz) { + return enumStringTextureGetter(clazz, IStringSerializable::getName); + } + + public static > IntFunction enumStringTextureGetter(Class clazz, Function nameGetter) { + return val -> { + T[] values = clazz.getEnumConstants(); + if (val >= values.length) { + throw new ArrayIndexOutOfBoundsException("Tried getting enum constant of class " + clazz.getSimpleName() + " at index " + val); + } + return IKey.lang(nameGetter.apply(values[val])); + }; + } +} diff --git a/src/main/java/gregtech/api/newgui/GuiTextures.java b/src/main/java/gregtech/api/newgui/GuiTextures.java index 09480e81d2e..ba2b5ae92c0 100644 --- a/src/main/java/gregtech/api/newgui/GuiTextures.java +++ b/src/main/java/gregtech/api/newgui/GuiTextures.java @@ -2,8 +2,11 @@ import com.cleanroommc.modularui.drawable.UITexture; import gregtech.api.GTValues; +import net.minecraft.util.ResourceLocation; -public class GuiTextures { +public class GuiTextures extends com.cleanroommc.modularui.drawable.GuiTextures { + + static void init() {} //GREGTECH public static final UITexture GREGTECH_LOGO = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/gregtech_logo.png", false); @@ -11,8 +14,8 @@ public class GuiTextures { public static final UITexture GREGTECH_LOGO_DARK = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/gregtech_logo_dark.png", false); public static final UITexture GREGTECH_LOGO_BLINKING_YELLOW = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/gregtech_logo_blinking_yellow.png", false); public static final UITexture GREGTECH_LOGO_BLINKING_RED = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/gregtech_logo_blinking_red.png", false); - //BASE TEXTURES + public static final UITexture BACKGROUND = UITexture.builder() .location(GTValues.MODID, "textures/gui/base/bordered_background.png") .imageSize(176, 166) @@ -36,11 +39,10 @@ public class GuiTextures { .adaptable(3) .canApplyTheme() .build();*/ + //public static final SteamTexture BACKGROUND_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/base/background_%s.png", 176, 166, 3, 3); - //public static final SteamTexture BACKGROUND_STEAM = SteamTexture.fullImage("textures/gui/base/background_%s.png", 176, 166, 3, 3); public static final UITexture CLIPBOARD_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/base/clipboard_background.png", false); public static final UITexture CLIPBOARD_PAPER_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/base/clipboard_paper_background.png", false); - public static final UITexture DISPLAY = UITexture.builder() .location(GTValues.MODID, "textures/gui/base/display.png") .imageSize(143, 75) @@ -48,267 +50,285 @@ public class GuiTextures { .build(); public static final UITexture BUTTON_PROXY = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_proxy.png", false); - public static final UITexture CLIPBOARD_BUTTON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/clipboard_button.png", false); + public static final UITexture CLIPBOARD_CHECK_BOX = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/clipboard_checkbox.png", false); - /*public static final UITexture BLANK = UITexture.fullImage("textures/gui/base/blank.png", 1, 1, 0, 0); - public static final UITexture DISPLAY = UITexture.fullImage("textures/gui/base/display.png", 143, 75, 2, 2); - public static final SteamTexture DISPLAY_STEAM = SteamTexture.fullImage("textures/gui/base/display_%s.png", 143, 75, 2, 2); - public static final UITexture FLUID_SLOT = UITexture.fullImage("textures/gui/base/fluid_slot.png", 18, 18, 1, 1); - public static final UITexture FLUID_TANK_BACKGROUND = UITexture.fullImage("textures/gui/base/fluid_tank_background.png"); - public static final UITexture FLUID_TANK_OVERLAY = UITexture.fullImage("textures/gui/base/fluid_tank_overlay.png"); - public static final UITexture SLOT = UITexture.fullImage("textures/gui/base/slot.png", 18, 18, 1, 1); - public static final UITexture SLOT_DARKENED = UITexture.fullImage("textures/gui/base/darkened_slot.png"); - public static final SteamTexture SLOT_STEAM = SteamTexture.fullImage("textures/gui/base/slot_%s.png"); - public static final UITexture TOGGLE_BUTTON_BACK = UITexture.fullImage("textures/gui/widget/toggle_button_background.png"); + /*public static final UITexture BLANK = UITexture.fullImage(GTValues.MODID, "textures/gui/base/blank.png", 1, 1, 0, 0); + public static final UITexture DISPLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/base/display.png", 143, 75, 2, 2); + public static final SteamTexture DISPLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/base/display_%s.png", 143, 75, 2, 2); + public static final UITexture FLUID_SLOT = UITexture.fullImage(GTValues.MODID, "textures/gui/base/fluid_slot.png", 18, 18, 1, 1); + public static final UITexture FLUID_TANK_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/base/fluid_tank_background.png"); + public static final UITexture FLUID_TANK_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/base/fluid_tank_overlay.png"); + public static final UITexture SLOT = UITexture.fullImage(GTValues.MODID, "textures/gui/base/slot.png", 18, 18, 1, 1); + public static final UITexture SLOT_DARKENED = UITexture.fullImage(GTValues.MODID, "textures/gui/base/darkened_slot.png"); + public static final SteamTexture SLOT_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/base/slot_%s.png"); + public static final UITexture TOGGLE_BUTTON_BACK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/toggle_button_background.png");*/ + // COVER UI TEXTURES + + public static final UITexture COVER_BUTTON = new UITexture(new ResourceLocation(GTValues.MODID, "gui/base/cover_normal"), 0f, 0f, 1f, 0.5f, true); + public static final UITexture COVER_BUTTON_HOVER = new UITexture(new ResourceLocation(GTValues.MODID, "gui/base/cover_normal_hovered"), 0f, 0f, 1f, 0.5f, false); + public static final UITexture COVER_DISABLED = UITexture.fullImage(GTValues.MODID, "textures/gui/base/cover_normal_disabled.png"); + public static final UITexture CROSS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/cross.png"); + public static final UITexture EXPORT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/export.png"); + public static final UITexture FILTERED = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/filtered.png"); + public static final UITexture IMPORT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/import.png"); + public static final UITexture UNFILTERED = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/unfiltered.png"); + public static final UITexture DISTRIBUTION_MODE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_distribution_mode.png"); + public static final UITexture FIRST_INSERT = DISTRIBUTION_MODE.getSubArea(0, 0, 1, 1/3f); + public static final UITexture ROUND_ROBIN = DISTRIBUTION_MODE.getSubArea(0, 1/3f, 1, 2/3f); + public static final UITexture ROUND_ROBIN_GLOBAL = DISTRIBUTION_MODE.getSubArea(0, 2/3f, 1, 1); //FLUID & ITEM OUTPUT BUTTONS - public static final UITexture BLOCKS_INPUT = UITexture.fullImage("textures/gui/widget/button_blocks_input.png"); - public static final UITexture BUTTON = UITexture.fullImage("textures/gui/widget/button.png"); - public static final UITexture BUTTON_ALLOW_IMPORT_EXPORT = UITexture.fullImage("textures/gui/widget/button_allow_import_export.png"); - public static final UITexture BUTTON_BLACKLIST = UITexture.fullImage("textures/gui/widget/button_blacklist.png"); - public static final UITexture BUTTON_CLEAR_GRID = UITexture.fullImage("textures/gui/widget/button_clear_grid.png"); - public static final UITexture BUTTON_FILTER_DAMAGE = UITexture.fullImage("textures/gui/widget/button_filter_damage.png"); - public static final UITexture BUTTON_FILTER_NBT = UITexture.fullImage("textures/gui/widget/button_filter_nbt.png"); - public static final UITexture BUTTON_FLUID_OUTPUT = UITexture.fullImage("textures/gui/widget/button_fluid_output_overlay.png"); - public static final UITexture BUTTON_ITEM_OUTPUT = UITexture.fullImage("textures/gui/widget/button_item_output_overlay.png"); - public static final UITexture BUTTON_LOCK = UITexture.fullImage("textures/gui/widget/button_lock.png"); - public static final UITexture BUTTON_VOID = UITexture.fullImage("textures/gui/widget/button_void.png"); - public static final UITexture BUTTON_VOID_NONE = UITexture.fullImage("textures/gui/widget/button_void_none.png"); - public static final UITexture BUTTON_VOID_MULTIBLOCK = UITexture.fullImage("textures/gui/widget/button_void_multiblock.png"); - public static final UITexture BUTTON_LEFT = UITexture.fullImage("textures/gui/widget/left.png"); - public static final UITexture BUTTON_OVERCLOCK = UITexture.fullImage("textures/gui/widget/button_overclock.png"); - public static final UITexture BUTTON_PUBLIC_PRIVATE = UITexture.fullImage("textures/gui/widget/button_public_private.png"); - public static final UITexture BUTTON_RIGHT = UITexture.fullImage("textures/gui/widget/right.png"); - public static final UITexture BUTTON_SWITCH_VIEW = UITexture.fullImage("textures/gui/widget/button_switch_view.png"); - public static final UITexture BUTTON_WORKING_ENABLE = UITexture.fullImage("textures/gui/widget/button_working_enable.png"); - public static final UITexture BUTTON_INT_CIRCUIT_PLUS = UITexture.fullImage("textures/gui/widget/button_circuit_plus.png"); - public static final UITexture BUTTON_INT_CIRCUIT_MINUS = UITexture.fullImage("textures/gui/widget/button_circuit_minus.png"); - public static final UITexture CLIPBOARD_BUTTON = UITexture.fullImage("textures/gui/widget/clipboard_button.png"); - public static final UITexture CLIPBOARD_TEXT_BOX = UITexture.fullImage("textures/gui/widget/clipboard_text_box.png", 9, 18, 1, 1); - public static final UITexture DISTRIBUTION_MODE = UITexture.fullImage("textures/gui/widget/button_distribution_mode.png"); - public static final UITexture LOCK = UITexture.fullImage("textures/gui/widget/lock.png"); - public static final UITexture LOCK_WHITE = UITexture.fullImage("textures/gui/widget/lock_white.png"); - public static final UITexture SWITCH = UITexture.fullImage("textures/gui/widget/switch.png"); - public static final UITexture SWITCH_HORIZONTAL = UITexture.fullImage("textures/gui/widget/switch_horizontal.png"); - public static final UITexture VANILLA_BUTTON = UITexture.fullImage("textures/gui/widget/vanilla_button.png", 200, 40); - public static final UITexture BUTTON_POWER = UITexture.fullImage("textures/gui/widget/button_power.png"); - public static final UITexture BUTTON_POWER_DETAIL = UITexture.fullImage("textures/gui/widget/button_power_detail.png"); - public static final UITexture BUTTON_DISTINCT_BUSES = UITexture.fullImage("textures/gui/widget/button_distinct_buses.png"); - public static final UITexture BUTTON_NO_DISTINCT_BUSES = UITexture.fullImage("textures/gui/widget/button_no_distinct_buses.png"); - public static final UITexture BUTTON_NO_FLEX = UITexture.fullImage("textures/gui/widget/button_no_flex.png"); - public static final UITexture BUTTON_MULTI_MAP = UITexture.fullImage("textures/gui/widget/button_multi_map.png"); - public static final UITexture BUTTON_MINER_MODES = UITexture.fullImage("textures/gui/widget/button_miner_modes.png"); - public static final UITexture BUTTON_THROTTLE_MINUS = UITexture.fullImage("textures/gui/widget/button_throttle_minus.png"); - public static final UITexture BUTTON_THROTTLE_PLUS = UITexture.fullImage("textures/gui/widget/button_throttle_plus.png"); + public static final UITexture BLOCKS_INPUT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_blocks_input.png"); + public static final UITexture BUTTON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button.png"); + public static final UITexture BUTTON_ALLOW_IMPORT_EXPORT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_allow_import_export.png"); + public static final UITexture BUTTON_BLACKLIST = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_blacklist.png"); + public static final UITexture BUTTON_CLEAR_GRID = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_clear_grid.png"); + public static final UITexture BUTTON_FILTER_DAMAGE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_filter_damage.png"); + public static final UITexture BUTTON_FILTER_NBT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_filter_nbt.png"); + public static final UITexture BUTTON_FLUID_OUTPUT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_fluid_output_overlay.png"); + public static final UITexture BUTTON_ITEM_OUTPUT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_item_output_overlay.png"); + public static final UITexture BUTTON_LOCK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_lock.png"); + public static final UITexture BUTTON_VOID = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_void.png"); + public static final UITexture BUTTON_VOID_NONE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_void_none.png"); + public static final UITexture BUTTON_VOID_MULTIBLOCK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_void_multiblock.png"); + public static final UITexture BUTTON_LEFT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/left.png"); + public static final UITexture BUTTON_OVERCLOCK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_overclock.png"); + public static final UITexture BUTTON_PUBLIC_PRIVATE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_public_private.png"); + public static final UITexture BUTTON_RIGHT = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/right.png"); + public static final UITexture BUTTON_SWITCH_VIEW = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_switch_view.png"); + public static final UITexture BUTTON_WORKING_ENABLE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_working_enable.png"); + public static final UITexture BUTTON_INT_CIRCUIT_PLUS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_circuit_plus.png"); + public static final UITexture BUTTON_INT_CIRCUIT_MINUS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_circuit_minus.png"); + public static final UITexture CLIPBOARD_BUTTON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/clipboard_button.png"); + //public static final UITexture CLIPBOARD_TEXT_BOX = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/clipboard_text_box.png", 9, 18, 1, 1); + public static final UITexture LOCK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/lock.png"); + public static final UITexture LOCK_WHITE = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/lock_white.png"); + public static final UITexture SWITCH = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/switch.png"); + public static final UITexture SWITCH_HORIZONTAL = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/switch_horizontal.png"); + //public static final UITexture VANILLA_BUTTON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/vanilla_button.png", 200, 40); + public static final UITexture BUTTON_POWER = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_power.png"); + public static final UITexture BUTTON_POWER_DETAIL = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_power_detail.png"); + public static final UITexture BUTTON_DISTINCT_BUSES = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_distinct_buses.png"); + public static final UITexture BUTTON_NO_DISTINCT_BUSES = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_no_distinct_buses.png"); + public static final UITexture BUTTON_NO_FLEX = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_no_flex.png"); + public static final UITexture BUTTON_MULTI_MAP = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_multi_map.png"); + public static final UITexture BUTTON_MINER_MODES = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_miner_modes.png"); + public static final UITexture BUTTON_THROTTLE_MINUS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_throttle_minus.png"); + public static final UITexture BUTTON_THROTTLE_PLUS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_throttle_plus.png"); //INDICATORS & ICONS - public static final UITexture INDICATOR_NO_ENERGY = UITexture.fullImage("textures/gui/base/indicator_no_energy.png"); - public static final SteamTexture INDICATOR_NO_STEAM = SteamTexture.fullImage("textures/gui/base/indicator_no_steam_%s.png"); - public static final UITexture TANK_ICON = UITexture.fullImage("textures/gui/base/tank_icon.png"); + public static final UITexture INDICATOR_NO_ENERGY = UITexture.fullImage(GTValues.MODID, "textures/gui/base/indicator_no_energy.png"); + //public static final SteamTexture INDICATOR_NO_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/base/indicator_no_steam_%s.png"); + public static final UITexture TANK_ICON = UITexture.fullImage(GTValues.MODID, "textures/gui/base/tank_icon.png"); //WIDGET UI RELATED - public static final UITexture SLIDER_BACKGROUND = UITexture.fullImage("textures/gui/widget/slider_background.png"); - public static final UITexture SLIDER_BACKGROUND_VERTICAL = UITexture.fullImage("textures/gui/widget/slider_background_vertical.png"); - public static final UITexture SLIDER_ICON = UITexture.fullImage("textures/gui/widget/slider.png"); - public static final UITexture MAINTENANCE_ICON = UITexture.fullImage("textures/gui/widget/button_maintenance.png"); + public static final UITexture SLIDER_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/slider_background.png"); + public static final UITexture SLIDER_BACKGROUND_VERTICAL = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/slider_background_vertical.png"); + public static final UITexture SLIDER_ICON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/slider.png"); + public static final UITexture MAINTENANCE_ICON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/button_maintenance.png"); //PRIMITIVE - public static final UITexture PRIMITIVE_BACKGROUND = UITexture.fullImage("textures/gui/primitive/primitive_background.png", 176, 166, 3, 3); - public static final UITexture PRIMITIVE_SLOT = UITexture.fullImage("textures/gui/primitive/primitive_slot.png", 18, 18, 1, 1); - public static final UITexture PRIMITIVE_FURNACE_OVERLAY = UITexture.fullImage("textures/gui/primitive/overlay_primitive_furnace.png"); - public static final UITexture PRIMITIVE_DUST_OVERLAY = UITexture.fullImage("textures/gui/primitive/overlay_primitive_dust.png"); - public static final UITexture PRIMITIVE_INGOT_OVERLAY = UITexture.fullImage("textures/gui/primitive/overlay_primitive_ingot.png"); - public static final UITexture PRIMITIVE_LARGE_FLUID_TANK = UITexture.fullImage("textures/gui/primitive/primitive_large_fluid_tank.png"); - public static final UITexture PRIMITIVE_LARGE_FLUID_TANK_OVERLAY = UITexture.fullImage("textures/gui/primitive/primitive_large_fluid_tank_overlay.png"); - public static final UITexture PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR = UITexture.fullImage("textures/gui/primitive/progress_bar_primitive_blast_furnace.png"); + //public static final UITexture PRIMITIVE_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/primitive_background.png", 176, 166, 3, 3); + //public static final UITexture PRIMITIVE_SLOT = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/primitive_slot.png", 18, 18, 1, 1); + public static final UITexture PRIMITIVE_FURNACE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/overlay_primitive_furnace.png"); + public static final UITexture PRIMITIVE_DUST_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/overlay_primitive_dust.png"); + public static final UITexture PRIMITIVE_INGOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/overlay_primitive_ingot.png"); + public static final UITexture PRIMITIVE_LARGE_FLUID_TANK = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/primitive_large_fluid_tank.png"); + public static final UITexture PRIMITIVE_LARGE_FLUID_TANK_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/primitive_large_fluid_tank_overlay.png"); + public static final UITexture PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR = UITexture.fullImage(GTValues.MODID, "textures/gui/primitive/progress_bar_primitive_blast_furnace.png"); //SLOT OVERLAYS - public static final UITexture ATOMIC_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/atomic_overlay_1.png"); - public static final UITexture ATOMIC_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/atomic_overlay_2.png"); - public static final UITexture ARROW_INPUT_OVERLAY = UITexture.fullImage("textures/gui/overlay/arrow_input_overlay.png"); - public static final UITexture ARROW_OUTPUT_OVERLAY = UITexture.fullImage("textures/gui/overlay/arrow_output_overlay.png"); - public static final UITexture BATTERY_OVERLAY = UITexture.fullImage("textures/gui/overlay/battery_overlay.png"); - public static final UITexture BEAKER_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/beaker_overlay_1.png"); - public static final UITexture BEAKER_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/beaker_overlay_2.png"); - public static final UITexture BEAKER_OVERLAY_3 = UITexture.fullImage("textures/gui/overlay/beaker_overlay_3.png"); - public static final UITexture BEAKER_OVERLAY_4 = UITexture.fullImage("textures/gui/overlay/beaker_overlay_4.png"); - public static final UITexture BENDER_OVERLAY = UITexture.fullImage("textures/gui/overlay/bender_overlay.png"); - public static final UITexture BOX_OVERLAY = UITexture.fullImage("textures/gui/overlay/box_overlay.png"); - public static final UITexture BOXED_OVERLAY = UITexture.fullImage("textures/gui/overlay/boxed_overlay.png"); - public static final UITexture BREWER_OVERLAY = UITexture.fullImage("textures/gui/overlay/brewer_overlay.png"); - public static final UITexture CANNER_OVERLAY = UITexture.fullImage("textures/gui/overlay/canner_overlay.png"); - public static final UITexture CHARGER_OVERLAY = UITexture.fullImage("textures/gui/overlay/charger_slot_overlay.png"); - public static final UITexture CANISTER_OVERLAY = UITexture.fullImage("textures/gui/overlay/canister_overlay.png"); - public static final SteamTexture CANISTER_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/canister_overlay_%s.png"); - public static final UITexture CENTRIFUGE_OVERLAY = UITexture.fullImage("textures/gui/overlay/centrifuge_overlay.png"); - public static final UITexture CIRCUIT_OVERLAY = UITexture.fullImage("textures/gui/overlay/circuit_overlay.png"); - public static final SteamTexture COAL_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/coal_overlay_%s.png"); - public static final UITexture COMPRESSOR_OVERLAY = UITexture.fullImage("textures/gui/overlay/compressor_overlay.png"); - public static final SteamTexture COMPRESSOR_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/compressor_overlay_%s.png"); - public static final UITexture CRACKING_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/cracking_overlay_1.png"); - public static final UITexture CRACKING_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/cracking_overlay_2.png"); - public static final UITexture CRUSHED_ORE_OVERLAY = UITexture.fullImage("textures/gui/overlay/crushed_ore_overlay.png"); - public static final SteamTexture CRUSHED_ORE_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/crushed_ore_overlay_%s.png"); - public static final UITexture CRYSTAL_OVERLAY = UITexture.fullImage("textures/gui/overlay/crystal_overlay.png"); - public static final UITexture CUTTER_OVERLAY = UITexture.fullImage("textures/gui/overlay/cutter_overlay.png"); - public static final UITexture DARK_CANISTER_OVERLAY = UITexture.fullImage("textures/gui/overlay/dark_canister_overlay.png"); - public static final UITexture DUST_OVERLAY = UITexture.fullImage("textures/gui/overlay/dust_overlay.png"); - public static final SteamTexture DUST_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/dust_overlay_%s.png"); - public static final UITexture EXTRACTOR_OVERLAY = UITexture.fullImage("textures/gui/overlay/extractor_overlay.png"); - public static final SteamTexture EXTRACTOR_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/extractor_overlay_%s.png"); - public static final UITexture FILTER_SLOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/filter_slot_overlay.png"); - public static final UITexture FURNACE_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/furnace_overlay_1.png"); - public static final UITexture FURNACE_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/furnace_overlay_2.png"); - public static final SteamTexture FURNACE_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/furnace_overlay_%s.png"); - public static final UITexture HAMMER_OVERLAY = UITexture.fullImage("textures/gui/overlay/hammer_overlay.png"); - public static final SteamTexture HAMMER_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/hammer_overlay_%s.png"); - public static final UITexture HEATING_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/heating_overlay_1.png"); - public static final UITexture HEATING_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/heating_overlay_2.png"); - public static final UITexture IMPLOSION_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/implosion_overlay_1.png"); - public static final UITexture IMPLOSION_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/implosion_overlay_2.png"); - public static final UITexture IN_SLOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/in_slot_overlay.png"); - public static final SteamTexture IN_SLOT_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/in_slot_overlay_%s.png"); - public static final UITexture INGOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/ingot_overlay.png"); - public static final UITexture INT_CIRCUIT_OVERLAY = UITexture.fullImage("textures/gui/overlay/int_circuit_overlay.png"); - public static final UITexture LENS_OVERLAY = UITexture.fullImage("textures/gui/overlay/lens_overlay.png"); - public static final UITexture LIGHTNING_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/lightning_overlay_1.png"); - public static final UITexture LIGHTNING_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/lightning_overlay_2.png"); - public static final UITexture MOLD_OVERLAY = UITexture.fullImage("textures/gui/overlay/mold_overlay.png"); - public static final UITexture MOLECULAR_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/molecular_overlay_1.png"); - public static final UITexture MOLECULAR_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/molecular_overlay_2.png"); - public static final UITexture MOLECULAR_OVERLAY_3 = UITexture.fullImage("textures/gui/overlay/molecular_overlay_3.png"); - public static final UITexture MOLECULAR_OVERLAY_4 = UITexture.fullImage("textures/gui/overlay/molecular_overlay_4.png"); - public static final UITexture OUT_SLOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/out_slot_overlay.png"); - public static final SteamTexture OUT_SLOT_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/out_slot_overlay_%s.png"); - public static final UITexture PAPER_OVERLAY = UITexture.fullImage("textures/gui/overlay/paper_overlay.png"); - public static final UITexture PRINTED_PAPER_OVERLAY = UITexture.fullImage("textures/gui/overlay/printed_paper_overlay.png"); - public static final UITexture PIPE_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/pipe_overlay_2.png"); - public static final UITexture PIPE_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/pipe_overlay_1.png"); - public static final UITexture PRESS_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/press_overlay_1.png"); - public static final UITexture PRESS_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/press_overlay_2.png"); - public static final UITexture PRESS_OVERLAY_3 = UITexture.fullImage("textures/gui/overlay/press_overlay_3.png"); - public static final UITexture PRESS_OVERLAY_4 = UITexture.fullImage("textures/gui/overlay/press_overlay_4.png"); - public static final UITexture SAWBLADE_OVERLAY = UITexture.fullImage("textures/gui/overlay/sawblade_overlay.png"); - public static final UITexture SOLIDIFIER_OVERLAY = UITexture.fullImage("textures/gui/overlay/solidifier_overlay.png"); - public static final UITexture STRING_SLOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/string_slot_overlay.png"); - public static final UITexture TOOL_SLOT_OVERLAY = UITexture.fullImage("textures/gui/overlay/tool_slot_overlay.png"); - public static final UITexture TURBINE_OVERLAY = UITexture.fullImage("textures/gui/overlay/turbine_overlay.png"); - public static final UITexture VIAL_OVERLAY_1 = UITexture.fullImage("textures/gui/overlay/vial_overlay_1.png"); - public static final UITexture VIAL_OVERLAY_2 = UITexture.fullImage("textures/gui/overlay/vial_overlay_2.png"); - public static final UITexture WIREMILL_OVERLAY = UITexture.fullImage("textures/gui/overlay/wiremill_overlay.png"); - public static final UITexture POSITIVE_MATTER_OVERLAY = UITexture.fullImage("textures/gui/overlay/positive_matter_overlay.png"); - public static final UITexture NEUTRAL_MATTER_OVERLAY = UITexture.fullImage("textures/gui/overlay/neutral_matter_overlay.png"); - public static final UITexture DATA_ORB_OVERLAY = UITexture.fullImage("textures/gui/overlay/data_orb_overlay.png"); - public static final UITexture SCANNER_OVERLAY = UITexture.fullImage("textures/gui/overlay/scanner_overlay.png"); - public static final UITexture DUCT_TAPE_OVERLAY = UITexture.fullImage("textures/gui/overlay/duct_tape_overlay.png"); - public static final UITexture RESEARCH_STATION_OVERLAY = UITexture.fullImage("textures/gui/overlay/research_station_overlay.png"); + public static final UITexture ATOMIC_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/atomic_overlay_1.png"); + public static final UITexture ATOMIC_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/atomic_overlay_2.png"); + public static final UITexture ARROW_INPUT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/arrow_input_overlay.png"); + public static final UITexture ARROW_OUTPUT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/arrow_output_overlay.png"); + public static final UITexture BATTERY_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/battery_overlay.png"); + public static final UITexture BEAKER_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/beaker_overlay_1.png"); + public static final UITexture BEAKER_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/beaker_overlay_2.png"); + public static final UITexture BEAKER_OVERLAY_3 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/beaker_overlay_3.png"); + public static final UITexture BEAKER_OVERLAY_4 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/beaker_overlay_4.png"); + public static final UITexture BENDER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/bender_overlay.png"); + public static final UITexture BOX_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/box_overlay.png"); + public static final UITexture BOXED_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/boxed_overlay.png"); + public static final UITexture BREWER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/brewer_overlay.png"); + public static final UITexture CANNER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/canner_overlay.png"); + public static final UITexture CHARGER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/charger_slot_overlay.png"); + public static final UITexture CANISTER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/canister_overlay.png"); + //public static final SteamTexture CANISTER_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/canister_overlay_%s.png"); + public static final UITexture CENTRIFUGE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/centrifuge_overlay.png"); + public static final UITexture CIRCUIT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/circuit_overlay.png"); + //public static final SteamTexture COAL_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/coal_overlay_%s.png"); + public static final UITexture COMPRESSOR_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/compressor_overlay.png"); + //public static final SteamTexture COMPRESSOR_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/compressor_overlay_%s.png"); + public static final UITexture CRACKING_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/cracking_overlay_1.png"); + public static final UITexture CRACKING_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/cracking_overlay_2.png"); + public static final UITexture CRUSHED_ORE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/crushed_ore_overlay.png"); + //public static final SteamTexture CRUSHED_ORE_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/crushed_ore_overlay_%s.png"); + public static final UITexture CRYSTAL_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/crystal_overlay.png"); + public static final UITexture CUTTER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/cutter_overlay.png"); + public static final UITexture DARK_CANISTER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/dark_canister_overlay.png"); + public static final UITexture DUST_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/dust_overlay.png"); + //public static final SteamTexture DUST_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/dust_overlay_%s.png"); + public static final UITexture EXTRACTOR_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/extractor_overlay.png"); + //public static final SteamTexture EXTRACTOR_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/extractor_overlay_%s.png"); + public static final UITexture FILTER_SLOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/filter_slot_overlay.png"); + public static final UITexture FURNACE_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/furnace_overlay_1.png"); + public static final UITexture FURNACE_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/furnace_overlay_2.png"); + //public static final SteamTexture FURNACE_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/furnace_overlay_%s.png"); + public static final UITexture HAMMER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/hammer_overlay.png"); + //public static final SteamTexture HAMMER_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/hammer_overlay_%s.png"); + public static final UITexture HEATING_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/heating_overlay_1.png"); + public static final UITexture HEATING_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/heating_overlay_2.png"); + public static final UITexture IMPLOSION_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/implosion_overlay_1.png"); + public static final UITexture IMPLOSION_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/implosion_overlay_2.png"); + public static final UITexture IN_SLOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/in_slot_overlay.png"); + //public static final SteamTexture IN_SLOT_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/in_slot_overlay_%s.png"); + public static final UITexture INGOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/ingot_overlay.png"); + public static final UITexture INT_CIRCUIT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/int_circuit_overlay.png"); + public static final UITexture LENS_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/lens_overlay.png"); + public static final UITexture LIGHTNING_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/lightning_overlay_1.png"); + public static final UITexture LIGHTNING_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/lightning_overlay_2.png"); + public static final UITexture MOLD_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/mold_overlay.png"); + public static final UITexture MOLECULAR_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/molecular_overlay_1.png"); + public static final UITexture MOLECULAR_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/molecular_overlay_2.png"); + public static final UITexture MOLECULAR_OVERLAY_3 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/molecular_overlay_3.png"); + public static final UITexture MOLECULAR_OVERLAY_4 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/molecular_overlay_4.png"); + public static final UITexture OUT_SLOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/out_slot_overlay.png"); + //public static final SteamTexture OUT_SLOT_OVERLAY_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/overlay/out_slot_overlay_%s.png"); + public static final UITexture PAPER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/paper_overlay.png"); + public static final UITexture PRINTED_PAPER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/printed_paper_overlay.png"); + public static final UITexture PIPE_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/pipe_overlay_2.png"); + public static final UITexture PIPE_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/pipe_overlay_1.png"); + public static final UITexture PRESS_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/press_overlay_1.png"); + public static final UITexture PRESS_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/press_overlay_2.png"); + public static final UITexture PRESS_OVERLAY_3 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/press_overlay_3.png"); + public static final UITexture PRESS_OVERLAY_4 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/press_overlay_4.png"); + public static final UITexture SAWBLADE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/sawblade_overlay.png"); + public static final UITexture SOLIDIFIER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/solidifier_overlay.png"); + public static final UITexture STRING_SLOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/string_slot_overlay.png"); + public static final UITexture TOOL_SLOT_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/tool_slot_overlay.png"); + public static final UITexture TURBINE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/turbine_overlay.png"); + public static final UITexture VIAL_OVERLAY_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/vial_overlay_1.png"); + public static final UITexture VIAL_OVERLAY_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/vial_overlay_2.png"); + public static final UITexture WIREMILL_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/wiremill_overlay.png"); + public static final UITexture POSITIVE_MATTER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/positive_matter_overlay.png"); + public static final UITexture NEUTRAL_MATTER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/neutral_matter_overlay.png"); + public static final UITexture DATA_ORB_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/data_orb_overlay.png"); + public static final UITexture SCANNER_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/scanner_overlay.png"); + public static final UITexture DUCT_TAPE_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/duct_tape_overlay.png"); + public static final UITexture RESEARCH_STATION_OVERLAY = UITexture.fullImage(GTValues.MODID, "textures/gui/overlay/research_station_overlay.png"); //PROGRESS BARS - public static final UITexture PROGRESS_BAR_ARC_FURNACE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_arc_furnace.png"); - public static final UITexture PROGRESS_BAR_ARROW = UITexture.fullImage("textures/gui/progress_bar/progress_bar_arrow.png"); - public static final SteamTexture PROGRESS_BAR_ARROW_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_arrow_%s.png"); - public static final UITexture PROGRESS_BAR_ARROW_MULTIPLE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_arrow_multiple.png"); - public static final UITexture PROGRESS_BAR_ASSEMBLY_LINE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_assembly_line.png"); - public static final UITexture PROGRESS_BAR_ASSEMBLY_LINE_ARROW = UITexture.fullImage("textures/gui/progress_bar/progress_bar_assembly_line_arrow.png"); - public static final UITexture PROGRESS_BAR_BATH = UITexture.fullImage("textures/gui/progress_bar/progress_bar_bath.png"); - public static final UITexture PROGRESS_BAR_BENDING = UITexture.fullImage("textures/gui/progress_bar/progress_bar_bending.png"); - public static final SteamTexture PROGRESS_BAR_BOILER_EMPTY = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_boiler_empty_%s.png"); - public static final SteamTexture PROGRESS_BAR_BOILER_FUEL = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_boiler_fuel_%s.png"); - public static final UITexture PROGRESS_BAR_BOILER_HEAT = UITexture.fullImage("textures/gui/progress_bar/progress_bar_boiler_heat.png"); - public static final UITexture PROGRESS_BAR_CANNER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_canner.png"); - public static final UITexture PROGRESS_BAR_CIRCUIT = UITexture.fullImage("textures/gui/progress_bar/progress_bar_circuit.png"); - public static final UITexture PROGRESS_BAR_CIRCUIT_ASSEMBLER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_circuit_assembler.png"); - public static final UITexture PROGRESS_BAR_COKE_OVEN = UITexture.fullImage("textures/gui/progress_bar/progress_bar_coke_oven.png"); - public static final UITexture PROGRESS_BAR_COMPRESS = UITexture.fullImage("textures/gui/progress_bar/progress_bar_compress.png"); - public static final SteamTexture PROGRESS_BAR_COMPRESS_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_compress_%s.png"); - public static final UITexture PROGRESS_BAR_CRACKING = UITexture.fullImage("textures/gui/progress_bar/progress_bar_cracking.png"); - public static final UITexture PROGRESS_BAR_CRACKING_INPUT = UITexture.fullImage("textures/gui/progress_bar/progress_bar_cracking_2.png"); - public static final UITexture PROGRESS_BAR_CRYSTALLIZATION = UITexture.fullImage("textures/gui/progress_bar/progress_bar_crystallization.png"); - public static final UITexture PROGRESS_BAR_DISTILLATION_TOWER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_distillation_tower.png"); - public static final UITexture PROGRESS_BAR_EXTRACT = UITexture.fullImage("textures/gui/progress_bar/progress_bar_extract.png"); - public static final SteamTexture PROGRESS_BAR_EXTRACT_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_extract_%s.png"); - public static final UITexture PROGRESS_BAR_EXTRUDER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_extruder.png"); - public static final UITexture PROGRESS_BAR_FUSION = UITexture.fullImage("textures/gui/progress_bar/progress_bar_fusion.png"); - public static final UITexture PROGRESS_BAR_GAS_COLLECTOR = UITexture.fullImage("textures/gui/progress_bar/progress_bar_gas_collector.png"); - public static final UITexture PROGRESS_BAR_HAMMER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_hammer.png"); - public static final SteamTexture PROGRESS_BAR_HAMMER_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_hammer_%s.png"); - public static final UITexture PROGRESS_BAR_HAMMER_BASE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_hammer_base.png"); - public static final SteamTexture PROGRESS_BAR_HAMMER_BASE_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_hammer_base_%s.png"); - public static final UITexture PROGRESS_BAR_LATHE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_lathe.png"); - public static final UITexture PROGRESS_BAR_LATHE_BASE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_lathe_base.png"); - public static final UITexture PROGRESS_BAR_MACERATE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_macerate.png"); - public static final SteamTexture PROGRESS_BAR_MACERATE_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_macerate_%s.png"); - public static final UITexture PROGRESS_BAR_MAGNET = UITexture.fullImage("textures/gui/progress_bar/progress_bar_magnet.png"); - public static final UITexture PROGRESS_BAR_MASS_FAB = UITexture.fullImage("textures/gui/progress_bar/progress_bar_mass_fab.png"); - public static final UITexture PROGRESS_BAR_MIXER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_mixer.png"); - public static final UITexture PROGRESS_BAR_PACKER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_packer.png"); - public static final UITexture PROGRESS_BAR_RECYCLER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_recycler.png"); - public static final UITexture PROGRESS_BAR_REPLICATOR = UITexture.fullImage("textures/gui/progress_bar/progress_bar_replicator.png"); - public static final UITexture PROGRESS_BAR_SIFT = UITexture.fullImage("textures/gui/progress_bar/progress_bar_sift.png"); - public static final UITexture PROGRESS_BAR_SLICE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_slice.png"); - public static final SteamTexture PROGRESS_BAR_SOLAR_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_solar_%s.png"); - public static final UITexture PROGRESS_BAR_UNLOCK = UITexture.fullImage("textures/gui/progress_bar/progress_bar_unlock.png"); - public static final UITexture PROGRESS_BAR_UNPACKER = UITexture.fullImage("textures/gui/progress_bar/progress_bar_unpacker.png"); - public static final UITexture PROGRESS_BAR_WIREMILL = UITexture.fullImage("textures/gui/progress_bar/progress_bar_wiremill.png"); - public static final UITexture PROGRESS_BAR_RESEARCH_STATION_1 = UITexture.fullImage("textures/gui/progress_bar/progress_bar_research_station_1.png"); - public static final UITexture PROGRESS_BAR_RESEARCH_STATION_2 = UITexture.fullImage("textures/gui/progress_bar/progress_bar_research_station_2.png"); - public static final UITexture PROGRESS_BAR_RESEARCH_STATION_BASE = UITexture.fullImage("textures/gui/progress_bar/progress_bar_research_station_base.png"); + public static final UITexture PROGRESS_BAR_ARC_FURNACE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_arc_furnace.png"); + public static final UITexture PROGRESS_BAR_ARROW = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_arrow.png"); + //public static final SteamTexture PROGRESS_BAR_ARROW_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_arrow_%s.png"); + public static final UITexture PROGRESS_BAR_ARROW_MULTIPLE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_arrow_multiple.png"); + public static final UITexture PROGRESS_BAR_ASSEMBLY_LINE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_assembly_line.png"); + public static final UITexture PROGRESS_BAR_ASSEMBLY_LINE_ARROW = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_assembly_line_arrow.png"); + public static final UITexture PROGRESS_BAR_BATH = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_bath.png"); + public static final UITexture PROGRESS_BAR_BENDING = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_bending.png"); + //public static final SteamTexture PROGRESS_BAR_BOILER_EMPTY = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_boiler_empty_%s.png"); + //public static final SteamTexture PROGRESS_BAR_BOILER_FUEL = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_boiler_fuel_%s.png"); + public static final UITexture PROGRESS_BAR_BOILER_HEAT = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_boiler_heat.png"); + public static final UITexture PROGRESS_BAR_CANNER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_canner.png"); + public static final UITexture PROGRESS_BAR_CIRCUIT = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_circuit.png"); + public static final UITexture PROGRESS_BAR_CIRCUIT_ASSEMBLER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_circuit_assembler.png"); + public static final UITexture PROGRESS_BAR_COKE_OVEN = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_coke_oven.png"); + public static final UITexture PROGRESS_BAR_COMPRESS = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_compress.png"); + //public static final SteamTexture PROGRESS_BAR_COMPRESS_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_compress_%s.png"); + public static final UITexture PROGRESS_BAR_CRACKING = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_cracking.png"); + public static final UITexture PROGRESS_BAR_CRACKING_INPUT = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_cracking_2.png"); + public static final UITexture PROGRESS_BAR_CRYSTALLIZATION = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_crystallization.png"); + public static final UITexture PROGRESS_BAR_DISTILLATION_TOWER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_distillation_tower.png"); + public static final UITexture PROGRESS_BAR_EXTRACT = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_extract.png"); + //public static final SteamTexture PROGRESS_BAR_EXTRACT_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_extract_%s.png"); + public static final UITexture PROGRESS_BAR_EXTRUDER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_extruder.png"); + public static final UITexture PROGRESS_BAR_FUSION = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_fusion.png"); + public static final UITexture PROGRESS_BAR_GAS_COLLECTOR = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_gas_collector.png"); + public static final UITexture PROGRESS_BAR_HAMMER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_hammer.png"); + //public static final SteamTexture PROGRESS_BAR_HAMMER_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_hammer_%s.png"); + public static final UITexture PROGRESS_BAR_HAMMER_BASE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_hammer_base.png"); + //public static final SteamTexture PROGRESS_BAR_HAMMER_BASE_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_hammer_base_%s.png"); + public static final UITexture PROGRESS_BAR_LATHE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_lathe.png"); + public static final UITexture PROGRESS_BAR_LATHE_BASE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_lathe_base.png"); + public static final UITexture PROGRESS_BAR_MACERATE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_macerate.png"); + //public static final SteamTexture PROGRESS_BAR_MACERATE_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_macerate_%s.png"); + public static final UITexture PROGRESS_BAR_MAGNET = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_magnet.png"); + public static final UITexture PROGRESS_BAR_MASS_FAB = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_mass_fab.png"); + public static final UITexture PROGRESS_BAR_MIXER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_mixer.png"); + public static final UITexture PROGRESS_BAR_PACKER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_packer.png"); + public static final UITexture PROGRESS_BAR_RECYCLER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_recycler.png"); + public static final UITexture PROGRESS_BAR_REPLICATOR = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_replicator.png"); + public static final UITexture PROGRESS_BAR_SIFT = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_sift.png"); + public static final UITexture PROGRESS_BAR_SLICE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_slice.png"); + //public static final SteamTexture PROGRESS_BAR_SOLAR_STEAM = SteamTexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_solar_%s.png"); + public static final UITexture PROGRESS_BAR_UNLOCK = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_unlock.png"); + public static final UITexture PROGRESS_BAR_UNPACKER = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_unpacker.png"); + public static final UITexture PROGRESS_BAR_WIREMILL = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_wiremill.png"); + public static final UITexture PROGRESS_BAR_RESEARCH_STATION_1 = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_research_station_1.png"); + public static final UITexture PROGRESS_BAR_RESEARCH_STATION_2 = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_research_station_2.png"); + public static final UITexture PROGRESS_BAR_RESEARCH_STATION_BASE = UITexture.fullImage(GTValues.MODID, "textures/gui/progress_bar/progress_bar_research_station_base.png"); //JEI - public static final UITexture INFO_ICON = UITexture.fullImage("textures/gui/widget/information.png"); - public static final UITexture MULTIBLOCK_CATEGORY = UITexture.fullImage("textures/gui/icon/multiblock_category.png"); - public static final UITexture ARC_FURNACE_RECYLCING_CATEGORY = UITexture.fullImage("textures/gui/icon/arc_furnace_recycling.png"); - public static final UITexture MACERATOR_RECYLCING_CATEGORY = UITexture.fullImage("textures/gui/icon/macerator_recycling.png"); - public static final UITexture EXTRACTOR_RECYLCING_CATEGORY = UITexture.fullImage("textures/gui/icon/extractor_recycling.png"); + public static final UITexture INFO_ICON = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/information.png"); + public static final UITexture MULTIBLOCK_CATEGORY = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/multiblock_category.png"); + public static final UITexture ARC_FURNACE_RECYLCING_CATEGORY = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/arc_furnace_recycling.png"); + public static final UITexture MACERATOR_RECYLCING_CATEGORY = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/macerator_recycling.png"); + public static final UITexture EXTRACTOR_RECYLCING_CATEGORY = UITexture.fullImage(GTValues.MODID, "textures/gui/icon/extractor_recycling.png"); // Covers - public static final UITexture COVER_MACHINE_CONTROLLER = UITexture.fullImage("textures/items/metaitems/cover.controller.png"); + public static final UITexture COVER_MACHINE_CONTROLLER = UITexture.fullImage(GTValues.MODID, "textures/items/metaitems/cover.controller.png"); // Ore Filter - public static final UITexture ORE_FILTER_INFO = UITexture.fullImage("textures/gui/widget/ore_filter/info.png"); - public static final UITexture ORE_FILTER_SUCCESS = UITexture.fullImage("textures/gui/widget/ore_filter/success.png"); - public static final UITexture ORE_FILTER_ERROR = UITexture.fullImage("textures/gui/widget/ore_filter/error.png"); - public static final UITexture ORE_FILTER_WARN = UITexture.fullImage("textures/gui/widget/ore_filter/warn.png"); - public static final UITexture ORE_FILTER_WAITING = UITexture.fullImage("textures/gui/widget/ore_filter/waiting.png"); + public static final UITexture ORE_FILTER_INFO = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/info.png"); + public static final UITexture ORE_FILTER_SUCCESS = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/success.png"); + public static final UITexture ORE_FILTER_ERROR = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/error.png"); + public static final UITexture ORE_FILTER_WARN = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/warn.png"); + public static final UITexture ORE_FILTER_WAITING = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/waiting.png"); - public static final UITexture ORE_FILTER_MATCH = UITexture.fullImage("textures/gui/widget/ore_filter/match.png"); - public static final UITexture ORE_FILTER_NO_MATCH = UITexture.fullImage("textures/gui/widget/ore_filter/no_match.png"); + public static final UITexture ORE_FILTER_MATCH = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/match.png"); + public static final UITexture ORE_FILTER_NO_MATCH = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/ore_filter/no_match.png"); //Terminal - public static final UITexture ICON_REMOVE = UITexture.fullImage("textures/gui/terminal/icon/remove_hover.png"); - public static final UITexture ICON_UP = UITexture.fullImage("textures/gui/terminal/icon/up_hover.png"); - public static final UITexture ICON_DOWN = UITexture.fullImage("textures/gui/terminal/icon/down_hover.png"); - public static final UITexture ICON_RIGHT = UITexture.fullImage("textures/gui/terminal/icon/right_hover.png"); - public static final UITexture ICON_LEFT = UITexture.fullImage("textures/gui/terminal/icon/left_hover.png"); - public static final UITexture ICON_ADD = UITexture.fullImage("textures/gui/terminal/icon/add_hover.png"); + public static final UITexture ICON_REMOVE = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/remove_hover.png"); + public static final UITexture ICON_UP = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/up_hover.png"); + public static final UITexture ICON_DOWN = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/down_hover.png"); + public static final UITexture ICON_RIGHT = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/right_hover.png"); + public static final UITexture ICON_LEFT = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/left_hover.png"); + public static final UITexture ICON_ADD = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/add_hover.png"); - public final static UITexture ICON_NEW_PAGE = UITexture.fullImage("textures/gui/terminal/icon/system/memory_card_hover.png"); - public final static UITexture ICON_LOAD = UITexture.fullImage("textures/gui/terminal/icon/folder_hover.png"); - public final static UITexture ICON_SAVE = UITexture.fullImage("textures/gui/terminal/icon/system/save_hover.png"); - public final static UITexture ICON_LOCATION = UITexture.fullImage("textures/gui/terminal/icon/guide_hover.png"); - public final static UITexture ICON_VISIBLE = UITexture.fullImage("textures/gui/terminal/icon/appearance_hover.png"); - public final static UITexture ICON_CALCULATOR = UITexture.fullImage("textures/gui/terminal/icon/calculator_hover.png"); - public final static UITexture UI_FRAME_SIDE_UP = UITexture.fullImage("textures/gui/terminal/frame_side_up.png"); - public final static UITexture UI_FRAME_SIDE_DOWN = UITexture.fullImage("textures/gui/terminal/frame_side_down.png"); + public final static UITexture ICON_NEW_PAGE = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/system/memory_card_hover.png"); + public final static UITexture ICON_LOAD = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/folder_hover.png"); + public final static UITexture ICON_SAVE = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/system/save_hover.png"); + public final static UITexture ICON_LOCATION = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/guide_hover.png"); + public final static UITexture ICON_VISIBLE = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/appearance_hover.png"); + public final static UITexture ICON_CALCULATOR = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/icon/calculator_hover.png"); + public final static UITexture UI_FRAME_SIDE_UP = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/frame_side_up.png"); + public final static UITexture UI_FRAME_SIDE_DOWN = UITexture.fullImage(GTValues.MODID, "textures/gui/terminal/frame_side_down.png"); // Texture Areas - public static final UITexture BUTTON_FLUID = UITexture.fullImage("textures/blocks/cover/cover_interface_fluid_button.png"); - public static final UITexture BUTTON_ITEM = UITexture.fullImage("textures/blocks/cover/cover_interface_item_button.png"); - public static final UITexture BUTTON_ENERGY = UITexture.fullImage("textures/blocks/cover/cover_interface_energy_button.png"); - public static final UITexture BUTTON_MACHINE = UITexture.fullImage("textures/blocks/cover/cover_interface_machine_button.png"); - public static final UITexture BUTTON_INTERFACE = UITexture.fullImage("textures/blocks/cover/cover_interface_computer_button.png"); - public static final UITexture COVER_INTERFACE_MACHINE_ON_PROXY = UITexture.fullImage("textures/blocks/cover/cover_interface_machine_on_proxy.png"); - public static final UITexture COVER_INTERFACE_MACHINE_OFF_PROXY = UITexture.fullImage("textures/blocks/cover/cover_interface_machine_off_proxy.png"); + public static final UITexture BUTTON_FLUID = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_fluid_button.png"); + public static final UITexture BUTTON_ITEM = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_item_button.png"); + public static final UITexture BUTTON_ENERGY = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_energy_button.png"); + public static final UITexture BUTTON_MACHINE = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_machine_button.png"); + public static final UITexture BUTTON_INTERFACE = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_computer_button.png"); + public static final UITexture COVER_INTERFACE_MACHINE_ON_PROXY = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_machine_on_proxy.png"); + public static final UITexture COVER_INTERFACE_MACHINE_OFF_PROXY = UITexture.fullImage(GTValues.MODID, "textures/blocks/cover/cover_interface_machine_off_proxy.png"); // Lamp item overlay - public static final UITexture LAMP_NO_BLOOM = UITexture.fullImage("textures/gui/item_overlay/lamp_no_bloom.png"); - public static final UITexture LAMP_NO_LIGHT = UITexture.fullImage("textures/gui/item_overlay/lamp_no_light.png"); + public static final UITexture LAMP_NO_BLOOM = UITexture.fullImage(GTValues.MODID, "textures/gui/item_overlay/lamp_no_bloom.png"); + public static final UITexture LAMP_NO_LIGHT = UITexture.fullImage(GTValues.MODID, "textures/gui/item_overlay/lamp_no_light.png"); // ME hatch/bus - public static final UITexture NUMBER_BACKGROUND = UITexture.fullImage("textures/gui/widget/number_background.png"); - public static final UITexture CONFIG_ARROW = UITexture.fullImage("textures/gui/widget/config_arrow.png"); - public static final UITexture CONFIG_ARROW_DARK = UITexture.fullImage("textures/gui/widget/config_arrow_dark.png"); - public static final UITexture SELECT_BOX = UITexture.fullImage("textures/gui/widget/select_box.png");*/ + public static final UITexture NUMBER_BACKGROUND = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/number_background.png"); + public static final UITexture CONFIG_ARROW = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/config_arrow.png"); + public static final UITexture CONFIG_ARROW_DARK = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/config_arrow_dark.png"); + public static final UITexture SELECT_BOX = UITexture.fullImage(GTValues.MODID, "textures/gui/widget/select_box.png"); + static { + registerBackground("cover_button", COVER_BUTTON); + registerBackground("cover_button_hover", COVER_BUTTON_HOVER); + registerBackground("cover_button_disabled", COVER_DISABLED); + } } diff --git a/src/main/java/gregtech/common/covers/CoverConveyor.java b/src/main/java/gregtech/common/covers/CoverConveyor.java index c80dbce034f..3f0d99bbbc0 100644 --- a/src/main/java/gregtech/common/covers/CoverConveyor.java +++ b/src/main/java/gregtech/common/covers/CoverConveyor.java @@ -5,6 +5,21 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.drawable.ItemDrawable; +import com.cleanroommc.modularui.manager.GuiCreationContext; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.utils.Alignment; +import com.cleanroommc.modularui.value.BoolValue; +import com.cleanroommc.modularui.value.sync.EnumSyncValue; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.value.sync.IntSyncValue; +import com.cleanroommc.modularui.widget.ParentWidget; +import com.cleanroommc.modularui.widgets.ToggleButton; +import com.cleanroommc.modularui.widgets.layout.Column; +import com.cleanroommc.modularui.widgets.layout.Row; +import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; import gregtech.api.GTValues; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; @@ -16,21 +31,21 @@ import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.newgui.GTGuis; import gregtech.api.util.GTTransferUtils; import gregtech.api.util.ItemStackHashStrategy; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; -import gregtech.common.covers.filter.ItemFilterContainer; +import gregtech.common.covers.filter.item.ItemFilter; +import gregtech.common.covers.filter.item.ItemFilterHolder; import gregtech.common.pipelike.itempipe.tile.TileEntityItemPipe; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; @@ -42,11 +57,11 @@ import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; import java.util.Collections; import java.util.Map; -import java.util.Set; public class CoverConveyor extends CoverBehavior implements CoverWithUI, ITickable, IControllable { @@ -56,7 +71,7 @@ public class CoverConveyor extends CoverBehavior implements CoverWithUI, ITickab protected ConveyorMode conveyorMode; protected DistributionMode distributionMode; protected ManualImportExportMode manualImportExportMode = ManualImportExportMode.DISABLED; - protected final ItemFilterContainer itemFilterContainer; + protected final ItemFilterHolder filterHolder; protected int itemsLeftToTransferLastSecond; private CoverableItemHandlerWrapper itemHandlerWrapper; protected boolean isWorkingAllowed = true; @@ -69,7 +84,7 @@ public CoverConveyor(ICoverable coverable, EnumFacing attachedSide, int tier, in this.itemsLeftToTransferLastSecond = transferRate; this.conveyorMode = ConveyorMode.EXPORT; this.distributionMode = DistributionMode.INSERT_FIRST; - this.itemFilterContainer = new ItemFilterContainer(this); + this.filterHolder = new ItemFilterHolder(this); } public void setTransferRate(int transferRate) { @@ -126,8 +141,13 @@ protected void setManualImportExportMode(ManualImportExportMode manualImportExpo coverHolder.markDirty(); } - public ItemFilterContainer getItemFilterContainer() { - return itemFilterContainer; + public ItemFilterHolder getFilterHolder() { + return filterHolder; + } + + @Nullable + public ItemFilter getItemFilter() { + return filterHolder.getCurrentFilter(); } @Override @@ -259,7 +279,7 @@ protected int moveInventoryItems(IItemHandler sourceInventory, IItemHandler targ if (itemStack.isEmpty()) { continue; } - Object matchSlotIndex = itemFilterContainer.matchItemStack(itemStack); + Object matchSlotIndex = filterHolder.matchItemStack(itemStack); if (matchSlotIndex == null || !itemInfos.containsKey(matchSlotIndex)) { continue; } @@ -302,7 +322,7 @@ protected int moveInventoryItems(IItemHandler sourceInventory, IItemHandler targ if (sourceStack.isEmpty()) { continue; } - if (!itemFilterContainer.testItemStack(sourceStack)) { + if (!filterHolder.test(sourceStack)) { continue; } ItemStack remainder = GTTransferUtils.insertItem(targetInventory, sourceStack, true); @@ -324,6 +344,7 @@ protected int moveInventoryItems(IItemHandler sourceInventory, IItemHandler targ } protected static class TypeItemInfo { + public final ItemStack itemStack; public final Object filterSlot; public final IntList slots; @@ -338,13 +359,12 @@ public TypeItemInfo(ItemStack itemStack, Object filterSlot, IntList slots, int t } protected static class GroupItemInfo { + public final Object filterSlot; - public final Set itemStackTypes; public int totalCount; - public GroupItemInfo(Object filterSlot, Set itemStackTypes, int totalCount) { + public GroupItemInfo(Object filterSlot, int totalCount) { this.filterSlot = filterSlot; - this.itemStackTypes = itemStackTypes; this.totalCount = totalCount; } } @@ -357,20 +377,13 @@ protected Map countInventoryItemsByType(@Nonnull IItemH if (itemStack.isEmpty()) { continue; } - Object transferSlotIndex = itemFilterContainer.matchItemStack(itemStack); + Object transferSlotIndex = filterHolder.matchItemStack(itemStack); if (transferSlotIndex == null) { continue; } - if (!result.containsKey(itemStack)) { - TypeItemInfo itemInfo = new TypeItemInfo(itemStack.copy(), transferSlotIndex, new IntArrayList(), 0); - itemInfo.totalCount += itemStack.getCount(); - itemInfo.slots.add(srcIndex); - result.put(itemStack.copy(), itemInfo); - } else { - TypeItemInfo itemInfo = result.get(itemStack); - itemInfo.totalCount += itemStack.getCount(); - itemInfo.slots.add(srcIndex); - } + TypeItemInfo itemInfo = result.computeIfAbsent(itemStack, key -> new TypeItemInfo(itemStack.copy(), transferSlotIndex, new IntArrayList(), 0)); + itemInfo.slots.add(srcIndex); + itemInfo.totalCount += itemStack.getCount(); } return result; } @@ -383,20 +396,12 @@ protected Map countInventoryItemsByMatchSlot(@Nonnull IIt if (itemStack.isEmpty()) { continue; } - Object transferSlotIndex = itemFilterContainer.matchItemStack(itemStack); + Object transferSlotIndex = filterHolder.matchItemStack(itemStack); if (transferSlotIndex == null) { continue; } - if (!result.containsKey(transferSlotIndex)) { - GroupItemInfo itemInfo = new GroupItemInfo(transferSlotIndex, new ObjectOpenCustomHashSet<>(ItemStackHashStrategy.comparingAllButCount()), 0); - itemInfo.itemStackTypes.add(itemStack.copy()); - itemInfo.totalCount += itemStack.getCount(); - result.put(transferSlotIndex, itemInfo); - } else { - GroupItemInfo itemInfo = result.get(transferSlotIndex); - itemInfo.itemStackTypes.add(itemStack.copy()); - itemInfo.totalCount += itemStack.getCount(); - } + GroupItemInfo itemInfo = result.computeIfAbsent(transferSlotIndex, key -> new GroupItemInfo(transferSlotIndex, 0)); + itemInfo.totalCount += itemStack.getCount(); } return result; } @@ -414,7 +419,7 @@ public boolean shouldCoverInteractWithOutputside() { @Override public void onRemoved() { NonNullList drops = NonNullList.create(); - MetaTileEntity.clearInventory(drops, itemFilterContainer.getFilterInventory()); + MetaTileEntity.clearInventory(drops, filterHolder.getFilterInventory()); for (ItemStack itemStack : drops) { Block.spawnAsEntity(coverHolder.getWorld(), coverHolder.getPos(), itemStack); } @@ -432,7 +437,8 @@ public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexO @Override public EnumActionResult onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, CuboidRayTraceResult hitResult) { if (!coverHolder.getWorld().isRemote) { - openUI((EntityPlayerMP) playerIn); + //openUI((EntityPlayerMP) playerIn); + GTGuis.openCoverUi(this, playerIn); } return EnumActionResult.SUCCESS; } @@ -500,7 +506,7 @@ public ModularUI createUI(EntityPlayer player) { primaryGroup.addWidget(distributionModeButton); } - this.itemFilterContainer.initUI(70, primaryGroup::addWidget); + //this.itemFilterContainer.initUI(70, primaryGroup::addWidget); ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 176, 190 + 82) .widget(primaryGroup) @@ -508,6 +514,149 @@ public ModularUI createUI(EntityPlayer player) { return buildUI(builder, player); } + public IWidget getTitleWidget() { + ItemStack item = getCoverDefinition().getDropItemStack(); + return new Row().height(16).coverChildrenWidth() + .child(new ItemDrawable(item).asWidget().size(16).marginRight(4)) + .child(IKey.str(item.getDisplayName()).asWidget().heightRel(1f)) + .pos(4, 4); + } + + public ParentWidget settingsRow() { + return new ParentWidget<>().height(16).widthRel(1f).marginBottom(2); + } + + private > BoolValue.Dynamic boolValueOf(EnumSyncValue syncValue, T value) { + return new BoolValue.Dynamic(() -> syncValue.getValue() == value, val -> syncValue.setValue(value)); + } + + @Override + public ModularPanel buildUI(GuiCreationContext creationContext, GuiSyncManager syncManager, boolean isClient) { + EnumSyncValue ioModeValue = new EnumSyncValue<>(ConveyorMode.class, this::getConveyorMode, this::setConveyorMode); + EnumSyncValue manualIoModeValue = new EnumSyncValue<>(ManualImportExportMode.class, this::getManualImportExportMode, this::setManualImportExportMode); + EnumSyncValue distributionModeValue = new EnumSyncValue<>(DistributionMode.class, this::getDistributionMode, this::setDistributionMode); + syncManager.syncValue("io_mode", ioModeValue); + syncManager.syncValue("manual_io_mode", manualIoModeValue); + syncManager.syncValue("distribution_mode", distributionModeValue); + + boolean hasPipeNeighbor = hasItemPipeNeighbour(); + + ModularPanel panel = GTGuis.createPanel("conveyor", 176, hasPipeNeighbor ? 202 : 184); + panel.child(getTitleWidget()) + .bindPlayerInventory() + .child(new Column() + .widthRel(1f).margin(7, 0) + .top(22).coverChildrenHeight() + .child(settingsRow() + .child(new ToggleButton().size(16).left(0) + .overlay(gregtech.api.newgui.GuiTextures.EXPORT) + .value(boolValueOf(ioModeValue, ConveyorMode.EXPORT))) + .child(new ToggleButton().size(16).left(18) + .overlay(gregtech.api.newgui.GuiTextures.IMPORT) + .value(boolValueOf(ioModeValue, ConveyorMode.IMPORT))) + .child(IKey.lang("cover.conveyor.mode.import_export").asWidget().height(16).left(60))) + .child(settingsRow() + .child(new ToggleButton().size(16).left(0) + .addTooltipLine(IKey.lang(ManualImportExportMode.DISABLED.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.CROSS) + .value(boolValueOf(manualIoModeValue, ManualImportExportMode.DISABLED))) + .child(new ToggleButton().size(16).left(18) + .addTooltipLine(IKey.lang(ManualImportExportMode.FILTERED.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.FILTERED) + .value(boolValueOf(manualIoModeValue, ManualImportExportMode.FILTERED))) + .child(new ToggleButton().size(16).left(36) + .addTooltipLine(IKey.lang(ManualImportExportMode.UNFILTERED.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.UNFILTERED) + .value(boolValueOf(manualIoModeValue, ManualImportExportMode.UNFILTERED))) + .child(IKey.lang("cover.universal.manual_import_export.mode").asWidget().height(16).left(60))) + .childIf(hasPipeNeighbor, settingsRow() + .child(new ToggleButton().size(16).left(0) + .addTooltipLine(IKey.lang(DistributionMode.INSERT_FIRST.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.FIRST_INSERT) + .value(boolValueOf(distributionModeValue, DistributionMode.INSERT_FIRST))) + .child(new ToggleButton().size(16).left(18) + .addTooltipLine(IKey.lang(DistributionMode.ROUND_ROBIN_PRIO.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.ROUND_ROBIN) + .value(boolValueOf(distributionModeValue, DistributionMode.ROUND_ROBIN_PRIO))) + .child(new ToggleButton().size(16).left(36) + .addTooltipLine(IKey.lang(DistributionMode.ROUND_ROBIN_GLOBAL.localeDescription)) + .overlay(gregtech.api.newgui.GuiTextures.ROUND_ROBIN_GLOBAL) + .value(boolValueOf(distributionModeValue, DistributionMode.ROUND_ROBIN_GLOBAL))) + .child(IKey.lang("cover.conveyor.distribution_mode").asWidget().height(16).left(60))) + .child(settingsRow().height(12) + .child(new TextFieldWidget() + .value(new IntSyncValue(() -> transferRate, this::setTransferRate)) + .setNumbers(1, maxItemTransferRate) + .setTextAlignment(Alignment.Center) + .size(52, 12)) + .child(IKey.lang("cover.conveyor.transfer_rate").asWidget().height(12).left(60))) + .child(this.filterHolder.createFilterUI(panel, creationContext, syncManager) + .flexBuilder(flex -> flex.widthRel(1f).marginBottom(2)))); + /*panel.child(IKey.format(getUITitle(), GTValues.VN[tier]).asWidget().pos(6, 6)) + .bindPlayerInventory() + .child(new Column() + .child(IKey.lang("cover.transfer_rate").asWidget() + .size(80, 12)) + .child(IKey.lang("cover.mode").asWidget() + .size(80, 12)) + .child(IKey.lang("cover.mode.manual_io").asWidget() + .size(80, 12)) + .child(IKey.lang("cover.conveyor.distribution_mode").asWidget() + .size(80, 12)) + .pos(7, 18) + .size(80, 48)) + .child(new Column() + .child(new Row() + .coverChildren() + .child(new ButtonWidget<>() + .syncHandler(new InteractionSyncHandler() + .setOnMousePressed(GuiFunctions.getIncrementer(-1, -8, -64, -512, this::adjustTransferRate))) + .addTooltipLine(IKey.format("modularui.decrement.tooltip", 1, 8, 64, 512)) + .overlay(IKey.lang("-").color(0xFFFFFF)) + .size(12, 12)) + .child(new TextFieldWidget() + .value(new IntSyncValue(() -> transferRate, this::setTransferRate)) + .setNumbers(1, maxItemTransferRate) + .setTextAlignment(Alignment.Center) + .size(56, 12)) + .child(new ButtonWidget<>() + .syncHandler(new InteractionSyncHandler() + .setOnMousePressed(GuiFunctions.getIncrementer(1, 8, 64, 512, this::adjustTransferRate))) + .addTooltipLine(IKey.format("modularui.increment.tooltip", 1, 8, 64, 512)) + .overlay(IKey.lang("+").color(0xFFFFFF)) + .size(12, 12))) + .child(new com.cleanroommc.modularui.widgets.CycleButtonWidget() + .value(new EnumSyncValue<>(ConveyorMode.class, this::getConveyorMode, this::setConveyorMode)) + .textureGetter(GuiFunctions.enumStringTextureGetter(ConveyorMode.class)) + .size(80, 12)) + .child(new com.cleanroommc.modularui.widgets.CycleButtonWidget() + .value(new EnumSyncValue<>(ManualImportExportMode.class, this::getManualImportExportMode, this::setManualImportExportMode)) + .textureGetter(GuiFunctions.enumStringTextureGetter(ManualImportExportMode.class)) + .addTooltip(0, IKey.lang(ManualImportExportMode.values()[0].localeDescription)) + .addTooltip(1, IKey.lang(ManualImportExportMode.values()[1].localeDescription)) + .addTooltip(2, IKey.lang(ManualImportExportMode.values()[2].localeDescription)) + .size(80, 12)) + .child(new com.cleanroommc.modularui.widgets.CycleButtonWidget() + .value(new EnumSyncValue<>(DistributionMode.class, this::getDistributionMode, this::setDistributionMode)) + .textureGetter(GuiFunctions.enumStringTextureGetter(DistributionMode.class)) + .addTooltip(0, IKey.lang(DistributionMode.values()[0].localeDescription)) + .addTooltip(1, IKey.lang(DistributionMode.values()[1].localeDescription)) + .addTooltip(2, IKey.lang(DistributionMode.values()[2].localeDescription)) + .setEnabledIf(widget -> hasItemPipeNeighbour()) + .size(80, 12)) + .pos(89, 18) + .size(80, 48));*/ + //IWidget filterUI = this.filterHolder.createFilterUI(panel, creationContext, syncManager); + //filterUI.flex().pos(7, 66); + //panel.child(filterUI); + return panel; + } + + private boolean hasItemPipeNeighbour() { + return coverHolder.getWorld().getTileEntity(coverHolder.getPos()) instanceof TileEntityItemPipe || + coverHolder.getWorld().getTileEntity(coverHolder.getPos().offset(attachedSide)) instanceof TileEntityItemPipe; + } + @Override public boolean isWorkingEnabled() { return isWorkingAllowed; @@ -549,7 +698,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { tagCompound.setInteger("DistributionMode", distributionMode.ordinal()); tagCompound.setBoolean("WorkingAllowed", isWorkingAllowed); tagCompound.setInteger("ManualImportExportMode", manualImportExportMode.ordinal()); - tagCompound.setTag("Filter", this.itemFilterContainer.serializeNBT()); + tagCompound.setTag("Filter", this.filterHolder.serializeNBT()); return tagCompound; } @@ -562,7 +711,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { this.distributionMode = DistributionMode.values()[tagCompound.getInteger("DistributionMode")]; this.isWorkingAllowed = tagCompound.getBoolean("WorkingAllowed"); this.manualImportExportMode = ManualImportExportMode.values()[tagCompound.getInteger("ManualImportExportMode")]; - this.itemFilterContainer.deserializeNBT(tagCompound.getCompoundTag("Filter")); + this.filterHolder.deserializeNBT(tagCompound.getCompoundTag("Filter")); } @Override @@ -605,7 +754,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate if (conveyorMode == ConveyorMode.EXPORT && manualImportExportMode == ManualImportExportMode.DISABLED) { return stack; } - if (manualImportExportMode == ManualImportExportMode.FILTERED && !itemFilterContainer.testItemStack(stack)) { + if (manualImportExportMode == ManualImportExportMode.FILTERED && !filterHolder.test(stack)) { return stack; } return super.insertItem(slot, stack, simulate); @@ -619,7 +768,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { } if (manualImportExportMode == ManualImportExportMode.FILTERED) { ItemStack result = super.extractItem(slot, amount, true); - if (result.isEmpty() || !itemFilterContainer.testItemStack(result)) { + if (result.isEmpty() || !filterHolder.test(result)) { return ItemStack.EMPTY; } return simulate ? result : super.extractItem(slot, amount, false); diff --git a/src/main/java/gregtech/common/covers/CoverFluidRegulator.java b/src/main/java/gregtech/common/covers/CoverFluidRegulator.java index 91e69f2824c..f18f9f0ec65 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidRegulator.java +++ b/src/main/java/gregtech/common/covers/CoverFluidRegulator.java @@ -9,8 +9,9 @@ import gregtech.api.util.TextFormattingUtil; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; -import gregtech.common.covers.filter.FluidFilter; import gregtech.common.covers.filter.FluidFilterContainer; +import gregtech.common.covers.filter.fluid.FluidFilter; +import gregtech.common.covers.filter.fluid.FluidFilterHolder; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; @@ -27,6 +28,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.apache.logging.log4j.message.FormattedMessage; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -43,7 +45,11 @@ public class CoverFluidRegulator extends CoverPump { public CoverFluidRegulator(ICoverable coverHolder, EnumFacing attachedSide, int tier, int mbPerTick) { super(coverHolder, attachedSide, tier, mbPerTick); this.transferMode = TransferMode.TRANSFER_ANY; - this.fluidFilter = new FluidFilterContainer(this, this::shouldShowTip, maxFluidTransferRate * 100); + } + + @Override + protected @NotNull FluidFilterHolder createFilterHolder() { + return new FluidFilterHolder(this, this::shouldShowTip, this.maxFluidTransferRate * 100); } @Override @@ -71,11 +77,11 @@ protected int doTransferFluidsInternal(IFluidHandler myFluidHandler, IFluidHandl } switch (transferMode) { case TRANSFER_ANY: - return GTTransferUtils.transferFluids(sourceHandler, destHandler, transferLimit, fluidFilter::testFluidStack); + return GTTransferUtils.transferFluids(sourceHandler, destHandler, transferLimit, this::checkInputFluid); case KEEP_EXACT: - return doKeepExact(transferLimit, sourceHandler, destHandler, fluidFilter::testFluidStack, this.transferAmount); + return doKeepExact(transferLimit, sourceHandler, destHandler, this::checkInputFluid, this.transferAmount); case TRANSFER_EXACT: - return doTransferExact(transferLimit, sourceHandler, destHandler, fluidFilter::testFluidStack, this.transferAmount); + return doTransferExact(transferLimit, sourceHandler, destHandler, this::checkInputFluid, this.transferAmount); } return 0; } @@ -84,8 +90,8 @@ protected int doTransferExact(int transferLimit, IFluidHandler sourceHandler, IF int fluidLeftToTransfer = transferLimit; for (IFluidTankProperties tankProperties : sourceHandler.getTankProperties()) { FluidStack sourceFluid = tankProperties.getContents(); - if (this.fluidFilter.getFilterWrapper().getFluidFilter() != null && transferMode != TransferMode.TRANSFER_ANY) { - supplyAmount = this.fluidFilter.getFilterWrapper().getFluidFilter().getFluidTransferLimit(sourceFluid); + if (this.filterHolder.getCurrentFilter() != null && transferMode != TransferMode.TRANSFER_ANY) { + supplyAmount = this.filterHolder.getCurrentFilter().getFluidTransferLimit(sourceFluid); } if (fluidLeftToTransfer < supplyAmount) break; @@ -128,8 +134,8 @@ protected int doKeepExact(final int transferLimit, if (transferred >= transferLimit) break; - if (this.fluidFilter.getFilterWrapper().getFluidFilter() != null && transferMode != TransferMode.TRANSFER_ANY) { - keepAmount = this.fluidFilter.getFilterWrapper().getFluidFilter().getFluidTransferLimit(fluidStack); + if (this.filterHolder.getCurrentFilter() != null && transferMode != TransferMode.TRANSFER_ANY) { + keepAmount = this.filterHolder.getCurrentFilter().getFluidTransferLimit(fluidStack); } // if fluid needs to be moved to meet the Keep Exact value @@ -238,7 +244,7 @@ public TransferMode getTransferMode() { } private boolean shouldDisplayAmountSlider() { - if (this.fluidFilter.getFilterWrapper().getFluidFilter() != null) { + if (this.filterHolder.hasFilter()) { return false; } return this.transferMode == TransferMode.TRANSFER_EXACT || this.transferMode == TransferMode.KEEP_EXACT; @@ -350,7 +356,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { this.transferMode = TransferMode.values()[tagCompound.getInteger("TransferMode")]; //legacy NBT tag if (!tagCompound.hasKey("filterv2") && tagCompound.hasKey("TransferAmount")) { - FluidFilter filter = getFluidFilterContainer().getFilterWrapper().getFluidFilter(); + FluidFilter filter = this.filterHolder.getCurrentFilter(); if (filter != null) { filter.configureFilterTanks(tagCompound.getInteger("TransferAmount")); } diff --git a/src/main/java/gregtech/common/covers/CoverFluidVoiding.java b/src/main/java/gregtech/common/covers/CoverFluidVoiding.java index 140d10e01ec..942a031822b 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidVoiding.java +++ b/src/main/java/gregtech/common/covers/CoverFluidVoiding.java @@ -11,11 +11,10 @@ import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.CycleButtonWidget; import gregtech.api.gui.widgets.LabelWidget; -import gregtech.api.gui.widgets.ToggleButtonWidget; import gregtech.api.gui.widgets.WidgetGroup; import gregtech.api.util.GTTransferUtils; import gregtech.client.renderer.texture.Textures; -import gregtech.common.covers.filter.FluidFilterContainer; +import gregtech.common.covers.filter.fluid.FluidFilterHolder; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumActionResult; @@ -27,6 +26,7 @@ import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler; +import org.jetbrains.annotations.NotNull; public class CoverFluidVoiding extends CoverPump { @@ -35,7 +35,11 @@ public class CoverFluidVoiding extends CoverPump { public CoverFluidVoiding(ICoverable coverHolder, EnumFacing attachedSide) { super(coverHolder, attachedSide, 0, Integer.MAX_VALUE); this.isWorkingAllowed = false; - this.fluidFilter = new FluidFilterContainer(this, this::shouldShowTip, Integer.MAX_VALUE); + } + + @Override + protected @NotNull FluidFilterHolder createFilterHolder() { + return new FluidFilterHolder(this, this::shouldShowTip, Integer.MAX_VALUE); } @Override @@ -51,7 +55,7 @@ protected void doTransferFluids() { if (myFluidHandler == null) { return; } - GTTransferUtils.transferFluids(myFluidHandler, nullFluidTank, Integer.MAX_VALUE, fluidFilter::testFluidStack); + GTTransferUtils.transferFluids(myFluidHandler, nullFluidTank, Integer.MAX_VALUE, this::checkInputFluid); } @Override @@ -64,7 +68,7 @@ public ModularUI createUI(EntityPlayer player) { WidgetGroup primaryGroup = new WidgetGroup(); primaryGroup.addWidget(new LabelWidget(10, 5, getUITitle())); - this.fluidFilter.initUI(20, primaryGroup::addWidget); + //this.fluidFilter.initUI(20, primaryGroup::addWidget); primaryGroup.addWidget(new CycleButtonWidget(10, 92, 80, 18, this::isWorkingEnabled, this::setWorkingEnabled, "cover.voiding.label.disabled", "cover.voiding.label.enabled") @@ -106,7 +110,7 @@ public T getCapability(Capability capability, T defaultValue) { return defaultValue; } - class NullFluidTank extends FluidTank { + protected class NullFluidTank extends FluidTank { public NullFluidTank() { super(Integer.MAX_VALUE); @@ -114,7 +118,7 @@ public NullFluidTank() { @Override public int fill(FluidStack resource, boolean doFill) { - if (fluidFilter.testFluidStack(resource)) { + if (checkInputFluid(resource)) { return resource.amount; } return 0; diff --git a/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java b/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java index fae40359cd0..ba32a01b4a5 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java +++ b/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java @@ -1,6 +1,5 @@ package gregtech.common.covers; -import codechicken.lib.raytracer.CuboidRayTraceResult; import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; @@ -15,9 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -50,10 +47,10 @@ protected void doTransferFluids() { } switch (voidingMode) { case VOID_ANY: - GTTransferUtils.transferFluids(myFluidHandler, nullFluidTank, Integer.MAX_VALUE, fluidFilter::testFluidStack); + GTTransferUtils.transferFluids(myFluidHandler, nullFluidTank, Integer.MAX_VALUE, this::checkInputFluid); break; case VOID_OVERFLOW: - voidOverflow(myFluidHandler, fluidFilter::testFluidStack, this.transferAmount); + voidOverflow(myFluidHandler, this::checkInputFluid, this.transferAmount); } } @@ -72,10 +69,10 @@ protected void voidOverflow(final IFluidHandler sourceHandler, for (IFluidTankProperties tankProperties : sourceHandler.getTankProperties()) { FluidStack sourceFluid = tankProperties.getContents(); - if (this.fluidFilter.getFilterWrapper().getFluidFilter() != null && voidingMode == VoidingMode.VOID_OVERFLOW) { - keepAmount = this.fluidFilter.getFilterWrapper().getFluidFilter().getFluidTransferLimit(sourceFluid); + if (this.filterHolder.getCurrentFilter() != null && voidingMode == VoidingMode.VOID_OVERFLOW) { + keepAmount = this.filterHolder.getCurrentFilter().getFluidTransferLimit(sourceFluid); } - if (sourceFluid == null || sourceFluid.amount == 0 || !getFluidFilterContainer().testFluidStack(sourceFluid, true)) continue; + if (sourceFluid == null || sourceFluid.amount == 0 || !this.filterHolder.test(sourceFluid, true)) continue; sourceFluid.amount = sourceFluid.amount - keepAmount; sourceHandler.drain(sourceFluid, true); } @@ -116,7 +113,7 @@ public VoidingMode getVoidingMode() { } private boolean shouldDisplayAmountSlider() { - if (this.fluidFilter.getFilterWrapper().getFluidFilter() != null) { + if (this.filterHolder.hasFilter()) { return false; } @@ -157,9 +154,9 @@ public ModularUI createUI(EntityPlayer player) { return buildUI(builder, player); } - public void initFilterUI(int y, Consumer widgetGroup){ + public void initFilterUI(int y, Consumer widgetGroup) { widgetGroup.accept(new LabelWidget(10, y, "cover.pump.fluid_filter.title")); - widgetGroup.accept(new SlotWidget(fluidFilter.getFilterInventory(), 0, 10, y + 15) + widgetGroup.accept(new SlotWidget(this.filterHolder.getFilterInventory(), 0, 10, y + 15) .setBackgroundTexture(GuiTextures.SLOT, GuiTextures.FILTER_SLOT_OVERLAY)); ServerWidgetGroup stackSizeGroup = new ServerWidgetGroup(this::shouldDisplayAmountSlider); @@ -199,8 +196,8 @@ public void initFilterUI(int y, Consumer widgetGroup){ widgetGroup.accept(stackSizeGroup); - this.fluidFilter.getFilterWrapper().initUI(y + 15, widgetGroup); - this.fluidFilter.getFilterWrapper().blacklistUI(y + 15, widgetGroup, () -> voidingMode != VoidingMode.VOID_OVERFLOW); + //this.fluidFilter.getFilterWrapper().initUI(y + 15, widgetGroup); + //this.fluidFilter.getFilterWrapper().blacklistUI(y + 15, widgetGroup, () -> voidingMode != VoidingMode.VOID_OVERFLOW); } @Override diff --git a/src/main/java/gregtech/common/covers/CoverItemVoiding.java b/src/main/java/gregtech/common/covers/CoverItemVoiding.java index f8a0778ef22..d9c6a64af01 100644 --- a/src/main/java/gregtech/common/covers/CoverItemVoiding.java +++ b/src/main/java/gregtech/common/covers/CoverItemVoiding.java @@ -5,6 +5,11 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.manager.GuiCreationContext; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.cover.ICoverable; import gregtech.api.gui.GuiTextures; @@ -12,6 +17,7 @@ import gregtech.api.gui.widgets.CycleButtonWidget; import gregtech.api.gui.widgets.LabelWidget; import gregtech.api.gui.widgets.WidgetGroup; +import gregtech.api.newgui.GTGuis; import gregtech.client.renderer.texture.Textures; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -57,7 +63,7 @@ void voidAny(IItemHandler myItemHandler) { if (sourceStack.isEmpty()) { continue; } - if (!itemFilterContainer.testItemStack(sourceStack)) { + if (!this.filterHolder.test(sourceStack)) { continue; } myItemHandler.extractItem(srcIndex, Integer.MAX_VALUE, false); @@ -73,7 +79,7 @@ protected String getUITitle() { public ModularUI createUI(EntityPlayer player) { WidgetGroup primaryGroup = new WidgetGroup(); primaryGroup.addWidget(new LabelWidget(10, 5, getUITitle())); - this.itemFilterContainer.initUI(20, primaryGroup::addWidget); + //this.itemFilterContainer.initUI(20, primaryGroup::addWidget); primaryGroup.addWidget(new CycleButtonWidget(10, 92 + 23, 80, 18, this::isWorkingEnabled, this::setWorkingEnabled, "cover.voiding.label.disabled", "cover.voiding.label.enabled") @@ -89,6 +95,15 @@ public ModularUI createUI(EntityPlayer player) { return builder.build(this, player); } + @Override + public ModularPanel buildUI(GuiCreationContext creationContext, GuiSyncManager syncManager, boolean isClient) { + ModularPanel panel = GTGuis.createPanel("cover_item_voiding", 176, 126).bindPlayerInventory(); + panel.child(IKey.lang(getUITitle()).asWidget().pos(10, 5)); + IWidget filterUI = filterHolder.createFilterUI(panel, creationContext, syncManager); + filterUI.flex().pos(7, 20); + return panel.child(filterUI); + } + @Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { Textures.ITEM_VOIDING.renderSided(attachedSide, plateBox, renderState, pipeline, translation); @@ -130,7 +145,7 @@ public ItemStack getStackInSlot(int slot) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!itemFilterContainer.testItemStack(stack)) { + if (!filterHolder.test(stack)) { return stack; } return ItemStack.EMPTY; diff --git a/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java b/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java index 1877d15ebcf..cfd30a68ed5 100644 --- a/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java +++ b/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java @@ -4,11 +4,25 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.manager.GuiCreationContext; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.utils.Alignment; +import com.cleanroommc.modularui.value.sync.EnumSyncValue; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.value.sync.IntSyncValue; +import com.cleanroommc.modularui.widgets.ButtonWidget; +import com.cleanroommc.modularui.widgets.layout.Column; +import com.cleanroommc.modularui.widgets.layout.Row; +import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; import gregtech.api.cover.ICoverable; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.Widget; import gregtech.api.gui.widgets.*; +import gregtech.api.newgui.GTGuis; +import gregtech.api.newgui.GuiFunctions; import gregtech.client.renderer.texture.Textures; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -29,7 +43,7 @@ public class CoverItemVoidingAdvanced extends CoverItemVoiding { public CoverItemVoidingAdvanced(ICoverable coverHolder, EnumFacing attachedSide) { super(coverHolder, attachedSide); this.voidingMode = VoidingMode.VOID_ANY; - this.itemFilterContainer.setMaxStackSize(1); + this.filterHolder.setMaxStackSize(1); } @Override @@ -53,12 +67,12 @@ protected void voidOverflow(IItemHandler myItemHandler) { for (TypeItemInfo typeItemInfo : itemTypeCount.values()) { int itemToVoidAmount = 0; - if (getItemFilterContainer().getFilterWrapper().getItemFilter() == null) { - itemToVoidAmount = typeItemInfo.totalCount - itemFilterContainer.getTransferStackSize(); + if (getItemFilter() == null) { + itemToVoidAmount = typeItemInfo.totalCount - this.filterHolder.getTransferStackSize(); } else { - if (itemFilterContainer.testItemStack(typeItemInfo.itemStack)) { - Object matchedSlot = itemFilterContainer.matchItemStack(typeItemInfo.itemStack); - itemToVoidAmount = typeItemInfo.totalCount - itemFilterContainer.getSlotTransferLimit(matchedSlot); + if (this.filterHolder.test(typeItemInfo.itemStack)) { + Object matchedSlot = this.filterHolder.matchItemStack(typeItemInfo.itemStack); + itemToVoidAmount = typeItemInfo.totalCount - this.filterHolder.getSlotTransferLimit(matchedSlot); } } @@ -114,24 +128,24 @@ public ModularUI createUI(EntityPlayer player) { //Basically the item filter container GUI code, with different Y widget positioning public void initFilterUI(int y, Consumer widgetGroup) { widgetGroup.accept(new LabelWidget(10, y, "cover.conveyor.item_filter.title")); - widgetGroup.accept(new SlotWidget(itemFilterContainer.getFilterInventory(), 0, 10, y + 15) + widgetGroup.accept(new SlotWidget(this.filterHolder.getFilterInventory(), 0, 10, y + 15) .setBackgroundTexture(GuiTextures.SLOT, GuiTextures.FILTER_SLOT_OVERLAY)); - ServerWidgetGroup stackSizeGroup = new ServerWidgetGroup(() -> itemFilterContainer.getFilterWrapper().getItemFilter() == null && voidingMode == VoidingMode.VOID_OVERFLOW); + ServerWidgetGroup stackSizeGroup = new ServerWidgetGroup(() -> getItemFilter() == null && voidingMode == VoidingMode.VOID_OVERFLOW); stackSizeGroup.addWidget(new ImageWidget(111, 34, 35, 20, GuiTextures.DISPLAY)); - stackSizeGroup.addWidget(new IncrementButtonWidget(146, 34, 20, 20, 1, 8, 64, 512, itemFilterContainer::adjustTransferStackSize) + stackSizeGroup.addWidget(new IncrementButtonWidget(146, 34, 20, 20, 1, 8, 64, 512, this.filterHolder::adjustTransferStackSize) .setDefaultTooltip() .setTextScale(0.7f) .setShouldClientCallback(false)); - stackSizeGroup.addWidget(new IncrementButtonWidget(91, 34, 20, 20, -1, -8, -64, -512, itemFilterContainer::adjustTransferStackSize) + stackSizeGroup.addWidget(new IncrementButtonWidget(91, 34, 20, 20, -1, -8, -64, -512, this.filterHolder::adjustTransferStackSize) .setDefaultTooltip() .setTextScale(0.7f) .setShouldClientCallback(false)); - stackSizeGroup.addWidget(new TextFieldWidget2(113, 41, 31, 20, () -> String.valueOf(itemFilterContainer.getTransferStackSize()), val -> { + stackSizeGroup.addWidget(new TextFieldWidget2(113, 41, 31, 20, () -> String.valueOf(this.filterHolder.getTransferStackSize()), val -> { if (val != null && !val.isEmpty()) - itemFilterContainer.setTransferStackSize(MathHelper.clamp(Integer.parseInt(val), 1, voidingMode.maxStackSize)); + this.filterHolder.setTransferStackSize(MathHelper.clamp(Integer.parseInt(val), 1, voidingMode.maxStackSize)); }) .setCentered(true) .setNumbersOnly(1, Integer.MAX_VALUE) @@ -141,9 +155,52 @@ public void initFilterUI(int y, Consumer widgetGroup) { widgetGroup.accept(stackSizeGroup); - this.itemFilterContainer.getFilterWrapper().initUI(y + 38, widgetGroup); + //this.itemFilterContainer.getFilterWrapper().initUI(y + 38, widgetGroup); - this.itemFilterContainer.getFilterWrapper().blacklistUI(y + 38, widgetGroup, () -> voidingMode != VoidingMode.VOID_OVERFLOW); + //this.itemFilterContainer.getFilterWrapper().blacklistUI(y + 38, widgetGroup, () -> voidingMode != VoidingMode.VOID_OVERFLOW); + } + + @Override + public ModularPanel buildUI(GuiCreationContext creationContext, GuiSyncManager syncManager, boolean isClient) { + ModularPanel panel = GTGuis.createPanel("cover_item_voiding_advanced", 176, 149); + panel.bindPlayerInventory() + .child(IKey.lang(getUITitle()).asWidget().pos(10, 5)) + .child(new Column() + .child(IKey.lang("cover.voiding.voiding_mode.name").asWidget().size(80, 12)) + .child(IKey.lang("cover.voiding.voiding_amount.name").asWidget().size(80, 12)) + .pos(7, 18) + .size(80, 24)) + .child(new Column() + .child(new com.cleanroommc.modularui.widgets.CycleButtonWidget() + .value(new EnumSyncValue<>(VoidingMode.class, this::getVoidingMode, this::setVoidingMode)) + .textureGetter(GuiFunctions.enumStringTextureGetter(VoidingMode.class)) + .addTooltip(0, IKey.lang(VoidingMode.values()[0].localeDescription)) + .addTooltip(1, IKey.lang(VoidingMode.values()[1].localeDescription)) + .size(80, 12)) + .child(new Row() + .child(new ButtonWidget<>() + //TODO .setOnClick(GuiFunctions.getIncrementer(-1, -8, -64, -512, filterHolder::adjustTransferStackSize)) + .addTooltipLine(IKey.format("modularui.decrement.tooltip", 1, 8, 64, 512)) + .overlay(IKey.str("-").color(0xFFFFFF)) + .size(12, 12)) + .child(new TextFieldWidget() + .value(new IntSyncValue(this.filterHolder::getTransferStackSize, val -> filterHolder.setTransferStackSize(MathHelper.clamp(val, 1, voidingMode.maxStackSize)))) + .setNumbers(1, Integer.MAX_VALUE) + .setTextAlignment(Alignment.Center) + .setTextColor(0xFFFFFF) + .size(56, 12)) + .child(new ButtonWidget<>() + //TODO .setOnClick(GuiFunctions.getIncrementer(1, 8, 64, 512, filterHolder::adjustTransferStackSize)) + .addTooltipLine(IKey.format("modularui.increment.tooltip", 1, 8, 64, 512)) + .overlay(IKey.str("+").color(0xFFFFFF)) + .size(12, 12)) + //TODO .setTicker(this::checkShowLimitSlider) + .pos(7, 20)) + .pos(89, 18) + .size(80, 24)); + IWidget filterUI = this.filterHolder.createFilterUI(panel, creationContext, syncManager); + filterUI.flex().pos(7, 42); + return panel.child(filterUI); } @Override @@ -153,7 +210,7 @@ public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexO public void setVoidingMode(VoidingMode voidingMode) { this.voidingMode = voidingMode; - this.itemFilterContainer.setMaxStackSize(voidingMode.maxStackSize); + this.filterHolder.setMaxStackSize(voidingMode.maxStackSize); this.coverHolder.markDirty(); } diff --git a/src/main/java/gregtech/common/covers/CoverPump.java b/src/main/java/gregtech/common/covers/CoverPump.java index 6f9e783ed7f..750219bca41 100644 --- a/src/main/java/gregtech/common/covers/CoverPump.java +++ b/src/main/java/gregtech/common/covers/CoverPump.java @@ -5,6 +5,9 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.manager.GuiCreationContext; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; import com.google.common.math.IntMath; import gregtech.api.GTValues; import gregtech.api.capability.GregtechTileCapabilities; @@ -21,6 +24,7 @@ import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; import gregtech.common.covers.filter.FluidFilterContainer; +import gregtech.common.covers.filter.fluid.FluidFilterHolder; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; @@ -39,6 +43,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -56,7 +61,7 @@ public class CoverPump extends CoverBehavior implements CoverWithUI, ITickable, protected int fluidLeftToTransferLastSecond; private CoverableFluidHandlerWrapper fluidHandlerWrapper; protected boolean isWorkingAllowed = true; - protected FluidFilterContainer fluidFilter; + protected final FluidFilterHolder filterHolder; protected BucketMode bucketMode; public CoverPump(ICoverable coverHolder, EnumFacing attachedSide, int tier, int mbPerTick) { @@ -68,7 +73,12 @@ public CoverPump(ICoverable coverHolder, EnumFacing attachedSide, int tier, int this.pumpMode = PumpMode.EXPORT; this.distributionMode = DistributionMode.INSERT_FIRST; this.bucketMode = BucketMode.MILLI_BUCKET; - this.fluidFilter = new FluidFilterContainer(this, this::shouldShowTip); + this.filterHolder = createFilterHolder(); + } + + @NotNull + protected FluidFilterHolder createFilterHolder() { + return new FluidFilterHolder(this, this::shouldShowTip); } protected boolean shouldShowTip() { @@ -119,8 +129,8 @@ protected void setManualImportExportMode(ManualImportExportMode manualImportExpo coverHolder.markDirty(); } - public FluidFilterContainer getFluidFilterContainer() { - return fluidFilter; + public FluidFilterHolder getFilterHolder() { + return filterHolder; } @Override @@ -147,15 +157,15 @@ protected int doTransferFluids(int transferLimit) { protected int doTransferFluidsInternal(IFluidHandler myFluidHandler, IFluidHandler fluidHandler, int transferLimit) { if (pumpMode == PumpMode.IMPORT) { - return GTTransferUtils.transferFluids(fluidHandler, myFluidHandler, transferLimit, fluidFilter::testFluidStack); + return GTTransferUtils.transferFluids(fluidHandler, myFluidHandler, transferLimit, this::checkInputFluid); } else if (pumpMode == PumpMode.EXPORT) { - return GTTransferUtils.transferFluids(myFluidHandler, fluidHandler, transferLimit, fluidFilter::testFluidStack); + return GTTransferUtils.transferFluids(myFluidHandler, fluidHandler, transferLimit, this::checkInputFluid); } return 0; } protected boolean checkInputFluid(FluidStack fluidStack) { - return fluidFilter.testFluidStack(fluidStack); + return this.filterHolder.test(fluidStack); } protected ModularUI buildUI(ModularUI.Builder builder, EntityPlayer player) { @@ -209,7 +219,7 @@ public ModularUI createUI(EntityPlayer player) { ManualImportExportMode.class, this::getManualImportExportMode, this::setManualImportExportMode) .setTooltipHoverString("cover.universal.manual_import_export.mode.description")); - this.fluidFilter.initUI(88, primaryGroup::addWidget); + //this.fluidFilter.initUI(88, primaryGroup::addWidget); ModularUI.Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 176, 184 + 82) .widget(primaryGroup) @@ -217,6 +227,11 @@ public ModularUI createUI(EntityPlayer player) { return buildUI(builder, player); } + @Override + public ModularPanel buildUI(GuiCreationContext creationContext, GuiSyncManager syncManager, boolean isClient) { + return CoverWithUI.super.buildUI(creationContext, syncManager, isClient); + } + public static Function getTextFieldValidator(IntSupplier maxSupplier) { int min = 1; return val -> { @@ -282,7 +297,7 @@ public boolean shouldCoverInteractWithOutputside() { @Override public void onRemoved() { NonNullList drops = NonNullList.create(); - MetaTileEntity.clearInventory(drops, fluidFilter.getFilterInventory()); + MetaTileEntity.clearInventory(drops, this.filterHolder.getFilterInventory()); for (ItemStack itemStack : drops) { Block.spawnAsEntity(coverHolder.getWorld(), coverHolder.getPos(), itemStack); } @@ -333,7 +348,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { tagCompound.setInteger("DistributionMode", distributionMode.ordinal()); tagCompound.setBoolean("WorkingAllowed", isWorkingAllowed); tagCompound.setInteger("ManualImportExportMode", manualImportExportMode.ordinal()); - tagCompound.setTag("Filter", fluidFilter.serializeNBT()); + tagCompound.setTag("Filter", this.filterHolder.serializeNBT()); return tagCompound; } @@ -346,7 +361,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { this.distributionMode = DistributionMode.values()[tagCompound.getInteger("DistributionMode")]; this.isWorkingAllowed = tagCompound.getBoolean("WorkingAllowed"); this.manualImportExportMode = ManualImportExportMode.values()[tagCompound.getInteger("ManualImportExportMode")]; - this.fluidFilter.deserializeNBT(tagCompound.getCompoundTag("Filter")); + this.filterHolder.deserializeNBT(tagCompound.getCompoundTag("Filter")); } @Override diff --git a/src/main/java/gregtech/common/covers/CoverRoboticArm.java b/src/main/java/gregtech/common/covers/CoverRoboticArm.java index 7e41fb6cbf0..26c27286658 100644 --- a/src/main/java/gregtech/common/covers/CoverRoboticArm.java +++ b/src/main/java/gregtech/common/covers/CoverRoboticArm.java @@ -12,6 +12,7 @@ import gregtech.client.renderer.texture.Textures; import gregtech.common.covers.filter.SmartItemFilter; import gregtech.common.pipelike.itempipe.net.ItemNetHandler; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -31,7 +32,7 @@ public class CoverRoboticArm extends CoverConveyor { public CoverRoboticArm(ICoverable coverable, EnumFacing attachedSide, int tier, int itemsPerSecond) { super(coverable, attachedSide, tier, itemsPerSecond); this.transferMode = TransferMode.TRANSFER_ANY; - this.itemFilterContainer.setMaxStackSize(1); + this.filterHolder.setMaxStackSize(1); } @Override @@ -69,18 +70,18 @@ protected int doTransferExact(IItemHandler itemHandler, IItemHandler myItemHandl while (iterator.hasNext()) { TypeItemInfo sourceInfo = sourceItemAmount.get(iterator.next()); int itemAmount = sourceInfo.totalCount; - int itemToMoveAmount = itemFilterContainer.getSlotTransferLimit(sourceInfo.filterSlot); + int itemToMoveAmount = this.filterHolder.getSlotTransferLimit(sourceInfo.filterSlot); // if smart item filter - if (itemFilterContainer.getFilterWrapper().getItemFilter() instanceof SmartItemFilter) { - if (itemFilterContainer.getTransferStackSize() > 1 && itemToMoveAmount * 2 <= itemAmount) { + /*TODO if (getItemFilter() instanceof SmartItemFilter) { + if (this.filterHolder.getTransferStackSize() > 1 && itemToMoveAmount * 2 <= itemAmount) { // get the max we can extract from the item filter variable int maxMultiplier = Math.floorDiv(maxTransferAmount, itemToMoveAmount); // multiply up to the total count of all the items - itemToMoveAmount *= Math.min(itemFilterContainer.getTransferStackSize(), maxMultiplier); + itemToMoveAmount *= Math.min(this.filterHolder.getTransferStackSize(), maxMultiplier); } - } + }*/ if (itemAmount >= itemToMoveAmount) { sourceInfo.totalCount = itemToMoveAmount; @@ -118,18 +119,18 @@ protected int doKeepExact(IItemHandler itemHandler, IItemHandler myItemHandler, while (iterator.hasNext()) { Object filterSlotIndex = iterator.next(); GroupItemInfo sourceInfo = sourceItemAmounts.get(filterSlotIndex); - int itemToKeepAmount = itemFilterContainer.getSlotTransferLimit(sourceInfo.filterSlot); + int itemToKeepAmount = this.filterHolder.getSlotTransferLimit(sourceInfo.filterSlot); // only run multiplier for smart item - if (itemFilterContainer.getFilterWrapper().getItemFilter() instanceof SmartItemFilter) { - if (itemFilterContainer.getTransferStackSize() > 1 && itemToKeepAmount * 2 <= sourceInfo.totalCount) { + /*TODO if (getItemFilter() instanceof SmartItemFilter) { + if (this.filterHolder.getTransferStackSize() > 1 && itemToKeepAmount * 2 <= sourceInfo.totalCount) { // get the max we can keep from the item filter variable int maxMultiplier = Math.floorDiv(sourceInfo.totalCount, itemToKeepAmount); // multiply up to the total count of all the items - itemToKeepAmount *= Math.min(itemFilterContainer.getTransferStackSize(), maxMultiplier); + itemToKeepAmount *= Math.min(this.filterHolder.getTransferStackSize(), maxMultiplier); } - } + }*/ int itemAmount = 0; if (currentItemAmount.containsKey(filterSlotIndex)) { @@ -160,7 +161,7 @@ public void clearBuffer() { public void setTransferMode(TransferMode transferMode) { this.transferMode = transferMode; this.coverHolder.markDirty(); - this.itemFilterContainer.setMaxStackSize(transferMode.maxStackSize); + this.filterHolder.setMaxStackSize(transferMode.maxStackSize); } public TransferMode getTransferMode() { @@ -171,7 +172,7 @@ private boolean shouldDisplayAmountSlider() { if (transferMode == TransferMode.TRANSFER_ANY) { return false; } - return itemFilterContainer.showGlobalTransferLimitSlider(); + return this.filterHolder.showGlobalTransferLimitSlider(); } @Override @@ -189,18 +190,18 @@ protected ModularUI buildUI(Builder builder, EntityPlayer player) { ServerWidgetGroup stackSizeGroup = new ServerWidgetGroup(this::shouldDisplayAmountSlider); stackSizeGroup.addWidget(new ImageWidget(111, 70, 35, 20, GuiTextures.DISPLAY)); - stackSizeGroup.addWidget(new IncrementButtonWidget(146, 70, 20, 20, 1, 8, 64, 512, itemFilterContainer::adjustTransferStackSize) + stackSizeGroup.addWidget(new IncrementButtonWidget(146, 70, 20, 20, 1, 8, 64, 512, this.filterHolder::adjustTransferStackSize) .setDefaultTooltip() .setTextScale(0.7f) .setShouldClientCallback(false)); - stackSizeGroup.addWidget(new IncrementButtonWidget(91, 70, 20, 20, -1, -8, -64, -512, itemFilterContainer::adjustTransferStackSize) + stackSizeGroup.addWidget(new IncrementButtonWidget(91, 70, 20, 20, -1, -8, -64, -512, this.filterHolder::adjustTransferStackSize) .setDefaultTooltip() .setTextScale(0.7f) .setShouldClientCallback(false)); - stackSizeGroup.addWidget(new TextFieldWidget2(113, 77, 31, 20, () -> String.valueOf(itemFilterContainer.getTransferStackSize()), val -> { + stackSizeGroup.addWidget(new TextFieldWidget2(113, 77, 31, 20, () -> String.valueOf(this.filterHolder.getTransferStackSize()), val -> { if (val != null && !val.isEmpty()) - itemFilterContainer.setTransferStackSize(MathHelper.clamp(Integer.parseInt(val), 1, transferMode.maxStackSize)); + this.filterHolder.setTransferStackSize(MathHelper.clamp(Integer.parseInt(val), 1, transferMode.maxStackSize)); }) .setNumbersOnly(1, transferMode.maxStackSize) .setMaxLength(4) diff --git a/src/main/java/gregtech/common/covers/DistributionMode.java b/src/main/java/gregtech/common/covers/DistributionMode.java index 63efe6d6051..56027b7a1ce 100644 --- a/src/main/java/gregtech/common/covers/DistributionMode.java +++ b/src/main/java/gregtech/common/covers/DistributionMode.java @@ -5,14 +5,17 @@ import javax.annotation.Nonnull; public enum DistributionMode implements IStringSerializable { + ROUND_ROBIN_GLOBAL("cover.conveyor.distribution.round_robin_enhanced"), ROUND_ROBIN_PRIO("cover.conveyor.distribution.round_robin"), INSERT_FIRST("cover.conveyor.distribution.first_insert"); public final String localeName; + public final String localeDescription; DistributionMode(String localeName) { this.localeName = localeName; + this.localeDescription = localeName + ".description"; } @Nonnull diff --git a/src/main/java/gregtech/common/covers/ManualImportExportMode.java b/src/main/java/gregtech/common/covers/ManualImportExportMode.java index 6c7218f62b3..a34e0afa4c3 100644 --- a/src/main/java/gregtech/common/covers/ManualImportExportMode.java +++ b/src/main/java/gregtech/common/covers/ManualImportExportMode.java @@ -11,9 +11,11 @@ public enum ManualImportExportMode implements IStringSerializable { UNFILTERED("cover.universal.manual_import_export.mode.unfiltered"); public final String localeName; + public final String localeDescription; ManualImportExportMode(String localeName) { this.localeName = localeName; + this.localeDescription = localeName + ".description"; } @Nonnull diff --git a/src/main/java/gregtech/common/covers/VoidingMode.java b/src/main/java/gregtech/common/covers/VoidingMode.java index c73ad7ea42c..4897a9e4c22 100644 --- a/src/main/java/gregtech/common/covers/VoidingMode.java +++ b/src/main/java/gregtech/common/covers/VoidingMode.java @@ -9,11 +9,13 @@ public enum VoidingMode implements IStringSerializable { VOID_OVERFLOW("cover.voiding.voiding_mode.void_overflow", 1024); public final String localeName; + public final String localeDescription; public final int maxStackSize; VoidingMode(String localeName, int maxStackSize) { this.localeName = localeName; this.maxStackSize = maxStackSize; + this.localeDescription = localeName + ".description"; } diff --git a/src/main/java/gregtech/common/covers/filter/fluid/FluidFilter.java b/src/main/java/gregtech/common/covers/filter/fluid/FluidFilter.java new file mode 100644 index 00000000000..56d0fa58fa6 --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/fluid/FluidFilter.java @@ -0,0 +1,39 @@ +package gregtech.common.covers.filter.fluid; + +import gregtech.api.cover.filter.Filter; +import net.minecraftforge.fluids.FluidStack; + +import java.util.function.BooleanSupplier; + +public abstract class FluidFilter extends Filter { + + private BooleanSupplier shouldShowTip = () -> false; + private int maxSize = 1000; + + public abstract void configureFilterTanks(int amount); + + public abstract void setMaxConfigurableFluidSize(int maxSize); + + public abstract int getFluidTransferLimit(FluidStack fluidStack); + + @Override + public int getTransferLimit(Object object, int globalTransferLimit) { + return getFluidTransferLimit((FluidStack) object); + } + + public void setShouldShowTip(BooleanSupplier shouldShowTip) { + this.shouldShowTip = shouldShowTip != null ? shouldShowTip : () -> false; + } + + public boolean shouldShowTip() { + return this.shouldShowTip.getAsBoolean(); + } + + public void setMaxSize(int maxSize) { + this.maxSize = maxSize; + } + + public int getMaxSize() { + return maxSize; + } +} diff --git a/src/main/java/gregtech/common/covers/filter/fluid/FluidFilterHolder.java b/src/main/java/gregtech/common/covers/filter/fluid/FluidFilterHolder.java new file mode 100644 index 00000000000..4a79f100521 --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/fluid/FluidFilterHolder.java @@ -0,0 +1,68 @@ +package gregtech.common.covers.filter.fluid; + +import gregtech.api.cover.filter.FilterHolder; +import gregtech.api.util.IDirtyNotifiable; +import gregtech.common.covers.filter.FilterTypeRegistry; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.ItemStackHandler; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.Nonnull; +import java.util.function.BooleanSupplier; + +public class FluidFilterHolder extends FilterHolder { + + private final BooleanSupplier shouldShowTip; + private final int maxSize; + + public FluidFilterHolder(IDirtyNotifiable dirtyNotifiable) { + this(dirtyNotifiable, () -> false, 1000); + } + + public FluidFilterHolder(IDirtyNotifiable dirtyNotifiable, BooleanSupplier shouldShowTip) { + this(dirtyNotifiable, shouldShowTip, 1000); + } + + public FluidFilterHolder(IDirtyNotifiable dirtyNotifiable, BooleanSupplier shouldShowTip, int maxSize) { + super(new ItemStackHandler(1) { + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + return FilterTypeRegistry.getFluidFilterForStack(stack) != null; + } + + @Override + public int getSlotLimit(int slot) { + return 1; + } + + /*@Override + protected void onLoad() { + onFilterSlotChange(false); + } + + @Override + protected void onContentsChanged(int slot) { + onFilterSlotChange(true); + }*/ + }, 0, dirtyNotifiable); + this.shouldShowTip = shouldShowTip; + this.maxSize = maxSize; + } + + @Override + public Class getFilterClass() { + return FluidFilter.class; + } + + @Override + public void onFilterChanged(@Nullable FluidFilter oldFilter, @Nullable FluidFilter newFilter) { + if (oldFilter != null) { + oldFilter.setShouldShowTip(null); + } + if (newFilter != null) { + newFilter.setShouldShowTip(this.shouldShowTip); + newFilter.setMaxSize(this.maxSize); + } + } +} diff --git a/src/main/java/gregtech/common/covers/filter/fluid/SimpleFluidFilter.java b/src/main/java/gregtech/common/covers/filter/fluid/SimpleFluidFilter.java new file mode 100644 index 00000000000..e3e59d540df --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/fluid/SimpleFluidFilter.java @@ -0,0 +1,118 @@ +package gregtech.common.covers.filter.fluid; + +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.FluidSlotSyncHandler; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.widgets.FluidSlot; +import com.cleanroommc.modularui.widgets.SlotGroupWidget; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nullable; + +public class SimpleFluidFilter extends FluidFilter { + + private static final int MAX_FLUID_SLOTS = 9; + + protected final FluidTank[] fluidFilterTanks = new FluidTank[MAX_FLUID_SLOTS]; + + public SimpleFluidFilter() { + for (int i = 0; i < MAX_FLUID_SLOTS; ++i) { + fluidFilterTanks[i] = new FluidTank(1000) { + @Override + public void setFluid(@Nullable FluidStack fluid) { + super.setFluid(fluid); + SimpleFluidFilter.this.markDirty(); + } + }; + } + } + + @Override + public void configureFilterTanks(int amount) { + for (FluidTank fluidTank : fluidFilterTanks) { + if (fluidTank.getFluid() != null) + fluidTank.getFluid().amount = amount; + } + this.markDirty(); + } + + @Override + public void setMaxConfigurableFluidSize(int maxSize) { + for (FluidTank fluidTank : fluidFilterTanks) { + fluidTank.setCapacity(maxSize); + } + } + + @Override + public boolean matches(FluidStack fluidStack, boolean ignoreInverted) { + boolean b = checkInputFluid(fluidFilterTanks, fluidStack); + return ignoreInverted ? b : b != isInverted(); + } + + @Override + public @NotNull IWidget createFilterUI(ModularPanel mainPanel, GuiSyncManager syncManager) { + return SlotGroupWidget.builder() + .matrix("FFF", "FFF", "FFF") + .key('F', i -> { + FluidSlotSyncHandler syncHandler = new FluidSlotSyncHandler(this.fluidFilterTanks[i]); + return new FluidSlot().syncHandler(syncHandler) + .onUpdateListener(fluidSlot -> { + boolean showTip = shouldShowTip(); + if (showTip != syncHandler.controlsAmount()) { + syncHandler.controlsAmount(showTip); + } + }); + }) + .build(); + } + + public void writeToNBT(NBTTagCompound tagCompound) { + NBTTagList filterSlots = new NBTTagList(); + for (int i = 0; i < this.fluidFilterTanks.length; ++i) { + FluidTank fluidTank = this.fluidFilterTanks[i]; + if (fluidTank.getFluid() != null) { + NBTTagCompound stackTag = new NBTTagCompound(); + fluidTank.getFluid().writeToNBT(stackTag); + stackTag.setInteger("Slot", i); + filterSlots.appendTag(stackTag); + } + } + tagCompound.setTag("FluidFilter", filterSlots); + } + + public void readFromNBT(NBTTagCompound tagCompound) { + NBTTagList filterSlots = tagCompound.getTagList("FluidFilter", 10); + for (NBTBase nbtBase : filterSlots) { + NBTTagCompound stackTag = (NBTTagCompound) nbtBase; + FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(stackTag); + this.fluidFilterTanks[stackTag.getInteger("Slot")].setFluid(fluidStack); + } + } + + public static boolean checkInputFluid(FluidTank[] fluidFilterTanks, FluidStack fluidStack) { + for (FluidTank fluidTank : fluidFilterTanks) { + if (fluidTank.getFluid() != null && fluidTank.getFluid().isFluidEqual(fluidStack)) { + return true; + } + } + return false; + } + + @Override + public int getFluidTransferLimit(FluidStack fluidStack) { + int limit = 0; + for (FluidTank fluidTank : fluidFilterTanks) { + if (fluidTank.getFluid() != null && fluidTank.getFluid().isFluidEqual(fluidStack)) { + limit = fluidTank.getFluid().amount; + break; + } + } + return limit; + } +} diff --git a/src/main/java/gregtech/common/covers/filter/item/ItemFilter.java b/src/main/java/gregtech/common/covers/filter/item/ItemFilter.java new file mode 100644 index 00000000000..a5fee90dbff --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/item/ItemFilter.java @@ -0,0 +1,38 @@ +package gregtech.common.covers.filter.item; + +import gregtech.api.cover.filter.Filter; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nullable; + +public abstract class ItemFilter extends Filter { + + private int maxStackSize = Integer.MAX_VALUE; + + public final int getMaxStackSize() { + return maxStackSize; + } + + public final void setMaxStackSize(int maxStackSize) { + this.maxStackSize = maxStackSize; + onMaxStackSizeChange(); + } + + protected void onMaxStackSizeChange() { + } + + public abstract boolean showGlobalTransferLimitSlider(); + + @Override + public int getTransferLimit(Object stack, int globalTransferLimit) { + return globalTransferLimit; + } + + @Nullable + public abstract Object matchItemStack(ItemStack itemStack); + + @Override + public boolean matches(ItemStack stack, boolean ignoreInverted) { + return matchItemStack(stack) == null == (!ignoreInverted && isInverted()); + } +} diff --git a/src/main/java/gregtech/common/covers/filter/item/ItemFilterHolder.java b/src/main/java/gregtech/common/covers/filter/item/ItemFilterHolder.java new file mode 100644 index 00000000000..6fe28d48753 --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/item/ItemFilterHolder.java @@ -0,0 +1,93 @@ +package gregtech.common.covers.filter.item; + +import gregtech.api.cover.filter.FilterHolder; +import gregtech.api.util.IDirtyNotifiable; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.MathHelper; +import net.minecraftforge.items.IItemHandlerModifiable; + +public class ItemFilterHolder extends FilterHolder { + + private static final Object MATCH_RESULT_TRUE = new Object(); + + private int maxStackSizeLimit = 1; + private int transferStackSize; + + public ItemFilterHolder(IDirtyNotifiable dirtyNotifiable) { + super(dirtyNotifiable); + } + + public ItemFilterHolder(IItemHandlerModifiable filterInventory, int filterSlotIndex, IDirtyNotifiable dirtyNotifiable) { + super(filterInventory, filterSlotIndex, dirtyNotifiable); + } + + @Override + public Class getFilterClass() { + return ItemFilter.class; + } + + public int getMaxStackSize() { + return maxStackSizeLimit; + } + + public int getTransferStackSize() { + if (!showGlobalTransferLimitSlider()) { + return getMaxStackSize(); + } + return transferStackSize; + } + + public void setTransferStackSize(int transferStackSize) { + this.transferStackSize = MathHelper.clamp(transferStackSize, 1, getMaxStackSize()); + this.dirtyNotifiable.markAsDirty(); + } + + public void adjustTransferStackSize(int amount) { + setTransferStackSize(transferStackSize + amount); + } + + public void setMaxStackSize(int maxStackSizeLimit) { + this.maxStackSizeLimit = maxStackSizeLimit; + this.transferStackSize = MathHelper.clamp(transferStackSize, 1, getMaxStackSize()); + this.dirtyNotifiable.markAsDirty(); + } + + public boolean showGlobalTransferLimitSlider() { + return getCurrentFilter() == null || getCurrentFilter().showGlobalTransferLimitSlider(); + } + + public int getSlotTransferLimit(Object slotIndex) { + int globalTransferLimit = getTransferStackSize(); + if (getCurrentFilter() == null || getCurrentFilter().isInverted()) { + return globalTransferLimit; + } + return getCurrentFilter().getTransferLimit(slotIndex, globalTransferLimit); + } + + public Object matchItemStack(ItemStack itemStack) { + if (getCurrentFilter() == null) { + return null; + } + Object result = getCurrentFilter().matchItemStack(itemStack); + if (result instanceof ItemStack) { + throw new IllegalStateException("Item Filter should not return a ItemStack as match result, since they can't be used properly in maps!"); + } + return result; + } + + @Override + public NBTTagCompound serializeNBT() { + NBTTagCompound nbt = super.serializeNBT(); + nbt.setInteger("MaxStackSize", maxStackSizeLimit); + nbt.setInteger("TransferStackSize", transferStackSize); + return nbt; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) { + super.deserializeNBT(nbt); + setMaxStackSize(nbt.getInteger("MaxStackSize")); + setTransferStackSize(nbt.getInteger("TransferStackSize")); + } +} diff --git a/src/main/java/gregtech/common/covers/filter/item/SimpleItemFilter.java b/src/main/java/gregtech/common/covers/filter/item/SimpleItemFilter.java new file mode 100644 index 00000000000..d54e554c15f --- /dev/null +++ b/src/main/java/gregtech/common/covers/filter/item/SimpleItemFilter.java @@ -0,0 +1,149 @@ +package gregtech.common.covers.filter.item; + +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.api.widget.IWidget; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; +import com.cleanroommc.modularui.value.sync.GuiSyncManager; +import com.cleanroommc.modularui.widget.ParentWidget; +import com.cleanroommc.modularui.widgets.CycleButtonWidget; +import com.cleanroommc.modularui.widgets.ItemSlot; +import com.cleanroommc.modularui.widgets.slot.ModularSlot; +import gregtech.api.util.LargeStackSizeItemStackHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemStackHandler; +import org.jetbrains.annotations.NotNull; + +public class SimpleItemFilter extends ItemFilter { + + private static final int MAX_MATCH_SLOTS = 9; + + protected final ItemStackHandler itemFilterSlots; + protected boolean ignoreDamage = true; + protected boolean ignoreNBT = true; + + public SimpleItemFilter() { + this.itemFilterSlots = new LargeStackSizeItemStackHandler(MAX_MATCH_SLOTS) { + @Override + public int getSlotLimit(int slot) { + return getMaxStackSize(); + } + }; + } + + @Override + protected void onMaxStackSizeChange() { + for (int i = 0; i < itemFilterSlots.getSlots(); i++) { + ItemStack itemStack = itemFilterSlots.getStackInSlot(i); + if (!itemStack.isEmpty()) { + itemStack.setCount(Math.min(itemStack.getCount(), getMaxStackSize())); + } + } + } + + public ItemStackHandler getItemFilterSlots() { + return itemFilterSlots; + } + + public boolean isIgnoreDamage() { + return ignoreDamage; + } + + public boolean isIgnoreNBT() { + return ignoreNBT; + } + + protected void setIgnoreDamage(boolean ignoreDamage) { + this.ignoreDamage = ignoreDamage; + markDirty(); + } + + protected void setIgnoreNBT(boolean ignoreNBT) { + this.ignoreNBT = ignoreNBT; + markDirty(); + } + + @Override + public Object matchItemStack(ItemStack itemStack) { + int itemFilterMatchIndex = itemFilterMatch(getItemFilterSlots(), isIgnoreDamage(), isIgnoreNBT(), itemStack); + return itemFilterMatchIndex == -1 ? null : itemFilterMatchIndex; + } + + @Override + public int getTransferLimit(Object obj, int globalTransferLimit) { + if (obj instanceof Integer) { + return (int) obj; + } + return 0; + } + + @Override + public boolean showGlobalTransferLimitSlider() { + return false; + } + + @Override + public @NotNull IWidget createFilterUI(ModularPanel mainPanel, GuiSyncManager syncManager) { + ParentWidget parentWidget = new ParentWidget<>().coverChildren(); + parentWidget.child(new CycleButtonWidget() + .value(new BooleanSyncValue(() -> ignoreDamage, this::setIgnoreDamage)) + .texture(gregtech.api.newgui.GuiTextures.BUTTON_FILTER_DAMAGE) + .addTooltip(0, IKey.lang("cover.item_filter.ignore_damage.disabled")) + .addTooltip(1, IKey.lang("cover.item_filter.ignore_damage.enabled")) + .pos(85, 0) + .size(18, 18)) + .child(new CycleButtonWidget() + .value(new BooleanSyncValue(() -> ignoreNBT, this::setIgnoreNBT)) + .texture(gregtech.api.newgui.GuiTextures.BUTTON_FILTER_NBT) + .addTooltip(0, IKey.lang("cover.item_filter.ignore_nbt.disabled")) + .addTooltip(1, IKey.lang("cover.item_filter.ignore_nbt.enabled")) + .pos(103, 0) + .size(18, 18)) + .child(createBlacklistButton(mainPanel, syncManager)); + for (int i = 0; i < 9; i++) { + parentWidget.child(new ItemSlot() + .slot(new ModularSlot(this.itemFilterSlots, i, true)) + .pos(i % 3 * 18, i / 3 * 18)); + } + return parentWidget; + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + tagCompound.setTag("ItemFilter", itemFilterSlots.serializeNBT()); + tagCompound.setBoolean("IgnoreDamage", ignoreDamage); + tagCompound.setBoolean("IgnoreNBT", ignoreNBT); + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + this.itemFilterSlots.deserializeNBT(tagCompound.getCompoundTag("ItemFilter")); + this.ignoreDamage = tagCompound.getBoolean("IgnoreDamage"); + this.ignoreNBT = tagCompound.getBoolean("IgnoreNBT"); + } + + public static int itemFilterMatch(IItemHandler filterSlots, boolean ignoreDamage, boolean ignoreNBTData, ItemStack itemStack) { + for (int i = 0; i < filterSlots.getSlots(); i++) { + ItemStack filterStack = filterSlots.getStackInSlot(i); + if (!filterStack.isEmpty() && areItemsEqual(ignoreDamage, ignoreNBTData, filterStack, itemStack)) { + return i; + } + } + return -1; + } + + private static boolean areItemsEqual(boolean ignoreDamage, boolean ignoreNBTData, ItemStack filterStack, ItemStack itemStack) { + if (ignoreDamage) { + if (!filterStack.isItemEqualIgnoreDurability(itemStack)) { + return false; + } + } else if (!filterStack.isItemEqual(itemStack)) { + return false; + } + return ignoreNBTData || ItemStack.areItemStackTagsEqual(filterStack, itemStack); + } +} diff --git a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java index c1a4afdcef7..16cc6c65bcc 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java +++ b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java @@ -606,8 +606,8 @@ public ModularPanel buildUI(GuiCreationContext guiCreationContext, GuiSyncManage }))) .child(IKey.lang("monitor.gui.title.plugin").asWidget().pos(7, y += 20)) .child(new ItemSlot().slot(SyncHandlers.itemSlot(this.inventory, 0) - .changeListener(stack -> { - if (this.getWorld() != null && !this.getWorld().isRemote) { + .changeListener((stack, onlyAmountChanged, client, init) -> { + if (!init && !onlyAmountChanged && !client) { setPluginItem(this.inventory.getStackInSlot(0)); } }) diff --git a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java index d0143552bce..da97caa0fb8 100644 --- a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java +++ b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java @@ -357,12 +357,12 @@ public CoverBehavior getCoverOnNeighbour(BlockPos pos, EnumFacing handlerFacing) public ItemStack insertOverRobotArm(IItemHandler handler, CoverRoboticArm arm, ItemStack stack, boolean simulate, int allowed, boolean ignoreLimit) { int rate; boolean isStackSpecific = false; - Object index = arm.getItemFilterContainer().matchItemStack(stack); + Object index = arm.getFilterHolder().matchItemStack(stack); if (index instanceof Integer) { - rate = arm.getItemFilterContainer().getSlotTransferLimit(index); + rate = arm.getFilterHolder().getSlotTransferLimit(index); isStackSpecific = true; } else - rate = arm.getItemFilterContainer().getTransferStackSize(); + rate = arm.getFilterHolder().getTransferStackSize(); int count; switch (arm.getTransferMode()) { case TRANSFER_ANY: @@ -396,7 +396,7 @@ public static int countStack(IItemHandler handler, ItemStack stack, CoverRobotic ItemStack slot = handler.getStackInSlot(i); if (slot.isEmpty()) continue; if (isStackSpecific ? ItemStackHashStrategy.comparingAllButCount().equals(stack, slot) : - arm.getItemFilterContainer().testItemStack(slot)) { + arm.getFilterHolder().test(slot)) { count += slot.getCount(); } } diff --git a/src/main/java/gregtech/core/CoreModule.java b/src/main/java/gregtech/core/CoreModule.java index d3e7a11d70b..4ff23ae4a86 100644 --- a/src/main/java/gregtech/core/CoreModule.java +++ b/src/main/java/gregtech/core/CoreModule.java @@ -7,6 +7,7 @@ import gregtech.api.capability.SimpleCapabilityManager; import gregtech.api.cover.CoverBehaviorUIFactory; import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.filter.FilterRegistry; import gregtech.api.fluids.MetaFluids; import gregtech.api.newgui.GTGuis; import gregtech.api.gui.UIFactory; @@ -225,6 +226,7 @@ public void init(FMLInitializationEvent event) { LootTableHelper.initialize(); FilterTypeRegistry.init(); + FilterRegistry.init(); /* Start Cover Definition Registration */ COVER_REGISTRY.unfreeze(); diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java index 547d83c0dde..398f9b777ca 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java @@ -7,6 +7,8 @@ import gregtech.api.util.TextFormattingUtil; import gregtech.common.covers.*; import gregtech.common.covers.filter.*; +import gregtech.common.covers.filter.fluid.FluidFilterHolder; +import gregtech.common.covers.filter.item.ItemFilterHolder; import mcjty.theoneprobe.api.IProbeHitData; import mcjty.theoneprobe.api.IProbeInfo; import mcjty.theoneprobe.api.TextStyleClass; @@ -63,12 +65,12 @@ private static void conveyorInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverCo transferRateText(probeInfo, conveyor.getConveyorMode(), rateUnit, conveyor.getTransferRate()); } - ItemFilterContainer filter = conveyor.getItemFilterContainer(); - if (conveyor instanceof CoverRoboticArm) { - CoverRoboticArm roboticArm = (CoverRoboticArm) conveyor; - transferModeText(probeInfo, roboticArm.getTransferMode(), rateUnit, filter.getTransferStackSize(), filter.getFilterWrapper().getItemFilter() != null); + ItemFilterHolder filter = conveyor.getFilterHolder(); + if (conveyor instanceof CoverRoboticArm roboticArm) { + transferModeText(probeInfo, roboticArm.getTransferMode(), rateUnit, filter.getTransferStackSize(), filter.hasFilter()); } - itemFilterText(probeInfo, filter.getFilterWrapper().getItemFilter()); + // TODO + itemFilterText(probeInfo, null); } /** @@ -80,11 +82,11 @@ private static void conveyorInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverCo private static void itemVoidingInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverItemVoiding voiding) { String unit = " {*gregtech.top.unit.items*}"; - ItemFilterContainer container = voiding.getItemFilterContainer(); + ItemFilterHolder container = voiding.getFilterHolder(); if (voiding instanceof CoverItemVoidingAdvanced) { CoverItemVoidingAdvanced advanced = (CoverItemVoidingAdvanced) voiding; VoidingMode mode = advanced.getVoidingMode(); - voidingText(probeInfo, mode, unit, container.getTransferStackSize(), container.getFilterWrapper().getItemFilter() != null); + voidingText(probeInfo, mode, unit, container.getTransferStackSize(), container.hasFilter()); } } @@ -104,12 +106,12 @@ private static void pumpInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverPump p transferRateText(probeInfo, pump.getPumpMode(), " " + rateUnit, pump.getBucketMode() == CoverPump.BucketMode.BUCKET ? pump.getTransferRate() / 1000 : pump.getTransferRate()); } - FluidFilterContainer filter = pump.getFluidFilterContainer(); + FluidFilterHolder filter = pump.getFilterHolder(); if (pump instanceof CoverFluidRegulator) { CoverFluidRegulator regulator = (CoverFluidRegulator) pump; - transferModeText(probeInfo, regulator.getTransferMode(), rateUnit, regulator.getTransferAmount(), filter.getFilterWrapper().getFluidFilter() != null); + transferModeText(probeInfo, regulator.getTransferMode(), rateUnit, regulator.getTransferAmount(), filter.hasFilter()); } - fluidFilterText(probeInfo, filter.getFilterWrapper().getFluidFilter()); + fluidFilterText(probeInfo, filter.getCurrentFilter()); } /** @@ -125,7 +127,7 @@ private static void fluidVoidingInfo(@Nonnull IProbeInfo probeInfo, @Nonnull Cov CoverFluidVoidingAdvanced advanced = (CoverFluidVoidingAdvanced) voiding; VoidingMode mode = advanced.getVoidingMode(); // do not display amount in overflow when a filter is present - voidingText(probeInfo, mode, unit, voiding.getBucketMode() == CoverPump.BucketMode.BUCKET ? advanced.getTransferAmount() / 1000 : advanced.getTransferAmount(), voiding.getFluidFilterContainer().getFilterWrapper().getFluidFilter() != null); + voidingText(probeInfo, mode, unit, voiding.getBucketMode() == CoverPump.BucketMode.BUCKET ? advanced.getTransferAmount() / 1000 : advanced.getTransferAmount(), voiding.getFilterHolder().hasFilter()); } } @@ -148,7 +150,7 @@ private static void itemFilterInfo(@Nonnull IProbeInfo probeInfo, @Nonnull Cover */ private static void fluidFilterInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverFluidFilter fluidFilter) { filterModeText(probeInfo, fluidFilter.getFilterMode()); - fluidFilterText(probeInfo, fluidFilter.getFluidFilter().getFluidFilter()); + //fluidFilterText(probeInfo, fluidFilter.getFluidFilter().getFluidFilter()); } /** @@ -159,7 +161,7 @@ private static void fluidFilterInfo(@Nonnull IProbeInfo probeInfo, @Nonnull Cove */ private static void enderFluidLinkInfo(@Nonnull IProbeInfo probeInfo, @Nonnull CoverEnderFluidLink enderFluidLink) { transferRateText(probeInfo, enderFluidLink.getPumpMode(), " {*cover.bucket.mode.milli_bucket*}", enderFluidLink.isIOEnabled() ? CoverEnderFluidLink.TRANSFER_RATE : 0); - fluidFilterText(probeInfo, enderFluidLink.getFluidFilterContainer().getFilterWrapper().getFluidFilter()); + //fluidFilterText(probeInfo, enderFluidLink.getFluidFilterContainer().getFilterWrapper().getFluidFilter()); if (!enderFluidLink.getColorStr().isEmpty()) { probeInfo.text(TextStyleClass.INFO + "{*gregtech.top.link_cover.color*} " + enderFluidLink.getColorStr()); @@ -242,7 +244,7 @@ private static void itemFilterText(@Nonnull IProbeInfo probeInfo, @Nullable Item * @param probeInfo the info to add the text to * @param filter the filter to display info from */ - private static void fluidFilterText(@Nonnull IProbeInfo probeInfo, @Nullable FluidFilter filter) { + private static void fluidFilterText(@Nonnull IProbeInfo probeInfo, @Nullable gregtech.common.covers.filter.fluid.FluidFilter filter) { // TODO If more unique fluid filtration is added, providers for it go here } } diff --git a/src/main/resources/assets/gregtech/lang/en_us.lang b/src/main/resources/assets/gregtech/lang/en_us.lang index 5ca6a82d7de..07b4c3152cf 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -530,7 +530,7 @@ metaitem.tool.datamodule.name=Data Module metaitem.tool.datamodule.tooltip=Storage for Incredibly Complex Data/n§cCan only be read by a Data Bank metaitem.circuit.integrated.name=Programmed Circuit metaitem.circuit.integrated.tooltip=Use to open configuration GUI/n/nShift-Right-Click on a machine/nwith a circuit slot to set it to/nthis circuit's value./n -metaitem.circuit.integrated.gui=Programmed Circuit Configuration +metaitem.circuit.integrated.gui=Circuit Programming metaitem.circuit.integrated.jei_description=JEI is only showing recipes for the given configuration.\n\nYou can select a configuration in the Programmed Circuit configuration tab. item.glass.lens=Glass Lens (White) @@ -1163,6 +1163,17 @@ gui.widget.recipeProgressWidget.default_tooltip=Show Recipes gregtech.recipe_memory_widget.tooltip.1=§7Left click to automatically input this recipe into the crafting grid gregtech.recipe_memory_widget.tooltip.2=§7Shift click to lock/unlock this recipe +cover.mode=Mode: +cover.transfer_rate=Transfer Rate: +cover.mode.manual_io=Manual IO Mode: +cover.transfer_mode=Transfer Mode: +cover.transfer_amount=Amount: + +cover.filter.label=Filter +cover.filter_mode.label=Filter Mode: +cover.filter.settings.label=Filter Settings +cover.filter.settings_open.label=Open Settings + cover.filter.blacklist.disabled=Whitelist cover.filter.blacklist.enabled=Blacklist @@ -1188,7 +1199,7 @@ cover.fluid_filter.mode.filter_both=Filter Fill & Drain cover.item_filter.title=Item Filter cover.filter.mode.filter_insert=Filter Insert cover.filter.mode.filter_extract=Filter Extract -cover.filter.mode.filter_both=Filter Insert/Extract +cover.filter.mode.filter_both=Filter Insert & Extract cover.item_filter.ignore_damage.enabled=Ignore Damage cover.item_filter.ignore_damage.disabled=Respect Damage cover.item_filter.ignore_nbt.enabled=Ignore NBT @@ -1214,18 +1225,28 @@ cover.smart_item_filter.filtering_mode.sifter=Sifter cover.smart_item_filter.filtering_mode.description=Select Machine this Smart Filter will use for filtering./nIt will automatically pick right portions of items for robotic arm. cover.conveyor.title=Conveyor Cover Settings (%s) -cover.conveyor.transfer_rate=§7items/sec -cover.conveyor.mode.export=Mode: Export -cover.conveyor.mode.import=Mode: Import -cover.conveyor.distribution.round_robin_enhanced=Distribution Mode/n§bEnhanced Round Robin§r/n§7Splits items equally to all inventories -cover.conveyor.distribution.round_robin=Distribution Mode/n§bRound Robin§r with Priority/n§7Tries to split items equally to inventories -cover.conveyor.distribution.first_insert=Distribution Mode/n§bFirst Insert§r/n§7Will insert into the first inventory it finds +cover.conveyor.transfer_rate=items/sec +cover.conveyor.mode.import_export=Import / Export +cover.conveyor.mode.export=Export +cover.conveyor.mode.import=Import +cover.conveyor.distribution_mode=Distribution Mode +cover.conveyor.distribution.description=§eEnhanced Round Robin§r splits items equally to all inventories\n§eRound Robin§r with Priority tries to split items equally to inventories\n§eFirst Insert§r will insert into the first inventory it finds +cover.conveyor.distribution.round_robin_enhanced=Enhanced RR +cover.conveyor.distribution.round_robin=Round Robin +cover.conveyor.distribution.first_insert=First Insert +cover.conveyor.distribution.round_robin_enhanced.description=§eEnhanced Round Robin§r splits items equally to all inventories +cover.conveyor.distribution.round_robin.description=§eRound Robin§r with Priority tries to split items equally to inventories +cover.conveyor.distribution.first_insert.description=§eFirst Insert§r will insert into the first inventory it finds cover.conveyor.blocks_input.enabled=If enabled, items will not be inserted when cover is set to pull items from the inventory into pipe./n§aEnabled cover.conveyor.blocks_input.disabled=If enabled, items will not be inserted when cover is set to pull items from the inventory into pipe./n§cDisabled -cover.universal.manual_import_export.mode.disabled=Manual I/O: Disabled -cover.universal.manual_import_export.mode.filtered=Manual I/O: Filtered -cover.universal.manual_import_export.mode.unfiltered=Manual I/O: Unfiltered -cover.universal.manual_import_export.mode.description=§eDisabled§r - Items/fluids will only move as specified by the cover and its filter. /n§eAllow Filtered§r - Items/fluids can be extracted and inserted independently of the cover mode, as long as its filter matches (if any). /n§eAllow Unfiltered§r - Items/fluids can be moved independently of the cover mode. Filter applies to the items inserted or extracted by this cover +cover.universal.manual_import_export.mode=Filtration Mode +cover.universal.manual_import_export.mode.disabled=Disabled +cover.universal.manual_import_export.mode.filtered=Filtered +cover.universal.manual_import_export.mode.unfiltered=Unfiltered +cover.universal.manual_import_export.mode.disabled.description=§eDisabled§r - Items/fluids will only move as specified by the cover and its filter. +cover.universal.manual_import_export.mode.filtered.description=§eAllow Filtered§r - Items/fluids can be extracted and inserted independently of the cover mode, as long as its filter matches (if any). +cover.universal.manual_import_export.mode.unfiltered.description=§eAllow Unfiltered§r - Items/fluids can be moved independently of the cover mode. Filter applies to the items inserted or extracted by this cover +cover.universal.manual_import_export.mode.description=§eDisabled§r - Items/fluids will only move as specified by the cover and its filter. \n§eAllow Filtered§r - Items/fluids can be extracted and inserted independently of the cover mode, as long as its filter matches (if any). \n§eAllow Unfiltered§r - Items/fluids can be moved independently of the cover mode. Filter applies to the items inserted or extracted by this cover cover.conveyor.item_filter.title=Item Filter cover.conveyor.ore_dictionary.title=Ore Dictionary Name cover.conveyor.ore_dictionary.title2=(use * for wildcard) @@ -1233,13 +1254,17 @@ cover.robotic_arm.title=Robotic Arm Settings (%s) cover.robotic_arm.transfer_mode.transfer_any=Transfer Any cover.robotic_arm.transfer_mode.transfer_exact=Supply Exact cover.robotic_arm.transfer_mode.keep_exact=Keep Exact +cover.robotic_arm.transfer_mode.transfer_any.description=§eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible. +cover.robotic_arm.transfer_mode.transfer_exact.description=§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for ore dictionary filter). If amount of items is less than portion size, items won't be moved. +cover.robotic_arm.transfer_mode.keep_exact.description=§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required.\n§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster. cover.robotic_arm.transfer_mode.description=§eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible./n§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for ore dictionary filter). If amount of items is less than portion size, items won't be moved. If there's a §bSmart Item Filter§r, the variable under this button will act as a multiplier instead./n§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required./n§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster. cover.pump.title=Pump Cover Settings (%s) -cover.pump.transfer_rate=%s +cover.pump.mode=Mode: cover.pump.mode.export=Mode: Export cover.pump.mode.import=Mode: Import cover.pump.fluid_filter.title=Fluid Filter +cover.pump.mode.bucket=Bucket Mode: cover.bucket.mode.bucket=kL/s cover.bucket.mode.milli_bucket=L/s cover.fluid_regulator.title=Fluid Regulator Settings (%s) @@ -1250,7 +1275,8 @@ cover.fluid_regulator.keep_exact=Keep Exact: %s cover.machine_controller.title=Machine Controller Settings cover.machine_controller.normal=Normal cover.machine_controller.inverted=Inverted -cover.machine_controller.inverted.description=§eNormal§r - in this mode, the cover will require a signal weaker than the set redstone level to run/n§eInverted§r - in this mode, the cover will require a signal stronger than the set redstone level to run +cover.machine_controller.normal.description=§eNormal§r - in this mode, the cover will require a signal weaker than the set redstone level to run +cover.machine_controller.inverted.description=§eInverted§r - in this mode, the cover will require a signal stronger than the set redstone level to run cover.machine_controller.redstone=Min Redstone Strength: %,d cover.machine_controller.mode.machine=Control Machine cover.machine_controller.mode.cover_up=Control Cover (Top) diff --git a/src/main/resources/assets/gregtech/textures/gui/base/cover_normal.png b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal.png new file mode 100644 index 00000000000..a05e4962da7 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_disabled.png b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_disabled.png new file mode 100644 index 00000000000..9004d0fbfac Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_disabled.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_hovered.png b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_hovered.png new file mode 100644 index 00000000000..0fe9ec5d322 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/base/cover_normal_hovered.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/button_allow_import_export.png b/src/main/resources/assets/gregtech/textures/gui/widget/button_allow_import_export.png index e572bef6337..82312eb718d 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/widget/button_allow_import_export.png and b/src/main/resources/assets/gregtech/textures/gui/widget/button_allow_import_export.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/button_blacklist.png b/src/main/resources/assets/gregtech/textures/gui/widget/button_blacklist.png index 0aae328fd4b..c054b4fc7e3 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/widget/button_blacklist.png and b/src/main/resources/assets/gregtech/textures/gui/widget/button_blacklist.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/button_blocks_input.png b/src/main/resources/assets/gregtech/textures/gui/widget/button_blocks_input.png index c5e0b41a6ba..f34d45e4245 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/widget/button_blocks_input.png and b/src/main/resources/assets/gregtech/textures/gui/widget/button_blocks_input.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/button_clear_grid.png b/src/main/resources/assets/gregtech/textures/gui/widget/button_clear_grid.png index f0c0f88c066..e331e699d9e 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/widget/button_clear_grid.png and b/src/main/resources/assets/gregtech/textures/gui/widget/button_clear_grid.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/button_distribution_mode.png b/src/main/resources/assets/gregtech/textures/gui/widget/button_distribution_mode.png index 86f6a27bd53..9e84d028dab 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/widget/button_distribution_mode.png and b/src/main/resources/assets/gregtech/textures/gui/widget/button_distribution_mode.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/cross.png b/src/main/resources/assets/gregtech/textures/gui/widget/cross.png new file mode 100644 index 00000000000..863553adbdc Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/widget/cross.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/export.png b/src/main/resources/assets/gregtech/textures/gui/widget/export.png new file mode 100644 index 00000000000..953c115a333 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/widget/export.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/filtered.png b/src/main/resources/assets/gregtech/textures/gui/widget/filtered.png new file mode 100644 index 00000000000..131fb2f3995 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/widget/filtered.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/import.png b/src/main/resources/assets/gregtech/textures/gui/widget/import.png new file mode 100644 index 00000000000..44527129d6b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/widget/import.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/widget/unfiltered.png b/src/main/resources/assets/gregtech/textures/gui/widget/unfiltered.png new file mode 100644 index 00000000000..ac8c3cbcc5f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/widget/unfiltered.png differ