mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
add Fluid Buffer
This commit is contained in:
1 parent
5e31096c7e
commit
77ccfb5606
16 files changed
+436
-56
No files matched your search
@@ -1,8 +1,6 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.ItemSubstitution;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
@@ -129,21 +127,22 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
this.buttonList.add(this.doubleBtn);
|
||||
combineLeft = 84;
|
||||
}
|
||||
// if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
// combineLeft = 74;
|
||||
// combineTop -= 11;
|
||||
// this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
// this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS,
|
||||
// PatternBeSubstitution.ENABLED);
|
||||
// this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
// this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
//
|
||||
// this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
// this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS,
|
||||
// PatternBeSubstitution.DISABLED);
|
||||
// this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
// this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
// }
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
combineLeft = 74;
|
||||
combineTop -= 11;
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84,
|
||||
this.guiTop + this.ySize - 153,
|
||||
Settings.ACTIONS,
|
||||
PatternBeSubstitution.DISABLED);
|
||||
this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
}
|
||||
this.combineEnableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "FORCE_COMBINE", "DO_COMBINE");
|
||||
this.combineEnableBtn.setHalfSize(true);
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.ItemSubstitution;
|
||||
import appeng.api.config.PatternSlotConfig;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -144,19 +141,20 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 114, "NOT_COMBINE", "DONT_COMBINE");
|
||||
this.combineDisableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineDisableBtn);
|
||||
// if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
// this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
// this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS,
|
||||
// PatternBeSubstitution.ENABLED);
|
||||
// this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
// this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
//
|
||||
// this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
// this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS,
|
||||
// PatternBeSubstitution.DISABLED);
|
||||
// this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
// this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
// }
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
this.beSubstitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 87,
|
||||
this.guiTop + this.ySize - 103,
|
||||
Settings.ACTIONS,
|
||||
PatternBeSubstitution.DISABLED);
|
||||
this.beSubstitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
}
|
||||
processingScrollBar.setTop(this.ySize - 164);
|
||||
}
|
||||
|
||||
@@ -241,6 +239,8 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
|
||||
substitutionsEnabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
substitutionsDisabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
beSubstitutionsEnabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
beSubstitutionsDisabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
fluidPrioritizedEnabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
fluidPrioritizedDisabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
doubleBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import com.glodblock.github.common.block.BlockFluidBuffer;
|
||||
import com.glodblock.github.common.tile.TileFluidBuffer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderBlockFluidBuffer extends BaseBlockRender<BlockFluidBuffer, TileFluidBuffer> {
|
||||
|
||||
public RenderBlockFluidBuffer() {
|
||||
super(false, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(
|
||||
final BlockFluidBuffer block,
|
||||
final IBlockAccess world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final RenderBlocks renderer) {
|
||||
final TileFluidBuffer ti = block.getTileEntity(world, x, y, z);
|
||||
final BlockRenderInfo info = block.getRendererInstance();
|
||||
this.renderFluid(ti, x, y, z, renderer);
|
||||
final boolean fz = super.renderInWorld(block, world, x, y, z, renderer);
|
||||
info.setTemporaryRenderIcon(null);
|
||||
return fz;
|
||||
}
|
||||
|
||||
private void renderFluid(TileFluidBuffer tileEntity, double x, double y, double z, RenderBlocks renderer) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (tileEntity != null && tileEntity.getFluidStack() != null) {
|
||||
Fluid storedFluid = tileEntity.getFluidStack().getFluid();
|
||||
if (storedFluid != null) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Block id = Block.getBlockById(FluidRegistry.WATER.getID());
|
||||
IIcon fluidIcon = storedFluid.getIcon();
|
||||
if (fluidIcon == null) fluidIcon = FluidRegistry.LAVA.getIcon();
|
||||
tessellator.setColorRGBA_F(
|
||||
(storedFluid.getColor() >> 16 & 0xFF) / 255.0F,
|
||||
(storedFluid.getColor() >> 8 & 0xFF) / 255.0F,
|
||||
(storedFluid.getColor() & 0xFF) / 255.0F,
|
||||
1.0F);
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderer.renderFaceYNeg(id, x, y, z, fluidIcon);
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderFaceYPos(id, x, y, z, fluidIcon);
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderer.renderFaceZNeg(id, x, y, z, fluidIcon);
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderFaceZPos(id, x, y, z, fluidIcon);
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXNeg(id, x, y, z, fluidIcon);
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(id, x, y, z, fluidIcon);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user