mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 13:30:04 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8822ac95d1 | ||
|
|
d5b8ef6ea9 | ||
|
|
f87b76347e | ||
|
|
14853a2481 | ||
|
|
2cd049d40e | ||
|
|
f01cde7659 | ||
|
|
56cda9f9e2 |
No files matched your search
+25
-8
@@ -1,4 +1,4 @@
|
||||
//version: 1683373797
|
||||
//version: 1685785062
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -69,7 +69,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14'
|
||||
}
|
||||
|
||||
print("You might want to check out './gradlew :faq' if your build fails.\n")
|
||||
@@ -569,9 +569,10 @@ repositories {
|
||||
|
||||
def mixinProviderGroup = "io.github.legacymoddingmc"
|
||||
def mixinProviderModule = "unimixins"
|
||||
def mixinProviderVersion = "0.1.6"
|
||||
def mixinProviderVersion = "0.1.7.1"
|
||||
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
|
||||
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
|
||||
ext.mixinProviderSpec = mixinProviderSpec
|
||||
|
||||
dependencies {
|
||||
if (usesMixins.toBoolean()) {
|
||||
@@ -729,7 +730,7 @@ dependencies {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13')
|
||||
}
|
||||
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
|
||||
@@ -822,6 +823,18 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
}
|
||||
|
||||
public void setup(Project project) {
|
||||
super.setup(project)
|
||||
if (project.usesMixins.toBoolean()) {
|
||||
this.extraJvmArgs.addAll(project.provider(() -> {
|
||||
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec))
|
||||
mixinCfg.canBeConsumed = false
|
||||
mixinCfg.transitive = false
|
||||
enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : []
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
|
||||
@@ -1263,10 +1276,14 @@ tasks.register('faq') {
|
||||
description = 'Prints frequently asked questions about building a project'
|
||||
|
||||
doLast {
|
||||
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " +
|
||||
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" +
|
||||
"The links can be found in repositories.gradle and build.gradle:repositories, " +
|
||||
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.")
|
||||
print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
|
||||
"Or you can manually check if the versions are still on the distributing sites - " +
|
||||
"the links can be found in repositories.gradle and build.gradle:repositories, " +
|
||||
"but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" +
|
||||
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
|
||||
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " +
|
||||
"However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " +
|
||||
"Java 9 or later.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-18
@@ -1,27 +1,22 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-203-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.3.50-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-215-GTNH:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.5.24:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.33:dev') { transitive = false }
|
||||
api('com.github.GTNewHorizons:waila:1.6.0:dev')
|
||||
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.9.0:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.11:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.42.82:dev')
|
||||
compileOnly('com.github.GTNewHorizons:StructureLib:1.2.6:dev')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.7:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.14:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.21:dev')
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.github.GTNewHorizons:AppleCore:3.2.10:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.33:dev') { transitive = false }
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.1-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:GTplusplus:1.8.42:dev') { transitive = false }
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:KekzTech:0.7.8:dev')
|
||||
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.2-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:GTplusplus:1.9.4:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.2.10:dev") { transitive = false }
|
||||
}
|
||||
+5
-1
@@ -21,6 +21,10 @@ forgeVersion = 10.13.4.1614
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern java syntax (up to version 17) via Jabel, while still targetting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
||||
@@ -35,7 +39,7 @@ gradleTokenGroupName = GRADLETOKEN_GROUPNAME
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage =
|
||||
apiPackage = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
|
||||
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.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -77,7 +77,7 @@ public class FluidCraft {
|
||||
CalculatorV2PluginLoader.installCalculatorV2Plugins();
|
||||
}
|
||||
if (ModAndClassUtil.isTypeFilter) {
|
||||
FluidFilter.installFilter();
|
||||
AEApi.instance().registries().itemDisplay().addItemFilter(FluidFilter::filter);
|
||||
}
|
||||
|
||||
proxy.postInit(event);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.glodblock.github.api;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public final class FluidCraftAPI implements IFluidCraftAPI {
|
||||
|
||||
private static final FluidCraftAPI API = new FluidCraftAPI();
|
||||
|
||||
/**
|
||||
* These fluids will not be allowed to be stored in fluid storage cells.
|
||||
*/
|
||||
private final Set<Class<? extends Fluid>> blacklistedFluids = new HashSet<>();
|
||||
|
||||
/**
|
||||
* These fluids will not be displayed in a fluid terminal.
|
||||
*/
|
||||
private final Set<Class<? extends Fluid>> blacklistedDispFluids = new HashSet<>();
|
||||
|
||||
public static FluidCraftAPI instance() {
|
||||
return API;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blacklistFluidInStorage(Class<? extends Fluid> fluid) {
|
||||
blacklistedFluids.add(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blacklistFluidInDisplay(Class<? extends Fluid> fluid) {
|
||||
blacklistedDispFluids.add(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlacklistedInStorage(Class<? extends Fluid> fluid) {
|
||||
return blacklistedFluids.contains(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlacklistedInDisplay(Class<? extends Fluid> fluid) {
|
||||
return blacklistedDispFluids.contains(fluid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.glodblock.github.api;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface IFluidCraftAPI {
|
||||
|
||||
/**
|
||||
* Blacklisted fluids will not be allowed to be added to a storage cell.
|
||||
*/
|
||||
void blacklistFluidInStorage(Class<? extends Fluid> fluid);
|
||||
|
||||
/**
|
||||
* Blacklisted fluids will not be displayed in fluid terminals.
|
||||
*/
|
||||
void blacklistFluidInDisplay(Class<? extends Fluid> fluid);
|
||||
|
||||
/**
|
||||
* Mostly for internal use; queries whether the fluid is blacklisted from storage cells.
|
||||
*/
|
||||
boolean isBlacklistedInStorage(Class<? extends Fluid> fluid);
|
||||
|
||||
/**
|
||||
* Mostly for internal use; queries whether the fluid is blacklisted from being displayed.
|
||||
*/
|
||||
boolean isBlacklistedInDisplay(Class<? extends Fluid> fluid);
|
||||
}
|
||||
@@ -128,15 +128,12 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
@Override
|
||||
protected String getBackground() {
|
||||
if (!ModAndClassUtil.isBigInterface) return "guis/interface.png";
|
||||
switch (((ContainerInterface) this.cvb).getPatternCapacityCardsInstalled()) {
|
||||
case 1:
|
||||
return "guis/interface2.png";
|
||||
case 2:
|
||||
return "guis/interface3.png";
|
||||
case 3:
|
||||
return "guis/interface4.png";
|
||||
}
|
||||
return "guis/interface.png";
|
||||
return switch (((ContainerInterface) this.cvb).getPatternCapacityCardsInstalled()) {
|
||||
case 1 -> "guis/interface2.png";
|
||||
case 2 -> "guis/interface3.png";
|
||||
case 3 -> "guis/interface4.png";
|
||||
default -> "guis/interface.png";
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -244,9 +244,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
Math.round(uv_y * 16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
this.mouseDragged(par1Minecraft, par2, par3);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.xPosition, this.yPosition, 0.0F);
|
||||
@@ -280,9 +278,9 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
Math.round(uv_y * 16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
this.mouseDragged(par1Minecraft, par2, par3);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
this.mouseDragged(par1Minecraft, par2, par3);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
|
||||
@@ -164,7 +164,6 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketValueConfig(result, 0));
|
||||
} catch (final NumberFormatException e) {
|
||||
// nope..
|
||||
this.level.setText("0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
protected static boolean onlyBrokenRecipes = false;
|
||||
protected GuiTabButton craftingStatusBtn;
|
||||
|
||||
// private final IConfigManager configSrc;
|
||||
private int rows = 3;
|
||||
|
||||
private static final String MOLECULAR_ASSEMBLER = "tile.appliedenergistics2.BlockMolecularAssembler";
|
||||
@@ -210,8 +209,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
|
||||
protected void repositionSlots() {
|
||||
for (final Object obj : this.inventorySlots.inventorySlots) {
|
||||
if (obj instanceof AppEngSlot) {
|
||||
final AppEngSlot slot = (AppEngSlot) obj;
|
||||
if (obj instanceof final AppEngSlot slot) {
|
||||
slot.yDisplayPosition = this.ySize + slot.getY() - 78 - 7;
|
||||
}
|
||||
}
|
||||
@@ -220,7 +218,9 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
protected int calculateRowsCount() {
|
||||
final int maxRows = this.getMaxRows();
|
||||
final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI);
|
||||
final int NEIPadding = hasNEI ? 22 /* input */ + 18 /* top panel */ : 0;
|
||||
final int input = 22;
|
||||
final int topPanel = 18;
|
||||
final int NEIPadding = hasNEI ? input + topPanel : 0;
|
||||
final int extraSpace = this.height - MAGIC_HEIGHT_NUMBER - NEIPadding;
|
||||
|
||||
return Math.max(3, Math.min(maxRows, extraSpace / 18));
|
||||
@@ -243,8 +243,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
final int ex = getScrollBar().getCurrentScroll();
|
||||
for (int x = 0; x < this.rows && ex + x < this.lines.size(); x++) {
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
if (lineObj instanceof final ClientDCInternalInv inv) {
|
||||
for (int z = 0; z < inv.getInventory().getSizeInventory(); z++) {
|
||||
if (this.matchedStacks.contains(inv.getInventory().getStackInSlot(z))) drawRect(
|
||||
z * 18 + 22,
|
||||
@@ -253,8 +252,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
1 + offset + 16,
|
||||
GuiColors.InterfaceTerminalMatch.getColor());
|
||||
}
|
||||
} else if (lineObj instanceof String) {
|
||||
String name = (String) lineObj;
|
||||
} else if (lineObj instanceof String name) {
|
||||
final int rows = this.byName.get(name).size();
|
||||
String postfix = "";
|
||||
|
||||
@@ -309,8 +307,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
for (int x = 0; x < this.rows && ex + x < this.lines.size(); x++) {
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
if (lineObj instanceof final ClientDCInternalInv inv) {
|
||||
for (int z = 0; z < inv.getInventory().getSizeInventory(); z++) {
|
||||
inventorySlots.inventorySlots.add(new SlotDisconnected(inv, z, z * 18 + 22, 1 + offset));
|
||||
}
|
||||
@@ -405,8 +402,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
|
||||
} else if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
} else if (btn instanceof GuiImgButton) {
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
} else if (btn instanceof final GuiImgButton iBtn) {
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
@@ -444,8 +440,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
for (int x = 0; x < this.rows && ex + x < this.lines.size(); x++) {
|
||||
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
if (lineObj instanceof final ClientDCInternalInv inv) {
|
||||
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
final int width = inv.getInventory().getSizeInventory() * 18;
|
||||
@@ -539,7 +534,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
|
||||
if (this.refreshList) {
|
||||
this.refreshList = false;
|
||||
// invalid caches on refresh
|
||||
// invalidate caches on refresh
|
||||
this.cachedSearches.clear();
|
||||
this.refreshList();
|
||||
}
|
||||
|
||||
@@ -364,32 +364,33 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
public void draw() {
|
||||
this.getQty().draw();
|
||||
this.getBatch().draw();
|
||||
ArrayList<String> message = new ArrayList<String>();
|
||||
ArrayList<String> message = new ArrayList<>();
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_TITLE) + "\n");
|
||||
switch (this.state) {
|
||||
case Idling:
|
||||
case Idling -> {
|
||||
this.line.setColor(0xFF55FF55);
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
break;
|
||||
case Crafting:
|
||||
}
|
||||
case Crafting -> {
|
||||
this.line.setColor(0xFFFFFF55);
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
break;
|
||||
case Exporting:
|
||||
}
|
||||
case Exporting -> {
|
||||
this.line.setColor(0xFFAA00AA);
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default -> {
|
||||
this.line.setColor(0);
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
|
||||
}
|
||||
}
|
||||
message.add("");
|
||||
if (isShiftKeyDown()) {
|
||||
@@ -430,7 +431,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
this.textField = textField;
|
||||
this.textField.setEnableBackgroundDrawing(false);
|
||||
this.textField.setText("0");
|
||||
this.textField.setMaxStringLength(10); // it's enough to useful
|
||||
this.textField.setMaxStringLength(10); // this length is enough to useful
|
||||
this.idx = idx;
|
||||
this.action = action;
|
||||
this.tooltip = tooltip;
|
||||
|
||||
@@ -16,7 +16,7 @@ import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiRenamer extends AEBaseGui implements IDropToFillTextField {
|
||||
|
||||
private MEGuiTextField textField;
|
||||
private final MEGuiTextField textField;
|
||||
|
||||
public GuiRenamer(InventoryPlayer ip, ITerminalHost monitorable) {
|
||||
super(new ContainerRenamer(ip, monitorable));
|
||||
|
||||
@@ -41,10 +41,10 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
final int a = AEConfig.instance.priorityByStacksAmounts(0);
|
||||
final int b = AEConfig.instance.priorityByStacksAmounts(1);
|
||||
final int c = AEConfig.instance.priorityByStacksAmounts(2);
|
||||
final int d = AEConfig.instance.priorityByStacksAmounts(3);
|
||||
final int a = AEConfig.instance.craftItemsByStackAmounts(0);
|
||||
final int b = AEConfig.instance.craftItemsByStackAmounts(1);
|
||||
final int c = AEConfig.instance.craftItemsByStackAmounts(2);
|
||||
final int d = AEConfig.instance.craftItemsByStackAmounts(3);
|
||||
|
||||
this.buttonList.add(this.plus1 = new GuiButton(0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a));
|
||||
this.buttonList.add(this.plus10 = new GuiButton(0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b));
|
||||
|
||||
@@ -29,11 +29,11 @@ import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IDisplayRepo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.gui.widgets.*;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -67,7 +67,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
protected final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
public FCContainerMonitor<T> monitorableContainer;
|
||||
public GuiTabButton craftingStatusBtn;
|
||||
protected ItemRepo repo;
|
||||
protected IDisplayRepo repo;
|
||||
protected GuiImgButton craftingStatusImgBtn;
|
||||
protected FCGuiTextField searchField;
|
||||
protected int perRow = 9;
|
||||
@@ -122,9 +122,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
if (btn == this.craftingStatusBtn || btn == this.craftingStatusImgBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
}
|
||||
if (btn instanceof GuiImgButton) {
|
||||
if (btn instanceof final GuiImgButton iBtn) {
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
final Enum<?> cv = iBtn.getCurrentValue();
|
||||
final Enum<?> next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
@@ -273,6 +272,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE)));
|
||||
this.offsetY += 20;
|
||||
|
||||
// Right now 80 > offsetX, but that can be changed later.
|
||||
// noinspection DataFlowIssue
|
||||
this.searchField = new FCGuiTextField(
|
||||
this.fontRendererObj,
|
||||
this.guiLeft + Math.max(80, this.offsetX),
|
||||
@@ -433,7 +434,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
|
||||
if (slot instanceof SlotPatternTerm) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
return; // prevents weird double clicks
|
||||
}
|
||||
try {
|
||||
NetworkHandler.instance.sendToServer(((SlotPatternTerm) slot).getRequest(isShiftKeyDown()));
|
||||
@@ -442,13 +443,13 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
}
|
||||
} else if (slot instanceof SlotCraftingTerm) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
return; // prevents weird double clicks
|
||||
}
|
||||
InventoryAction action;
|
||||
if (isShiftKeyDown()) {
|
||||
action = InventoryAction.CRAFT_SHIFT;
|
||||
} else {
|
||||
// Craft stack on right-click, craft single on left-click
|
||||
// Craft a stack on right-click, craft a single one on left-click
|
||||
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
}
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slotIdx, 0);
|
||||
@@ -649,7 +650,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
this.repo.setPower(this.monitorableContainer.isPowered());
|
||||
this.repo.setPowered(this.monitorableContainer.isPowered());
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
|
||||
@@ -119,12 +119,6 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
if (slotIndex == -1) {
|
||||
out.stackSize = fluidContainer.stackSize;
|
||||
} else {
|
||||
if (drainStack != null) {
|
||||
System.out.print("---------\n");
|
||||
System.out.print(drainStack.right + "\n");
|
||||
System.out.print(drainStack.left + "\n");
|
||||
System.out.print(aeFluidStack.getStackSize() + "\n");
|
||||
}
|
||||
out.stackSize = (int) (fluidContainer.stackSize
|
||||
- (aeFluidStack.getStackSize() / drainStack.left));
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
/**
|
||||
* The insert operation. For input, we have an filled container stack. For outputs, we have the following: 1.
|
||||
* The insert operation. For input, we have a filled container stack. For outputs, we have the following: 1.
|
||||
* Leftover filled container stack - primary output. 2. Empty containers 3. Partially filled container x1 In order
|
||||
* above, the itemstack at `slotIndex` is transformed into the output.
|
||||
*/
|
||||
|
||||
+10
-7
@@ -106,7 +106,10 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
}
|
||||
|
||||
private static IAEItemStack[] collectAeInventory(AeStackInventory<IAEItemStack> inv) {
|
||||
// see note at top of DensePatternDetails
|
||||
/*
|
||||
* AE2 API documentation says the input/output arrays can contain nulls, but their use of the API directly
|
||||
* contradicts that, so we just go by behaviour and filter out nulls.
|
||||
*/
|
||||
List<IAEItemStack> acc = new ArrayList<>();
|
||||
for (IAEItemStack stack : inv) {
|
||||
if (stack != null) {
|
||||
@@ -130,20 +133,20 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
if (slot instanceof SlotFluidConvertingFake) {
|
||||
final ItemStack stack = player.inventory.getItemStack();
|
||||
switch (action) {
|
||||
case PICKUP_OR_SET_DOWN:
|
||||
case PICKUP_OR_SET_DOWN -> {
|
||||
if (stack == null) {
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
((SlotFluidConvertingFake) slot).putConvertedStack(stack.copy());
|
||||
}
|
||||
break;
|
||||
case PLACE_SINGLE:
|
||||
}
|
||||
case PLACE_SINGLE -> {
|
||||
if (stack != null) {
|
||||
((SlotFluidConvertingFake) slot)
|
||||
.putConvertedStack(Objects.requireNonNull(Util.copyStackWithSize(stack, 1)));
|
||||
}
|
||||
break;
|
||||
case SPLIT_OR_PLACE_SINGLE:
|
||||
}
|
||||
case SPLIT_OR_PLACE_SINGLE -> {
|
||||
ItemStack inSlot = slot.getStack();
|
||||
if (inSlot != null) {
|
||||
if (stack == null) {
|
||||
@@ -161,7 +164,7 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
((SlotFluidConvertingFake) slot)
|
||||
.putConvertedStack(Objects.requireNonNull(Util.copyStackWithSize(stack, 1)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.doAction(player, action, slotId, id);
|
||||
|
||||
+15
-22
@@ -42,13 +42,12 @@ import appeng.util.inv.WrapperInvSlot;
|
||||
public class ContainerInterfaceWireless extends FCBaseContainer {
|
||||
|
||||
/**
|
||||
* this stuff is all server side..
|
||||
* this stuff is all server side
|
||||
*/
|
||||
private static long autoBase = Long.MIN_VALUE;
|
||||
|
||||
private final Multimap<IInterfaceHost, ContainerInterfaceWireless.InvTracker> diList = HashMultimap.create();
|
||||
private final Map<Long, ContainerInterfaceWireless.InvTracker> byId = new HashMap<Long, ContainerInterfaceWireless.InvTracker>();
|
||||
// private final Map<Long, InvTracker> byId = new HashMap<>();
|
||||
private final Map<Long, ContainerInterfaceWireless.InvTracker> byId = new HashMap<>();
|
||||
private IGrid grid;
|
||||
private NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
@@ -114,9 +113,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
|
||||
try {
|
||||
NetworkHandler.instance
|
||||
.sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
|
||||
} catch (final IOException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final IOException ignored) {}
|
||||
|
||||
this.data = new NBTTagCompound();
|
||||
}
|
||||
@@ -140,7 +137,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
|
||||
boolean canInsert = true;
|
||||
|
||||
switch (action) {
|
||||
case PICKUP_OR_SET_DOWN:
|
||||
case PICKUP_OR_SET_DOWN -> {
|
||||
if (hasItemInHand) {
|
||||
for (int s = 0; s < interfaceHandler.getSizeInventory(); s++) {
|
||||
if (Platform.isSameItemPrecise(
|
||||
@@ -175,9 +172,8 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
|
||||
final IInventory mySlot = slotInv.getWrapper(slot + inv.offset);
|
||||
mySlot.setInventorySlotContents(0, playerHand.addItems(mySlot.getStackInSlot(0)));
|
||||
}
|
||||
|
||||
break;
|
||||
case SPLIT_OR_PLACE_SINGLE:
|
||||
}
|
||||
case SPLIT_OR_PLACE_SINGLE -> {
|
||||
if (hasItemInHand) {
|
||||
for (int s = 0; s < interfaceHandler.getSizeInventory(); s++) {
|
||||
if (Platform.isSameItemPrecise(
|
||||
@@ -205,31 +201,28 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
|
||||
interfaceSlot.addItems(extra);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case SHIFT_CLICK:
|
||||
}
|
||||
case SHIFT_CLICK -> {
|
||||
final IInventory mySlot = slotInv.getWrapper(slot + inv.offset);
|
||||
final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN);
|
||||
mySlot.setInventorySlotContents(0, mergeToPlayerInventory(playerInv, mySlot.getStackInSlot(0)));
|
||||
|
||||
break;
|
||||
case MOVE_REGION:
|
||||
}
|
||||
case MOVE_REGION -> {
|
||||
final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN);
|
||||
for (int x = 0; x < inv.client.getSizeInventory(); x++) {
|
||||
inv.server.setInventorySlotContents(
|
||||
x + inv.offset,
|
||||
mergeToPlayerInventory(playerInvAd, inv.server.getStackInSlot(x + inv.offset)));
|
||||
}
|
||||
|
||||
break;
|
||||
case CREATIVE_DUPLICATE:
|
||||
}
|
||||
case CREATIVE_DUPLICATE -> {
|
||||
if (player.capabilities.isCreativeMode && !hasItemInHand) {
|
||||
player.inventory.setItemStack(is == null ? null : is.copy());
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default -> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.updateHeld(player);
|
||||
|
||||
+4
-4
@@ -132,11 +132,11 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
&& (stack.getItem() instanceof IFluidContainerItem || FluidContainerRegistry.isContainer(stack))) {
|
||||
FluidStack fluid = null;
|
||||
switch (action) {
|
||||
case PICKUP_OR_SET_DOWN:
|
||||
case PICKUP_OR_SET_DOWN -> {
|
||||
fluid = Util.getFluidFromItem(stack);
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
break;
|
||||
case SPLIT_OR_PLACE_SINGLE:
|
||||
}
|
||||
case SPLIT_OR_PLACE_SINGLE -> {
|
||||
fluid = Util.getFluidFromItem(Util.copyStackWithSize(stack, 1));
|
||||
FluidStack origin = ItemFluidPacket.getFluidStack(slot.getStack());
|
||||
if (fluid != null && fluid.equals(origin)) {
|
||||
@@ -144,7 +144,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
if (fluid.amount <= 0) fluid = null;
|
||||
}
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fluid == null) {
|
||||
super.doAction(player, action, slotId, id);
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public abstract class FCContainerFluidConfigurable extends ContainerUpgradeable
|
||||
@Override
|
||||
protected void standardDetectAndSendChanges() {
|
||||
if (Platform.isServer()) {
|
||||
// clear out config items that are no longer valid (eg capacity upgrade removed)
|
||||
// clear out config items that are no longer valid (for instance, capacity upgrade removed)
|
||||
final AppEngInternalAEInventory inv = this.getFakeFluidInv();
|
||||
final Map<Integer, IAEFluidStack> tmp = new HashMap<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
|
||||
+1
-2
@@ -210,8 +210,7 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends FCBaseCo
|
||||
@Override
|
||||
public void onListUpdate() {
|
||||
for (final Object c : this.crafters) {
|
||||
if (c instanceof ICrafting) {
|
||||
final ICrafting cr = (ICrafting) c;
|
||||
if (c instanceof final ICrafting cr) {
|
||||
this.queueInventory(cr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package com.glodblock.github.client.me;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.util.FluidSorters;
|
||||
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
public class EssentiaRepo extends FluidRepo {
|
||||
|
||||
@@ -21,7 +29,84 @@ public class EssentiaRepo extends FluidRepo {
|
||||
|
||||
@Override
|
||||
public void updateView() {
|
||||
super.updateView();
|
||||
this.view.clear();
|
||||
this.dsp.clear();
|
||||
|
||||
this.view.ensureCapacity(this.list.size());
|
||||
this.dsp.ensureCapacity(this.list.size());
|
||||
|
||||
final Enum<?> viewMode = this.sortSrc.getSortDisplay();
|
||||
final Enum<?> searchMode = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
|
||||
if (searchMode == SearchBoxMode.NEI_AUTOSEARCH || searchMode == SearchBoxMode.NEI_MANUAL_SEARCH) {
|
||||
this.updateNEI(this.searchString);
|
||||
}
|
||||
|
||||
String innerSearch = this.searchString;
|
||||
|
||||
if (innerSearch.startsWith("@")) {
|
||||
innerSearch = innerSearch.substring(1);
|
||||
}
|
||||
|
||||
Pattern m;
|
||||
try {
|
||||
m = Pattern.compile(innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable ignore) {
|
||||
try {
|
||||
m = Pattern.compile(Pattern.quote(innerSearch.toLowerCase()), Pattern.CASE_INSENSITIVE);
|
||||
} catch (final Throwable __) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (IAEItemStack is : this.list) {
|
||||
if (this.myPartitionList != null) {
|
||||
if (!this.myPartitionList.isListed(is)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.CRAFTABLE) {
|
||||
is = is.copy();
|
||||
is.setStackSize(0);
|
||||
}
|
||||
|
||||
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Fluid fluid = ItemFluidDrop.getAeFluidStack(is).getFluid();
|
||||
if (!AspectUtil.isEssentiaGas(fluid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.matcher(fluid.getLocalizedName().toLowerCase()).find()) {
|
||||
this.view.add(is);
|
||||
}
|
||||
}
|
||||
|
||||
final Enum<?> SortBy = this.sortSrc.getSortBy();
|
||||
final Enum<?> SortDir = this.sortSrc.getSortDir();
|
||||
|
||||
FluidSorters.setDirection((appeng.api.config.SortDir) SortDir);
|
||||
FluidSorters.init();
|
||||
|
||||
if (SortBy == SortOrder.MOD) {
|
||||
this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_MOD);
|
||||
} else if (SortBy == SortOrder.AMOUNT) {
|
||||
this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_SIZE);
|
||||
} else if (SortBy == SortOrder.INVTWEAKS) {
|
||||
this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
|
||||
} else {
|
||||
this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME);
|
||||
}
|
||||
|
||||
for (final IAEItemStack is : this.view) {
|
||||
this.dsp.add(is.getItemStack());
|
||||
}
|
||||
Iterator<IAEItemStack> it1 = this.view.iterator();
|
||||
while (it1.hasNext()) {
|
||||
IAEFluidStack fluid = ItemFluidDrop.getAeFluidStack(it1.next());
|
||||
|
||||
@@ -20,6 +20,7 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.FluidSorters;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -27,36 +28,36 @@ import com.glodblock.github.util.Util;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IDisplayRepo;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.items.storage.ItemViewCell;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class FluidRepo extends ItemRepo {
|
||||
public class FluidRepo implements IDisplayRepo {
|
||||
|
||||
private final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
protected final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
protected final ArrayList<IAEItemStack> view = new ArrayList<>();
|
||||
protected final ArrayList<ItemStack> dsp = new ArrayList<>();
|
||||
private final IScrollSource src;
|
||||
private final ISortSource sortSrc;
|
||||
protected final IScrollSource src;
|
||||
protected final ISortSource sortSrc;
|
||||
|
||||
private int rowSize = 9;
|
||||
protected int rowSize = 9;
|
||||
|
||||
private String searchString = "";
|
||||
private IPartitionList<IAEItemStack> myPartitionList;
|
||||
protected String searchString = "";
|
||||
protected IPartitionList<IAEItemStack> myPartitionList;
|
||||
private String NEIWord = null;
|
||||
private boolean hasPower;
|
||||
|
||||
public FluidRepo(final IScrollSource src, final ISortSource sortSrc) {
|
||||
super(src, sortSrc);
|
||||
this.src = src;
|
||||
this.sortSrc = sortSrc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack getReferenceItem(int idx) {
|
||||
idx += this.src.getCurrentScroll() * this.rowSize;
|
||||
|
||||
@@ -66,6 +67,7 @@ public class FluidRepo extends ItemRepo {
|
||||
return this.view.get(idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(int idx) {
|
||||
idx += this.src.getCurrentScroll() * this.rowSize;
|
||||
|
||||
@@ -75,10 +77,7 @@ public class FluidRepo extends ItemRepo {
|
||||
return this.dsp.get(idx);
|
||||
}
|
||||
|
||||
void setSearch(final String search) {
|
||||
this.searchString = search == null ? "" : search;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postUpdate(final IAEItemStack is) {
|
||||
final IAEItemStack st = this.list.findPrecise(is);
|
||||
if (st != null) {
|
||||
@@ -89,11 +88,13 @@ public class FluidRepo extends ItemRepo {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setViewCell(final ItemStack[] list) {
|
||||
this.myPartitionList = ItemViewCell.createFilter(list);
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView() {
|
||||
this.view.clear();
|
||||
this.dsp.clear();
|
||||
@@ -145,7 +146,13 @@ public class FluidRepo extends ItemRepo {
|
||||
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Fluid fluid = ItemFluidDrop.getAeFluidStack(is).getFluid();
|
||||
|
||||
if (FluidCraftAPI.instance().isBlacklistedInDisplay(fluid.getClass())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (searchMod) {
|
||||
if (m.matcher(Util.getFluidModID(fluid).toLowerCase()).find()
|
||||
|| m.matcher(Util.getFluidModName(fluid).toLowerCase()).find()) {
|
||||
@@ -179,7 +186,7 @@ public class FluidRepo extends ItemRepo {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNEI(final String filter) {
|
||||
protected void updateNEI(final String filter) {
|
||||
try {
|
||||
if (this.NEIWord == null || !this.NEIWord.equals(filter)) {
|
||||
final Class<?> c = ReflectionHelper
|
||||
@@ -199,19 +206,23 @@ public class FluidRepo extends ItemRepo {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return this.view.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.list.resetStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower() {
|
||||
return this.hasPower;
|
||||
}
|
||||
|
||||
public void setPower(final boolean hasPower) {
|
||||
@Override
|
||||
public void setPowered(final boolean hasPower) {
|
||||
this.hasPower = hasPower;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ 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;
|
||||
@@ -50,6 +52,10 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -37,15 +37,12 @@ public class ItemWalrusRender implements IItemRenderer {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
|
||||
GL11.glPushMatrix();
|
||||
switch (type) {
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case EQUIPPED_FIRST_PERSON -> {
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glTranslatef(-1F, 0.5F, -0.5F);
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.1F);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case INVENTORY -> GL11.glTranslatef(-0.5F, -0.5F, -0.1F);
|
||||
default -> {}
|
||||
}
|
||||
this.modelWalrus.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -97,7 +97,7 @@ public class FluidTankRenderer {
|
||||
|
||||
for (int s = 0; s < DISPLAY_STAGES; ++s) {
|
||||
diplayLists[s] = GLAllocation.generateDisplayLists(1);
|
||||
GL11.glNewList(diplayLists[s], 4864 /* GL_COMPILE */);
|
||||
GL11.glNewList(diplayLists[s], GL11.GL_COMPILE);
|
||||
|
||||
liquidBlock.minX = 0.01f;
|
||||
liquidBlock.minY = 0;
|
||||
|
||||
@@ -15,7 +15,6 @@ public class Config {
|
||||
public static boolean noFluidPacket;
|
||||
public static boolean fluidIOBus;
|
||||
public static boolean removeRecipe;
|
||||
public static boolean blacklistEssentiaGas;
|
||||
public static double portableCellBattery;
|
||||
public static int packetSize;
|
||||
public static int packetRate;
|
||||
@@ -47,11 +46,6 @@ public class Config {
|
||||
"Fluid Craft for AE2",
|
||||
false,
|
||||
"Disable all recipes, for quick tweaker.");
|
||||
blacklistEssentiaGas = Config.getBoolean(
|
||||
"Blacklist Essentia Gas",
|
||||
"Fluid Craft for AE2",
|
||||
true,
|
||||
"Blacklist Essentia Gas from Thaumic Energistics, so they won't be stored in Fluid Storage Cells.");
|
||||
portableCellBattery = Config.get("Fluid Craft for AE2", "Portable Fluid Cell Battery Capacity", 20000D)
|
||||
.getDouble();
|
||||
packetSize = Config.get("Fluid Craft for AE2", "packetSize", 256, "Number of items to be sent per packet")
|
||||
@@ -62,8 +56,8 @@ public class Config {
|
||||
.getInt();
|
||||
if (packetRate <= 0) packetRate = 50;
|
||||
replaceEC2 = Config.getBoolean(
|
||||
"Fluid Craft for AE2",
|
||||
"replaceEC2",
|
||||
"Fluid Craft for AE2",
|
||||
true,
|
||||
"Set true to handle missing item mappings from EC2. Note to work properly, you must have all relevant parts.");
|
||||
if (Config.hasChanged()) Config.save();
|
||||
|
||||
@@ -78,16 +78,12 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
switch (meta) {
|
||||
case 1:
|
||||
return this.sideTopIcon;
|
||||
case 2:
|
||||
return this.sideBottomIcon;
|
||||
case 3:
|
||||
return this.sideMiddleIcon;
|
||||
default:
|
||||
return side == 0 ? this.bottomIcon : side == 1 ? this.topIcon : this.sideIcon;
|
||||
}
|
||||
return switch (meta) {
|
||||
case 1 -> this.sideTopIcon;
|
||||
case 2 -> this.sideBottomIcon;
|
||||
case 3 -> this.sideMiddleIcon;
|
||||
default -> side == 0 ? this.bottomIcon : side == 1 ? this.topIcon : this.sideIcon;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,8 +99,7 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileCertusQuartzTank) {
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) tile;
|
||||
if (tile instanceof TileCertusQuartzTank tank) {
|
||||
return tank.getFluidLightLevel();
|
||||
}
|
||||
return super.getLightValue(world, x, y, z);
|
||||
|
||||
@@ -76,21 +76,11 @@ public class BlockWalrus extends BaseBlockContainer {
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
switch (ForgeDirection.getOrientation(blockAccess.getBlockMetadata(x, y, z))) {
|
||||
case NORTH:
|
||||
setBlockBounds(0.0F, 0.0F, -1.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case EAST:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 2.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case SOUTH:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2.0F);
|
||||
break;
|
||||
case WEST:
|
||||
setBlockBounds(-1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
default:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case NORTH -> setBlockBounds(0.0F, 0.0F, -1.0F, 1.0F, 1.0F, 1.0F);
|
||||
case EAST -> setBlockBounds(0.0F, 0.0F, 0.0F, 2.0F, 1.0F, 1.0F);
|
||||
case SOUTH -> setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2.0F);
|
||||
case WEST -> setBlockBounds(-1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
default -> setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,12 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
@@ -87,10 +86,8 @@ public abstract class FCBaseItemCell extends AEBaseItem implements IStorageFluid
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
return requestedAddition == null || requestedAddition.getFluid() == null
|
||||
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,8 +96,7 @@ public abstract class FCBaseItemCell extends AEBaseItem implements IStorageFluid
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
if (inventory instanceof final IFluidCellInventoryHandler handler) {
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if (cellInventory != null) {
|
||||
|
||||
@@ -46,41 +46,42 @@ public class ItemBasicFluidStorageCell extends FCBaseItemCell
|
||||
setUnlocalizedName(NameConst.ITEM_FLUID_STORAGE + kilobytes);
|
||||
|
||||
switch (this.component) {
|
||||
case Cell1kPart:
|
||||
case Cell1kPart -> {
|
||||
this.idleDrain = 0.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4kPart:
|
||||
}
|
||||
case Cell4kPart -> {
|
||||
this.idleDrain = 1.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16kPart:
|
||||
}
|
||||
case Cell16kPart -> {
|
||||
this.idleDrain = 1.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell64kPart:
|
||||
}
|
||||
case Cell64kPart -> {
|
||||
this.idleDrain = 2.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell256kPart:
|
||||
}
|
||||
case Cell256kPart -> {
|
||||
this.idleDrain = 2.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell1024kPart:
|
||||
}
|
||||
case Cell1024kPart -> {
|
||||
this.idleDrain = 3.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4096kPart:
|
||||
}
|
||||
case Cell4096kPart -> {
|
||||
this.idleDrain = 3.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16384kPart:
|
||||
}
|
||||
case Cell16384kPart -> {
|
||||
this.idleDrain = 4.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default -> {
|
||||
this.idleDrain = 0.0;
|
||||
this.perType = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -54,10 +53,8 @@ public class ItemCreativeFluidStorageCell extends AEBaseItem
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
return requestedAddition == null || requestedAddition.getFluid() == null
|
||||
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,8 +108,7 @@ public class ItemCreativeFluidStorageCell extends AEBaseItem
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
if (inventory instanceof final IFluidCellInventoryHandler handler) {
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
shape = aIconRegister.registerIcon(NameConst.RES_KEY + NameConst.ITEM_FLUID_DROP);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack newStack(@Nullable FluidStack fluid) {
|
||||
if (fluid == null || fluid.amount <= 0) {
|
||||
return null;
|
||||
@@ -97,6 +98,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack newDisplayStack(FluidStack fluid) {
|
||||
if (fluid == null) {
|
||||
return null;
|
||||
@@ -120,6 +122,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
return getFluidStack(stack.getItemStack()) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FluidStack getFluidStack(ItemStack stack) {
|
||||
if (stack == null || stack.getItem() != ItemAndBlockHolder.DROP || !stack.hasTagCompound()) {
|
||||
return null;
|
||||
@@ -139,6 +142,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IAEFluidStack getAeFluidStack(@Nullable IAEItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
@@ -151,6 +155,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IAEItemStack newAeStack(@Nullable FluidStack fluid) {
|
||||
if (fluid == null || fluid.amount <= 0) {
|
||||
return null;
|
||||
@@ -163,6 +168,7 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IAEItemStack newAeStack(@Nullable IAEFluidStack fluid) {
|
||||
if (fluid == null || fluid.getStackSize() <= 0) {
|
||||
return null;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FluidStack getFluidStack(ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound()) {
|
||||
return null;
|
||||
@@ -82,10 +83,12 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FluidStack getFluidStack(@Nullable IAEItemStack stack) {
|
||||
return stack != null ? getFluidStack(stack.getItemStack()) : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack newStack(@Nullable FluidStack fluid) {
|
||||
if (fluid == null || fluid.amount == 0) {
|
||||
return null;
|
||||
@@ -99,6 +102,7 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack newStack(@Nullable IAEFluidStack fluid) {
|
||||
if (fluid == null || fluid.getStackSize() == 0) {
|
||||
return null;
|
||||
@@ -106,6 +110,7 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
return newStack(fluid.getFluidStack());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack newDisplayStack(@Nullable FluidStack fluid) {
|
||||
if (fluid == null) {
|
||||
return null;
|
||||
|
||||
@@ -47,41 +47,42 @@ public class ItemMultiFluidStorageCell extends FCBaseItemCell
|
||||
setUnlocalizedName(NameConst.ITEM_MULTI_FLUID_STORAGE + kilobytes);
|
||||
|
||||
switch (this.component) {
|
||||
case Cell1kPart:
|
||||
case Cell1kPart -> {
|
||||
this.idleDrain = 0.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4kPart:
|
||||
}
|
||||
case Cell4kPart -> {
|
||||
this.idleDrain = 1.0;
|
||||
this.perType = 32;
|
||||
break;
|
||||
case Cell16kPart:
|
||||
}
|
||||
case Cell16kPart -> {
|
||||
this.idleDrain = 1.5;
|
||||
this.perType = 128;
|
||||
break;
|
||||
case Cell64kPart:
|
||||
}
|
||||
case Cell64kPart -> {
|
||||
this.idleDrain = 2.0;
|
||||
this.perType = 512;
|
||||
break;
|
||||
case Cell256kPart:
|
||||
}
|
||||
case Cell256kPart -> {
|
||||
this.idleDrain = 2.5;
|
||||
this.perType = 2048;
|
||||
break;
|
||||
case Cell1024kPart:
|
||||
}
|
||||
case Cell1024kPart -> {
|
||||
this.idleDrain = 3.0;
|
||||
this.perType = 8192;
|
||||
break;
|
||||
case Cell4096kPart:
|
||||
}
|
||||
case Cell4096kPart -> {
|
||||
this.idleDrain = 3.5;
|
||||
this.perType = 32768;
|
||||
break;
|
||||
case Cell16384kPart:
|
||||
}
|
||||
case Cell16384kPart -> {
|
||||
this.idleDrain = 4.0;
|
||||
this.perType = 131072;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default -> {
|
||||
this.idleDrain = 0.0;
|
||||
this.perType = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
@@ -24,7 +25,6 @@ import com.glodblock.github.inventory.item.IItemInventory;
|
||||
import com.glodblock.github.inventory.item.PortableFluidCellInventory;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import com.google.common.base.Optional;
|
||||
@@ -78,8 +78,7 @@ public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
super.addCheckedInformation(stack, player, lines, displayMoreInfo);
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
if (inventory instanceof final IFluidCellInventoryHandler handler) {
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
if (cellInventory != null) {
|
||||
lines.add(
|
||||
@@ -132,10 +131,8 @@ public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
return requestedAddition == null || requestedAddition.getFluid() == null
|
||||
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,9 +102,7 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
}
|
||||
}
|
||||
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -153,9 +151,7 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
player.openContainer.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,9 +163,7 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
|
||||
}
|
||||
this.updateSchedulingMode(this.getSchedulingMode(), i);
|
||||
return didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
|
||||
} catch (GridAccessException e) {
|
||||
// Ignore
|
||||
}
|
||||
} catch (GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
return TickRateModulation.SLEEP;
|
||||
|
||||
@@ -130,10 +130,16 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
return false;
|
||||
}
|
||||
|
||||
final boolean flipState = this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER)
|
||||
== RedstoneMode.LOW_SIGNAL;
|
||||
return flipState ? this.reportingValue >= this.lastReportedValue + 1
|
||||
: this.reportingValue < this.lastReportedValue + 1;
|
||||
final Enum<?> redstoneEmitterSetting = this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER);
|
||||
final boolean result;
|
||||
|
||||
if (redstoneEmitterSetting == RedstoneMode.LOW_SIGNAL) {
|
||||
result = this.reportingValue >= this.lastReportedValue + 1;
|
||||
} else {
|
||||
result = this.reportingValue < this.lastReportedValue + 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
@@ -181,9 +187,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
this.myWatcher.add(myStack);
|
||||
}
|
||||
this.updateReportingValue(this.getProxy().getStorage().getFluidInventory());
|
||||
} catch (final GridAccessException e1) {
|
||||
// :/
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
private void updateReportingValue(final IMEMonitor<IAEFluidStack> monitor) {
|
||||
@@ -282,9 +286,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
public void onListUpdate() {
|
||||
try {
|
||||
this.updateReportingValue(this.getProxy().getStorage().getFluidInventory());
|
||||
} catch (final GridAccessException e) {
|
||||
// ;P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,40 +306,23 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
this.renderTorchAtAngle(0, -0.5, 0);
|
||||
Tessellator.instance.draw();
|
||||
// rh.setBounds( 7, 7, 10, 9, 9, 15 );
|
||||
// rh.renderInventoryBox( renderer );
|
||||
}
|
||||
|
||||
private void renderTorchAtAngle(double baseX, double baseY, double baseZ) {
|
||||
final boolean isOn = this.isLevelEmitterOn();
|
||||
final IIcon offTexture = this.getItemStack().getIconIndex();
|
||||
final IIcon IIcon = (isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture);
|
||||
//
|
||||
this.centerX = baseX + 0.5;
|
||||
this.centerY = baseY + 0.5;
|
||||
this.centerZ = baseZ + 0.5;
|
||||
|
||||
baseY += 7.0 / 16.0;
|
||||
|
||||
// double par11 = 0;
|
||||
|
||||
/*
|
||||
* double d5 = (double)IIcon.func_94209_e(); double d6 = (double)IIcon.func_94206_g(); double d7 =
|
||||
* (double)IIcon.func_94212_f(); double d8 = (double)IIcon.func_94210_h(); double d9 =
|
||||
* (double)IIcon.func_94214_a(7.0D); double d10 = (double)IIcon.func_94207_b(6.0D); double d11 =
|
||||
* (double)IIcon.func_94214_a(9.0D); double d12 = (double)IIcon.func_94207_b(8.0D); double d13 =
|
||||
* (double)IIcon.func_94214_a(7.0D); double d14 = (double)IIcon.func_94207_b(13.0D); double d15 =
|
||||
* (double)IIcon.func_94214_a(9.0D); double d16 = (double)IIcon.func_94207_b(15.0D);
|
||||
*/
|
||||
|
||||
final float var16 = IIcon.getMinU();
|
||||
final float var17 = IIcon.getMaxU();
|
||||
final float var18 = IIcon.getMinV();
|
||||
final float var19 = IIcon.getMaxV();
|
||||
/*
|
||||
* float var16 = (float)var14 / 256.0F; float var17 = ((float)var14 + 15.99F) / 256.0F; float var18 =
|
||||
* (float)var15 / 256.0F; float var19 = ((float)var15 + 15.99F) / 256.0F;
|
||||
*/
|
||||
|
||||
final double var20b = offTexture.getInterpolatedU(7.0D);
|
||||
final double var24b = offTexture.getInterpolatedU(9.0D);
|
||||
|
||||
@@ -376,56 +361,26 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
final double var44 = 0.0625D;
|
||||
final double Zero = 0;
|
||||
final double par10 = 0;
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) - var44,
|
||||
baseY + TorchLen - toff,
|
||||
baseZ + par10 * (1.0D - TorchLen) - var44,
|
||||
var20,
|
||||
var22);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) - var44,
|
||||
baseY + TorchLen - toff,
|
||||
baseZ + par10 * (1.0D - TorchLen) + var44,
|
||||
var20,
|
||||
var26);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) + var44,
|
||||
baseY + TorchLen - toff,
|
||||
baseZ + par10 * (1.0D - TorchLen) + var44,
|
||||
var24,
|
||||
var26);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) + var44,
|
||||
baseY + TorchLen - toff,
|
||||
baseZ + par10 * (1.0D - TorchLen) - var44,
|
||||
var24,
|
||||
var22);
|
||||
|
||||
final double x = baseX + Zero * (1.0D - TorchLen) - var44;
|
||||
final double x1 = baseX + Zero * (1.0D - TorchLen) + var44;
|
||||
|
||||
final double y = baseY + TorchLen - toff;
|
||||
final double var422 = 0.1915D + 1.0 / 16.0;
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) + var44,
|
||||
baseY + var422,
|
||||
baseZ + par10 * (1.0D - TorchLen) - var44,
|
||||
var24b,
|
||||
var22b);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) + var44,
|
||||
baseY + var422,
|
||||
baseZ + par10 * (1.0D - TorchLen) + var44,
|
||||
var24b,
|
||||
var26b);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) - var44,
|
||||
baseY + var422,
|
||||
baseZ + par10 * (1.0D - TorchLen) + var44,
|
||||
var20b,
|
||||
var26b);
|
||||
this.addVertexWithUV(
|
||||
baseX + Zero * (1.0D - TorchLen) - var44,
|
||||
baseY + var422,
|
||||
baseZ + par10 * (1.0D - TorchLen) - var44,
|
||||
var20b,
|
||||
var22b);
|
||||
final double y1 = baseY + var422;
|
||||
|
||||
final double z = baseZ + par10 * (1.0D - TorchLen) - var44;
|
||||
final double z1 = baseZ + par10 * (1.0D - TorchLen) + var44;
|
||||
|
||||
this.addVertexWithUV(x, y, z, var20, var22);
|
||||
this.addVertexWithUV(x, y, z1, var20, var26);
|
||||
this.addVertexWithUV(x1, y, z1, var24, var26);
|
||||
this.addVertexWithUV(x1, y, z, var24, var22);
|
||||
|
||||
this.addVertexWithUV(x1, y1, z, var24b, var22b);
|
||||
this.addVertexWithUV(x1, y1, z1, var24b, var26b);
|
||||
this.addVertexWithUV(x, y1, z1, var20b, var26b);
|
||||
this.addVertexWithUV(x, y1, z, var20b, var22b);
|
||||
|
||||
this.addVertexWithUV(baseX + var44 + Zero, baseY, baseZ - var44 + par10, var32, var30);
|
||||
this.addVertexWithUV(baseX + var44 + Zero, baseY, baseZ + var44 + par10, var32, var34);
|
||||
@@ -503,13 +458,6 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
rh.setTexture(this.getItemStack().getIconIndex());
|
||||
// rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() );
|
||||
|
||||
// rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
// rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
// rh.setBounds( 7, 7, 10, 9, 9, 15 );
|
||||
// rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
@@ -523,8 +471,6 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
|
||||
rh.setBounds(7, 7, 11, 9, 9, 12);
|
||||
this.renderLights(x, y, z, rh, renderer);
|
||||
|
||||
// super.renderWorldBlock( world, x, y, z, block, modelId, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,9 +41,8 @@ public class PartFluidPatternTerminal extends FCFluidEncodeTerminal {
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details = pattern
|
||||
if (is != null && is.getItem() instanceof final ICraftingPatternItem craftingPatternItem) {
|
||||
final ICraftingPatternDetails details = craftingPatternItem
|
||||
.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
if (details != null) {
|
||||
final IAEItemStack[] inItems = details.getInputs();
|
||||
|
||||
@@ -40,9 +40,8 @@ public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details = pattern
|
||||
if (is != null && is.getItem() instanceof final ICraftingPatternItem craftingPatternItem) {
|
||||
final ICraftingPatternDetails details = craftingPatternItem
|
||||
.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
|
||||
if (details != null) {
|
||||
|
||||
@@ -348,8 +348,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
if (esh != null) {
|
||||
final IMEInventory<?> inv = esh
|
||||
.getInventory(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
if (inv instanceof MEMonitorIFluidHandler) {
|
||||
final MEMonitorIFluidHandler h = (MEMonitorIFluidHandler) inv;
|
||||
if (inv instanceof final MEMonitorIFluidHandler h) {
|
||||
h.setMode((StorageFilter) this.getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
h.setActionSource(new MachineSource(this));
|
||||
this.monitor = (MEMonitorIFluidHandler) inv;
|
||||
|
||||
@@ -179,8 +179,8 @@ public abstract class FCFluidEncodeTerminal extends FCPart implements IItemPatte
|
||||
|
||||
@Override
|
||||
public void sortCraftingItems() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fluids = new ArrayList<ItemStack>();
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
List<ItemStack> fluids = new ArrayList<>();
|
||||
for (ItemStack is : this.crafting) {
|
||||
if (is == null) continue;
|
||||
if (is.getItem() instanceof ItemFluidPacket) {
|
||||
|
||||
@@ -76,7 +76,7 @@ public abstract class FCPart extends AEBasePart
|
||||
this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
|
||||
this.getProxy().setIdlePowerUsage(1.0 / 2.0);
|
||||
} else {
|
||||
this.getProxy().setIdlePowerUsage(1.0 / 16.0); // lights drain a little bit.
|
||||
this.getProxy().setIdlePowerUsage(1.0 / 16.0); // lights drain a little
|
||||
}
|
||||
this.cm.registerSetting(Settings.SORT_BY, SortOrder.NAME);
|
||||
this.cm.registerSetting(Settings.VIEW_MODE, ViewItems.ALL);
|
||||
@@ -163,9 +163,7 @@ public abstract class FCPart extends AEBasePart
|
||||
if (this.getProxy().getNode().meetsChannelRequirements()) {
|
||||
this.clientFlags = this.getClientFlags() | FCPart.CHANNEL_FLAG;
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// um.. nothing.
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
|
||||
data.writeByte((byte) this.getClientFlags());
|
||||
}
|
||||
@@ -195,18 +193,10 @@ public abstract class FCPart extends AEBasePart
|
||||
}
|
||||
|
||||
switch (this.getSpin()) {
|
||||
case 0:
|
||||
this.spin = 1;
|
||||
break;
|
||||
case 1:
|
||||
this.spin = 3;
|
||||
break;
|
||||
case 2:
|
||||
this.spin = 0;
|
||||
break;
|
||||
case 3:
|
||||
this.spin = 2;
|
||||
break;
|
||||
case 0 -> this.spin = 1;
|
||||
case 1 -> this.spin = 3;
|
||||
case 2 -> this.spin = 0;
|
||||
case 3 -> this.spin = 2;
|
||||
}
|
||||
|
||||
this.getHost().markForUpdate();
|
||||
@@ -276,9 +266,7 @@ public abstract class FCPart extends AEBasePart
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
try {
|
||||
return this.getProxy().getStorage().getItemInventory();
|
||||
} catch (final GridAccessException e) {
|
||||
// err nope?
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -286,9 +274,7 @@ public abstract class FCPart extends AEBasePart
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
try {
|
||||
return this.getProxy().getStorage().getFluidInventory();
|
||||
} catch (final GridAccessException e) {
|
||||
// err nope?
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -434,27 +420,27 @@ public abstract class FCPart extends AEBasePart
|
||||
/**
|
||||
* The texture used for the bright front layer.
|
||||
* <p>
|
||||
* The final texture can overlap any of the the texture in no particular order.
|
||||
* The final texture can overlap any of the texture in no particular order.
|
||||
*/
|
||||
public abstract FCPartsTexture getFrontBright();
|
||||
|
||||
/**
|
||||
* The texture used for the colored (medium) front layer.
|
||||
* <p>
|
||||
* The final texture can overlap any of the the texture in no particular order.
|
||||
* The final texture can overlap any of the texture in no particular order.
|
||||
*/
|
||||
public abstract FCPartsTexture getFrontColored();
|
||||
|
||||
/**
|
||||
* The texture used for the dark front layer.
|
||||
* <p>
|
||||
* The final texture can overlap any of the the texture in no particular order.
|
||||
* The final texture can overlap any of the texture in no particular order.
|
||||
*/
|
||||
public abstract FCPartsTexture getFrontDark();
|
||||
|
||||
/**
|
||||
* Should the part emit light. This actually only affects the light level, light source use a level of 15 and non
|
||||
* light source 9.
|
||||
* Should the part emit light. This actually only affects the light level, light source use a level of 15 and
|
||||
* non-light source 9.
|
||||
*/
|
||||
public abstract boolean isLightSource();
|
||||
}
|
||||
@@ -175,9 +175,7 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
|
||||
this.updateReportingValue(this.getProxy().getStorage().getFluidInventory());
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// >.>
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
protected void extractItem(final EntityPlayer player) {}
|
||||
@@ -248,41 +246,35 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
}
|
||||
|
||||
private void tesrRenderScreen(final Tessellator tess, final IAEFluidStack ais) {
|
||||
// GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||
|
||||
final ForgeDirection d = this.getSide();
|
||||
|
||||
GL11.glTranslated(d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77);
|
||||
|
||||
switch (d) {
|
||||
case UP:
|
||||
case UP -> {
|
||||
GL11.glScalef(1.0f, -1.0f, 1.0f);
|
||||
GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
GL11.glRotatef(this.getSpin() * 90.0F, 0, 0, 1);
|
||||
break;
|
||||
case DOWN:
|
||||
}
|
||||
case DOWN -> {
|
||||
GL11.glScalef(1.0f, -1.0f, 1.0f);
|
||||
GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
GL11.glRotatef(this.getSpin() * -90.0F, 0, 0, 1);
|
||||
break;
|
||||
case EAST:
|
||||
}
|
||||
case EAST -> {
|
||||
GL11.glScalef(-1.0f, -1.0f, -1.0f);
|
||||
GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case WEST:
|
||||
}
|
||||
case WEST -> {
|
||||
GL11.glScalef(-1.0f, -1.0f, -1.0f);
|
||||
GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case NORTH:
|
||||
GL11.glScalef(-1.0f, -1.0f, -1.0f);
|
||||
break;
|
||||
case SOUTH:
|
||||
}
|
||||
case NORTH -> GL11.glScalef(-1.0f, -1.0f, -1.0f);
|
||||
case SOUTH -> {
|
||||
GL11.glScalef(-1.0f, -1.0f, -1.0f);
|
||||
GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default -> {}
|
||||
}
|
||||
final ItemStack sis = ItemFluidPacket.newDisplayStack(ais.getFluidStack());
|
||||
|
||||
@@ -296,7 +288,6 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
// RenderHelper.enableGUIStandardItemLighting();
|
||||
tess.setColorOpaque_F(1.0f, 1.0f, 1.0f);
|
||||
|
||||
ClientHelper.proxy.doRenderItem(sis, this.getTile().getWorldObj());
|
||||
@@ -318,7 +309,6 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
GL11.glTranslatef(-0.5f * width, 0.0f, -1.0f);
|
||||
fr.drawString(renderedStackSize, 0, 0, 0);
|
||||
}
|
||||
// GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,9 +62,7 @@ public abstract class FCSharedFluidBus extends PartUpgradeable implements IGridT
|
||||
} else {
|
||||
this.getProxy().getTick().sleepDevice(this.getProxy().getNode());
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,24 +57,15 @@ public enum CellType {
|
||||
}
|
||||
|
||||
public static EnumChatFormatting getTypeColor(CellType type) {
|
||||
switch (type) {
|
||||
case Cell1kPart:
|
||||
return EnumChatFormatting.GOLD;
|
||||
case Cell4kPart:
|
||||
return EnumChatFormatting.YELLOW;
|
||||
case Cell16kPart:
|
||||
return EnumChatFormatting.GREEN;
|
||||
case Cell64kPart:
|
||||
return EnumChatFormatting.AQUA;
|
||||
case Cell256kPart:
|
||||
return EnumChatFormatting.BLUE;
|
||||
case Cell1024kPart:
|
||||
return EnumChatFormatting.LIGHT_PURPLE;
|
||||
case Cell4096kPart:
|
||||
return EnumChatFormatting.RED;
|
||||
case Cell16384kPart:
|
||||
return EnumChatFormatting.DARK_PURPLE;
|
||||
}
|
||||
return EnumChatFormatting.WHITE;
|
||||
return switch (type) {
|
||||
case Cell1kPart -> EnumChatFormatting.GOLD;
|
||||
case Cell4kPart -> EnumChatFormatting.YELLOW;
|
||||
case Cell16kPart -> EnumChatFormatting.GREEN;
|
||||
case Cell64kPart -> EnumChatFormatting.AQUA;
|
||||
case Cell256kPart -> EnumChatFormatting.BLUE;
|
||||
case Cell1024kPart -> EnumChatFormatting.LIGHT_PURPLE;
|
||||
case Cell4096kPart -> EnumChatFormatting.RED;
|
||||
case Cell16384kPart -> EnumChatFormatting.DARK_PURPLE;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,7 @@ public class FluidCellHandler implements ICellHandler {
|
||||
public void openChestGui(final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler,
|
||||
final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan) {
|
||||
if (chan == StorageChannel.FLUIDS) {
|
||||
if (chest instanceof TileEntity) {
|
||||
TileEntity te = (TileEntity) chest;
|
||||
if (chest instanceof TileEntity te) {
|
||||
InventoryHandler
|
||||
.openGui(player, te.getWorldObj(), new BlockPos(te), chest.getUp(), GuiType.FLUID_TERMINAL);
|
||||
}
|
||||
@@ -59,8 +58,7 @@ public class FluidCellHandler implements ICellHandler {
|
||||
|
||||
@Override
|
||||
public int getStatusForCell(final ItemStack is, final IMEInventory handler) {
|
||||
if (handler instanceof FluidCellInventoryHandler) {
|
||||
final FluidCellInventoryHandler ci = (FluidCellInventoryHandler) handler;
|
||||
if (handler instanceof final FluidCellInventoryHandler ci) {
|
||||
return ci.getStatusForCell();
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -99,9 +99,8 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
if (drained == null || drained.amount < fluid.amount) {
|
||||
TileEntity offTE = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if (offTE instanceof TileCertusQuartzTank) {
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) offTE;
|
||||
FluidStack externallyDrained = tank.drain(
|
||||
if (offTE instanceof TileCertusQuartzTank tileCertusQuartzTank) {
|
||||
FluidStack externallyDrained = tileCertusQuartzTank.drain(
|
||||
new FluidStack(fluid.getFluid(), fluid.amount - (drained != null ? drained.amount : 0)),
|
||||
doDrain,
|
||||
false);
|
||||
@@ -158,16 +157,18 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
if (filled < fluid.amount) {
|
||||
TileEntity offTE = this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
if (offTE instanceof TileCertusQuartzTank) {
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) offTE;
|
||||
return filled + tank.fill(new FluidStack(fluid.getFluid(), fluid.amount - filled), doFill, false);
|
||||
if (offTE instanceof TileCertusQuartzTank tileCertusQuartzTank) {
|
||||
return filled + tileCertusQuartzTank
|
||||
.fill(new FluidStack(fluid.getFluid(), fluid.amount - filled), doFill, false);
|
||||
}
|
||||
}
|
||||
|
||||
return filled;
|
||||
}
|
||||
|
||||
/* IFluidHandler */
|
||||
/**
|
||||
* An override for {@link IFluidHandler}
|
||||
*/
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
if (resource == null || this.tank.getFluid() != null && resource.getFluid() != this.tank.getFluid().getFluid())
|
||||
@@ -223,7 +224,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
|
||||
|
||||
private TileCertusQuartzTank getTankBelow(TileEntity tile) {
|
||||
TileEntity tank = new BlockPos(tile).getOffSet(0, -1, 0).getTileEntity();
|
||||
if (tank != null && tank instanceof TileCertusQuartzTank) {
|
||||
if (tank instanceof TileCertusQuartzTank) {
|
||||
return (TileCertusQuartzTank) tank;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -50,9 +50,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
.findPrecise(AEFluidStack.create(fs));
|
||||
this.invFluids.setFluidInSlot(0, ias);
|
||||
if (ias != null) return true;
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -67,9 +65,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
this.source);
|
||||
if (notInserted != null) return fluidStack.amount -= notInserted.getStackSize();
|
||||
return fluidStack.amount;
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -92,9 +88,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
.extractItems(ias, actionable, this.source);
|
||||
if (extracted == null) return null;
|
||||
return extracted.getFluidStack();
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -113,9 +107,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
try {
|
||||
return this.getProxy().getStorage().getFluidInventory().getStorageList()
|
||||
.findPrecise(this.getAEFluidStack());
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -43,7 +44,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
@Override
|
||||
public boolean canBeRotated() {
|
||||
return false;
|
||||
// based
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,7 +190,8 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
if (fluidGrid != null) {
|
||||
for (IAEFluidStack fluid : fluidGrid.getStorageList()) {
|
||||
IAEItemStack stack = ItemFluidDrop.newAeStack(fluid);
|
||||
if (stack != null) {
|
||||
if (stack != null
|
||||
&& !FluidCraftAPI.instance().isBlacklistedInDisplay(fluid.getFluid().getClass())) {
|
||||
itemCache.add(stack);
|
||||
}
|
||||
}
|
||||
@@ -210,7 +211,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
@Override
|
||||
public boolean isValid(Object verificationToken) {
|
||||
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
|
||||
return fluidGrid != null && fluidGrid == verificationToken /* && !conflict */;
|
||||
return fluidGrid != null && fluidGrid == verificationToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -221,7 +222,8 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
List<IAEItemStack> mappedChanges = new ArrayList<>();
|
||||
for (IAEFluidStack fluidStack : change) {
|
||||
IAEItemStack itemStack = ItemFluidDrop.newAeStack(fluidStack);
|
||||
if (itemStack != null) {
|
||||
if (itemStack != null
|
||||
&& !FluidCraftAPI.instance().isBlacklistedInDisplay(fluidStack.getFluid().getClass())) {
|
||||
mappedChanges.add(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,34 +14,17 @@ public class FCClassTransformer implements IClassTransformer {
|
||||
public byte[] transform(String name, String transformedName, byte[] code) {
|
||||
Transform tform;
|
||||
switch (transformedName) {
|
||||
case "appeng.crafting.CraftingTreeNode":
|
||||
tform = CraftingTreeNodeTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.me.cluster.implementations.CraftingCPUCluster":
|
||||
tform = CraftingCpuTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.helpers.DualityInterface":
|
||||
tform = DualityInterfaceTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.container.implementations.ContainerInterfaceTerminal":
|
||||
tform = ContainerInterfaceTerminalTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.client.gui.implementations.GuiCraftingCPU":
|
||||
case "appeng.client.gui.implementations.GuiCraftConfirm":
|
||||
case "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm":
|
||||
tform = GuiCraftingTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.integration.modules.NEI":
|
||||
tform = NEITransfermer.INSTANCE;
|
||||
break;
|
||||
case "appeng.core.features.registries.ExternalStorageRegistry":
|
||||
tform = ExternalStorageRegistryTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.core.sync.packets.PacketCompressedNBT":
|
||||
tform = PacketCompressedNBTTransformer.INSTANCE;
|
||||
break;
|
||||
default:
|
||||
case "appeng.crafting.CraftingTreeNode" -> tform = CraftingTreeNodeTransformer.INSTANCE;
|
||||
case "appeng.me.cluster.implementations.CraftingCPUCluster" -> tform = CraftingCpuTransformer.INSTANCE;
|
||||
case "appeng.helpers.DualityInterface" -> tform = DualityInterfaceTransformer.INSTANCE;
|
||||
case "appeng.container.implementations.ContainerInterfaceTerminal" -> tform = ContainerInterfaceTerminalTransformer.INSTANCE;
|
||||
case "appeng.client.gui.implementations.GuiCraftingCPU", "appeng.client.gui.implementations.GuiCraftConfirm", "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm" -> tform = GuiCraftingTransformer.INSTANCE;
|
||||
case "appeng.integration.modules.NEI" -> tform = NEITransfermer.INSTANCE;
|
||||
case "appeng.core.features.registries.ExternalStorageRegistry" -> tform = ExternalStorageRegistryTransformer.INSTANCE;
|
||||
case "appeng.core.sync.packets.PacketCompressedNBT" -> tform = PacketCompressedNBTTransformer.INSTANCE;
|
||||
default -> {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
System.out.println("[AE2FC] Transforming class: " + transformedName);
|
||||
return tform.transformClass(code);
|
||||
|
||||
+6
-10
@@ -27,16 +27,12 @@ public class DualityInterfaceTransformer extends FCClassTransformer.ClassMapper
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
switch (name) {
|
||||
case "pushItemsOut":
|
||||
case "pushPattern":
|
||||
case "isBusy":
|
||||
return new TransformInvAdaptorCalls(
|
||||
api,
|
||||
super.visitMethod(access, name, desc, signature, exceptions));
|
||||
default:
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
return switch (name) {
|
||||
case "pushItemsOut", "pushPattern", "isBusy" -> new TransformInvAdaptorCalls(
|
||||
api,
|
||||
super.visitMethod(access, name, desc, signature, exceptions));
|
||||
default -> super.visitMethod(access, name, desc, signature, exceptions);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,16 +27,15 @@ public class NEITransfermer extends FCClassTransformer.ClassMapper {
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
switch (name) {
|
||||
case "getStackUnderMouse":
|
||||
return new TransformStackUnderMouse(
|
||||
api,
|
||||
super.visitMethod(access, name, desc, signature, exceptions));
|
||||
case "shouldShowTooltip":
|
||||
return new TransformShowTooltip(api, super.visitMethod(access, name, desc, signature, exceptions));
|
||||
default:
|
||||
return super.visitMethod(access, name, desc, signature, 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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import li.cil.oc.api.Items;
|
||||
import li.cil.oc.api.detail.ItemInfo;
|
||||
|
||||
/**
|
||||
* Shell class to organize proxy replacements and hide the ugliness
|
||||
* A shell class to organize proxy replacements and hide the ugliness
|
||||
*/
|
||||
public class ItemReplacements {
|
||||
|
||||
@@ -78,9 +78,11 @@ public class ItemReplacements {
|
||||
registry.put("extracells:storage.physical.void", voidCell);
|
||||
deprecateItem("pattern.fluid", ItemAndBlockHolder.PATTERN);
|
||||
deprecateWireless("terminal.fluid.wireless", ItemAndBlockHolder.WIRELESS_FLUID_TERM);
|
||||
|
||||
/* Storage casings */
|
||||
deprecateItem("storage.casing", 0, AEApi.instance().definitions().materials().emptyAdvancedStorageCell());
|
||||
deprecateItem("storage.casing", 1, ItemAndBlockHolder.CELL_HOUSING, 2);
|
||||
|
||||
/* Storage components (1k component, etc.) */
|
||||
deprecateItem("storage.component", 0, AEApi.instance().definitions().materials().cell256kPart());
|
||||
deprecateItem("storage.component", 1, AEApi.instance().definitions().materials().cell1024kPart());
|
||||
|
||||
@@ -69,8 +69,7 @@ public class ProxyItem extends FCBaseItem {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) {
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entityIn;
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityPlayer player) {
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); ++i) {
|
||||
ItemStack s = player.inventory.getStackInSlot(i);
|
||||
if (s == stack) {
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -186,6 +188,7 @@ public class ProxyPart implements IPart, IPartDeprecated {
|
||||
return def;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
return extra;
|
||||
|
||||
@@ -23,12 +23,6 @@ public class ProxyPartItem extends ProxyItem implements IPartItem {
|
||||
super(ec2itemName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param srcMeta
|
||||
* @param replacement
|
||||
* @param part
|
||||
*/
|
||||
protected void addItemPart(int srcMeta, Item replacement, Function<ProxyPartItem, ProxyPart> part) {
|
||||
this.replacements.put(srcMeta, new PartReplacement(replacement, part));
|
||||
}
|
||||
@@ -42,8 +36,7 @@ public class ProxyPartItem extends ProxyItem implements IPartItem {
|
||||
@Override
|
||||
public IPart createPartFromItemStack(ItemStack is) {
|
||||
final int meta = is.getItemDamage();
|
||||
if (this.replacements.get(meta) instanceof PartReplacement) {
|
||||
PartReplacement part = (PartReplacement) this.replacements.get(meta);
|
||||
if (this.replacements.get(meta) instanceof PartReplacement part) {
|
||||
return part.proxyPart.apply(this);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import static net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
@@ -25,6 +27,7 @@ public class ProxyFluidBusIO extends ProxyPart {
|
||||
super(partItem);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Transform NBT in place
|
||||
@@ -50,18 +53,10 @@ public class ProxyFluidBusIO extends ProxyPart {
|
||||
// Redstone mode
|
||||
RedstoneMode redstoneMode = RedstoneMode.values()[extra.getInteger("redstoneMode")];
|
||||
switch (redstoneMode) {
|
||||
case LOW_SIGNAL:
|
||||
extra.setString("REDSTONE_CONTROLLED", "LOW_SIGNAL");
|
||||
break;
|
||||
case HIGH_SIGNAL:
|
||||
extra.setString("REDSTONE_CONTROLLED", "HIGH_SIGNAL");
|
||||
break;
|
||||
case SIGNAL_PULSE:
|
||||
extra.setString("REDSTONE_CONTROLLED", "SIGNAL_PULSE");
|
||||
break;
|
||||
default:
|
||||
extra.setString("REDSTONE_CONTROLLED", "IGNORE");
|
||||
break;
|
||||
case LOW_SIGNAL -> extra.setString("REDSTONE_CONTROLLED", "LOW_SIGNAL");
|
||||
case HIGH_SIGNAL -> extra.setString("REDSTONE_CONTROLLED", "HIGH_SIGNAL");
|
||||
case SIGNAL_PULSE -> extra.setString("REDSTONE_CONTROLLED", "SIGNAL_PULSE");
|
||||
default -> extra.setString("REDSTONE_CONTROLLED", "IGNORE");
|
||||
}
|
||||
extra.removeTag("redstoneMode");
|
||||
// Part data
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
@@ -13,6 +15,7 @@ public class ProxyFluidInterface extends ProxyPart {
|
||||
super(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Internal fluids - ConfigInv and FluidInv
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import static net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
@@ -31,6 +33,7 @@ public class ProxyFluidStorage extends ProxyPart {
|
||||
super(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Transform in place, less messy IMO
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.glodblock.github.crossmod.extracells.ProxyPart;
|
||||
@@ -13,6 +15,7 @@ public class ProxyLevelEmitter extends ProxyPart {
|
||||
super(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Fluid
|
||||
|
||||
+4
-1
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.glodblock.github.crossmod.extracells.ProxyPart;
|
||||
@@ -13,9 +15,10 @@ public class ProxyOreDictExportBus extends ProxyPart {
|
||||
super(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Node tag... should've used OOP here but im too lazy to fix it now
|
||||
// TODO: Node tag... should use OOP here.
|
||||
extra.setTag("part", extra.getCompoundTag("node").getCompoundTag("node0"));
|
||||
extra.removeTag("node");
|
||||
// Ore dict card
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.glodblock.github.crossmod.extracells.parts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@@ -13,6 +15,7 @@ public class ProxyStorageMonitor extends ProxyPart {
|
||||
super(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound transformNBT(NBTTagCompound extra) {
|
||||
// Fluid
|
||||
|
||||
+3
-6
@@ -3,10 +3,9 @@ package com.glodblock.github.crossmod.extracells.storage;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.api.FluidCraftAPI;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.crossmod.extracells.ProxyItem;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
@@ -46,10 +45,8 @@ public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCel
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
return requestedAddition == null || requestedAddition.getFluid() == null
|
||||
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -28,8 +28,7 @@ public class ProxyVoidStorageCell extends ItemVoidStorageCell {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) {
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entityIn;
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityPlayer player) {
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); ++i) {
|
||||
ItemStack s = player.inventory.getStackInSlot(i);
|
||||
if (s == stack) {
|
||||
|
||||
+1
-2
@@ -73,8 +73,7 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
}
|
||||
Node node = node().network().node(address);
|
||||
if (!(node instanceof Component)) throw new IllegalArgumentException("no such component");
|
||||
if (!(node.host() instanceof Database)) throw new IllegalArgumentException("not a database");
|
||||
Database database = (Database) node.host();
|
||||
if (!(node.host() instanceof Database database)) throw new IllegalArgumentException("not a database");
|
||||
if (index >= 0 && index < DualityFluidInterface.NUMBER_OF_TANKS) {
|
||||
ItemStack data = database.getStackInSlot(entry - 1);
|
||||
if (data == null) {
|
||||
|
||||
+1
-2
@@ -77,9 +77,8 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
if (pattern == null) {
|
||||
throw new IllegalArgumentException("No pattern here!");
|
||||
}
|
||||
if (pattern.getItem() instanceof ItemEncodedPattern
|
||||
if (pattern.getItem() instanceof ItemEncodedPattern iep
|
||||
&& !(pattern.getItem() instanceof ItemFluidEncodedPattern)) {
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) pattern.getItem();
|
||||
return iep.getOutput(pattern) == null;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
@@ -11,9 +12,11 @@ import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.IEssentiaContainerItem;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumicenergistics.api.ThEApi;
|
||||
import thaumicenergistics.api.storage.IAspectStack;
|
||||
import thaumicenergistics.common.fluids.GaseousEssentia;
|
||||
import thaumicenergistics.common.integration.tc.EssentiaItemContainerHelper;
|
||||
@@ -22,7 +25,12 @@ import thaumicenergistics.common.storage.AspectStack;
|
||||
public class AspectUtil {
|
||||
|
||||
public static final EssentiaItemContainerHelper HELPER = EssentiaItemContainerHelper.INSTANCE;
|
||||
public static final int R = 128;
|
||||
public static int R = 128;
|
||||
|
||||
@Optional.Method(modid = "thaumicenergistics")
|
||||
public static void init() {
|
||||
R = ThEApi.instance().config().conversionMultiplier();
|
||||
}
|
||||
|
||||
public static boolean isPlayerDiscoveredAspect(final EntityPlayer player, final Aspect aspect) {
|
||||
if (player != null && aspect != null) {
|
||||
@@ -31,6 +39,10 @@ public class AspectUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isEssentiaGas(Fluid fluid) {
|
||||
return fluid instanceof GaseousEssentia;
|
||||
}
|
||||
|
||||
public static boolean isEssentiaGas(FluidStack fluid) {
|
||||
return fluid != null && fluid.getFluid() instanceof GaseousEssentia;
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ public class FCTooltipHandlerWaila extends TooltipHandlerWaila {
|
||||
+ EnumChatFormatting.RESET);
|
||||
}
|
||||
String modName = Util.getFluidModName(fs.getFluid());
|
||||
if (modName != null && !modName.equals(""))
|
||||
currenttip.set(currenttip.size() - 1, "\u00a79\u00a7o" + modName);
|
||||
if (modName != null && !modName.equals("")) currenttip.set(currenttip.size() - 1, "§9§o" + modName);
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class PartWailaDataProvider implements IWailaDataProvider {
|
||||
ItemStack wailaStack = null;
|
||||
|
||||
for (final IPartWailaDataProvider provider : this.providers) {
|
||||
wailaStack = provider.getWailaStack(part, config, wailaStack);
|
||||
wailaStack = provider.getWailaStack(part, config, null);
|
||||
if (wailaStack != null) break;
|
||||
}
|
||||
return wailaStack;
|
||||
|
||||
@@ -349,7 +349,7 @@ public class AEFluidInventory implements IAEFluidTank {
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return Math.min(AEFluidInventory.this.capacity, Integer.MAX_VALUE);
|
||||
return AEFluidInventory.this.capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,7 +82,6 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
}
|
||||
|
||||
public static InventoryAdaptor wrap(TileEntity capProvider, ForgeDirection face) {
|
||||
// sometimes i wish 1.7.10 has cap system.
|
||||
TileEntity inter = capProvider.getWorldObj().getTileEntity(
|
||||
capProvider.xCoord + face.offsetX,
|
||||
capProvider.yCoord + face.offsetY,
|
||||
@@ -376,9 +375,8 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
}
|
||||
if (tank != null && tank.getTankInfo(direction) != null) {
|
||||
List<FluidTankInfo[]> tankInfos = new LinkedList<>();
|
||||
if (Util.getPart(tank, direction) instanceof PartP2PLiquids) {
|
||||
if (Util.getPart(tank, direction) instanceof PartP2PLiquids invFluidsP2P) {
|
||||
// read other ends of p2p for blocking mode
|
||||
PartP2PLiquids invFluidsP2P = (PartP2PLiquids) Util.getPart(tank, direction);
|
||||
try {
|
||||
Iterator<PartP2PLiquids> it = invFluidsP2P.getOutputs().iterator();
|
||||
boolean checkedInput = false;
|
||||
@@ -430,7 +428,7 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
if (te instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity();
|
||||
if (mte instanceof MetaPipeEntity) {
|
||||
return ((MetaPipeEntity) mte).isConnectedAtSide(direction.ordinal());
|
||||
return ((MetaPipeEntity) mte).isConnectedAtSide(direction);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -22,7 +22,6 @@ public class FluidConvertingInventoryCrafting extends InventoryCrafting {
|
||||
if (fluid != null) {
|
||||
super.setInventorySlotContents(index, ItemFluidPacket.newStack(new FluidStack(fluid, stack.stackSize)));
|
||||
} else {
|
||||
// wtf?
|
||||
super.setInventorySlotContents(
|
||||
index,
|
||||
ItemFluidPacket.newStack(new FluidStack(FluidRegistry.WATER, 1000)));
|
||||
|
||||
@@ -181,10 +181,8 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
public IItemList<IAEFluidStack> getAvailableItems(IItemList out) {
|
||||
Iterator<?> var2 = this.cache.iterator();
|
||||
|
||||
while (var2.hasNext()) {
|
||||
IAEFluidStack fs = (IAEFluidStack) var2.next();
|
||||
for (IAEFluidStack fs : this.cache) {
|
||||
out.addStorage(fs);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -30,9 +30,8 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
if (te instanceof ITileStorageMonitorable
|
||||
&& ((ITileStorageMonitorable) te).getMonitorable(d, src) != null) {
|
||||
return ((ITileStorageMonitorable) te).getMonitorable(d, src).getFluidInventory();
|
||||
} else if (Util.getPart(te, d.getOpposite()) instanceof ITileStorageMonitorable
|
||||
} else if (Util.getPart(te, d.getOpposite()) instanceof ITileStorageMonitorable part
|
||||
&& ((ITileStorageMonitorable) Util.getPart(te, d.getOpposite())).getMonitorable(d, src) != null) {
|
||||
ITileStorageMonitorable part = (ITileStorageMonitorable) Util.getPart(te, d.getOpposite());
|
||||
return part.getMonitorable(d, src).getFluidInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import appeng.helpers.IPriorityHost;
|
||||
|
||||
public enum GuiType {
|
||||
|
||||
RENAMER(new PartOrItemGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
RENAMER(new PartOrItemGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -39,7 +39,7 @@ public enum GuiType {
|
||||
return new GuiRenamer(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
FLUID_AUTO_FILLER(new TileGuiFactory<TileFluidAutoFiller>(TileFluidAutoFiller.class) {
|
||||
FLUID_AUTO_FILLER(new TileGuiFactory<>(TileFluidAutoFiller.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileFluidAutoFiller inv) {
|
||||
@@ -52,7 +52,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_LEVEL_EMITTER(new PartGuiFactory<PartFluidLevelEmitter>(PartFluidLevelEmitter.class) {
|
||||
FLUID_LEVEL_EMITTER(new PartGuiFactory<>(PartFluidLevelEmitter.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidLevelEmitter inv) {
|
||||
@@ -65,7 +65,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
LEVEL_MAINTAINER(new TileGuiFactory<TileLevelMaintainer>(TileLevelMaintainer.class) {
|
||||
LEVEL_MAINTAINER(new TileGuiFactory<>(TileLevelMaintainer.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileLevelMaintainer inv) {
|
||||
@@ -78,7 +78,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
OC_PATTERN_EDITOR(new TileGuiFactory<TileOCPatternEditor>(TileOCPatternEditor.class) {
|
||||
OC_PATTERN_EDITOR(new TileGuiFactory<>(TileOCPatternEditor.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileOCPatternEditor inv) {
|
||||
@@ -91,7 +91,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE(new TileOrPartGuiFactory<IInterfaceHost>(IInterfaceHost.class) {
|
||||
DUAL_INTERFACE(new TileOrPartGuiFactory<>(IInterfaceHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IInterfaceHost inv) {
|
||||
@@ -104,7 +104,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_FLUID(new TileOrPartGuiFactory<IDualHost>(IDualHost.class) {
|
||||
DUAL_INTERFACE_FLUID(new TileOrPartGuiFactory<>(IDualHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IDualHost inv) {
|
||||
@@ -117,7 +117,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
PRIORITY(new TileOrPartGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
PRIORITY(new TileOrPartGuiFactory<>(IPriorityHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
@@ -130,7 +130,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_BUS_IO(new PartGuiFactory<FCSharedFluidBus>(FCSharedFluidBus.class) {
|
||||
FLUID_BUS_IO(new PartGuiFactory<>(FCSharedFluidBus.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCSharedFluidBus inv) {
|
||||
@@ -143,7 +143,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_STORAGE_BUS(new PartGuiFactory<PartFluidStorageBus>(PartFluidStorageBus.class) {
|
||||
FLUID_STORAGE_BUS(new PartGuiFactory<>(PartFluidStorageBus.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidStorageBus inv) {
|
||||
@@ -156,7 +156,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
INGREDIENT_BUFFER(new TileGuiFactory<TileIngredientBuffer>(TileIngredientBuffer.class) {
|
||||
INGREDIENT_BUFFER(new TileGuiFactory<>(TileIngredientBuffer.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileIngredientBuffer inv) {
|
||||
@@ -169,7 +169,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
LARGE_INGREDIENT_BUFFER(new TileGuiFactory<TileLargeIngredientBuffer>(TileLargeIngredientBuffer.class) {
|
||||
LARGE_INGREDIENT_BUFFER(new TileGuiFactory<>(TileLargeIngredientBuffer.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileLargeIngredientBuffer inv) {
|
||||
@@ -182,7 +182,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
CRAFTING_STATUS(new PartOrItemGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
CRAFTING_STATUS(new PartOrItemGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -195,7 +195,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_TERMINAL(new TileOrPartGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
FLUID_TERMINAL(new TileOrPartGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -208,7 +208,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
PORTABLE_FLUID_CELL(new ItemGuiFactory<IFluidPortableCell>(IFluidPortableCell.class) {
|
||||
PORTABLE_FLUID_CELL(new ItemGuiFactory<>(IFluidPortableCell.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IFluidPortableCell inv) {
|
||||
@@ -221,7 +221,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
WIRELESS_FLUID_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_FLUID_TERMINAL(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -234,7 +234,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
WIRELESS_ESSENTIA_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_ESSENTIA_TERMINAL(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -247,7 +247,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
WIRELESS_FLUID_PATTERN_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_FLUID_PATTERN_TERMINAL(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -259,7 +259,7 @@ public enum GuiType {
|
||||
return new GuiFluidPatternWireless(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
WIRELESS_FLUID_PATTERN_TERMINAL_EX(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_FLUID_PATTERN_TERMINAL_EX(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -271,7 +271,7 @@ public enum GuiType {
|
||||
return new GuiFluidPatternExWireless(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
WIRELESS_INTERFACE_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_INTERFACE_TERMINAL(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -284,7 +284,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
WIRELESS_CRAFTING_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
WIRELESS_CRAFTING_TERMINAL(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -297,7 +297,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PATTERN_TERMINAL(new PartGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
FLUID_PATTERN_TERMINAL(new PartGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -310,7 +310,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PATTERN_TERMINAL_EX(new PartGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
FLUID_PATTERN_TERMINAL_EX(new PartGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -323,7 +323,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PATTERN_ENCODER(new TileGuiFactory<TileFluidPatternEncoder>(TileFluidPatternEncoder.class) {
|
||||
FLUID_PATTERN_ENCODER(new TileGuiFactory<>(TileFluidPatternEncoder.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileFluidPatternEncoder inv) {
|
||||
@@ -336,7 +336,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_CRAFTING_CONFIRM(new PartGuiFactory<FCPart>(FCPart.class) {
|
||||
FLUID_CRAFTING_CONFIRM(new PartGuiFactory<>(FCPart.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCPart inv) {
|
||||
@@ -349,7 +349,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_CRAFTING_CONFIRM_ITEM(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
FLUID_CRAFTING_CONFIRM_ITEM(new ItemGuiFactory<>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
@@ -362,7 +362,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_CRAFTING_AMOUNT(new PartOrItemGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
FLUID_CRAFTING_AMOUNT(new PartOrItemGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
@@ -375,7 +375,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PACKET_DECODER(new TileGuiFactory<TileFluidPacketDecoder>(TileFluidPacketDecoder.class) {
|
||||
FLUID_PACKET_DECODER(new TileGuiFactory<>(TileFluidPacketDecoder.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileFluidPacketDecoder inv) {
|
||||
@@ -388,7 +388,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
PATTERN_VALUE_SET(new PartOrItemGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
PATTERN_VALUE_SET(new PartOrItemGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
|
||||
+4
-5
@@ -177,9 +177,8 @@ public class WirelessPatternTerminalExInventory extends MEMonitorHandler<IAEItem
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details = pattern
|
||||
if (is != null && is.getItem() instanceof final ICraftingPatternItem craftingPatternItem) {
|
||||
final ICraftingPatternDetails details = craftingPatternItem
|
||||
.getPatternForItem(is, this.getActionableNode().getWorld());
|
||||
|
||||
if (details != null) {
|
||||
@@ -373,8 +372,8 @@ public class WirelessPatternTerminalExInventory extends MEMonitorHandler<IAEItem
|
||||
|
||||
@Override
|
||||
public void sortCraftingItems() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fluids = new ArrayList<ItemStack>();
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
List<ItemStack> fluids = new ArrayList<>();
|
||||
for (ItemStack is : this.crafting) {
|
||||
if (is == null) continue;
|
||||
if (is.getItem() instanceof ItemFluidPacket) {
|
||||
|
||||
+4
-5
@@ -174,9 +174,8 @@ public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemSt
|
||||
ItemStack newStack) {
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details = pattern
|
||||
if (is != null && is.getItem() instanceof final ICraftingPatternItem craftingPatternItem) {
|
||||
final ICraftingPatternDetails details = craftingPatternItem
|
||||
.getPatternForItem(is, this.getActionableNode().getWorld());
|
||||
if (details != null) {
|
||||
final IAEItemStack[] inItems = details.getInputs();
|
||||
@@ -345,8 +344,8 @@ public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemSt
|
||||
|
||||
@Override
|
||||
public void sortCraftingItems() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fluids = new ArrayList<ItemStack>();
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
List<ItemStack> fluids = new ArrayList<>();
|
||||
for (ItemStack is : this.crafting) {
|
||||
if (is == null) continue;
|
||||
if (is.getItem() instanceof ItemFluidPacket) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.glodblock.github.loader;
|
||||
|
||||
import static com.glodblock.github.common.storage.CellType.Cell16384kPart;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.*;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.CELL4KM;
|
||||
import static net.minecraft.init.Blocks.redstone_torch;
|
||||
import static net.minecraft.init.Items.fish;
|
||||
|
||||
|
||||
@@ -9,24 +9,21 @@ import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import appeng.api.config.TypeFilter;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.client.me.ItemRepo;
|
||||
|
||||
public class FluidFilter {
|
||||
|
||||
public static void installFilter() {
|
||||
ItemRepo.registerTypeHandler(FluidFilter::filter, FLUIDS);
|
||||
}
|
||||
|
||||
private static boolean filter(IAEStack<?> stack, TypeFilter typeFilter) {
|
||||
public static boolean filter(TypeFilter typeFilter, IAEStack<?> stack) {
|
||||
if (typeFilter == ALL) return true;
|
||||
if (stack instanceof IAEItemStack) {
|
||||
Item item = ((IAEItemStack) stack).getItem();
|
||||
if (item != null) {
|
||||
switch (typeFilter) {
|
||||
case ITEMS:
|
||||
case ITEMS -> {
|
||||
return !(item instanceof ItemFluidDrop);
|
||||
case FLUIDS:
|
||||
}
|
||||
case FLUIDS -> {
|
||||
return item instanceof ItemFluidDrop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.glodblock.github.nei;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
|
||||
import codechicken.nei.api.IStackStringifyHandler;
|
||||
|
||||
public class FCStackStringifyHandler implements IStackStringifyHandler {
|
||||
|
||||
@Override
|
||||
public NBTTagCompound convertItemStackToNBT(ItemStack stack, boolean saveStackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack convertNBTToItemStack(NBTTagCompound nbtTag) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack getFluid(ItemStack item) {
|
||||
if (item.getItem() instanceof ItemFluidDrop) {
|
||||
FluidStack fluid = ItemFluidDrop.getFluidStack(item);
|
||||
if (fluid == null) return null;
|
||||
fluid.amount /= Math.max(item.stackSize, 1);
|
||||
return fluid;
|
||||
} else if (item.getItem() instanceof ItemFluidPacket) {
|
||||
return ItemFluidPacket.getFluidStack(item);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class FluidCraftingTransferHandler implements IOverlayHandler {
|
||||
Slot slot = (Slot) o;
|
||||
if (slot.getSlotIndex() == col + row * 3) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final List<ItemStack> list = new LinkedList<ItemStack>();
|
||||
final List<ItemStack> list = new LinkedList<>();
|
||||
// prefer pure crystals.
|
||||
for (int x = 0; x < positionedStack.items.length; x++) {
|
||||
if (Platform.isRecipePrioritized(positionedStack.items[x])) {
|
||||
|
||||
@@ -41,8 +41,7 @@ public class NEIItemFilter implements SearchField.ISearchProvider {
|
||||
if (itemStack.getItem() instanceof IStorageFluidCell) {
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(itemStack, null, StorageChannel.FLUIDS);
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
if (inventory instanceof final IFluidCellInventoryHandler handler) {
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
if (cellInventory != null) {
|
||||
for (IAEFluidStack fluid : cellInventory.getContents()) {
|
||||
|
||||
@@ -23,8 +23,7 @@ public class NEIUtils {
|
||||
if (currentStack.stackSize == 0) continue;
|
||||
boolean find = false;
|
||||
for (OrderStack<?> storedStack : comp) {
|
||||
if (storedStack == null || !(storedStack.getStack() instanceof ItemStack)) continue;
|
||||
ItemStack firstStack = (ItemStack) storedStack.getStack();
|
||||
if (storedStack == null || !(storedStack.getStack() instanceof ItemStack firstStack)) continue;
|
||||
boolean areItemStackEqual = firstStack.isItemEqual(currentStack)
|
||||
&& ItemStack.areItemStackTagsEqual(firstStack, currentStack);
|
||||
if (areItemStackEqual
|
||||
|
||||
@@ -8,12 +8,14 @@ import com.glodblock.github.util.ModAndClassUtil;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class NEI_FC_Config implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
API.registerNEIGuiHandler(new NEIGuiHandler());
|
||||
API.addSearchProvider(new NEIItemFilter());
|
||||
API.registerStackStringifyHandler(new FCStackStringifyHandler());
|
||||
|
||||
if (ModAndClassUtil.AVARITIA) {
|
||||
API.registerGuiOverlay(GuiFluidPatternWireless.class, "extreme", null);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class OrderStack<T> {
|
||||
NBTTagCompound info = buf.getCompoundTag(index + ":");
|
||||
byte id = info.getByte("t");
|
||||
switch (id) {
|
||||
case ITEM:
|
||||
case ITEM -> {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
if (info.hasKey(index + ":")) {
|
||||
NBTTagList items = info.getTagList(index + ":", 10);
|
||||
@@ -134,13 +134,15 @@ public class OrderStack<T> {
|
||||
}
|
||||
}
|
||||
return new OrderStack<>(ItemStack.loadItemStackFromNBT(info), index, list.toArray(new ItemStack[0]));
|
||||
case FLUID:
|
||||
}
|
||||
case FLUID -> {
|
||||
return new OrderStack<>(FluidStack.loadFluidStackFromNBT(info), index);
|
||||
case CUSTOM:
|
||||
}
|
||||
case CUSTOM -> {
|
||||
if (dummy == null) throw new IllegalOrderStackID(id);
|
||||
return new OrderStack<>(dummy.customNBTReader(buf), index);
|
||||
default:
|
||||
throw new IllegalOrderStackID(id);
|
||||
}
|
||||
default -> throw new IllegalOrderStackID(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -35,8 +35,7 @@ public class EnderIORecipeExtractor implements IRecipeExtractor {
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs, IRecipeHandler recipe, int index) {
|
||||
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
|
||||
List<OrderStack<?>> tmp;
|
||||
if (tRecipe.arecipes.get(index) instanceof VatRecipeHandler.InnerVatRecipe) {
|
||||
VatRecipeHandler.InnerVatRecipe vatRecipe = (VatRecipeHandler.InnerVatRecipe) tRecipe.arecipes.get(index);
|
||||
if (tRecipe.arecipes.get(index) instanceof VatRecipeHandler.InnerVatRecipe vatRecipe) {
|
||||
ArrayList<PositionedStack> inputs = ReflectEIO.getInputs(vatRecipe);
|
||||
tmp = ExtractorUtil.packItemStack(inputs);
|
||||
FluidStack in = ReflectEIO.getInputFluid(vatRecipe);
|
||||
@@ -63,8 +62,7 @@ public class EnderIORecipeExtractor implements IRecipeExtractor {
|
||||
int index) {
|
||||
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
if (tRecipe.arecipes.get(index) instanceof VatRecipeHandler.InnerVatRecipe) {
|
||||
VatRecipeHandler.InnerVatRecipe vatRecipe = (VatRecipeHandler.InnerVatRecipe) tRecipe.arecipes.get(index);
|
||||
if (tRecipe.arecipes.get(index) instanceof VatRecipeHandler.InnerVatRecipe vatRecipe) {
|
||||
FluidStack result = ReflectEIO.getResult(vatRecipe);
|
||||
if (result != null) {
|
||||
tmp.add(new OrderStack<>(result, 0));
|
||||
|
||||
@@ -57,13 +57,10 @@ public class CPacketCraftRequest implements IMessage {
|
||||
@Nullable
|
||||
@Override
|
||||
public IMessage onMessage(CPacketCraftRequest message, MessageContext ctx) {
|
||||
if (ctx.getServerHandler().playerEntity.openContainer instanceof ContainerCraftAmount) {
|
||||
if (ctx.getServerHandler().playerEntity.openContainer instanceof final ContainerCraftAmount cca) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final ContainerCraftAmount cca = (ContainerCraftAmount) ctx
|
||||
.getServerHandler().playerEntity.openContainer;
|
||||
final Object target = cca.getTarget();
|
||||
if (target instanceof IGridHost) {
|
||||
final IGridHost gh = (IGridHost) target;
|
||||
if (target instanceof final IGridHost gh) {
|
||||
final IGridNode gn = gh.getGridNode(ForgeDirection.UNKNOWN);
|
||||
|
||||
if (gn == null) {
|
||||
@@ -106,8 +103,7 @@ public class CPacketCraftRequest implements IMessage {
|
||||
GuiType.FLUID_CRAFTING_CONFIRM_ITEM);
|
||||
}
|
||||
|
||||
if (player.openContainer instanceof ContainerCraftConfirm) {
|
||||
final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
|
||||
if (player.openContainer instanceof final ContainerCraftConfirm ccc) {
|
||||
ccc.setAutoStart(message.heldShift);
|
||||
ccc.setJob(futureJob);
|
||||
cca.detectAndSendChanges();
|
||||
|
||||
@@ -64,60 +64,32 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
String Name = message.Name;
|
||||
String Value = message.Value;
|
||||
final Container c = ctx.getServerHandler().playerEntity.openContainer;
|
||||
if (Name.startsWith("PatternTerminal.") && (c instanceof FCContainerEncodeTerminal)) {
|
||||
final FCContainerEncodeTerminal cpt = (FCContainerEncodeTerminal) c;
|
||||
if (Name.startsWith("PatternTerminal.") && (c instanceof final FCContainerEncodeTerminal cpt)) {
|
||||
switch (Name) {
|
||||
case "PatternTerminal.CraftMode":
|
||||
cpt.getPatternTerminal().setCraftingRecipe(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Encode":
|
||||
case "PatternTerminal.CraftMode" -> cpt.getPatternTerminal().setCraftingRecipe(Value.equals("1"));
|
||||
case "PatternTerminal.Encode" -> {
|
||||
switch (Value) {
|
||||
case "0":
|
||||
cpt.encode();
|
||||
break;
|
||||
case "1":
|
||||
cpt.encodeAndMoveToInventory();
|
||||
break;
|
||||
case "3":
|
||||
cpt.encodeAllItemAndMoveToInventory();
|
||||
break;
|
||||
case "0" -> cpt.encode();
|
||||
case "1" -> cpt.encodeAndMoveToInventory();
|
||||
case "3" -> cpt.encodeAllItemAndMoveToInventory();
|
||||
}
|
||||
break;
|
||||
case "PatternTerminal.Clear":
|
||||
cpt.clear();
|
||||
break;
|
||||
case "PatternTerminal.Substitute":
|
||||
cpt.getPatternTerminal().setSubstitution(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Invert":
|
||||
cpt.getPatternTerminal().setInverted(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Double":
|
||||
cpt.doubleStacks(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Combine":
|
||||
cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.beSubstitute":
|
||||
cpt.getPatternTerminal().setBeSubstitute(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.ActivePage":
|
||||
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||
break;
|
||||
case "PatternTerminal.Prioritize":
|
||||
}
|
||||
case "PatternTerminal.Clear" -> cpt.clear();
|
||||
case "PatternTerminal.Substitute" -> cpt.getPatternTerminal().setSubstitution(Value.equals("1"));
|
||||
case "PatternTerminal.Invert" -> cpt.getPatternTerminal().setInverted(Value.equals("1"));
|
||||
case "PatternTerminal.Double" -> cpt.doubleStacks(Value.equals("1"));
|
||||
case "PatternTerminal.Combine" -> cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||
case "PatternTerminal.beSubstitute" -> cpt.getPatternTerminal().setBeSubstitute(Value.equals("1"));
|
||||
case "PatternTerminal.ActivePage" -> cpt.getPatternTerminal()
|
||||
.setActivePage(Integer.parseInt(Value));
|
||||
case "PatternTerminal.Prioritize" -> {
|
||||
switch (Value) {
|
||||
case "0":
|
||||
case "1":
|
||||
cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||
break;
|
||||
case "2":
|
||||
cpt.getPatternTerminal().sortCraftingItems();
|
||||
break;
|
||||
case "0", "1" -> cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||
case "2" -> cpt.getPatternTerminal().sortCraftingItems();
|
||||
}
|
||||
break;
|
||||
case "PatternTerminal.AutoFillerPattern":
|
||||
cpt.getPatternTerminal().setAutoFillPattern(Value.equals("1"));
|
||||
break;
|
||||
}
|
||||
case "PatternTerminal.AutoFillerPattern" -> cpt.getPatternTerminal()
|
||||
.setAutoFillPattern(Value.equals("1"));
|
||||
}
|
||||
cpt.getPatternTerminal().saveSettings();
|
||||
} else if (Name.startsWith("StorageBus.") && c instanceof ContainerFluidStorageBus) {
|
||||
|
||||
@@ -92,8 +92,7 @@ public class CPacketInventoryAction implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(CPacketInventoryAction message, MessageContext ctx) {
|
||||
final EntityPlayerMP sender = ctx.getServerHandler().playerEntity;
|
||||
if (sender.openContainer instanceof AEBaseContainer) {
|
||||
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
|
||||
if (sender.openContainer instanceof final AEBaseContainer baseContainer) {
|
||||
Object target = baseContainer.getTarget();
|
||||
if (message.action == InventoryAction.AUTO_CRAFT) {
|
||||
final ContainerOpenContext context = baseContainer.getOpenContext();
|
||||
@@ -117,8 +116,7 @@ public class CPacketInventoryAction implements IMessage {
|
||||
ForgeDirection.UNKNOWN,
|
||||
GuiType.FLUID_CRAFTING_AMOUNT);
|
||||
}
|
||||
if (sender.openContainer instanceof ContainerCraftAmount) {
|
||||
final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer;
|
||||
if (sender.openContainer instanceof final ContainerCraftAmount cca) {
|
||||
if (baseContainer.getTargetStack() != null) {
|
||||
cca.getCraftingItem().putStack(baseContainer.getTargetStack().getItemStack());
|
||||
cca.setItemToCraft(baseContainer.getTargetStack());
|
||||
@@ -154,8 +152,7 @@ public class CPacketInventoryAction implements IMessage {
|
||||
amt = fluid == null ? 1 : fluid.amount;
|
||||
}
|
||||
FluidCraft.proxy.netHandler.sendTo(new SPacketSetItemAmount(amt), sender);
|
||||
if (sender.openContainer instanceof ContainerPatternValueAmount) {
|
||||
final ContainerPatternValueAmount cpv = (ContainerPatternValueAmount) sender.openContainer;
|
||||
if (sender.openContainer instanceof final ContainerPatternValueAmount cpv) {
|
||||
if (baseContainer.getTargetStack() != null) {
|
||||
cpv.setValueIndex(message.slot);
|
||||
cpv.getPatternValue().putStack(baseContainer.getTargetStack().getItemStack());
|
||||
|
||||
@@ -116,23 +116,14 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(CPacketLevelMaintainer message, MessageContext ctx) {
|
||||
if (message.action.startsWith("TileLevelMaintainer.")
|
||||
&& ctx.getServerHandler().playerEntity.openContainer instanceof ContainerLevelMaintainer) {
|
||||
&& ctx.getServerHandler().playerEntity.openContainer instanceof final ContainerLevelMaintainer cca) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final ContainerLevelMaintainer cca = (ContainerLevelMaintainer) ctx
|
||||
.getServerHandler().playerEntity.openContainer;
|
||||
switch (message.action) {
|
||||
case "TileLevelMaintainer.Quantity":
|
||||
cca.getTile().updateQuantity(message.slotIndex, message.size);
|
||||
break;
|
||||
case "TileLevelMaintainer.Batch":
|
||||
cca.getTile().updateBatchSize(message.slotIndex, message.size);
|
||||
break;
|
||||
case "TileLevelMaintainer.Enable":
|
||||
cca.getTile().setRequestStatus(message.slotIndex, false);
|
||||
break;
|
||||
case "TileLevelMaintainer.Disable":
|
||||
cca.getTile().setRequestStatus(message.slotIndex, true);
|
||||
break;
|
||||
case "TileLevelMaintainer.Quantity" -> cca.getTile()
|
||||
.updateQuantity(message.slotIndex, message.size);
|
||||
case "TileLevelMaintainer.Batch" -> cca.getTile().updateBatchSize(message.slotIndex, message.size);
|
||||
case "TileLevelMaintainer.Enable" -> cca.getTile().setRequestStatus(message.slotIndex, false);
|
||||
case "TileLevelMaintainer.Disable" -> cca.getTile().setRequestStatus(message.slotIndex, true);
|
||||
}
|
||||
this.refresh(cca, player);
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ public class CPacketPatternValueSet implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(CPacketPatternValueSet message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
if (player.openContainer instanceof ContainerPatternValueAmount) {
|
||||
ContainerPatternValueAmount cpv = (ContainerPatternValueAmount) player.openContainer;
|
||||
if (player.openContainer instanceof ContainerPatternValueAmount cpv) {
|
||||
final Object target = cpv.getTarget();
|
||||
if (target instanceof IGridHost) {
|
||||
final ContainerOpenContext context = cpv.getOpenContext();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
this.shift = shift;
|
||||
}
|
||||
|
||||
// I should use GZIP to compress the message, but i'm too lazy.
|
||||
// TODO: this should use GZIP to compress the message
|
||||
// NBT to ByteBuf has a compress stream
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
@@ -100,9 +100,8 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
if (monitor != null) {
|
||||
storageList = monitor.getStorageList();
|
||||
}
|
||||
if (c instanceof FCContainerEncodeTerminal) {
|
||||
if (c instanceof FCContainerEncodeTerminal cf) {
|
||||
// pattern terminal only
|
||||
FCContainerEncodeTerminal cf = (FCContainerEncodeTerminal) c;
|
||||
|
||||
boolean combine = cf.combine;
|
||||
cf.getPatternTerminal().setCraftingRecipe(message.isCraft);
|
||||
|
||||
@@ -91,7 +91,6 @@ public class SPacketMEItemInvUpdate implements IMessage {
|
||||
public static class Handler implements IMessageHandler<SPacketMEItemInvUpdate, IMessage> {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public IMessage onMessage(SPacketMEItemInvUpdate message, MessageContext ctx) {
|
||||
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
|
||||
if (gs instanceof GuiItemMonitor) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.crossmod.extracells.EC2Replacer;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.inventory.external.AEFluidInterfaceHandler;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.SPacketMEUpdateBuffer;
|
||||
@@ -30,6 +31,9 @@ public class CommonProxy {
|
||||
public void init(FMLInitializationEvent event) {
|
||||
this.registerMovables();
|
||||
FMLCommonHandler.instance().bus().register(SPacketMEUpdateBuffer.class);
|
||||
if (ModAndClassUtil.ThE) {
|
||||
AspectUtil.init();
|
||||
}
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
@@ -83,6 +83,8 @@ public class Ae2Reflect {
|
||||
for (String name : names) {
|
||||
try {
|
||||
f = owner.getDeclaredField(name);
|
||||
// IntelliJ misses that the exception is ignored and thus "f" can indeed be null.
|
||||
// noinspection ConstantValue
|
||||
if (f != null) break;
|
||||
} catch (NoSuchFieldException ignore) {}
|
||||
}
|
||||
|
||||
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user