Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
updated antimatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 28, 2023
1 parent 475670c commit 90ac9c6
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ public void onGuiEvent(IGuiEvent event, Player playerEntity) {
@Override
public void addWidgets(GuiInstance instance, IGuiElement parent) {
super.addWidgets(instance, parent);
instance.addSwitchButton(8, 63, 16, 16, ButtonOverlays.ENERGY_OFF, ButtonOverlays.ENERGY_ON, h -> ((BlockEntityBuffer)h).emitEnergy);
instance.addSwitchButton(26, 63, 16, 16, ButtonOverlays.REDSTONE_CONTROL_OFF, ButtonOverlays.REDSTONE_CONTROL_ON, h -> ((BlockEntityBuffer)h).outputRedstone);
instance.addSwitchButton(44, 63, 16, 16, ButtonOverlays.INVERT_REDSTONE_OFF, ButtonOverlays.INVERT_REDSTONE_ON, h -> ((BlockEntityBuffer)h).invertRedstone);
instance.addSwitchButton(8, 63, 16, 16, ButtonOverlays.ENERGY_OFF, ButtonOverlays.ENERGY_ON, h -> ((BlockEntityBuffer)h).emitEnergy, true);
instance.addSwitchButton(26, 63, 16, 16, ButtonOverlays.REDSTONE_CONTROL_OFF, ButtonOverlays.REDSTONE_CONTROL_ON, h -> ((BlockEntityBuffer)h).outputRedstone, true);
instance.addSwitchButton(44, 63, 16, 16, ButtonOverlays.INVERT_REDSTONE_OFF, ButtonOverlays.INVERT_REDSTONE_ON, h -> ((BlockEntityBuffer)h).invertRedstone, true);
}

public static class BufferItemHandler extends MachineItemHandler<BlockEntityBuffer> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import muramasa.antimatter.blockentity.BlockEntityMachine;
import muramasa.antimatter.capability.machine.MachineEnergyHandler;
import muramasa.antimatter.gui.GuiInstance;
import muramasa.antimatter.gui.IGuiElement;
import muramasa.antimatter.gui.SlotType;
import muramasa.antimatter.gui.event.GuiEvents;
import muramasa.antimatter.gui.event.IGuiEvent;
Expand All @@ -12,6 +14,7 @@
import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.antimatter.util.Utils;
import muramasa.gregtech.data.SlotTypes;
import muramasa.gregtech.gui.ButtonOverlays;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
Expand Down Expand Up @@ -97,6 +100,16 @@ public void onGuiEvent(IGuiEvent event, Player playerEntity) {
}
}
}

@Override
public void addWidgets(GuiInstance instance, IGuiElement parent) {
super.addWidgets(instance, parent);
instance.addSwitchButton(8, 63, 16, 16, ButtonOverlays.ENERGY_OFF, ButtonOverlays.ENERGY_ON, h -> ((BlockEntityItemFilter)h).emitEnergy, true);
instance.addSwitchButton(26, 63, 16, 16, ButtonOverlays.REDSTONE_CONTROL_OFF, ButtonOverlays.REDSTONE_CONTROL_ON, h -> ((BlockEntityItemFilter)h).outputRedstone, true);
instance.addSwitchButton(44, 63, 16, 16, ButtonOverlays.INVERT_REDSTONE_OFF, ButtonOverlays.INVERT_REDSTONE_ON, h -> ((BlockEntityItemFilter)h).invertRedstone, true);
instance.addSwitchButton(62, 63, 16, 16, ButtonOverlays.BLACKLIST_OFF, ButtonOverlays.BLACKLIST_ON, h -> ((BlockEntityItemFilter)h).blacklist, true);
instance.addSwitchButton(80, 63, 16, 16, ButtonOverlays.NBT_OFF, ButtonOverlays.NBT_ON, h -> ((BlockEntityItemFilter)h).nbt, true);
}


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CoverEnergyDetector extends BaseCover {
public CoverEnergyDetector(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
super(source, tier, side, factory);
addGuiCallback(t -> {
t.addSwitchButton(79, 34, 16, 16, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, h -> inverted, b -> "tooltip.gti.redstone_mode." + (b ? "inverted" : "normal"));
t.addSwitchButton(79, 34, 16, 16, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, h -> inverted, true, b -> "tooltip.gti.redstone_mode." + (b ? "inverted" : "normal"));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public CoverBasicTransport(ICoverHandler<?> source, @Nullable Tier tier, Directi
redstoneMode = RedstoneMode.NO_WORK;
coverModeInt = exportMode.ordinal();
addGuiCallback(t -> {
t.addCycleButton(70, 34, 16, 16, h -> ((CoverBasicRedstone)h).redstoneMode.ordinal(), i -> "tooltip.gti.redstone_mode." + i, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, ButtonOverlay.REDSTONE);
t.addCycleButton(88, 34, 16, 16, h -> ((CoverBasicTransport)h).exportMode.ordinal(), i -> "tooltip.gti.export_mode." + i, ButtonOverlay.EXPORT, ButtonOverlay.IMPORT, ButtonOverlay.EXPORT_IMPORT, ButtonOverlay.IMPORT_EXPORT);
t.addCycleButton(70, 34, 16, 16, h -> ((CoverBasicRedstone)h).redstoneMode.ordinal(), true, i -> "tooltip.gti.redstone_mode." + i, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, ButtonOverlay.REDSTONE);
t.addCycleButton(88, 34, 16, 16, h -> ((CoverBasicTransport)h).exportMode.ordinal(), true, i -> "tooltip.gti.export_mode." + i, ButtonOverlay.EXPORT, ButtonOverlay.IMPORT, ButtonOverlay.EXPORT_IMPORT, ButtonOverlay.IMPORT_EXPORT);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CoverRedstoneMachineController extends BaseCover {
public CoverRedstoneMachineController(ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
super(source, tier, side, factory);
addGuiCallback(t -> {
t.addSwitchButton(79, 34, 16, 16, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, h -> inverted, b -> "tooltip.gti.redstone_mode." + (b ? "inverted" : "normal"));
t.addSwitchButton(79, 34, 16, 16, ButtonOverlay.TORCH_OFF, ButtonOverlay.TORCH_ON, h -> inverted, true, b -> "tooltip.gti.redstone_mode." + (b ? "inverted" : "normal"));
});
}

Expand Down
40 changes: 17 additions & 23 deletions common/src/main/java/muramasa/gregtech/data/Guis.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,32 +320,26 @@ public static void init(Side side) {

// if (side.isClient()) {
ADJUSTABLE_TRANSFORMER.addGuiCallback(t -> {
t.addButton(10, 18, ButtonOverlay.APAD_LEFT)
.addButton(25, 18, ButtonOverlay.PAD_LEFT)
.addButton(10, 33, ButtonOverlay.APAD_LEFT)
.addButton(25, 33, ButtonOverlay.PAD_LEFT)
.addButton(10, 48, ButtonOverlay.APAD_LEFT)
.addButton(25, 48, ButtonOverlay.PAD_LEFT)
.addButton(10, 63, ButtonOverlay.APAD_LEFT)
.addButton(25, 63, ButtonOverlay.PAD_LEFT)
.addButton(137, 18, ButtonOverlay.PAD_RIGHT)
.addButton(152, 18, ButtonOverlay.APAD_RIGHT)
.addButton(137, 33, ButtonOverlay.PAD_RIGHT)
.addButton(152, 33, ButtonOverlay.APAD_RIGHT)
.addButton(137, 48, ButtonOverlay.PAD_RIGHT)
.addButton(152, 48, ButtonOverlay.APAD_RIGHT)
.addButton(137, 63, ButtonOverlay.PAD_RIGHT)
.addButton(152, 63, ButtonOverlay.APAD_RIGHT);
t.addButton(10, 18, ButtonOverlay.APAD_LEFT, false)
.addButton(25, 18, ButtonOverlay.PAD_LEFT, false)
.addButton(10, 33, ButtonOverlay.APAD_LEFT, false)
.addButton(25, 33, ButtonOverlay.PAD_LEFT, false)
.addButton(10, 48, ButtonOverlay.APAD_LEFT, false)
.addButton(25, 48, ButtonOverlay.PAD_LEFT, false)
.addButton(10, 63, ButtonOverlay.APAD_LEFT, false)
.addButton(25, 63, ButtonOverlay.PAD_LEFT, false)
.addButton(137, 18, ButtonOverlay.PAD_RIGHT, false)
.addButton(152, 18, ButtonOverlay.APAD_RIGHT, false)
.addButton(137, 33, ButtonOverlay.PAD_RIGHT, false)
.addButton(152, 33, ButtonOverlay.APAD_RIGHT, false)
.addButton(137, 48, ButtonOverlay.PAD_RIGHT, false)
.addButton(152, 48, ButtonOverlay.APAD_RIGHT, false)
.addButton(137, 63, ButtonOverlay.PAD_RIGHT, false)
.addButton(152, 63, ButtonOverlay.APAD_RIGHT, false);
});

ELECTRIC_ITEM_FILTER.getCallbacks().remove(1);
ELECTRIC_ITEM_FILTER.addGuiCallback(t -> {
t.addWidget(FilterButtonArrayWidget.build());
});
ELECTRIC_TYPE_FILTER.getCallbacks().remove(1);
ELECTRIC_TYPE_FILTER.addGuiCallback(t -> {
t.addWidget(FilterButtonArrayWidget.build());
});
CHEST_BUFFER.getCallbacks().remove(1);

BLAST_FURNACE.add(MULTIBLOCK.getSlots()).getGui().setOverrideLocation(MULTIBLOCK.getTexture(LV, "machine"));
Expand All @@ -367,7 +361,7 @@ public static void init(Side side) {
FUSION_REACTOR.getGui().setBackgroundTexture("fusion_control_computer").setEnablePlayerSlots(false)
.getMachineData().setProgressLocation("fusion_reactor").setProgressPos(163, 4).setProgressSize(149, 16);
FUSION_REACTOR.addGuiCallback(t -> {
t.addButton(155, 23, ButtonOverlay.NO_OVERLAY).addButton(155, 41, ButtonOverlay.NO_OVERLAY).addButton(155, 59, ButtonOverlay.NO_OVERLAY).addWidget(makeProgress()).addWidget(FusionButtonWidget.build());
t.addButton(155, 23, ButtonOverlay.NO_OVERLAY, false).addButton(155, 41, ButtonOverlay.NO_OVERLAY, false).addButton(155, 59, ButtonOverlay.NO_OVERLAY, false).addWidget(makeProgress()).addWidget(FusionButtonWidget.build());
});
}

Expand Down

This file was deleted.

0 comments on commit 90ac9c6

Please sign in to comment.