mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 05:19:49 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6c3227cd9 | ||
|
|
20f03a8e9f | ||
|
|
341f1d9236 | ||
|
|
0f68feb0be | ||
|
|
300bb445e2 | ||
|
|
4cf54e7658 |
No files matched your search
+7
-7
@@ -34,28 +34,28 @@
|
||||
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
||||
*/
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-754-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.43-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-762-GTNH:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.9.15:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.29:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.34:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.10:dev") {
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.11:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.4-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.8:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.138:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.10:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.152:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.6-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.8-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.16-GTNH:dev') { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev")
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -51,13 +49,6 @@ public class GuiFluidInterface extends GuiSub {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146977_a(final Slot s) {
|
||||
try {
|
||||
GuiContainer.class.getDeclaredMethod("func_146977_a_original", Slot.class).invoke(this, s);
|
||||
} catch (final Exception ignore) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
fontRendererObj.drawString(getGuiDisplayName(I18n.format(NameConst.GUI_FLUID_INTERFACE)), 8, 6, 0x404040);
|
||||
|
||||
@@ -244,8 +244,7 @@ public class ContainerLevelTerminal extends FCBaseContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimaryGui getPrimaryGui() {
|
||||
|
||||
public PrimaryGui createPrimaryGui() {
|
||||
ContainerOpenContext context = getOpenContext();
|
||||
return new FluidPrimaryGui(
|
||||
GuiType.LEVEL_TERMINAL,
|
||||
|
||||
@@ -22,8 +22,7 @@ public class ContainerLevelWireless extends ContainerLevelTerminal {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimaryGui getPrimaryGui() {
|
||||
|
||||
public PrimaryGui createPrimaryGui() {
|
||||
ContainerOpenContext context = getOpenContext();
|
||||
return new FluidPrimaryGui(
|
||||
GuiType.WIRELESS_LEVEL_TERMINAL,
|
||||
|
||||
+1
-2
@@ -172,8 +172,7 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimaryGui getPrimaryGui() {
|
||||
|
||||
public PrimaryGui createPrimaryGui() {
|
||||
ContainerOpenContext context = getOpenContext();
|
||||
return new FluidPrimaryGui(
|
||||
GuiType.GUI_SUPER_STOCK_REPLENISHER,
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
|
||||
|
||||
@Override
|
||||
protected int getAdaptorFlags() {
|
||||
return InventoryAdaptor.DEFAULT & ~InventoryAdaptor.ALLOW_ITEMS;
|
||||
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_INSERTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ import appeng.api.storage.data.IAEStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.parts.automation.PartBaseImportBus;
|
||||
import appeng.tile.inventory.IAEStackInventory;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
@@ -97,13 +98,12 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
|
||||
if (tanksInfo == null) return true;
|
||||
|
||||
int maxDrain = this.calculateAmountToSend();
|
||||
boolean doBreak = true;
|
||||
|
||||
for (FluidTankInfo tankInfo : tanksInfo) {
|
||||
if (tankInfo.fluid == null) continue;
|
||||
|
||||
FluidStack fluidStack = new FluidStack(tankInfo.fluid, Math.min(tankInfo.fluid.amount, maxDrain));
|
||||
FluidStack fluidStack = new FluidStack(
|
||||
tankInfo.fluid,
|
||||
Math.min(tankInfo.fluid.amount, this.itemToSend));
|
||||
fluidStack = fh.drain(this.getSide().getOpposite(), fluidStack, false);
|
||||
if (this.filterEnabled() && !this.isInFilter(fluidStack)) continue;
|
||||
|
||||
@@ -112,18 +112,16 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
final IAEFluidStack notInserted = inv.injectItems(aeFluidStack, Actionable.MODULATE, this.mySrc);
|
||||
|
||||
if (notInserted != null && notInserted.getStackSize() > 0) {
|
||||
if (notInserted.getFluidStack().amount == aeFluidStack.getFluidStack().amount) continue;
|
||||
aeFluidStack.decStackSize(notInserted.getStackSize());
|
||||
}
|
||||
|
||||
fh.drain(this.getSide().getOpposite(), aeFluidStack.getFluidStack(), true);
|
||||
maxDrain -= aeFluidStack.getFluidStack().amount;
|
||||
doBreak = false;
|
||||
this.itemToSend -= aeFluidStack.getFluidStack().amount;
|
||||
this.worked = true;
|
||||
}
|
||||
}
|
||||
|
||||
return doBreak;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -173,4 +171,9 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getAdaptorFlags() {
|
||||
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_EXTRACTS;
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
|
||||
int drained = drainedFluid != null ? drainedFluid.amount : 0;
|
||||
|
||||
if (drained > 0) {
|
||||
if (doDrain && drained > 0) {
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return drain(null, maxDrain, true, true);
|
||||
return drain(null, maxDrain, doDrain, true);
|
||||
}
|
||||
|
||||
public int fill(FluidStack fluid, boolean doFill, boolean findMainTank) {
|
||||
@@ -131,7 +131,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
int filled = this.tank.fill(fluid, doFill);
|
||||
|
||||
if (filled > 0) {
|
||||
if (doFill && filled > 0) {
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import com.glodblock.github.network.CPacketValueConfig;
|
||||
import com.glodblock.github.util.UltraTerminalModes;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
@@ -24,13 +26,43 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class KeybindLoader implements Runnable {
|
||||
|
||||
public static KeyBinding openTerminal;
|
||||
public static KeyBinding openCraftingTerminal;
|
||||
public static KeyBinding openLevelTerminal;
|
||||
public static KeyBinding openInterfaceTerminal;
|
||||
public static KeyBinding openPatternTerminal;
|
||||
public static KeyBinding openPatternExTerminal;
|
||||
public static KeyBinding restock;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
openTerminal = new KeyBinding(FluidCraft.MODID + ".key.OpenTerminal", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
|
||||
openCraftingTerminal = new KeyBinding(
|
||||
FluidCraft.MODID + ".key.OpenCraftingTerminal",
|
||||
Keyboard.CHAR_NONE,
|
||||
"itemGroup.ae2fc");
|
||||
openLevelTerminal = new KeyBinding(
|
||||
FluidCraft.MODID + ".key.OpenLevelTerminal",
|
||||
Keyboard.CHAR_NONE,
|
||||
"itemGroup.ae2fc");
|
||||
openInterfaceTerminal = new KeyBinding(
|
||||
FluidCraft.MODID + ".key.OpenInterfaceTerminal",
|
||||
Keyboard.CHAR_NONE,
|
||||
"itemGroup.ae2fc");
|
||||
openPatternTerminal = new KeyBinding(
|
||||
FluidCraft.MODID + ".key.OpenPatternTerminal",
|
||||
Keyboard.CHAR_NONE,
|
||||
"itemGroup.ae2fc");
|
||||
openPatternExTerminal = new KeyBinding(
|
||||
FluidCraft.MODID + ".key.OpenPatternExTerminal",
|
||||
Keyboard.CHAR_NONE,
|
||||
"itemGroup.ae2fc");
|
||||
restock = new KeyBinding(FluidCraft.MODID + ".key.Restock", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
|
||||
ClientRegistry.registerKeyBinding(openTerminal);
|
||||
ClientRegistry.registerKeyBinding(openCraftingTerminal);
|
||||
ClientRegistry.registerKeyBinding(openLevelTerminal);
|
||||
ClientRegistry.registerKeyBinding(openInterfaceTerminal);
|
||||
ClientRegistry.registerKeyBinding(openPatternTerminal);
|
||||
ClientRegistry.registerKeyBinding(openPatternExTerminal);
|
||||
ClientRegistry.registerKeyBinding(restock);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
@@ -38,29 +70,40 @@ public class KeybindLoader implements Runnable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event) {
|
||||
if (openTerminal.isPressed()) {
|
||||
handleOpenTerminalKey();
|
||||
} else if (restock.isPressed()) {
|
||||
handleRestockKey();
|
||||
}
|
||||
handleKeybindings();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(InputEvent.MouseInputEvent event) {
|
||||
handleKeybindings();
|
||||
}
|
||||
|
||||
private void handleKeybindings() {
|
||||
if (openTerminal.isPressed()) {
|
||||
handleOpenTerminalKey();
|
||||
handleOpenTerminalKey(null);
|
||||
} else if (openCraftingTerminal.isPressed()) {
|
||||
handleOpenTerminalKey(UltraTerminalModes.CRAFTING);
|
||||
} else if (openLevelTerminal.isPressed()) {
|
||||
handleOpenTerminalKey(UltraTerminalModes.LEVEL);
|
||||
} else if (openInterfaceTerminal.isPressed()) {
|
||||
handleOpenTerminalKey(UltraTerminalModes.INTERFACE);
|
||||
} else if (openPatternTerminal.isPressed()) {
|
||||
handleOpenTerminalKey(UltraTerminalModes.PATTERN);
|
||||
} else if (openPatternExTerminal.isPressed()) {
|
||||
handleOpenTerminalKey(UltraTerminalModes.PATTERN_EX);
|
||||
} else if (restock.isPressed()) {
|
||||
handleRestockKey();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleOpenTerminalKey() {
|
||||
private void handleOpenTerminalKey(UltraTerminalModes mode) {
|
||||
if (Minecraft.getMinecraft().currentScreen != null) return;
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
ImmutablePair<Integer, ItemStack> temp = Util.getUltraWirelessTerm(player);
|
||||
if (temp == null) return;
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(null, true));
|
||||
if (mode != null) ItemWirelessUltraTerminal.setMode(temp.getRight(), mode);
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(mode, true));
|
||||
}
|
||||
|
||||
private void handleRestockKey() {
|
||||
|
||||
@@ -115,7 +115,7 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
}
|
||||
}
|
||||
case MAGNET_OPEN_FILTER -> {
|
||||
final PrimaryGui pGui = abc.getPrimaryGui();
|
||||
final PrimaryGui pGui = abc.createPrimaryGui();
|
||||
final int nextGui = abc.getSwitchAbleGuiNext();
|
||||
|
||||
InventoryHandler.openGui(
|
||||
|
||||
@@ -120,7 +120,7 @@ public class CPacketLevelTerminalCommands implements IMessage {
|
||||
|
||||
if (Objects.requireNonNull(message.action) == Action.EDIT) {
|
||||
if (player.openContainer instanceof AEBaseContainer abc) {
|
||||
final PrimaryGui pGui = abc.getPrimaryGui();
|
||||
final PrimaryGui pGui = abc.createPrimaryGui();
|
||||
|
||||
TileEntity tile = DimensionManager.getWorld(message.dim)
|
||||
.getTileEntity(message.x, message.y, message.z);
|
||||
@@ -150,7 +150,7 @@ public class CPacketLevelTerminalCommands implements IMessage {
|
||||
}
|
||||
} else if (Objects.requireNonNull(message.action) == Action.RENAME) {
|
||||
if (player.openContainer instanceof AEBaseContainer abc) {
|
||||
final PrimaryGui pGui = abc.getPrimaryGui();
|
||||
final PrimaryGui pGui = abc.createPrimaryGui();
|
||||
|
||||
TileEntity tile = DimensionManager.getWorld(message.dim)
|
||||
.getTileEntity(message.x, message.y, message.z);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class CPacketSwitchGuis implements IMessage {
|
||||
}
|
||||
} else {
|
||||
if (cont instanceof AEBaseContainer aeBaseContainer) {
|
||||
final PrimaryGui pGui = aeBaseContainer.getPrimaryGui();
|
||||
final PrimaryGui pGui = aeBaseContainer.createPrimaryGui();
|
||||
ContainerOpenContext context = aeBaseContainer.getOpenContext();
|
||||
if (context == null) return null;
|
||||
TileEntity te = context.getTile();
|
||||
|
||||
@@ -219,6 +219,11 @@ ae2fc.gui.color.StateError=FFFF5555
|
||||
error.unknown=Unknown
|
||||
|
||||
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
|
||||
ae2fc.key.OpenCraftingTerminal=Open Wireless Universal Crafting Terminal
|
||||
ae2fc.key.OpenLevelTerminal=Open Wireless Universal Level Terminal
|
||||
ae2fc.key.OpenInterfaceTerminal=Open Wireless Universal Interface Terminal
|
||||
ae2fc.key.OpenPatternTerminal=Open Wireless Universal Pattern Terminal
|
||||
ae2fc.key.OpenPatternExTerminal=Open Wireless Universal Processing Pattern Terminal
|
||||
ae2fc.key.Restock=Toggle Restock
|
||||
|
||||
itemGroup.ae2fc=Fluid Craft For AE2
|
||||
|
||||
Reference in new issue
Block a user