Compare commits

...
Author SHA1 Message Date
RanzuandKogepan229 31533e96df Convert to ColorUtils (#440)
Co-authored-by: Kogepan229 <[email protected]>
2026-06-15 18:50:35 +02:00
Kogepan229 7124e812d1 Fix fluid auto filler crash (#445) 2026-06-15 18:50:18 +02:00
Martin Robertz edac0cdec6 update+gradle+deps+bs 2026-06-12 22:03:10 +02:00
Kogepan229andUltraProdigy 3b67b77572 Fix FMP compatibility (#444)
Co-authored-by: UltraProdigy <[email protected]>
2026-06-12 15:44:33 -04:00
Kogepan229 208e4d66d9 Allow to copy Fluid Interface fluid config to Memory Card (#443) 2026-06-10 06:44:42 +00:00
Inphysible 1aba13e96f Make Fluid Cells storable in Item Cells again (#441) 2026-06-10 01:07:31 -04:00
Kogepan229 dd05ae29c1 Adapt to GUIColor changes (#439) 2026-06-04 16:06:19 +02:00
sisyphussy 44dfa4d551 Optimize Walrus (#437) 2026-05-29 16:51:11 +02:00
28 changed files with 237 additions and 174 deletions

No files matched your search

+8 -8
View File
@@ -34,17 +34,17 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.8.98-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-959-GTNH:dev')
api('com.github.GTNewHorizons:waila:1.19.28:dev')
api("com.github.GTNewHorizons:GTNHLib:0.10.2:dev")
api('com.github.GTNewHorizons:NotEnoughItems:2.8.102-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-983-GTNH:dev')
api('com.github.GTNewHorizons:waila:1.19.30:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.15:dev")
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.19-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.60:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.23:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:5.2.62:dev')
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.42-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.26:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.31:dev')
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.45-GTNH:dev') { transitive = false }
compileOnly("org.jetbrains:annotations:26.1.0")
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.26'
}
@@ -307,43 +307,43 @@ public class GuiLevelMaintainer extends GuiSub {
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_TITLE) + "\n");
switch (this.state) {
case Idle -> {
this.line.setColor(FCGuiColors.StateIdle.getColor());
this.line.setColor(FCGuiColors.stateIdle.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
}
case Craft -> {
this.line.setColor(FCGuiColors.StateCraft.getColor());
this.line.setColor(FCGuiColors.stateCraft.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
}
case Export -> {
this.line.setColor(FCGuiColors.StateExport.getColor());
this.line.setColor(FCGuiColors.stateExport.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
}
case Error -> {
this.line.setColor(FCGuiColors.StateError.getColor());
this.line.setColor(FCGuiColors.stateError.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR));
}
case NotFound -> {
this.line.setColor(FCGuiColors.StateError.getColor());
this.line.setColor(FCGuiColors.stateError.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NOT_FOUND));
}
case CantCraft -> {
this.line.setColor(FCGuiColors.StateError.getColor());
this.line.setColor(FCGuiColors.stateError.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CANT_CRAFT));
}
default -> {
this.line.setColor(FCGuiColors.StateNone.getColor());
this.line.setColor(FCGuiColors.stateNone.getColor());
message.add(
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
@@ -62,7 +62,6 @@ import appeng.container.AEBaseContainer;
import appeng.container.slot.AppEngSlot;
import appeng.core.AEConfig;
import appeng.core.localization.ButtonToolTips;
import appeng.core.localization.GuiColors;
import appeng.core.localization.GuiText;
import appeng.core.localization.PlayerMessages;
import appeng.core.sync.GuiBridge;
@@ -241,12 +240,12 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
StatCollector.translateToLocal(NameConst.GUI_LEVEL_TERMINAL),
8,
6,
GuiColors.InterfaceTerminalTitle.getColor());
FCGuiColors.guiTextColorGray.getColor());
fontRendererObj.drawString(
GuiText.inventory.getLocal(),
GuiLevelTerminal.offsetX + 2,
ySize - 96 + 3,
GuiColors.InterfaceTerminalInventory.getColor());
FCGuiColors.guiTextColorGray.getColor());
if (!ModAndClassUtil.NEI && tooltipStack != null) {
renderToolTip(tooltipStack, mouseX, mouseY);
@@ -395,7 +394,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
int title;
int renderY = 0;
final int sectionBottom = viewY + section.getHeight() - 1;
final int fontColor = GuiColors.InterfaceTerminalInventory.getColor();
final int fontColor = FCGuiColors.guiTextColorGray.getColor();
/*
* Render title
*/
@@ -563,11 +562,11 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
aes.drawOverlayInGui(mc, 0, 0, false, false, false, false);
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z);
int color = switch (state) {
case Idle -> FCGuiColors.StateIdle.getColor();
case Craft -> FCGuiColors.StateCraft.getColor();
case Export -> FCGuiColors.StateExport.getColor();
case Error, NotFound, CantCraft -> FCGuiColors.StateError.getColor();
case None -> FCGuiColors.StateNone.getColor();
case Idle -> FCGuiColors.stateIdle.getColor();
case Craft -> FCGuiColors.stateCraft.getColor();
case Export -> FCGuiColors.stateExport.getColor();
case Error, NotFound, CantCraft -> FCGuiColors.stateError.getColor();
case None -> FCGuiColors.stateNone.getColor();
};
int offset = 0;
int size = 4;
@@ -585,7 +584,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
if (!tooltip) {
if (entry.filteredRecipes[slotIdx]) {
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z);
drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor());
drawRect(0, 0, 16, 16, FCGuiColors.itemSlotOverlayUnpowered.getColor());
}
} else {
tooltipStack = Platform.stackConvert(aes).getItemStack();
@@ -594,7 +593,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
} else if (entry.filteredRecipes[slotIdx]) {
GL11.glPushMatrix();
GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_OVERLAY_Z);
drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor());
drawRect(0, 0, 16, 16, FCGuiColors.itemSlotOverlayUnpowered.getColor());
GL11.glPopMatrix();
}
if (tooltip) {
@@ -1,25 +1,19 @@
package com.glodblock.github.client.render;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import org.lwjgl.opengl.GL11;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.tile.TileWalrus;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.proxy.ClientProxy;
import cpw.mods.fml.client.registry.ClientRegistry;
public class ItemWalrusRender implements IItemRenderer {
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
public ItemWalrusRender() {
ClientRegistry.bindTileEntitySpecialRenderer(TileWalrus.class, new RenderBlockWalrus());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ItemAndBlockHolder.WALRUS), this);
@@ -32,7 +26,6 @@ public class ItemWalrusRender implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
GL11.glPushMatrix();
switch (type) {
case EQUIPPED_FIRST_PERSON -> {
@@ -42,7 +35,7 @@ public class ItemWalrusRender implements IItemRenderer {
case INVENTORY -> GL11.glTranslatef(-0.5F, -0.5F, -0.1F);
default -> {}
}
ClientProxy.getWalrusModel().renderAll();
WalrusRenderer.render();
GL11.glPopMatrix();
}
@@ -1,23 +1,16 @@
package com.glodblock.github.client.render;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.tile.TileWalrus;
import com.glodblock.github.proxy.ClientProxy;
public class RenderBlockWalrus extends TileEntitySpecialRenderer {
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partialTickTime) {
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
if (!(tileentity instanceof TileWalrus Tile)) return;
float scale = Tile.getWalrusScale();
GL11.glPushMatrix();
@@ -40,7 +33,7 @@ public class RenderBlockWalrus extends TileEntitySpecialRenderer {
break;
}
GL11.glScalef(scale, scale, scale);
ClientProxy.getWalrusModel().renderAll();
WalrusRenderer.render();
GL11.glPopMatrix();
}
}
@@ -0,0 +1,28 @@
package com.glodblock.github.client.render;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.glodblock.github.FluidCraft;
import com.gtnewhorizon.gtnhlib.client.model.wavefront.WavefrontVBOBuilder;
import com.gtnewhorizon.gtnhlib.client.renderer.vao.IVertexArrayObject;
public final class WalrusRenderer {
private static IVertexArrayObject walrus;
private static final ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
public static void load() {
walrus = WavefrontVBOBuilder.compileToVBO(FluidCraft.resource("models/walrus.obj"));
}
public static void render() {
Minecraft.getMinecraft().renderEngine.bindTexture(textureWalrus);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
walrus.render();
}
}
@@ -50,4 +50,9 @@ public abstract class FCBaseItemCell extends AEBaseCell {
public ItemStack stack() {
return new ItemStack(this, 1);
}
@Override
public boolean storableInStorageCell() {
return true;
}
}
@@ -24,6 +24,7 @@ import com.glodblock.github.inventory.AEFluidInventory;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.DualHostSettings;
import com.glodblock.github.util.DualityFluidInterface;
import com.glodblock.github.util.Util;
@@ -41,6 +42,7 @@ import appeng.helpers.ICustomButtonDataObject;
import appeng.helpers.ICustomButtonProvider;
import appeng.parts.misc.PartInterface;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.util.SettingsFrom;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -156,6 +158,20 @@ public class PartFluidInterface extends PartInterface implements IDualHost, ICus
getInternalFluid().writeToNBT(data, "FluidInv");
}
@Override
public void uploadSettings(@NotNull SettingsFrom from, @NotNull NBTTagCompound compound) {
super.uploadSettings(from, compound);
DualHostSettings.uploadSettings(this, compound);
}
@Override
@NotNull
public NBTTagCompound downloadSettings(SettingsFrom from) {
NBTTagCompound output = super.downloadSettings(from);
DualHostSettings.downloadSettings(this, output);
return output;
}
@Override
public int getInstalledUpgrades(final Upgrades u) {
return getInterfaceDuality().getInstalledUpgrades(u);
@@ -25,6 +25,7 @@ import com.glodblock.github.inventory.AEFluidInventory;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.DualHostSettings;
import com.glodblock.github.util.DualityFluidInterface;
import com.glodblock.github.util.Util;
@@ -43,6 +44,7 @@ import appeng.parts.p2p.PartP2PInterface;
import appeng.parts.p2p.PartP2PTunnel;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -71,6 +73,13 @@ public class PartFluidP2PInterface extends PartP2PInterface implements IDualHost
return ItemAndBlockHolder.INTERFACE.getBlockTextureFromSide(0);
}
@Override
public NBTTagCompound getMemoryCardData() {
NBTTagCompound output = super.getMemoryCardData();
DualHostSettings.downloadSettings(this, output);
return output;
}
@Override
public PartP2PTunnel<?> applyMemoryCard(EntityPlayer player, IMemoryCard memoryCard, ItemStack is) {
PartP2PTunnel<?> newTunnel = super.applyMemoryCard(player, memoryCard, is);
@@ -78,6 +87,7 @@ public class PartFluidP2PInterface extends PartP2PInterface implements IDualHost
NBTTagCompound data = memoryCard.getData(is);
if (newTunnel instanceof PartFluidP2PInterface p2PInterface) {
p2PInterface.duality.getConfigManager().readFromNBT(data);
DualHostSettings.uploadSettings(p2PInterface, data);
}
return newTunnel;
}
@@ -90,9 +100,24 @@ public class PartFluidP2PInterface extends PartP2PInterface implements IDualHost
IConfigManager config = fromInterface.duality.getConfigManager();
config.getSettings()
.forEach(setting -> newDuality.getConfigManager().putSetting(setting, config.getSetting(setting)));
DualHostSettings.copySettings(this, fromInterface);
}
}
@Override
public void uploadSettings(@NotNull SettingsFrom from, @NotNull NBTTagCompound compound) {
super.uploadSettings(from, compound);
DualHostSettings.uploadSettings(this, compound);
}
@Override
@NotNull
public NBTTagCompound downloadSettings(SettingsFrom from) {
NBTTagCompound output = super.downloadSettings(from);
DualHostSettings.downloadSettings(this, output);
return output;
}
@Override
public TickingRequest getTickingRequest(IGridNode node) {
TickingRequest item = duality.getTickingRequest(node);
@@ -77,15 +77,27 @@ public class TileFluidAutoFiller extends AENetworkInvTile
public TileFluidAutoFiller() {
getProxy().setIdlePowerUsage(1D);
getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
inventory.setInventorySlotContents(0, BUCKET);
inventory.setInventorySlotContents(0, BUCKET.copy());
}
@Nonnull
public ItemStack getContainerItem() {
normalizeContainerItem();
return getInventory().getStackInSlot(0);
}
public void setContainerItem(ItemStack is) {
getInventory().setInventorySlotContents(0, is);
normalizeContainerItem();
}
private void normalizeContainerItem() {
ItemStack is = getInventory().getStackInSlot(0);
if (is == null) {
is = BUCKET.copy();
getInventory().setInventorySlotContents(0, is);
}
is.stackSize = 1;
}
@Override
@@ -102,18 +114,15 @@ public class TileFluidAutoFiller extends AENetworkInvTile
}
public void updatePattern() {
ItemStack is = inventory.getStackInSlot(0);
if (is == null) return;
this.setContainerItem(is);
normalizeContainerItem();
postEvent();
}
@TileEvent(TileEventType.WORLD_NBT_READ)
public void readFromNBTEvent(NBTTagCompound data) {
inventory.readFromNBT(data, "Inv");
if (inventory.getStackInSlot(0) == null) {
inventory.setInventorySlotContents(0, BUCKET);
}
ItemStack container = inventory.getStackInSlot(0);
this.setContainerItem(container);
}
@TileEvent(TileEventType.WORLD_NBT_WRITE)
@@ -150,21 +159,21 @@ public class TileFluidAutoFiller extends AENetworkInvTile
public void provideCrafting(ICraftingProviderHelper craftingTracker) {
IStorageGrid storage = getStorageGrid();
if (storage == null) return;
ItemStack containerItem = this.getContainerItem();
if (this.fluids.isEmpty()) {
this.fluids = storage.getFluidInventory().getStorageList();
}
for (IAEFluidStack fluidStack : this.fluids) {
Fluid fluid = fluidStack.getFluid();
if (fluid == null) continue;
int maxCapacity = Util.FluidUtil.getCapacity(this.getContainerItem(), fluid);
int maxCapacity = Util.FluidUtil.getCapacity(containerItem, fluid);
if (maxCapacity == 0) continue;
MutablePair<Integer, ItemStack> filled = Util.FluidUtil
.fillStack(this.getContainerItem().copy(), new FluidStack(fluid, maxCapacity));
.fillStack(containerItem.copy(), new FluidStack(fluid, maxCapacity));
if (filled == null) continue;
if (filled.right == null) continue;
ItemStack pattern = getPattern(
this.getContainerItem(),
filled.right,
fluidStack.copy().setStackSize(maxCapacity));
ItemStack pattern = getPattern(containerItem, filled.right, fluidStack.copy().setStackSize(maxCapacity));
ICraftingPatternItem patter = (ICraftingPatternItem) pattern.getItem();
craftingTracker.addCraftingOption(this, patter.getPatternForItem(pattern, getWorldObj()));
}
@@ -25,6 +25,7 @@ import com.glodblock.github.inventory.AEFluidInventory;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.DualHostSettings;
import com.glodblock.github.util.DualityFluidInterface;
import com.glodblock.github.util.Util;
@@ -47,6 +48,7 @@ import appeng.tile.TileEvent;
import appeng.tile.events.TileEventType;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.misc.TileInterface;
import appeng.util.SettingsFrom;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -187,6 +189,20 @@ public class TileFluidInterface extends TileInterface implements IDualHost, ICus
return data;
}
@Override
public void uploadSettings(SettingsFrom from, NBTTagCompound compound) {
super.uploadSettings(from, compound);
DualHostSettings.uploadSettings(this, compound);
}
@Override
public NBTTagCompound downloadSettings(SettingsFrom from) {
NBTTagCompound output = super.downloadSettings(from);
output = output == null ? new NBTTagCompound() : output;
DualHostSettings.downloadSettings(this, output);
return output;
}
@Nullable
protected ItemStack getItemFromTile(final Object obj) {
if (obj instanceof TileFluidInterface) {
@@ -13,7 +13,7 @@ import com.glodblock.github.util.DualityFluidInterface;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.Util;
import appeng.api.parts.IPartHost;
import appeng.util.Platform;
import li.cil.oc.api.driver.EnvironmentProvider;
import li.cil.oc.api.driver.NamedBlock;
import li.cil.oc.api.driver.SidedBlock;
@@ -104,20 +104,19 @@ public class DriverDualFluidInterface implements SidedBlock {
if (te instanceof TileFluidInterface) {
return true;
}
if (te instanceof IPartHost) {
return ((IPartHost) te).getPart(face) instanceof PartFluidInterface;
}
return Platform.getPartFromTE(te, face) instanceof PartFluidInterface;
}
return false;
}
private static DualityFluidInterface getInterface(TileEntity te, ForgeDirection face) {
if (te != null) {
if (te instanceof TileFluidInterface) {
return ((TileFluidInterface) te).getDualityFluid();
if (te instanceof TileFluidInterface tile) {
return tile.getDualityFluid();
}
if (te instanceof IPartHost && ((IPartHost) te).getPart(face) instanceof PartFluidInterface) {
return ((PartFluidInterface) ((IPartHost) te).getPart(face)).getDualityFluid();
if (Platform.getPartFromTE(te, face) instanceof PartFluidInterface part) {
return part.getDualityFluid();
}
}
return null;
@@ -4,6 +4,8 @@ import com.glodblock.github.common.tile.TileCertusQuartzTank;
import com.glodblock.github.util.ModAndClassUtil;
import appeng.api.parts.IPartHost;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
import codechicken.nei.guihook.GuiContainerManager;
@@ -19,8 +21,12 @@ public class WailaInit {
public static void register(final IWailaRegistrar registrar) {
final IWailaDataProvider part = new PartWailaDataProvider();
registrar.registerBodyProvider(part, IPartHost.class);
registrar.registerNBTProvider(part, IPartHost.class);
registerPartProvider(registrar, part, IPartHost.class);
if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.FMP)) {
try {
registerPartProvider(registrar, part, Class.forName("codechicken.multipart.TileMultipart"));
} catch (final ClassNotFoundException ignored) {}
}
if (Platform.isClient()) GuiContainerManager.addTooltipHandler(new FCTooltipHandlerWaila());
final IWailaDataProvider tile = new TileWailaDataProvider();
@@ -32,4 +38,10 @@ public class WailaInit {
registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class);
}
}
private static void registerPartProvider(final IWailaRegistrar registrar, final IWailaDataProvider provider,
final Class<?> tileClass) {
registrar.registerBodyProvider(provider, tileClass);
registrar.registerNBTProvider(provider, tileClass);
}
}
@@ -3,13 +3,12 @@ package com.glodblock.github.inventory.external;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import com.glodblock.github.util.Util;
import appeng.api.implementations.tiles.ITileStorageMonitorable;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IExternalStorageHandler;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.StorageChannel;
import appeng.util.Platform;
public class AEFluidInterfaceHandler implements IExternalStorageHandler {
@@ -18,7 +17,7 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
if (channel == StorageChannel.FLUIDS) {
if (te instanceof ITileStorageMonitorable) {
return true;
} else return Util.getPart(te, d.getOpposite()) instanceof ITileStorageMonitorable;
} else return Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable;
}
return false;
}
@@ -30,8 +29,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 part
&& ((ITileStorageMonitorable) Util.getPart(te, d.getOpposite())).getMonitorable(d, src) != null) {
} else if (Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable part
&& part.getMonitorable(d, src) != null) {
return part.getMonitorable(d, src).getFluidInventory();
}
}
@@ -6,7 +6,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.util.Platform;
public abstract class PartGuiFactory<T> extends TileGuiFactory<T> {
@@ -17,12 +17,11 @@ public abstract class PartGuiFactory<T> extends TileGuiFactory<T> {
@Nullable
@Override
protected T getInventory(TileEntity tile, ForgeDirection face) {
if (tile instanceof IPartHost) {
IPart part = ((IPartHost) tile).getPart(face);
if (invClass.isInstance(part)) {
return invClass.cast(part);
}
IPart part = Platform.getPartFromTE(tile, face);
if (invClass.isInstance(part)) {
return invClass.cast(part);
}
return null;
}
}
@@ -6,7 +6,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.util.Platform;
public abstract class TileOrPartGuiFactory<T> extends TileGuiFactory<T> {
@@ -17,12 +17,11 @@ public abstract class TileOrPartGuiFactory<T> extends TileGuiFactory<T> {
@Nullable
@Override
protected T getInventory(TileEntity tile, ForgeDirection face) {
if (tile instanceof IPartHost) {
IPart part = ((IPartHost) tile).getPart(face);
if (invClass.isInstance(part)) {
return invClass.cast(part);
}
IPart part = Platform.getPartFromTE(tile, face);
if (invClass.isInstance(part)) {
return invClass.cast(part);
}
return super.getInventory(tile, face);
}
}
@@ -4,11 +4,13 @@ import com.glodblock.github.client.render.ItemCertusQuartzTankRender;
import com.glodblock.github.client.render.ItemDropRender;
import com.glodblock.github.client.render.ItemPacketRender;
import com.glodblock.github.client.render.ItemWalrusRender;
import com.glodblock.github.client.render.WalrusRenderer;
public class RenderLoader implements Runnable {
@Override
public void run() {
WalrusRenderer.load();
new ItemDropRender();
new ItemPacketRender();
new ItemWalrusRender();
@@ -12,8 +12,6 @@ import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.util.BlockPos;
import appeng.api.parts.ILevelEmitter;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.container.AEBaseContainer;
import appeng.container.PrimaryGui;
import appeng.container.interfaces.IContainerSubGui;
@@ -125,16 +123,13 @@ public class CPacketLevelTerminalCommands implements IMessage {
TileEntity tile = DimensionManager.getWorld(message.dim)
.getTileEntity(message.x, message.y, message.z);
if (tile instanceof IPartHost host) {
IPart part = host.getPart(message.side);
if (part instanceof ILevelEmitter) {
InventoryHandler.openGui(
player,
tile.getWorldObj(),
new BlockPos(tile),
message.side,
GuiType.LEVEL_EMITTER_PROXY);
}
if (Platform.getPartFromTE(tile, message.side) instanceof ILevelEmitter) {
InventoryHandler.openGui(
player,
tile.getWorldObj(),
new BlockPos(tile),
message.side,
GuiType.LEVEL_EMITTER_PROXY);
} else {
InventoryHandler.openGui(
player,
@@ -4,8 +4,6 @@ import static com.glodblock.github.common.Config.reStockTime;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -26,7 +24,6 @@ public class ClientProxy extends CommonProxy {
private static final Minecraft mc = Minecraft.getMinecraft();
private static long refreshTick = System.currentTimeMillis();
private static IModelCustom modelWalrus;
@Override
public void preInit(FMLPreInitializationEvent event) {
@@ -39,7 +36,6 @@ public class ClientProxy extends CommonProxy {
(new ListenerLoader()).run();
(new RenderLoader()).run();
(new KeybindLoader()).run();
modelWalrus = AdvancedModelLoader.loadModel(FluidCraft.resource("models/walrus.obj"));
}
@Override
@@ -58,8 +54,4 @@ public class ClientProxy extends CommonProxy {
refreshTick = System.currentTimeMillis();
}
}
public static IModelCustom getWalrusModel() {
return modelWalrus;
}
}
@@ -0,0 +1,30 @@
package com.glodblock.github.util;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.Constants.NBT;
import com.glodblock.github.inventory.IDualHost;
public final class DualHostSettings {
private static final String FLUID_CONFIG_KEY = "fluidConfig";
private DualHostSettings() {}
public static void uploadSettings(IDualHost host, NBTTagCompound compound) {
if (compound.hasKey(FLUID_CONFIG_KEY, NBT.TAG_COMPOUND)) {
host.getDualityFluid().readConfigFromNBT(compound, FLUID_CONFIG_KEY);
host.getConfig();
}
}
public static void downloadSettings(IDualHost host, NBTTagCompound output) {
host.getDualityFluid().writeConfigToNBT(output, FLUID_CONFIG_KEY);
}
public static void copySettings(IDualHost target, IDualHost source) {
NBTTagCompound data = new NBTTagCompound();
downloadSettings(source, data);
uploadSettings(target, data);
}
}
@@ -147,6 +147,16 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
this.readConfig();
}
public void writeConfigToNBT(NBTTagCompound data, String name) {
this.config.writeToNBT(data, name);
}
public void readConfigFromNBT(NBTTagCompound data, String name) {
this.config.readFromNBT(data, name);
this.readConfig();
this.saveChanges();
}
public AEFluidInventory getConfig() {
return this.config;
}
@@ -1,46 +1,20 @@
package com.glodblock.github.util;
import net.minecraft.util.StatCollector;
import com.gtnewhorizon.gtnhlib.color.ColorResource;
import appeng.core.AELog;
public class FCGuiColors {
public enum FCGuiColors {
private static final ColorResource.Factory color = new ColorResource.Factory("ae2fc");
// ARGB Colors: Name and default value
StateNone(0x00000000),
StateIdle(0xFF55FF55),
StateCraft(0xFFFFFF55),
StateExport(0xFFAA00AA),
StateError(0xFFFF5555);
public static final ColorResource
// spotless:off
guiTextColorGray = color.rgb("guiTextColorGray", "0x404040"),
private final String root;
private final int color;
FCGuiColors() {
this.root = "ae2fc.gui.color";
this.color = 0x000000;
}
FCGuiColors(final int hex) {
this.root = "ae2fc.gui.color";
this.color = hex;
}
public int getColor() {
String hex = StatCollector.translateToLocal(this.getUnlocalized());
int color = this.color;
if (hex.length() <= 8) {
try {
color = Integer.parseUnsignedInt(hex, 16);
} catch (final NumberFormatException e) {
AELog.warn("Couldn't format color correctly for: " + this.root + " -> " + hex);
}
}
return color;
}
public String getUnlocalized() {
return this.root + '.' + this.toString();
}
stateNone = color.argb("stateNone", "0x00000000"),
stateIdle = color.argb("stateIdle", "0xFF55FF55"),
stateCraft = color.argb("stateCraft", "0xFFFFFF55"),
stateExport = color.argb("stateExport", "0xFFAA00AA"),
stateError = color.argb("stateError", "0xFFFF5555"),
itemSlotOverlayUnpowered = color.argb("itemSlotOverlayUnpowered", "0x66111111");
// spotless:on
}
@@ -52,7 +52,6 @@ import appeng.api.util.DimensionalCoord;
import appeng.container.AEBaseContainer;
import appeng.items.tools.powered.ToolWirelessTerminal;
import appeng.me.storage.NullInventory;
import appeng.tile.networking.TileCableBus;
import appeng.util.Platform;
import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
@@ -345,13 +344,6 @@ public final class Util {
return null;
}
public static IPart getPart(Object te, ForgeDirection face) {
if (te instanceof TileCableBus) {
return ((TileCableBus) te).getPart(face);
}
return null;
}
public static void writeFluidMapToBuf(Map<Integer, IAEFluidStack> list, ByteBuf buf) throws IOException {
buf.writeInt(list.size());
for (Map.Entry<Integer, IAEFluidStack> fs : list.entrySet()) {
@@ -190,12 +190,6 @@ ae2fc.gui.magnet.ore=Ore Dictionary benutzen
ae2fc.gui.magnet.whitelist=Whitelist
ae2fc.gui.magnet.blacklist=Blacklist
ae2fc.gui.color.StateNone=00000000
ae2fc.gui.color.StateIdle=FF55FF55
ae2fc.gui.color.StateCraft=FFFFFF55
ae2fc.gui.color.StateExport=FFAA00AA
ae2fc.gui.color.StateError=FFFF5555
error.unknown=Unbekannt
ae2fc.key.OpenTerminal=Handkonsole öffnen
@@ -199,12 +199,6 @@ ae2fc.gui.magnet.ore=Use Ore Dictionary
ae2fc.gui.magnet.whitelist=Whitelisting
ae2fc.gui.magnet.blacklist=Blacklisting
ae2fc.gui.color.StateNone=00000000
ae2fc.gui.color.StateIdle=FF55FF55
ae2fc.gui.color.StateCraft=FFFFFF55
ae2fc.gui.color.StateExport=FFAA00AA
ae2fc.gui.color.StateError=FFFF5555
error.unknown=Unknown
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
@@ -190,12 +190,6 @@ ae2fc.gui.magnet.ore=Использовать словарь руд
ae2fc.gui.magnet.whitelist=Белый список
ae2fc.gui.magnet.blacklist=Чёрный список
ae2fc.gui.color.StateNone=00000000
ae2fc.gui.color.StateIdle=FF55FF55
ae2fc.gui.color.StateCraft=FFFFFF55
ae2fc.gui.color.StateExport=FFAA00AA
ae2fc.gui.color.StateError=FFFF5555
error.unknown=Неизвестно
ae2fc.key.OpenTerminal=Открыть беспроводной универсальный терминал
@@ -184,12 +184,6 @@ ae2fc.gui.magnet.ore=Use Ore Dictionary
ae2fc.gui.magnet.whitelist=Whitelisting
ae2fc.gui.magnet.blacklist=Blacklisting
ae2fc.gui.color.StateNone=00000000
ae2fc.gui.color.StateIdle=FF55FF55
ae2fc.gui.color.StateCraft=FFFFFF55
ae2fc.gui.color.StateExport=FFAA00AA
ae2fc.gui.color.StateError=FFFF5555
error.unknown=未知流体
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal