Compare commits

...
53 changed files with 107 additions and 11 deletions

No files matched your search

@@ -24,10 +24,12 @@ public class ContainerLevelWireless extends ContainerLevelTerminal {
@Override
public PrimaryGui createPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
PrimaryGui primaryGui = new FluidPrimaryGui(
GuiType.WIRELESS_LEVEL_TERMINAL,
ItemAndBlockHolder.WIRELESS_LEVEL_TERM.stack(),
context.getTile(),
context.getSide());
primaryGui.setSlotIndex(getTargetSlotIndex());
return primaryGui;
}
}
@@ -9,6 +9,7 @@ import com.glodblock.github.client.textures.FCPartsTexture;
import com.glodblock.github.common.block.BlockFluidInterface;
import com.glodblock.github.common.tile.TileFluidInterface;
import appeng.api.util.AEColor;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.BlockRenderInfo;
import appeng.tile.misc.TileInterface;
@@ -25,15 +26,18 @@ public class RenderBlockFluidInterface extends BaseBlockRender<BlockFluidInterfa
final TileInterface ti = block.getTileEntity(world, x, y, z);
final BlockRenderInfo info = block.getRendererInstance();
if (ti != null && ti.getForward() != ForgeDirection.UNKNOWN) {
final IIcon side = FCPartsTexture.BlockFluidInterfaceAlternate_Arrow.getIcon();
info.setTemporaryRenderIcons(
FCPartsTexture.BlockInterfaceAlternate.getIcon(),
block.getIcon(0, 0),
side,
side,
side,
side);
if (ti != null) {
final AEColor color = ti.getProxy().getColor();
if (ti.getForward() != ForgeDirection.UNKNOWN) {
final IIcon face = color == AEColor.Transparent ? block.getIcon(0, 0)
: block.getColoredTexture(0, color);
final IIcon alternate = color == AEColor.Transparent ? FCPartsTexture.BlockInterfaceAlternate.getIcon()
: block.getColoredTexture(1, color);
final IIcon side = color == AEColor.Transparent
? FCPartsTexture.BlockFluidInterfaceAlternate_Arrow.getIcon()
: block.getColoredTexture(2, color);
info.setTemporaryRenderIcons(alternate, face, side, side, side, side);
}
}
final boolean fz = super.renderInWorld(block, world, x, y, z, renderer);
@@ -4,7 +4,10 @@ import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -13,6 +16,7 @@ import com.glodblock.github.common.tabs.FluidCraftingTabs;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.util.NameConst;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.block.AEBaseItemBlock;
import appeng.core.features.AEFeature;
@@ -25,6 +29,12 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidInterface extends FCBaseBlock {
private static final String[] COLORED_TEXTURES = { "fluid_interface", "fluid_interface_a",
"fluid_interface_arrow" };
@SideOnly(Side.CLIENT)
private IIcon[][] coloredTextures;
public BlockFluidInterface() {
super(Material.iron, NameConst.BLOCK_FLUID_INTERFACE);
setFullBlock(true);
@@ -39,6 +49,38 @@ public class BlockFluidInterface extends FCBaseBlock {
return new RenderBlockFluidInterface();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister iconRegistry) {
super.registerBlockIcons(iconRegistry);
this.coloredTextures = new IIcon[COLORED_TEXTURES.length][AEColor.VALUES.length];
for (final AEColor color : AEColor.VALID_COLORS) {
for (int id = 0; id < COLORED_TEXTURES.length; id++) {
this.coloredTextures[id][color.ordinal()] = iconRegistry
.registerIcon("ae2fc:interface/" + COLORED_TEXTURES[id] + "_" + color.name());
}
}
}
@SideOnly(Side.CLIENT)
public IIcon getColoredTexture(final int id, final AEColor color) {
return this.coloredTextures[id][color.ordinal()];
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileInterface tile = this.getTileEntity(world, x, y, z);
if (tile != null && tile.getForward() == ForgeDirection.UNKNOWN) {
final AEColor color = tile.getProxy().getColor();
if (color != AEColor.Transparent) {
return this.getColoredTexture(0, color);
}
}
return super.getIcon(world, x, y, z, side);
}
@Override
public boolean onActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
final int facing, final float hitX, final float hitY, final float hitZ) {
@@ -2,7 +2,12 @@ package com.glodblock.github.common.item;
import static appeng.util.item.AEFluidStackType.FLUID_STACK_TYPE;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import org.jetbrains.annotations.NotNull;
@@ -10,8 +15,17 @@ import com.glodblock.github.common.storage.CellType;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.google.common.base.Optional;
import appeng.api.AEApi;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEStackType;
import appeng.core.localization.GuiText;
import appeng.items.AEBaseCell;
import appeng.me.storage.FluidCellInventoryHandler;
import appeng.util.IterationCounter;
import appeng.util.ReadableNumberConverter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class FCBaseItemCell extends AEBaseCell {
@@ -31,6 +45,38 @@ public abstract class FCBaseItemCell extends AEBaseCell {
return FLUID_STACK_TYPE;
}
@Override
@SideOnly(Side.CLIENT)
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
final boolean displayMoreInfo) {
super.addCheckedInformation(stack, player, lines, displayMoreInfo);
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
.getCellInventory(stack, null, getStackType());
if (!(inventory instanceof FluidCellInventoryHandler handler) || handler.getCellInv().getTotalItemTypes() != 1
|| handler.getCellInv().getStoredItemTypes() == 0)
return;
final IAEFluidStack content = handler
.getAvailableItems(FLUID_STACK_TYPE.createPrimitiveList(), IterationCounter.fetchNewId())
.getFirstItem();
final String oldLine = GuiText.Contains.getLocal() + ": " + content.getDisplayName();
final int oldLineIndex = lines.lastIndexOf(oldLine);
if (oldLineIndex >= 0) {
if (!GuiScreen.isCtrlKeyDown()) {
lines.set(oldLineIndex, EnumChatFormatting.GRAY + GuiText.HoldCtrlForContents.getLocal());
return;
}
final String unit = FLUID_STACK_TYPE.getDisplayUnit();
lines.set(
oldLineIndex,
" " + content.getDisplayName()
+ " x"
+ ReadableNumberConverter.INSTANCE.toWideReadableForm(content.getStackSize())
+ (unit.isEmpty() ? "" : " " + unit));
}
}
public FCBaseItemCell(Optional subName) {
super(subName);
}
@@ -69,7 +69,9 @@ public class PartFluidFormationPlane extends PartBaseFormationPlane implements I
@Override
protected void updateHandler() {
this.onNeighborChanged();
if (this.getProxy().isReady()) {
this.onNeighborChanged();
}
}
public boolean doWork() {
Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B