diff --git a/dependencies.gradle b/dependencies.gradle index 6ec934ca..9091c5c2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -57,7 +57,6 @@ dependencies { compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.4-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.11:dev") { transitive = false } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev") } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiFluidTerminal.java b/src/main/java/com/glodblock/github/client/gui/GuiFluidTerminal.java index 36331e26..dd6bbc8b 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiFluidTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiFluidTerminal.java @@ -19,9 +19,7 @@ import com.glodblock.github.common.item.ItemFluidDrop; import com.glodblock.github.inventory.InventoryHandler; import com.glodblock.github.inventory.gui.GuiType; import com.glodblock.github.network.CPacketFluidUpdate; -import com.glodblock.github.util.ModAndClassUtil; import com.glodblock.github.util.Util; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; import appeng.api.storage.ITerminalHost; import appeng.api.storage.data.IAEFluidStack; @@ -97,10 +95,6 @@ public class GuiFluidTerminal extends GuiFluidMonitor { IIcon icon = fluid.getIcon(); if (icon == null) return; - if (ModAndClassUtil.HODGEPODGE && icon instanceof IPatchedTextureAtlasSprite) { - ((IPatchedTextureAtlasSprite) icon).markNeedsAnimationUpdate(); - } - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); @@ -109,7 +103,7 @@ public class GuiFluidTerminal extends GuiFluidMonitor { (fluid.getColor() >> 16 & 0xFF) / 255.0F, (fluid.getColor() >> 8 & 0xFF) / 255.0F, (fluid.getColor() & 0xFF) / 255.0F); - drawTexturedModelRectFromIcon(posX, posY, fluid.getIcon(), 16, 16); + drawTexturedModelRectFromIcon(posX, posY, icon, 16, 16); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor3f(1, 1, 1); diff --git a/src/main/java/com/glodblock/github/client/render/ItemCertusQuartzTankRender.java b/src/main/java/com/glodblock/github/client/render/ItemCertusQuartzTankRender.java index 7a687269..f2160be0 100644 --- a/src/main/java/com/glodblock/github/client/render/ItemCertusQuartzTankRender.java +++ b/src/main/java/com/glodblock/github/client/render/ItemCertusQuartzTankRender.java @@ -17,10 +17,9 @@ import org.lwjgl.opengl.GL11; import com.glodblock.github.FluidCraft; import com.glodblock.github.client.render.tank.ModelCertusTank; +import com.glodblock.github.common.item.ItemCertusQuartzTank; import com.glodblock.github.common.tile.TileCertusQuartzTank; import com.glodblock.github.loader.ItemAndBlockHolder; -import com.glodblock.github.util.ModAndClassUtil; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; import cpw.mods.fml.client.registry.ClientRegistry; @@ -35,7 +34,7 @@ public class ItemCertusQuartzTankRender implements IItemRenderer { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.EQUIPPED_FIRST_PERSON; + return true; } @Override @@ -49,31 +48,32 @@ public class ItemCertusQuartzTankRender implements IItemRenderer { .bindTexture(FluidCraft.resource("textures/blocks/certus_quartz_tank/map.png")); GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - GL11.glScalef(1, -1, -1); - this.model.render(0.0625f); - GL11.glScalef(1, -1, 1); - this.model.render(0.0625f); + if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) { + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } - if (item != null && item.hasTagCompound()) { - FluidStack storedFluid = FluidStack - .loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity")); - int tankCapacity = 32000; + GL11.glRotatef(180F, 1F, 0F, 0F); + this.model.render(0.0625f); + GL11.glRotatef(180F, 1F, 0F, 0F); + + if (item.getItem() instanceof ItemCertusQuartzTank itemCertusQuartzTank) { + FluidStack storedFluid = itemCertusQuartzTank.getFluid(item); + int tankCapacity = itemCertusQuartzTank.getCapacity(item); if (storedFluid != null && storedFluid.getFluid() != null) { IIcon fluidIcon = storedFluid.getFluid().getIcon(); if (fluidIcon == null) fluidIcon = FluidRegistry.LAVA.getIcon(); - if (ModAndClassUtil.HODGEPODGE && fluidIcon instanceof IPatchedTextureAtlasSprite) { - ((IPatchedTextureAtlasSprite) fluidIcon).markNeedsAnimationUpdate(); - } + Tessellator tessellator = Tessellator.instance; RenderBlocks renderer = new RenderBlocks(); - GL11.glScalef(1, 1, -1); + Block waterBlock = FluidRegistry.WATER.getBlock(); + + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); renderer.setRenderBounds( 0.08F, 0.001F, @@ -81,9 +81,12 @@ public class ItemCertusQuartzTankRender implements IItemRenderer { 0.92F, (float) storedFluid.amount / (float) tankCapacity * 0.999F, 0.92F); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Block waterBlock = FluidRegistry.WATER.getBlock(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + tessellator.startDrawingQuads(); tessellator.setColorRGBA_F( (storedFluid.getFluid().getColor() >> 16 & 0xFF) / 255.0F, diff --git a/src/main/java/com/glodblock/github/client/render/ItemPacketRender.java b/src/main/java/com/glodblock/github/client/render/ItemPacketRender.java index ab95d81e..33ea9b02 100644 --- a/src/main/java/com/glodblock/github/client/render/ItemPacketRender.java +++ b/src/main/java/com/glodblock/github/client/render/ItemPacketRender.java @@ -13,9 +13,7 @@ import org.lwjgl.opengl.GL11; import com.glodblock.github.common.item.ItemFluidPacket; import com.glodblock.github.loader.ItemAndBlockHolder; -import com.glodblock.github.util.ModAndClassUtil; import com.glodblock.github.util.RenderUtil; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -46,16 +44,9 @@ public class ItemPacketRender implements IItemRenderer { GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); FluidStack fluid = ItemFluidPacket.getFluidStack(item); - int RGB = 0xFFFFFF; - if (fluid != null) { - RGB = fluid.getFluid().getColor(fluid); - } + int RGB = fluid == null ? 0xFFFFFF : fluid.getFluid().getColor(fluid); IIcon icon = fluid == null ? FluidRegistry.WATER.getStillIcon() : fluid.getFluid().getStillIcon(); - if (ModAndClassUtil.HODGEPODGE && icon instanceof IPatchedTextureAtlasSprite) { - ((IPatchedTextureAtlasSprite) icon).markNeedsAnimationUpdate(); - } - if (RGB != 0xFFFFFF) { GL11.glColor3f((RGB >> 16 & 0xFF) / 255.0F, (RGB >> 8 & 0xFF) / 255.0F, (RGB & 0xFF) / 255.0F); } diff --git a/src/main/java/com/glodblock/github/client/render/tank/ModelCertusTank.java b/src/main/java/com/glodblock/github/client/render/tank/ModelCertusTank.java index 2ae7804e..00ec8d05 100644 --- a/src/main/java/com/glodblock/github/client/render/tank/ModelCertusTank.java +++ b/src/main/java/com/glodblock/github/client/render/tank/ModelCertusTank.java @@ -25,8 +25,7 @@ public class ModelCertusTank extends ModelBase { this.textureHeight = 64; this.Shape1 = new ModelRenderer(this, 0, 0); - this.Shape1.addBox(0F, 0F, 0F, 14, 16, 14); - this.Shape1.setRotationPoint(-7F, -8F, -7F); + this.Shape1.addBox(-7F, -8F, -7F, 14, 16, 14); this.Shape1.setTextureSize(this.textureWidth, this.textureHeight); this.Shape1.mirror = true; setRotation(this.Shape1, 0F, 0F, 0F); diff --git a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java index 721e2912..39fdab99 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -219,12 +219,16 @@ public class FluidCellInventory implements IFluidCellInventory { public long getRemainingFluidCountDist(IAEFluidStack l) { long remaining; long types = 0; - for (int i = 0; i < this.getTotalFluidTypes(); i++) { - if (this.getConfigInventory().getStackInSlot(i) != null) { + long maxFluidTypes = this.getTotalFluidTypes(); + IInventory configInventory = this.getConfigInventory(); + for (int i = 0; i < configInventory.getSizeInventory(); i++) { + // Check all partition slots to determine min distribution behaviour until max fluid types is reached + if (types >= maxFluidTypes) break; + if (configInventory.getStackInSlot(i) != null) { types++; } } - if (types == 0) types = this.getTotalFluidTypes(); + if (types == 0) types = maxFluidTypes; if (l != null) { if (restrictionLong > 0) { remaining = Math.min((restrictionLong / types) - l.getStackSize(), getRemainingFluidCount()); diff --git a/src/main/java/com/glodblock/github/crossmod/waila/WailaInit.java b/src/main/java/com/glodblock/github/crossmod/waila/WailaInit.java index 8cbf4293..820cb660 100644 --- a/src/main/java/com/glodblock/github/crossmod/waila/WailaInit.java +++ b/src/main/java/com/glodblock/github/crossmod/waila/WailaInit.java @@ -1,6 +1,7 @@ package com.glodblock.github.crossmod.waila; import com.glodblock.github.common.tile.TileCertusQuartzTank; +import com.glodblock.github.util.ModAndClassUtil; import appeng.api.parts.IPartHost; import appeng.tile.AEBaseTile; @@ -26,8 +27,9 @@ public class WailaInit { registrar.registerBodyProvider(tile, AEBaseTile.class); registrar.registerNBTProvider(tile, AEBaseTile.class); - final IWailaDataProvider certusQuartzTank = new CertusQuartzTankWailaDataProvider(); - registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class); - + if (!ModAndClassUtil.WAILA_PLUGINS) { + final IWailaDataProvider certusQuartzTank = new CertusQuartzTankWailaDataProvider(); + registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class); + } } } diff --git a/src/main/java/com/glodblock/github/nei/NEICellViewHandler.java b/src/main/java/com/glodblock/github/nei/NEICellViewHandler.java index 372fc60b..a15f6f9f 100644 --- a/src/main/java/com/glodblock/github/nei/NEICellViewHandler.java +++ b/src/main/java/com/glodblock/github/nei/NEICellViewHandler.java @@ -23,8 +23,6 @@ import org.lwjgl.opengl.GL11; import com.glodblock.github.common.item.ItemFluidDrop; import com.glodblock.github.common.storage.FluidCellInventoryHandler; -import com.glodblock.github.util.ModAndClassUtil; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; import appeng.api.AEApi; import appeng.api.config.TerminalFontSize; @@ -164,10 +162,6 @@ public class NEICellViewHandler implements IUsageHandler { final int line = i % ROW_ITEM_NUM; final int row = i / ROW_ITEM_NUM; - if (ModAndClassUtil.HODGEPODGE && icon instanceof IPatchedTextureAtlasSprite sprite) { - sprite.markNeedsAnimationUpdate(); - } - tessellator.setColorRGBA(color >> 16 & 0xFF, color >> 8 & 0xFF, color & 0xFF, 0xFF); tessellator.addVertexWithUV( OFFSET_X + 18 * (line + 1) - 1, diff --git a/src/main/java/com/glodblock/github/util/ModAndClassUtil.java b/src/main/java/com/glodblock/github/util/ModAndClassUtil.java index 65b62cac..6cdded95 100644 --- a/src/main/java/com/glodblock/github/util/ModAndClassUtil.java +++ b/src/main/java/com/glodblock/github/util/ModAndClassUtil.java @@ -32,8 +32,8 @@ public final class ModAndClassUtil { public static boolean COFH = false; public static boolean GTPP = false; public static boolean WAILA = false; + public static boolean WAILA_PLUGINS = false; public static boolean AVARITIA = false; - public static boolean HODGEPODGE = false; public static boolean NEW_HORIZONS_CORE_MOD = false; public static boolean isV2; @@ -147,8 +147,8 @@ public final class ModAndClassUtil { if (Loader.isModLoaded("CoFHCore")) COFH = true; if (Loader.isModLoaded("miscutils")) GTPP = true; if (Loader.isModLoaded("Waila")) WAILA = true; + if (Loader.isModLoaded("wailaplugins")) WAILA_PLUGINS = true; if (Loader.isModLoaded("Avaritia")) AVARITIA = true; - if (Loader.isModLoaded("hodgepodge")) HODGEPODGE = true; if (Loader.isModLoaded("dreamcraft")) NEW_HORIZONS_CORE_MOD = true; } } diff --git a/src/main/java/com/glodblock/github/util/RenderUtil.java b/src/main/java/com/glodblock/github/util/RenderUtil.java index aaeb8adb..3d0fad3c 100644 --- a/src/main/java/com/glodblock/github/util/RenderUtil.java +++ b/src/main/java/com/glodblock/github/util/RenderUtil.java @@ -12,8 +12,6 @@ import net.minecraft.util.IIcon; import org.lwjgl.opengl.GL11; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; - import appeng.api.storage.data.IAEFluidStack; public final class RenderUtil { @@ -53,9 +51,6 @@ public final class RenderUtil { if (aeFluidStack.getStackSize() > 0 && hi > 0) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); IIcon fluidIcon = aeFluidStack.getFluid().getStillIcon(); - if (ModAndClassUtil.HODGEPODGE && fluidIcon instanceof IPatchedTextureAtlasSprite) { - ((IPatchedTextureAtlasSprite) fluidIcon).markNeedsAnimationUpdate(); - } GL11.glColor3f( (float) (aeFluidStack.getFluid().getColor() >> 16 & 255) / 255.0F, (float) (aeFluidStack.getFluid().getColor() >> 8 & 255) / 255.0F,