mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 13:30:04 +00:00
Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e62215f02b | ||
|
|
f4c6d8a3f0 | ||
|
|
72a068b6d6 | ||
|
|
58cdd446a7 | ||
|
|
af032179f6 | ||
|
|
9732625ced | ||
|
|
f23d792b91 | ||
|
|
f6c3227cd9 | ||
|
|
20f03a8e9f | ||
|
|
341f1d9236 | ||
|
|
0f68feb0be | ||
|
|
300bb445e2 | ||
|
|
4cf54e7658 | ||
|
|
95dad4d305 | ||
|
|
f24e014bd7 | ||
|
|
ac4bfc9411 | ||
|
|
f8b19c7e16 | ||
|
|
f6b5ab03f1 | ||
|
|
90031e2fc8 | ||
|
|
93688313e6 | ||
|
|
b95dc4df18 | ||
|
|
d650636479 | ||
|
|
2e6bfe6aac | ||
|
|
219f8c313a | ||
|
|
0d5f682d3a | ||
|
|
adee911b77 | ||
|
|
8909e28ea3 | ||
|
|
0207ffe430 | ||
|
|
3bb08974ce |
No files matched your search
+11
-12
@@ -34,30 +34,29 @@
|
||||
* 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.33-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-738-GTNh-pre:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.48-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-775-GTNH:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.9.7:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.0:dev")
|
||||
api('com.github.GTNewHorizons:waila:1.9.15:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.41:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.8-pre:dev") {
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.12:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-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.3:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.101-pre:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.4:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.12:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.179: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.4-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.11:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.9-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.18-GTNH:dev') { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev")
|
||||
}
|
||||
+8
-1
@@ -43,6 +43,10 @@ developmentEnvironmentUserName = Developer
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = true
|
||||
@@ -104,7 +108,7 @@ mixinsPackage =
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass = coremod.FluidCraftCore
|
||||
coreModClass =
|
||||
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
@@ -209,3 +213,6 @@ curseForgeRelations =
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.7'
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@ import static com.glodblock.github.inventory.item.WirelessMagnet.modeKey;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiFCImgButton;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
@@ -24,6 +26,8 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
|
||||
|
||||
public static String restockItems = "restock";
|
||||
|
||||
private ItemStack terminal;
|
||||
|
||||
private GuiFCImgButton CraftingTerminal;
|
||||
private GuiFCImgButton PatternTerminal;
|
||||
private GuiFCImgButton InterfaceTerminal;
|
||||
@@ -45,6 +49,10 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
|
||||
|
||||
private int offset;
|
||||
|
||||
public UltraTerminalButtons(ItemStack terminal) {
|
||||
this.terminal = terminal;
|
||||
}
|
||||
|
||||
public void initCustomButtons(int guiLeft, int guiTop, int xSize, int ySize, int xOffset, int yOffset,
|
||||
List<GuiButton> buttonList) {
|
||||
this.offset = yOffset;
|
||||
@@ -93,16 +101,21 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
|
||||
@Override
|
||||
public boolean actionPerformedCustomButtons(final GuiButton btn) {
|
||||
if (btn instanceof GuiFCImgButton) {
|
||||
UltraTerminalModes mode = null;
|
||||
if (btn == this.CraftingTerminal) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.CRAFTING, true));
|
||||
mode = UltraTerminalModes.CRAFTING;
|
||||
} else if (btn == this.PatternTerminal) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.PATTERN, true));
|
||||
mode = UltraTerminalModes.PATTERN;
|
||||
} else if (btn == this.InterfaceTerminal) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.INTERFACE, true));
|
||||
mode = UltraTerminalModes.INTERFACE;
|
||||
} else if (btn == this.LevelTerminal) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.LEVEL, true));
|
||||
mode = UltraTerminalModes.LEVEL;
|
||||
} else if (btn == this.PatternTerminalEx) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.PATTERN_EX, true));
|
||||
mode = UltraTerminalModes.PATTERN_EX;
|
||||
}
|
||||
if (mode != null) {
|
||||
ItemWirelessUltraTerminal.setMode(this.terminal, mode);
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(mode, true));
|
||||
}
|
||||
|
||||
if (btn == this.magnetOff || btn == this.magnetME || btn == this.magnetInv) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
new GuiFCImgButton(guiLeft + 105 + 47, guiTop + 17 + 19 * i, "SUBMIT", "SUBMIT", false),
|
||||
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "ENABLE", "ENABLE", false),
|
||||
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "DISABLE", "DISABLE", false),
|
||||
new FCGuiLineField(fontRendererObj, guiLeft + 47, guiTop + 33 + 19 * i, 125),
|
||||
new FCGuiLineField(fontRendererObj, guiLeft + 47, guiTop + 33 + 19 * i, 120),
|
||||
this.buttonList,
|
||||
this.cont);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -17,10 +17,9 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.render.tank.ModelCertusTank;
|
||||
import com.glodblock.github.common.item.ItemCertusQuartzTank;
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
|
||||
@@ -35,7 +34,7 @@ public class ItemCertusQuartzTankRender implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type != ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,31 +48,32 @@ public class ItemCertusQuartzTankRender implements IItemRenderer {
|
||||
.bindTexture(FluidCraft.resource("textures/blocks/certus_quartz_tank/map.png"));
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(1, -1, -1);
|
||||
this.model.render(0.0625f);
|
||||
GL11.glScalef(1, -1, 1);
|
||||
this.model.render(0.0625f);
|
||||
if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
if (item != null && item.hasTagCompound()) {
|
||||
FluidStack storedFluid = FluidStack
|
||||
.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity"));
|
||||
int tankCapacity = 32000;
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
this.model.render(0.0625f);
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
|
||||
if (item.getItem() instanceof ItemCertusQuartzTank itemCertusQuartzTank) {
|
||||
FluidStack storedFluid = itemCertusQuartzTank.getFluid(item);
|
||||
int tankCapacity = itemCertusQuartzTank.getCapacity(item);
|
||||
|
||||
if (storedFluid != null && storedFluid.getFluid() != null) {
|
||||
IIcon fluidIcon = storedFluid.getFluid().getIcon();
|
||||
if (fluidIcon == null) fluidIcon = FluidRegistry.LAVA.getIcon();
|
||||
if (ModAndClassUtil.HODGEPODGE && fluidIcon instanceof IPatchedTextureAtlasSprite) {
|
||||
((IPatchedTextureAtlasSprite) fluidIcon).markNeedsAnimationUpdate();
|
||||
}
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
RenderBlocks renderer = new RenderBlocks();
|
||||
GL11.glScalef(1, 1, -1);
|
||||
Block waterBlock = FluidRegistry.WATER.getBlock();
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
renderer.setRenderBounds(
|
||||
0.08F,
|
||||
0.001F,
|
||||
@@ -81,9 +81,12 @@ public class ItemCertusQuartzTankRender implements IItemRenderer {
|
||||
0.92F,
|
||||
(float) storedFluid.amount / (float) tankCapacity * 0.999F,
|
||||
0.92F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
Block waterBlock = FluidRegistry.WATER.getBlock();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(
|
||||
(storedFluid.getFluid().getColor() >> 16 & 0xFF) / 255.0F,
|
||||
|
||||
@@ -13,9 +13,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -46,16 +44,9 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
FluidStack fluid = ItemFluidPacket.getFluidStack(item);
|
||||
int RGB = 0xFFFFFF;
|
||||
if (fluid != null) {
|
||||
RGB = fluid.getFluid().getColor(fluid);
|
||||
}
|
||||
int RGB = fluid == null ? 0xFFFFFF : fluid.getFluid().getColor(fluid);
|
||||
IIcon icon = fluid == null ? FluidRegistry.WATER.getStillIcon() : fluid.getFluid().getStillIcon();
|
||||
|
||||
if (ModAndClassUtil.HODGEPODGE && icon instanceof IPatchedTextureAtlasSprite) {
|
||||
((IPatchedTextureAtlasSprite) icon).markNeedsAnimationUpdate();
|
||||
}
|
||||
|
||||
if (RGB != 0xFFFFFF) {
|
||||
GL11.glColor3f((RGB >> 16 & 0xFF) / 255.0F, (RGB >> 8 & 0xFF) / 255.0F, (RGB & 0xFF) / 255.0F);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ public class ModelCertusTank extends ModelBase {
|
||||
this.textureHeight = 64;
|
||||
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(0F, 0F, 0F, 14, 16, 14);
|
||||
this.Shape1.setRotationPoint(-7F, -8F, -7F);
|
||||
this.Shape1.addBox(-7F, -8F, -7F, 14, 16, 14);
|
||||
this.Shape1.setTextureSize(this.textureWidth, this.textureHeight);
|
||||
this.Shape1.mirror = true;
|
||||
setRotation(this.Shape1, 0F, 0F, 0F);
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -16,6 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import com.glodblock.github.common.item.ItemCertusQuartzTank;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
@@ -105,67 +107,107 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer entityplayer, int blockID,
|
||||
float offsetX, float offsetY, float offsetZ) {
|
||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float offsetX,
|
||||
float offsetY, float offsetZ) {
|
||||
ItemStack itemInHand = player.inventory.getCurrentItem();
|
||||
|
||||
if (entityplayer.isSneaking() && current != null) {
|
||||
if (current.getItem() instanceof IAEWrench
|
||||
&& ((IAEWrench) current.getItem()).canWrench(current, entityplayer, x, y, z)) {
|
||||
if (itemInHand == null || itemInHand.getItem() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In case if we're holding a IFluidContainerItem which is also a block we'll just allow to place a block
|
||||
// instead of trying to fill or drain it. In other cases we don't need to handle blocks either way
|
||||
if (itemInHand.getItem() instanceof ItemBlock) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isSneaking()) {
|
||||
if (itemInHand.getItem() instanceof IAEWrench wrench && wrench.canWrench(itemInHand, player, x, y, z)) {
|
||||
dropBlockAsItem(worldObj, x, y, z, getDropWithNBT(worldObj, x, y, z));
|
||||
worldObj.setBlockToAir(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (current != null) {
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if (liquid != null) {
|
||||
int amountFilled = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
if (amountFilled != 0 && !entityplayer.capabilities.isCreativeMode && current.getItem() != null) {
|
||||
ItemStack empty;
|
||||
if (FluidContainerRegistry.isContainer(current)) {
|
||||
empty = FluidContainerRegistry.drainFluidContainer(current);
|
||||
} else {
|
||||
// Try this as a fallback.
|
||||
entityplayer.inventory.addItemStackToInventory(current.getItem().getContainerItem(current));
|
||||
empty = current.getItem().getContainerItem(current);
|
||||
}
|
||||
if (current.stackSize > 1) {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem].stackSize -= 1;
|
||||
entityplayer.inventory.addItemStackToInventory(empty);
|
||||
} else {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = empty;
|
||||
}
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) worldObj.getTileEntity(x, y, z);
|
||||
boolean isCreativeMode = player.capabilities.isCreativeMode;
|
||||
|
||||
if (FluidContainerRegistry.isFilledContainer(itemInHand)) {
|
||||
// Fill the tank from the container in hand
|
||||
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(itemInHand);
|
||||
|
||||
if (fluid == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int amountFilled = tank.fill(ForgeDirection.UNKNOWN, fluid, true);
|
||||
if (amountFilled > 0 && !isCreativeMode) {
|
||||
ItemStack empty = FluidContainerRegistry.drainFluidContainer(itemInHand);
|
||||
replaceItemInInventory(worldObj, player, itemInHand, empty);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (FluidContainerRegistry.isEmptyContainer(itemInHand)) {
|
||||
// Fill the container in hand from the tank
|
||||
FluidStack available = tank.getTankInfo(true)[0].fluid;
|
||||
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, itemInHand);
|
||||
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(filled);
|
||||
|
||||
if (fluid == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
tank.drain(ForgeDirection.UNKNOWN, fluid.amount, true);
|
||||
if (!isCreativeMode) {
|
||||
replaceItemInInventory(worldObj, player, itemInHand, filled);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (itemInHand.getItem() instanceof IFluidContainerItem) {
|
||||
ItemStack singleContainerItem = itemInHand.copy();
|
||||
singleContainerItem.stackSize = 1;
|
||||
|
||||
IFluidContainerItem fluidContainer = (IFluidContainerItem) singleContainerItem.getItem();
|
||||
assert fluidContainer != null;
|
||||
|
||||
FluidStack fluid = fluidContainer.getFluid(itemInHand);
|
||||
|
||||
if (fluid != null && fluid.amount > 0) {
|
||||
// Fill the tank from the container in hand
|
||||
int filled = tank.fill(ForgeDirection.UNKNOWN, fluid, true);
|
||||
if (filled > 0 && !isCreativeMode) {
|
||||
fluidContainer.drain(singleContainerItem, filled, true);
|
||||
replaceItemInInventory(worldObj, player, itemInHand, singleContainerItem);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
|
||||
if (available != null) {
|
||||
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current);
|
||||
|
||||
liquid = FluidContainerRegistry.getFluidForFilledItem(filled);
|
||||
|
||||
if (liquid != null) {
|
||||
tank.drain(ForgeDirection.UNKNOWN, liquid.amount, true);
|
||||
if (!entityplayer.capabilities.isCreativeMode) {
|
||||
if (current.stackSize == 1) {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = filled;
|
||||
} else {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem].stackSize--;
|
||||
if (!entityplayer.inventory.addItemStackToInventory(filled))
|
||||
entityplayer.entityDropItem(filled, 0);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// Fill the container in hand from the tank
|
||||
int containerCapacity = fluidContainer.getCapacity(itemInHand);
|
||||
FluidStack drained = tank.drain(ForgeDirection.UNKNOWN, containerCapacity, true);
|
||||
if (drained != null && drained.amount > 0 && !isCreativeMode) {
|
||||
fluidContainer.fill(singleContainerItem, drained, true);
|
||||
replaceItemInInventory(worldObj, player, itemInHand, singleContainerItem);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void replaceItemInInventory(World world, EntityPlayer player, ItemStack item, ItemStack replacement) {
|
||||
if (item.stackSize > 1) {
|
||||
item.stackSize--;
|
||||
// This method meant to be called both from client and server side, and trying to drop an item
|
||||
// from the client side would create a doubled ghost item, so we don't allow to do that
|
||||
if (!player.inventory.addItemStackToInventory(replacement) && !world.isRemote) {
|
||||
player.entityDropItem(replacement, 0);
|
||||
}
|
||||
} else {
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, replacement);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -211,10 +253,10 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = worldIn.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileCertusQuartzTank tileCertusQuartzTank) {
|
||||
FluidTankInfo[] info = tileCertusQuartzTank.getTankInfo(false);
|
||||
if (info[0].fluid != null) {
|
||||
int nonEmptyBump = info[0].fluid.amount > 0 ? 1 : 0;
|
||||
return (int) (14.0 * info[0].fluid.amount / info[0].capacity) + nonEmptyBump;
|
||||
FluidTankInfo info = tileCertusQuartzTank.getTankInfo(false)[0];
|
||||
if (info.fluid != null) {
|
||||
int nonEmptyBump = info.fluid.amount > 0 ? 1 : 0;
|
||||
return (int) (14.0 * info.fluid.amount / info.capacity) + nonEmptyBump;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidDiscretizer;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
|
||||
public BlockFluidDiscretizer() {
|
||||
super(Material.iron, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
setFullBlock(true);
|
||||
setOpaque(true);
|
||||
setTileEntity(TileFluidDiscretizer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidDiscretizer register() {
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
GameRegistry.registerTileEntity(TileFluidDiscretizer.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.addAll(RenderUtil.listFormattedStringToWidth(NameConst.i18n(NameConst.TT_FLUID_DISCRETIZER_DESC)));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.google.common.base.Optional;
|
||||
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.items.AEBaseCell;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class FCBaseItemCell extends AEBaseCell {
|
||||
|
||||
@@ -46,4 +47,20 @@ public abstract class FCBaseItemCell extends AEBaseCell {
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCellData(ItemStack is) {
|
||||
return totalBytes + ","
|
||||
+ this.getTotalTypes(null)
|
||||
+ ","
|
||||
+ perType
|
||||
+ ","
|
||||
+ 8 * 256
|
||||
+ ","
|
||||
+ Platform.openNbtData(is).getByte("cellRestrictionTypes")
|
||||
+ ","
|
||||
+ Platform.openNbtData(is).getLong("cellRestrictionAmount")
|
||||
+ ","
|
||||
+ "fluid";
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -100,6 +101,7 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
public static UltraTerminalModes getMode(ItemStack is) {
|
||||
Item item = is.getItem();
|
||||
if (item instanceof ItemWirelessUltraTerminal) {
|
||||
if (!is.hasTagCompound()) is.setTagCompound(new NBTTagCompound());
|
||||
return UltraTerminalModes.values()[is.getTagCompound().getInteger(MODE)];
|
||||
} else if (item instanceof ItemWirelessPatternTerminal) {
|
||||
return UltraTerminalModes.PATTERN;
|
||||
@@ -144,4 +146,16 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
if (wh == null) return null;
|
||||
return new WirelessTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInfinityPower(ItemStack is) {
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
return data != null && data.hasKey(infinityEnergyCard) && data.getBoolean(infinityEnergyCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInfinityRange(ItemStack is) {
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
return data != null && data.hasKey(infinityBoosterCard) && data.getBoolean(infinityBoosterCard);
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class ItemFluidLevelEmitter extends FCBaseItem implements IPartItem {
|
||||
@Override
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
|
||||
final boolean displayMoreInfo) {
|
||||
lines.add("Deprecated, use regular level emitter, hold CTRL for get fluid of container.");
|
||||
lines.add("§4Deprecated, use regular level emitter, hold CTRL for get fluid of container.");
|
||||
super.addInformation(stack, player, lines, displayMoreInfo);
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,6 @@ public class ItemPartFluidPatternTerminal extends FCBaseItem implements IPartIte
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
|
||||
toolTip.add("DEPRECATED!");
|
||||
toolTip.add("§4DEPRECATED!");
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,6 @@ public class ItemPartFluidPatternTerminalEx extends FCBaseItem implements IPartI
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
|
||||
toolTip.add("DEPRECATED!");
|
||||
toolTip.add("§4DEPRECATED!");
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class ItemPartFluidTerminal extends FCBaseItem implements IPartItem {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
|
||||
toolTip.add("DEPRECATED!");
|
||||
toolTip.add("§4DEPRECATED!");
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_FLUID_TERMINAL));
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -38,4 +39,10 @@ public class ItemWirelessFluidTerminal extends ItemBaseWirelessTerminal
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines,
|
||||
boolean displayMoreInfo) {
|
||||
lines.add("§4DEPRECATED!");
|
||||
super.addCheckedInformation(stack, player, lines, displayMoreInfo);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,6 @@ public class ItemWirelessInterfaceTerminal extends ItemBaseWirelessTerminal
|
||||
public IGuiItemObject getGuiObject(ItemStack is, World world, EntityPlayer p, int x, int y, int z) {
|
||||
final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler(is);
|
||||
if (wh == null) return null;
|
||||
return new WirelessInterfaceTerminalGuiObject(wh, is);
|
||||
return new WirelessInterfaceTerminalGuiObject(wh, is, x);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import static appeng.util.Platform.baublesSlotsOffset;
|
||||
import static appeng.util.Platform.itemGuiSlotOffset;
|
||||
import static appeng.util.Platform.nextEnum;
|
||||
import static com.glodblock.github.util.Util.GuiHelper.decodeInvType;
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
@@ -130,7 +129,9 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
if (terminal == null) return;
|
||||
if (mode != null) setMode(terminal, mode);
|
||||
else mode = getMode(terminal);
|
||||
openGui(terminal, player.worldObj, player, mode, term.getLeft());
|
||||
|
||||
if (AEApi.instance().registries().wireless().performCheck(terminal, player))
|
||||
openGui(terminal, player.worldObj, player, mode, term.getLeft());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,9 +166,8 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
null,
|
||||
null,
|
||||
aeGui,
|
||||
invSlotPair.getLeft() == Util.GuiHelper.InvType.PLAYER_INV
|
||||
? slotIndex
|
||||
: invSlotPair.getRight() + baublesSlotsOffset);
|
||||
invSlotPair.getLeft() == Util.GuiHelper.InvType.PLAYER_INV ? slotIndex
|
||||
: invSlotPair.getRight() + baublesSlotsOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -219,13 +219,13 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
return switch (y != Integer.MIN_VALUE ? UltraTerminalModes.values()[y] : getMode(is)) {
|
||||
case CRAFTING -> new WirelessCraftingTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case PATTERN, PATTERN_EX -> new WirelessPatternTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case INTERFACE -> new WirelessInterfaceTerminalGuiObject(wh, is);
|
||||
case INTERFACE -> new WirelessInterfaceTerminalGuiObject(wh, is, x);
|
||||
default -> super.getGuiObject(is, world, p, x, y, z);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICustomButtonDataObject getCustomDataObject(ICustomButtonProvider provider) {
|
||||
return new UltraTerminalButtons();
|
||||
return new UltraTerminalButtons(((IGuiItemObject) provider).getItemStack());
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,11 @@ public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
|
||||
return FCPartsTexture.PartFluidExportBus.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getAdaptorFlags() {
|
||||
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_INSERTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateAmountToSend() {
|
||||
double amount = 1000D;
|
||||
|
||||
@@ -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> {
|
||||
@@ -95,15 +96,14 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
final IMEMonitor<IAEFluidStack> inv, final IEnergySource energy, final FuzzyMode fzMode) {
|
||||
if (myTarget instanceof IFluidHandler fh) {
|
||||
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
|
||||
if (tanksInfo == null) return false;
|
||||
|
||||
int maxDrain = this.calculateAmountToSend();
|
||||
boolean drained = false;
|
||||
if (tanksInfo == null) return 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,19 +112,17 @@ 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;
|
||||
drained = true;
|
||||
this.itemToSend -= aeFluidStack.getFluidStack().amount;
|
||||
this.worked = true;
|
||||
}
|
||||
}
|
||||
|
||||
return drained;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,4 +171,9 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getAdaptorFlags() {
|
||||
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_EXTRACTS;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.parts.automation.PartLevelEmitter;
|
||||
|
||||
@@ -11,4 +16,14 @@ public class PartFluidLevelEmitter extends PartLevelEmitter {
|
||||
public PartFluidLevelEmitter(final ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
|
||||
final IAEStack<?> aes = this.getAEInventoryByName(null).getAEStackInSlot(0);
|
||||
if (aes instanceof IAEItemStack ais && ais.getItem() instanceof ItemFluidPacket) {
|
||||
this.getAEInventoryByName(null).putAEStackInSlot(0, ItemFluidPacket.getFluidAEStack(ais));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import appeng.helpers.ICustomButtonProvider;
|
||||
import appeng.parts.p2p.PartP2PInterface;
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ public class FluidCraftingTabs extends CreativeTabs {
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return ItemAndBlockHolder.DISCRETIZER.stack().getItem();
|
||||
return ItemAndBlockHolder.WALRUS.stack().getItem();
|
||||
}
|
||||
}
|
||||
@@ -33,42 +33,61 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
return tankFluid == null || tankFluid.amount == 0 ? 0 : tankFluid.getFluid().getLuminosity(tankFluid);
|
||||
}
|
||||
|
||||
public FluidStack drain(FluidStack fluid, boolean doDrain, boolean findMainTank) {
|
||||
if (fluid == null || this.getFluid() == null || this.getFluid() != fluid.getFluid()) {
|
||||
public FluidStack drain(Fluid fluid, int amount, boolean doDrain, boolean findMainTank) {
|
||||
if (fluid != null && this.getFluid() != fluid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (findMainTank) {
|
||||
// Main tank is the highest tank in the column with desired fluid
|
||||
TileCertusQuartzTank mainTank = this;
|
||||
TileCertusQuartzTank tankAbove;
|
||||
|
||||
while ((tankAbove = mainTank.getTankAbove()) != null) {
|
||||
// We can't drain tank with different or null fluid
|
||||
if (fluid.getFluid() != tankAbove.getFluid()) {
|
||||
break;
|
||||
if (this.tank.getFluid() != null) {
|
||||
// Current tank has a fluid, searching for the highest tank with this fluid
|
||||
TileCertusQuartzTank tankAbove;
|
||||
while ((tankAbove = mainTank.getTankAbove()) != null) {
|
||||
// We can't drain tank with different or null fluid
|
||||
if (tankAbove.getFluid() == null || mainTank.getFluid() != tankAbove.getFluid()) {
|
||||
break;
|
||||
}
|
||||
mainTank = tankAbove;
|
||||
}
|
||||
} else {
|
||||
// Current tank doesn't have a fluid, searching for the first non-empty tank below
|
||||
TileCertusQuartzTank tankBelow;
|
||||
while ((tankBelow = mainTank.getTankBelow()) != null) {
|
||||
// We can't drain tank with different fluid
|
||||
if (fluid != null && tankBelow.getFluid() != fluid) {
|
||||
break;
|
||||
}
|
||||
mainTank = tankBelow;
|
||||
if (tankBelow.getFluid() != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
mainTank = tankAbove;
|
||||
}
|
||||
|
||||
return mainTank.drain(fluid, doDrain, false);
|
||||
return mainTank.drain(fluid, amount, doDrain, false);
|
||||
}
|
||||
|
||||
FluidStack drainedFluid = this.tank.drain(fluid.amount, doDrain);
|
||||
if (this.getFluid() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
|
||||
int drained = drainedFluid != null ? drainedFluid.amount : 0;
|
||||
|
||||
if (drained > 0) {
|
||||
if (doDrain && drained > 0) {
|
||||
update();
|
||||
}
|
||||
|
||||
if (drained < fluid.amount) {
|
||||
if (drained < amount) {
|
||||
TileCertusQuartzTank tankBelow = this.getTankBelow();
|
||||
if (tankBelow != null) {
|
||||
FluidStack fluidToDrain = new FluidStack(fluid.getFluid(), fluid.amount - drained);
|
||||
FluidStack externallyDrained = tankBelow.drain(fluidToDrain, doDrain, false);
|
||||
FluidStack externallyDrained = tankBelow.drain(this.getFluid(), amount - drained, doDrain, false);
|
||||
|
||||
if (externallyDrained != null) {
|
||||
return new FluidStack(fluid.getFluid(), drained + externallyDrained.amount);
|
||||
return new FluidStack(this.getFluid(), drained + externallyDrained.amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,14 +97,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return drain(resource, doDrain, true);
|
||||
if (resource == null) return null;
|
||||
|
||||
return drain(resource.getFluid(), resource.amount, doDrain, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
if (this.tank.getFluid() == null) return null;
|
||||
|
||||
return drain(from, new FluidStack(this.tank.getFluid(), maxDrain), doDrain);
|
||||
return drain(null, maxDrain, doDrain, true);
|
||||
}
|
||||
|
||||
public int fill(FluidStack fluid, boolean doFill, boolean findMainTank) {
|
||||
@@ -116,7 +135,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
int filled = this.tank.fill(fluid, doFill);
|
||||
|
||||
if (filled > 0) {
|
||||
if (doFill && filled > 0) {
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -174,14 +193,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
}
|
||||
|
||||
final FluidStack tankFluidStack = this.tank.getFluid();
|
||||
final Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
|
||||
Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
|
||||
|
||||
int amount = tankFluidStack == null ? 0 : tankFluidStack.amount;
|
||||
int capacity = this.tank.getCapacity();
|
||||
|
||||
TileCertusQuartzTank tankAbove = this;
|
||||
while ((tankAbove = tankAbove.getTankAbove()) != null) {
|
||||
if (tankAbove.getFluid() == null || mainFluid != tankAbove.getFluid()) {
|
||||
if (tankAbove.getFluid() != null && mainFluid != tankAbove.getFluid()) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -192,7 +211,10 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
TileCertusQuartzTank tankBelow = this;
|
||||
while ((tankBelow = tankBelow.getTankBelow()) != null) {
|
||||
if (mainFluid == null || mainFluid != tankBelow.getFluid()) {
|
||||
if (mainFluid == null && tankBelow.getFluid() != null) {
|
||||
mainFluid = tankBelow.getFluid();
|
||||
}
|
||||
if (mainFluid != tankBelow.getFluid()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
public class TileFluidDiscretizer extends AENetworkTile {
|
||||
|
||||
public TileFluidDiscretizer() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -255,24 +255,24 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) {
|
||||
switch (mc) {
|
||||
case setInventorySlotContents -> {
|
||||
if (added != null) {
|
||||
if (inv == cell) {
|
||||
if (inv == cell) {
|
||||
if (added != null) {
|
||||
if (added.getItem() instanceof ItemBasicStorageCell ibsc) {
|
||||
totalBytes = ibsc.getBytesLong(added);
|
||||
} else if (added.getItem() instanceof FCBaseItemCell fcbic) {
|
||||
totalBytes = fcbic.getBytes(added);
|
||||
}
|
||||
getProxy().setIdlePowerUsage(Math.sqrt(Math.pow(totalBytes, 0.576D)));
|
||||
} else if (inv == invItems) {
|
||||
storedItemCount += added.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
if (removed != null) {
|
||||
if (inv == cell) {
|
||||
} else if (removed != null) {
|
||||
totalBytes = 0;
|
||||
getProxy().setIdlePowerUsage(4d);
|
||||
} else if (inv == invItems) {
|
||||
}
|
||||
} else if (inv == invItems) {
|
||||
if (added != null) {
|
||||
storedItemCount += added.stackSize;
|
||||
}
|
||||
|
||||
if (removed != null) {
|
||||
storedItemCount -= removed.stackSize;
|
||||
}
|
||||
}
|
||||
@@ -282,11 +282,12 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
|
||||
totalBytes = 0;
|
||||
getProxy().setIdlePowerUsage(4d);
|
||||
}
|
||||
|
||||
if (inv == invItems) {
|
||||
storedItemCount -= removed.stackSize;
|
||||
}
|
||||
}
|
||||
case markDirty -> {}
|
||||
case markDirty -> markDirty();
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.glodblock.github.coremod;
|
||||
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
|
||||
import com.glodblock.github.coremod.transform.ExternalStorageRegistryTransformer;
|
||||
import com.glodblock.github.coremod.transform.GuiCraftingTransformer;
|
||||
import com.glodblock.github.coremod.transform.NEITransformer;
|
||||
import com.gtnewhorizon.gtnhlib.asm.ASMUtil;
|
||||
|
||||
public class FCClassTransformer implements IClassTransformer {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger("ASM AE2FC");
|
||||
|
||||
@Override
|
||||
public byte[] transform(String name, String transformedName, byte[] basicClass) {
|
||||
ClassMapper tform;
|
||||
switch (transformedName) {
|
||||
case "appeng.client.gui.implementations.GuiCraftingCPU", "appeng.client.gui.implementations.GuiCraftConfirm", "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm", "appeng.client.gui.widgets.GuiCraftingTree" -> tform = GuiCraftingTransformer.INSTANCE;
|
||||
case "appeng.integration.modules.NEI" -> tform = NEITransformer.INSTANCE;
|
||||
case "appeng.core.features.registries.ExternalStorageRegistry" -> tform = ExternalStorageRegistryTransformer.INSTANCE;
|
||||
default -> {
|
||||
return basicClass;
|
||||
}
|
||||
}
|
||||
logger.debug("Transforming class: " + transformedName);
|
||||
final byte[] bytes = tform.transformClass(basicClass);
|
||||
if (FluidCraftCore.DUMP_CLASSES()) {
|
||||
ASMUtil.saveAsRawClassFile(basicClass, transformedName + "_PRE", this);
|
||||
ASMUtil.saveAsRawClassFile(bytes, transformedName + "_POST", this);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public abstract static class ClassMapper {
|
||||
|
||||
public final byte[] transformClass(byte[] code) {
|
||||
ClassReader reader = new ClassReader(code);
|
||||
ClassWriter writer = new ClassWriter(reader, getWriteFlags());
|
||||
reader.accept(getClassMapper(writer), ClassReader.EXPAND_FRAMES);
|
||||
return writer.toByteArray();
|
||||
}
|
||||
|
||||
protected int getWriteFlags() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract ClassVisitor getClassMapper(ClassVisitor downstream);
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.glodblock.github.coremod;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
||||
|
||||
@IFMLLoadingPlugin.Name("FluidCraftCore")
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
@IFMLLoadingPlugin.TransformerExclusions("com.glodblock.github.coremod")
|
||||
public class FluidCraftCore implements IFMLLoadingPlugin {
|
||||
|
||||
private static final boolean DUMP_CLASSES = Boolean.parseBoolean(System.getProperty("ae2fc.dumpClass", "false"));
|
||||
private static boolean OBF_ENV;
|
||||
|
||||
@Override
|
||||
public String[] getASMTransformerClass() {
|
||||
return new String[] { FCClassTransformer.class.getName() };
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getModContainerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getSetupClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data) {
|
||||
OBF_ENV = (boolean) data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getAccessTransformerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean DUMP_CLASSES() {
|
||||
return DUMP_CLASSES || !OBF_ENV;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.glodblock.github.coremod.hooker;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.IGuiTooltipHandler;
|
||||
|
||||
public class CoreModHooks {
|
||||
|
||||
public static ItemStack displayFluid(IAEItemStack aeStack) {
|
||||
if (aeStack.getItemStack() != null && aeStack.getItemStack().getItem() instanceof ItemFluidDrop) {
|
||||
FluidStack fluid = ItemFluidDrop.getFluidStack(aeStack.getItemStack());
|
||||
return ItemFluidPacket.newDisplayStack(fluid);
|
||||
} else return aeStack.getItemStack();
|
||||
}
|
||||
|
||||
public static ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
|
||||
if (gui instanceof IGuiTooltipHandler guiTooltipHandler) {
|
||||
return guiTooltipHandler.getHoveredStack();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.glodblock.github.coremod.hooker;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CoreModHooksClient {
|
||||
|
||||
}
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
package com.glodblock.github.coremod.transform;
|
||||
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.Label;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import com.glodblock.github.coremod.FCClassTransformer;
|
||||
|
||||
public class ExternalStorageRegistryTransformer extends FCClassTransformer.ClassMapper {
|
||||
|
||||
public static final ExternalStorageRegistryTransformer INSTANCE = new ExternalStorageRegistryTransformer();
|
||||
|
||||
private ExternalStorageRegistryTransformer() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
|
||||
return new TransformExternalStorageRegistry(Opcodes.ASM5, downstream);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getWriteFlags() {
|
||||
return ClassWriter.COMPUTE_FRAMES;
|
||||
}
|
||||
|
||||
private static class TransformExternalStorageRegistry extends ClassVisitor {
|
||||
|
||||
public TransformExternalStorageRegistry(int api, ClassVisitor cv) {
|
||||
super(api, cv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
if ("getHandler".equals(name)) {
|
||||
return new TransformGetHandler(api, super.visitMethod(access, name, desc, signature, exceptions));
|
||||
} else {
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class TransformGetHandler extends MethodVisitor {
|
||||
|
||||
private int cnt_return = 0;
|
||||
private int cnt_if = 0;
|
||||
private Label L6 = null;
|
||||
private final Label L9 = new Label();
|
||||
|
||||
TransformGetHandler(int api, MethodVisitor mv) {
|
||||
super(api, mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitJumpInsn(int opcode, Label label) {
|
||||
if (opcode == Opcodes.IFEQ) {
|
||||
cnt_if++;
|
||||
}
|
||||
if (cnt_if == 3) {
|
||||
L6 = label;
|
||||
cnt_if++;
|
||||
super.visitJumpInsn(opcode, L9);
|
||||
return;
|
||||
}
|
||||
super.visitJumpInsn(opcode, label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
if (opcode == Opcodes.ARETURN) {
|
||||
cnt_return++;
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
if (cnt_return == 2) {
|
||||
super.visitLabel(L9);
|
||||
super.visitFieldInsn(
|
||||
Opcodes.GETSTATIC,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE",
|
||||
"Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 2);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 3);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 4);
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKEVIRTUAL,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"canHandle",
|
||||
"(Lnet/minecraft/tileentity/TileEntity;Lnet/minecraftforge/common/util/ForgeDirection;Lappeng/api/storage/StorageChannel;Lappeng/api/networking/security/BaseActionSource;)Z",
|
||||
false);
|
||||
super.visitJumpInsn(Opcodes.IFEQ, L6);
|
||||
super.visitFieldInsn(
|
||||
Opcodes.GETSTATIC,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE",
|
||||
"Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitInsn(Opcodes.ARETURN);
|
||||
cnt_return++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.glodblock.github.coremod.transform;
|
||||
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import com.glodblock.github.coremod.FCClassTransformer;
|
||||
|
||||
public class GuiCraftingTransformer extends FCClassTransformer.ClassMapper {
|
||||
|
||||
public static final GuiCraftingTransformer INSTANCE = new GuiCraftingTransformer();
|
||||
|
||||
private GuiCraftingTransformer() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
|
||||
return new TransformGuiCrafting(Opcodes.ASM5, downstream);
|
||||
}
|
||||
|
||||
private static class TransformGuiCrafting extends ClassVisitor {
|
||||
|
||||
TransformGuiCrafting(int api, ClassVisitor cv) {
|
||||
super(api, cv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
if ("drawFG".equals(name) || "drawListFG".equals(name) || "drawStack".equals(name)) {
|
||||
return new TransformFluidIcon(api, super.visitMethod(access, name, desc, signature, exceptions));
|
||||
}
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TransformFluidIcon extends MethodVisitor {
|
||||
|
||||
TransformFluidIcon(int api, MethodVisitor mv) {
|
||||
super(api, mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
|
||||
if (opcode == Opcodes.INVOKEINTERFACE && owner.equals("appeng/api/storage/data/IAEItemStack")
|
||||
&& name.equals("getItemStack")) {
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKESTATIC,
|
||||
"com/glodblock/github/coremod/hooker/CoreModHooks",
|
||||
"displayFluid",
|
||||
"(Lappeng/api/storage/data/IAEItemStack;)Lnet/minecraft/item/ItemStack;",
|
||||
false);
|
||||
} else {
|
||||
super.visitMethodInsn(opcode, owner, name, desc, itf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package com.glodblock.github.coremod.transform;
|
||||
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import com.glodblock.github.coremod.FCClassTransformer;
|
||||
|
||||
public class NEITransformer extends FCClassTransformer.ClassMapper {
|
||||
|
||||
public static final NEITransformer INSTANCE = new NEITransformer();
|
||||
|
||||
private NEITransformer() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
|
||||
return new TransformNEI(Opcodes.ASM5, downstream);
|
||||
}
|
||||
|
||||
private static class TransformNEI extends ClassVisitor {
|
||||
|
||||
TransformNEI(int api, ClassVisitor cv) {
|
||||
super(api, cv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
return switch (name) {
|
||||
case "getStackUnderMouse" -> new TransformStackUnderMouse(
|
||||
api,
|
||||
super.visitMethod(access, name, desc, signature, exceptions));
|
||||
case "shouldShowTooltip" -> new TransformShowTooltip(
|
||||
api,
|
||||
super.visitMethod(access, name, desc, signature, exceptions));
|
||||
default -> super.visitMethod(access, name, desc, signature, exceptions);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static class TransformStackUnderMouse extends MethodVisitor {
|
||||
|
||||
TransformStackUnderMouse(int api, MethodVisitor mv) {
|
||||
super(api, mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
if (opcode == Opcodes.ACONST_NULL) {
|
||||
super.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
super.visitVarInsn(Opcodes.ILOAD, 2);
|
||||
super.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKESTATIC,
|
||||
"com/glodblock/github/coremod/hooker/CoreModHooks",
|
||||
"getStackUnderMouse",
|
||||
"(Lnet/minecraft/client/gui/inventory/GuiContainer;II)Lnet/minecraft/item/ItemStack;",
|
||||
false);
|
||||
return;
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TransformShowTooltip extends MethodVisitor {
|
||||
|
||||
int const_1 = 0;
|
||||
|
||||
TransformShowTooltip(int api, MethodVisitor mv) {
|
||||
super(api, mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
if (opcode == Opcodes.ICONST_1 && const_1 == 2) {
|
||||
super.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKESTATIC,
|
||||
"com/glodblock/github/coremod/hooker/CoreModHooks",
|
||||
"shouldShowTooltip",
|
||||
"(Lnet/minecraft/client/gui/inventory/GuiContainer;)Z",
|
||||
false);
|
||||
const_1++;
|
||||
return;
|
||||
}
|
||||
if (opcode == Opcodes.ICONST_1) {
|
||||
const_1++;
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -20,9 +20,11 @@ public class CertusQuartzTankWailaDataProvider extends BaseWailaDataProvider {
|
||||
TileEntity tileEntity = accessor.getTileEntity();
|
||||
if (tileEntity instanceof TileCertusQuartzTank quartzTank) {
|
||||
FluidTankInfo info = quartzTank.getTankInfo(true)[0];
|
||||
if (info.fluid != null) {
|
||||
currentToolTip
|
||||
.add(Tooltip.fluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
|
||||
if (info.fluid == null) {
|
||||
currentToolTip.add(Tooltip.tankEmptyFormat(info.capacity));
|
||||
} else {
|
||||
currentToolTip.add(
|
||||
Tooltip.tankWithFluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
|
||||
}
|
||||
}
|
||||
return currentToolTip;
|
||||
|
||||
@@ -15,14 +15,18 @@ public class Tooltip {
|
||||
return String.format("%s: %s mB", name, NumberFormat.getInstance().format(amount));
|
||||
}
|
||||
|
||||
public static String fluidFormat(String name, long amount, long capacity) {
|
||||
public static String tankWithFluidFormat(String fluidName, long amount, long capacity) {
|
||||
return String.format(
|
||||
"%s: %s mB / %s mB",
|
||||
name,
|
||||
fluidName,
|
||||
NumberFormat.getInstance().format(amount),
|
||||
NumberFormat.getInstance().format(capacity));
|
||||
}
|
||||
|
||||
public static String tankEmptyFormat(long capacity) {
|
||||
return String.format("0 mB / %s mB", NumberFormat.getInstance().format(capacity));
|
||||
}
|
||||
|
||||
public static String partFluidBusFormat(int amount) {
|
||||
return String
|
||||
.format("%s: %s mB/t", I18n.format(NameConst.WAILA_SPEED), NumberFormat.getInstance().format(amount));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.crossmod.waila;
|
||||
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -26,8 +27,9 @@ public class WailaInit {
|
||||
registrar.registerBodyProvider(tile, AEBaseTile.class);
|
||||
registrar.registerNBTProvider(tile, AEBaseTile.class);
|
||||
|
||||
final IWailaDataProvider certusQuartzTank = new CertusQuartzTankWailaDataProvider();
|
||||
registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class);
|
||||
|
||||
if (!ModAndClassUtil.WAILA_PLUGINS) {
|
||||
final IWailaDataProvider certusQuartzTank = new CertusQuartzTankWailaDataProvider();
|
||||
registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.block.BlockCertusQuartzTank;
|
||||
import com.glodblock.github.common.block.BlockFluidAutoFiller;
|
||||
import com.glodblock.github.common.block.BlockFluidBuffer;
|
||||
import com.glodblock.github.common.block.BlockFluidDiscretizer;
|
||||
import com.glodblock.github.common.block.BlockFluidInterface;
|
||||
import com.glodblock.github.common.block.BlockFluidPacketDecoder;
|
||||
import com.glodblock.github.common.block.BlockFluidPatternEncoder;
|
||||
@@ -54,7 +53,6 @@ public class ItemAndBlockHolder {
|
||||
|
||||
public static BlockCertusQuartzTank CERTUS_QUARTZ_TANK = new BlockCertusQuartzTank().register();
|
||||
public static BlockFluidAutoFiller FLUID_AUTO_FILLER = new BlockFluidAutoFiller().register();
|
||||
public static BlockFluidDiscretizer DISCRETIZER = new BlockFluidDiscretizer().register();
|
||||
public static BlockLevelMaintainer LEVEL_MAINTAINER = new BlockLevelMaintainer().register();
|
||||
public static BlockFluidPatternEncoder ENCODER = new BlockFluidPatternEncoder().register();
|
||||
public static BlockFluidPacketDecoder DECODER = new BlockFluidPacketDecoder().register();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.glodblock.github.loader.ItemAndBlockHolder.CELL64KM;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.CELL_HOUSING;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.CERTUS_QUARTZ_TANK;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.DECODER;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.DISCRETIZER;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.ENCODER;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.ENERGY_CARD;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_AUTO_FILLER;
|
||||
@@ -51,11 +50,11 @@ import static com.glodblock.github.loader.ItemAndBlockHolder.QUANTUM_BRIDGE_CARD
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.QUANTUM_CELL;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.SINGULARITY_CELL;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WALRUS;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_FLUID_TERM;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_INTERFACE_TERM;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_LEVEL_TERM;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_PATTERN_TERM;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_ULTRA_TERM;
|
||||
import static net.minecraft.init.Blocks.redstone_torch;
|
||||
import static net.minecraft.init.Items.fish;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -111,6 +110,10 @@ public class RecipeLoader implements Runnable {
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
|
||||
1,
|
||||
340);
|
||||
public static final ItemStack AE2_PATTERN_TERM_EX = new ItemStack(
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
|
||||
1,
|
||||
500);
|
||||
public static final ItemStack AE2_PROCESS_LOG = new ItemStack(
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
|
||||
1,
|
||||
@@ -189,6 +192,12 @@ public class RecipeLoader implements Runnable {
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
|
||||
1,
|
||||
28);
|
||||
|
||||
public static final ItemStack AE2_LEVEL_EMITTER = new ItemStack(
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
|
||||
1,
|
||||
280);
|
||||
|
||||
public static final ItemStack AE2_WIRELESS_RECEIVER = new ItemStack(
|
||||
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
|
||||
1,
|
||||
@@ -234,26 +243,12 @@ public class RecipeLoader implements Runnable {
|
||||
GameRegistry.addShapelessRecipe(FLUID_INTERFACE_P2P.stack(), AE2_P2P_ME, FLUID_INTERFACE.stack());
|
||||
}
|
||||
GameRegistry.addShapelessRecipe(INTERFACE.stack(), FLUID_INTERFACE.stack());
|
||||
GameRegistry.addShapelessRecipe(WIRELESS_PATTERN_TERM.stack(), FLUID_TERMINAL);
|
||||
GameRegistry.addShapelessRecipe(WIRELESS_PATTERN_TERM.stack(), AE2_WIRELESS_TERMINAL, AE2_PATTERN_TERM);
|
||||
GameRegistry.addShapelessRecipe(WIRELESS_INTERFACE_TERM.stack(), AE2_WIRELESS_TERMINAL, AE2_INTERFACE_TERMINAL);
|
||||
GameRegistry.addShapelessRecipe(WIRELESS_LEVEL_TERM.stack(), AE2_WIRELESS_TERMINAL, LEVEL_MAINTAINER);
|
||||
GameRegistry
|
||||
.addRecipe(new ShapedOreRecipe(CERTUS_QUARTZ_TANK.stack(), "GGG", "G G", "GGG", 'G', AE2_QUARTZ_GLASS));
|
||||
GameRegistry.addShapelessRecipe(FLUID_AUTO_FILLER.stack(), FLUID_TERMINAL, ENCODER);
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
DISCRETIZER.stack(),
|
||||
"IPI",
|
||||
"TMT",
|
||||
"IPI",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'P',
|
||||
AE2_PROCESS_ENG,
|
||||
'T',
|
||||
AE2_STORAGE_BUS,
|
||||
'M',
|
||||
AE2_CONDENSER));
|
||||
GameRegistry.addShapelessRecipe(FLUID_AUTO_FILLER.stack(), AE2_PATTERN_TERM, ENCODER);
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
DECODER.stack(),
|
||||
@@ -294,7 +289,7 @@ public class RecipeLoader implements Runnable {
|
||||
'I',
|
||||
"itemIlluminatedPanel",
|
||||
'E',
|
||||
FLUID_LEVEL_EMITTER,
|
||||
AE2_LEVEL_EMITTER,
|
||||
'P',
|
||||
"dyeBlue"));
|
||||
GameRegistry.addRecipe(
|
||||
@@ -307,13 +302,6 @@ public class RecipeLoader implements Runnable {
|
||||
FLUID_STORAGE_MONITOR,
|
||||
'F',
|
||||
AE2_CORE_FOM));
|
||||
GameRegistry.addShapelessRecipe(FLUID_TERMINAL.stack(), AE2_PATTERN_TERM, ENCODER);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
FLUID_TERMINAL_EX.stack(),
|
||||
FLUID_TERMINAL.stack(),
|
||||
AE2_PROCESS_CAL,
|
||||
AE2_PROCESS_ENG,
|
||||
AE2_PROCESS_LOG);
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
BUFFER.stack(),
|
||||
@@ -333,16 +321,6 @@ public class RecipeLoader implements Runnable {
|
||||
'B',
|
||||
BUCKET));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(WALRUS, "FFF", "F F", "FFF", 'F', fish));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
FLUID_LEVEL_EMITTER.stack(),
|
||||
"RPD",
|
||||
'R',
|
||||
redstone_torch,
|
||||
'P',
|
||||
AE2_PROCESS_CAL,
|
||||
'D',
|
||||
"dyeBlue"));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
LARGE_BUFFER.stack(),
|
||||
@@ -356,7 +334,6 @@ public class RecipeLoader implements Runnable {
|
||||
'E',
|
||||
AE2_PROCESS_ENG));
|
||||
GameRegistry.addShapelessRecipe(AE2_BLANK_PATTERN, PATTERN.stack());
|
||||
GameRegistry.addShapelessRecipe(FLUID_TERM.stack(), AE2_TERMINAL, BUFFER);
|
||||
GameRegistry.addShapelessRecipe(LEVEL_TERMINAL.stack(), AE2_TERMINAL, LEVEL_MAINTAINER);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
FLUID_BUFFER.stack(),
|
||||
@@ -365,6 +342,14 @@ public class RecipeLoader implements Runnable {
|
||||
: ModAndClassUtil.EC2 ? ItemEnum.STORAGECOMPONENT.getDamagedStack(4) : null);
|
||||
GameRegistry
|
||||
.addShapelessRecipe(LEVEL_MAINTAINER.stack(), AE2_CRAFTING_CP_UNIT, ENCODER, AE2_PATTERN_CAPACITY_CARD);
|
||||
|
||||
// Deprecated
|
||||
GameRegistry.addShapelessRecipe(AE2_TERMINAL, FLUID_TERM.stack());
|
||||
GameRegistry.addShapelessRecipe(AE2_WIRELESS_TERMINAL, WIRELESS_FLUID_TERM.stack());
|
||||
GameRegistry.addShapelessRecipe(AE2_LEVEL_EMITTER, FLUID_LEVEL_EMITTER.stack());
|
||||
GameRegistry.addShapelessRecipe(AE2_PATTERN_TERM, FLUID_TERMINAL.stack());
|
||||
GameRegistry.addShapelessRecipe(AE2_PATTERN_TERM_EX, FLUID_TERMINAL_EX.stack());
|
||||
|
||||
if (Config.fluidCells) {
|
||||
OreDictionary.registerOre("anyCertusCrystal", AE2_PURE_CERTUS);
|
||||
for (ItemStack it : OreDictionary.getOres("crystalCertusQuartz"))
|
||||
|
||||
@@ -22,8 +22,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TerminalFontSize;
|
||||
@@ -164,10 +162,6 @@ public class NEICellViewHandler implements IUsageHandler {
|
||||
final int line = i % ROW_ITEM_NUM;
|
||||
final int row = i / ROW_ITEM_NUM;
|
||||
|
||||
if (ModAndClassUtil.HODGEPODGE && icon instanceof IPatchedTextureAtlasSprite sprite) {
|
||||
sprite.markNeedsAnimationUpdate();
|
||||
}
|
||||
|
||||
tessellator.setColorRGBA(color >> 16 & 0xFF, color >> 8 & 0xFF, color & 0xFF, 0xFF);
|
||||
tessellator.addVertexWithUV(
|
||||
OFFSET_X + 18 * (line + 1) - 1,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -168,6 +168,28 @@ public class CommonProxy {
|
||||
Upgrades.DISTRIBUTION.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096KM), 1);
|
||||
Upgrades.DISTRIBUTION.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384KM), 1);
|
||||
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_VOID_CELL), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL64K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL256K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1024K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384K), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.QUANTUM_CELL), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.SINGULARITY_CELL), 1);
|
||||
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL64KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL256KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1024KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384KM), 1);
|
||||
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.ARTIFICIAL_UNIVERSE_CELL), 1);
|
||||
|
||||
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 1);
|
||||
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 1);
|
||||
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE_P2P), 1);
|
||||
|
||||
@@ -412,12 +412,9 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
IAEFluidStack remove;
|
||||
if (doFill) {
|
||||
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.MODULATE, this.mySource);
|
||||
if (remove == null) {
|
||||
onStackReturnedToNetwork(resource);
|
||||
} else {
|
||||
if (remove == null) {} else {
|
||||
FluidStack copy = resource.copy();
|
||||
copy.amount -= (int) remove.getStackSize();
|
||||
onStackReturnedToNetwork(copy);
|
||||
}
|
||||
} else {
|
||||
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.SIMULATE, this.mySource);
|
||||
@@ -450,10 +447,6 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
return this.tanks.getTankInfo(from);
|
||||
}
|
||||
|
||||
private void onStackReturnedToNetwork(FluidStack fluidStack) {
|
||||
this.iHost.getInterfaceDuality().onStackReturnedToNetwork(ItemFluidDrop.newAeStack(fluidStack));
|
||||
}
|
||||
|
||||
private static class InterfaceInventory extends MEMonitorIFluidHandler {
|
||||
|
||||
InterfaceInventory(DualityFluidInterface tileInterface) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FluidPrimaryGui extends PrimaryGui {
|
||||
p,
|
||||
p.worldObj,
|
||||
new BlockPos(
|
||||
p.inventory.currentItem,
|
||||
this.slotIndex == Integer.MIN_VALUE ? p.inventory.currentItem : this.slotIndex,
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
0),
|
||||
Objects.requireNonNull(side),
|
||||
|
||||
@@ -32,8 +32,8 @@ public final class ModAndClassUtil {
|
||||
public static boolean COFH = false;
|
||||
public static boolean GTPP = false;
|
||||
public static boolean WAILA = false;
|
||||
public static boolean WAILA_PLUGINS = false;
|
||||
public static boolean AVARITIA = false;
|
||||
public static boolean HODGEPODGE = false;
|
||||
public static boolean NEW_HORIZONS_CORE_MOD = false;
|
||||
|
||||
public static boolean isV2;
|
||||
@@ -140,8 +140,8 @@ public final class ModAndClassUtil {
|
||||
if (Loader.isModLoaded("CoFHCore")) COFH = true;
|
||||
if (Loader.isModLoaded("miscutils")) GTPP = true;
|
||||
if (Loader.isModLoaded("Waila")) WAILA = true;
|
||||
if (Loader.isModLoaded("wailaplugins")) WAILA_PLUGINS = true;
|
||||
if (Loader.isModLoaded("Avaritia")) AVARITIA = true;
|
||||
if (Loader.isModLoaded("hodgepodge")) HODGEPODGE = true;
|
||||
if (Loader.isModLoaded("dreamcraft")) NEW_HORIZONS_CORE_MOD = true;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import com.glodblock.github.FluidCraft;
|
||||
public class NameConst {
|
||||
|
||||
public static final String BLOCK_CERTUS_QUARTZ_TANK = "certus_quartz_tank";
|
||||
public static final String BLOCK_FLUID_DISCRETIZER = "fluid_discretizer";
|
||||
public static final String BLOCK_FLUID_PATTERN_ENCODER = "fluid_pattern_encoder";
|
||||
public static final String BLOCK_FLUID_PACKET_DECODER = "fluid_packet_decoder";
|
||||
public static final String BLOCK_FLUID_INTERFACE = "fluid_interface";
|
||||
@@ -75,8 +74,6 @@ public class NameConst {
|
||||
public static final String TT_FLUID_PACKET_DECODER = TT_KEY + "fluid_packet_decoder.";
|
||||
public static final String TT_FLUID_PACKET_DECODER_DESC = TT_FLUID_PACKET_DECODER + "desc";
|
||||
public static final String TT_FLUID_BUFFER_DESC = TT_FLUID_BUFFER + "desc";
|
||||
public static final String TT_FLUID_DISCRETIZER = TT_KEY + "discretizer.";
|
||||
public static final String TT_FLUID_DISCRETIZER_DESC = TT_FLUID_DISCRETIZER + "desc";
|
||||
public static final String TT_LEVEL_MAINTAINER = TT_KEY + "level_maintainer.";
|
||||
public static final String TT_LEVEL_MAINTAINER_DESC = TT_LEVEL_MAINTAINER + "desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_WHO_AM_I = TT_LEVEL_MAINTAINER + "Who_Am_I";
|
||||
|
||||
@@ -12,8 +12,6 @@ import net.minecraft.util.IIcon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
|
||||
public final class RenderUtil {
|
||||
@@ -53,9 +51,6 @@ public final class RenderUtil {
|
||||
if (aeFluidStack.getStackSize() > 0 && hi > 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
IIcon fluidIcon = aeFluidStack.getFluid().getStillIcon();
|
||||
if (ModAndClassUtil.HODGEPODGE && fluidIcon instanceof IPatchedTextureAtlasSprite) {
|
||||
((IPatchedTextureAtlasSprite) fluidIcon).markNeedsAnimationUpdate();
|
||||
}
|
||||
GL11.glColor3f(
|
||||
(float) (aeFluidStack.getFluid().getColor() >> 16 & 255) / 255.0F,
|
||||
(float) (aeFluidStack.getFluid().getColor() >> 8 & 255) / 255.0F,
|
||||
|
||||
@@ -15,7 +15,7 @@ item.part_level_terminal.name=ME Level Terminal
|
||||
item.portable_fluid_cell.name=Portable Fluid Cell
|
||||
item.wireless_fluid_terminal.name=Wireless Fluid Terminal
|
||||
item.wireless_level_terminal.name=Wireless Level Terminal
|
||||
item.wireless_fluid_pattern_terminal.name=Wireless Fluid Pattern Terminal
|
||||
item.wireless_fluid_pattern_terminal.name=Wireless Pattern Terminal
|
||||
item.wireless_interface_terminal.name=Wireless Interface Terminal
|
||||
item.wireless_ultra_terminal.name=Universal Wireless Terminal
|
||||
item.wireless_ultra_terminal.CRAFTING.name=Universal Wireless Terminal - Crafting
|
||||
@@ -63,7 +63,6 @@ item.fluid_storage_housing.1.name=ME Advanced Fluid Storage Housing
|
||||
item.fluid_storage_housing.2.name=ME Multi-Fluid Storage Housing
|
||||
item.fluid_storage_housing.3.name=ME Advanced Multi-Fluid Storage Housing
|
||||
|
||||
tile.fluid_discretizer.name=Fluid Discretizer
|
||||
tile.fluid_pattern_encoder.name=Fluid Pattern Encoder
|
||||
tile.fluid_packet_decoder.name=ME Fluid Packet Decoder
|
||||
tile.fluid_interface.name=ME Dual Interface
|
||||
@@ -85,7 +84,6 @@ ae2fc.waila.disable=Disable
|
||||
ae2fc.tooltip.shift_for_more=§r> Hold §3Shift§r for more information
|
||||
ae2fc.tooltip.ctrl_for_more=§r> Hold §3Ctrl§r for more information
|
||||
ae2fc.tooltip.fluid_packet_decoder.desc=The Fluid Decoder can decode Fluid packets. It has to be connected to a ME System and a place to store the liquid in otherwise it won't work.
|
||||
ae2fc.tooltip.discretizer.desc=When the ME Fluid Discretizer is attached to your ME System, it will represent the Fluids that are stored in your ME Fluid Storage Cells (Or Storage bus) as drops. They will be the item equivalent of fluids. Its just another way to show fluids, it won't actually convert your fluids to items.
|
||||
ae2fc.tooltip.fluid_buffer.desc=This is a high speed fluid IO
|
||||
ae2fc.tooltip.walrus.desc=GTNH is like a job
|
||||
ae2fc.tooltip.fluid_auto_filler=Creates fluid canning pattern with given container automatically.
|
||||
@@ -221,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
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 609 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.4 KiB |
Reference in new issue
Block a user