Compare commits

...
3 Commits
70 changed files with 74 additions and 4 deletions

No files matched your search

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

@@ -10,7 +10,6 @@ import org.lwjgl.opengl.GL11;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.gui.container.ContainerFluidInterface;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.inventory.gui.MouseRegionManager;
@@ -19,6 +18,7 @@ import com.glodblock.github.util.FCGuiColors;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.RenderUtil;
import appeng.api.parts.IPart;
import appeng.api.storage.data.IAEFluidStack;
import appeng.client.gui.GuiSub;
import appeng.core.localization.GuiText;
@@ -103,6 +103,6 @@ public class GuiFluidInterface extends GuiSub {
}
private boolean isPart() {
return this.cont.getTile() instanceof PartFluidInterface;
return this.cont.getTile() instanceof IPart;
}
}
@@ -1,7 +1,10 @@
package com.glodblock.github.common.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;
@@ -12,11 +15,17 @@ import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.util.BlockPos;
import com.glodblock.github.util.NameConst;
import appeng.api.util.AEColor;
import appeng.block.AEBaseItemBlock;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSuperStockReplenisher extends FCBaseBlock {
@SideOnly(Side.CLIENT)
private IIcon[] coloredTextures;
public BlockSuperStockReplenisher() {
super(Material.web, NameConst.BLOCK_SUPER_STOCK_REPLENISHER);
setTileEntity(TileSuperStockReplenisher.class);
@@ -25,6 +34,28 @@ public class BlockSuperStockReplenisher extends FCBaseBlock {
this.lightOpacity = 4;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister iconRegistry) {
super.registerBlockIcons(iconRegistry);
this.coloredTextures = new IIcon[AEColor.VALUES.length];
for (final AEColor color : AEColor.VALID_COLORS) {
this.coloredTextures[color.ordinal()] = iconRegistry
.registerIcon(this.getTextureName().replace(":", ":replenisher/") + "_" + color.name());
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileSuperStockReplenisher tile = this.getTileEntity(world, x, y, z);
if (tile != null && tile.getColor() != AEColor.Transparent) {
return this.coloredTextures[tile.getColor().ordinal()];
}
return super.getIcon(world, x, y, z, side);
}
@Override
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
float hitY, float hitZ) {
@@ -14,6 +14,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.item.BaseItemBlockContainer;
import com.glodblock.github.common.tabs.FluidCraftingTabs;
import com.glodblock.github.common.tile.TileWalrus;
@@ -30,6 +31,8 @@ public class BlockWalrus extends BaseBlockContainer {
setHardness(2.0F);
setResistance(10.0F);
setBlockName(NameConst.BLOCK_WALRUS);
// only used for hit/break particles, the block itself is rendered by RenderBlockWalrus
setBlockTextureName(FluidCraft.MODID + ":" + NameConst.BLOCK_WALRUS + "_particle");
}
@Override
@@ -5,10 +5,12 @@ import java.util.stream.IntStream;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -28,6 +30,7 @@ import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.implementations.items.IStorageCell;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkBootingStatusChange;
@@ -45,6 +48,7 @@ import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.IConfigManager;
import appeng.core.AELog;
@@ -63,7 +67,7 @@ import appeng.util.item.AEItemStack;
import io.netty.buffer.ByteBuf;
public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFluidInventory, IFluidHandler,
IPowerChannelState, IGridTickable, ITerminalHost, IIAEStackInventory {
IPowerChannelState, IGridTickable, ITerminalHost, IIAEStackInventory, IColorableTile {
private final AppEngInternalInventory cell = new AppEngInternalInventory(this, 1);
private final BiggerAppEngInventory invItems = new BiggerAppEngInventory(this, 63);
@@ -87,6 +91,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
};
private final BaseActionSource source;
private boolean isPowered;
private AEColor paintedColor = AEColor.Transparent;
private long totalBytes;
private long storedFluidCount;
private long storedItemCount;
@@ -601,17 +606,26 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
@TileEvent(TileEventType.NETWORK_READ)
public boolean readFromStream_TileSuperStockReplenisher(final ByteBuf data) {
final boolean oldPower = isPowered;
final AEColor oldPaintedColor = this.paintedColor;
isPowered = data.readBoolean();
return isPowered != oldPower;
this.paintedColor = AEColor.fromOrdinal(data.readByte());
this.getProxy().setColor(this.paintedColor);
return isPowered != oldPower || this.paintedColor != oldPaintedColor;
}
@TileEvent(TileEventType.NETWORK_WRITE)
public void writeToStream_TileSuperStockReplenisher(final ByteBuf data) {
data.writeBoolean(isActive());
data.writeByte(this.paintedColor.ordinal());
}
@TileEvent(TileEventType.WORLD_NBT_READ)
public void readFromNBTEvent(NBTTagCompound data) {
final int color = data.hasKey("paintedColor", Constants.NBT.TAG_BYTE) ? data.getByte("paintedColor")
: AEColor.Transparent.ordinal();
this.paintedColor = color >= 0 && color < AEColor.VALUES.length ? AEColor.fromOrdinal(color)
: AEColor.Transparent;
this.getProxy().setColor(this.paintedColor);
invItems.readFromNBT(data, "ItemInv");
invFluids.readFromNBT(data, "FluidInv");
configItems.readFromNBT(data, "configItems");
@@ -626,6 +640,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
@TileEvent(TileEventType.WORLD_NBT_WRITE)
public NBTTagCompound writeToNBTEvent(NBTTagCompound data) {
data.setByte("paintedColor", (byte) this.paintedColor.ordinal());
invItems.writeToNBT(data, "ItemInv");
invFluids.writeToNBT(data, "FluidInv");
configItems.writeToNBT(data, "configItems");
@@ -638,6 +653,27 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
return data;
}
@Override
public AEColor getColor() {
return this.paintedColor;
}
@Override
public boolean recolourBlock(final ForgeDirection side, final AEColor newPaintedColor, final EntityPlayer who) {
if (this.paintedColor == newPaintedColor) {
return false;
}
this.paintedColor = newPaintedColor;
this.getProxy().setColor(this.paintedColor);
final IGridNode node = this.getGridNode(side);
if (node != null) {
node.updateState();
}
this.markDirty();
this.markForUpdate();
return true;
}
@MENetworkEventSubscribe
public void stateChange(final MENetworkPowerStatusChange p) {
this.updatePowerState();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB