project essence, part 1
|
@ -8,7 +8,9 @@
|
||||||
*/
|
*/
|
||||||
package buildcraft.api.filler;
|
package buildcraft.api.filler;
|
||||||
|
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
import buildcraft.api.statements.IStatement;
|
import buildcraft.api.statements.IStatement;
|
||||||
|
|
||||||
public interface IFillerPattern extends IStatement {
|
public interface IFillerPattern extends IStatement {
|
||||||
|
IIcon getBlockOverlay();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Please check the contents of the license, which should be located
|
* Please check the contents of the license, which should be located
|
||||||
* as "LICENSE.API" in the BuildCraft source code distribution.
|
* as "LICENSE.API" in the BuildCraft source code distribution.
|
||||||
*/
|
*/
|
||||||
@API(apiVersion = "3.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|filler")
|
@API(apiVersion = "4.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|filler")
|
||||||
package buildcraft.api.filler;
|
package buildcraft.api.filler;
|
||||||
import cpw.mods.fml.common.API;
|
import cpw.mods.fml.common.API;
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 387 B |
BIN
buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/front.png
Normal file → Executable file
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top.png
Normal file → Executable file
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 499 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 1.2 KiB |
BIN
buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top.png
Normal file → Executable file
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 171 B |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 1.5 KiB |
BIN
buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/base.png
Normal file → Executable file
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/chamber.png
Normal file → Executable file
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 1.8 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/base.png
Normal file → Executable file
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 1.2 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/chamber.png
Normal file → Executable file
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/trunk.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/base.png
Normal file → Executable file
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 1.4 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/chamber.png
Normal file → Executable file
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 1.1 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/base.png
Normal file → Executable file
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 1.4 KiB |
BIN
buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/chamber.png
Normal file → Executable file
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 1.1 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/bottom.png
Normal file → Executable file
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 1.2 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/side.png
Normal file → Executable file
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/top.png
Normal file → Executable file
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 223 B |
After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 315 B |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png
Normal file → Executable file
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 547 B |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 157 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/back.png
Normal file → Executable file
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 1.2 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/bottom.png
Normal file → Executable file
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/front.png
Normal file → Executable file
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 139 B |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/side.png
Normal file → Executable file
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/top.png
Normal file → Executable file
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 1.3 KiB |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/bottom.png
Normal file → Executable file
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 139 B |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/side.png
Normal file → Executable file
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 475 B |
BIN
buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top.png
Normal file → Executable file
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
|
@ -172,6 +172,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public static IIconProvider iconProvider;
|
public static IIconProvider iconProvider;
|
||||||
public static int blockByEntityModel;
|
public static int blockByEntityModel;
|
||||||
|
public static int multipassModel;
|
||||||
public static int legacyPipeModel;
|
public static int legacyPipeModel;
|
||||||
public static int markerModel;
|
public static int markerModel;
|
||||||
public static ITriggerExternal triggerMachineActive = new TriggerMachine(true);
|
public static ITriggerExternal triggerMachineActive = new TriggerMachine(true);
|
||||||
|
@ -451,7 +452,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockRedLaser");
|
BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockRedLaser");
|
||||||
BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockBlueLaser");
|
BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockBlueLaser");
|
||||||
BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockStripesLaser");
|
BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockStripesLaser");
|
||||||
BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:laserBox/blockTransparentLaser");
|
BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:misc/transparent");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,23 +8,32 @@
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.builders;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.BuildCraftBuilders;
|
||||||
|
import buildcraft.BuildCraftCore;
|
||||||
|
import buildcraft.core.BlockBuildCraftLED;
|
||||||
import buildcraft.core.lib.block.BlockBuildCraft;
|
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||||
import buildcraft.core.BCCreativeTab;
|
import buildcraft.core.BCCreativeTab;
|
||||||
import buildcraft.core.GuiIds;
|
import buildcraft.core.GuiIds;
|
||||||
|
import buildcraft.core.lib.utils.ResourceUtils;
|
||||||
|
import buildcraft.factory.TilePump;
|
||||||
|
|
||||||
|
public class BlockArchitect extends BlockBuildCraftLED {
|
||||||
|
private IIcon[] led;
|
||||||
|
|
||||||
public class BlockArchitect extends BlockBuildCraft {
|
|
||||||
public BlockArchitect() {
|
public BlockArchitect() {
|
||||||
super(Material.iron, BCCreativeTab.get("main"));
|
super(Material.iron);
|
||||||
setRotatable(true);
|
setRotatable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +72,16 @@ public class BlockArchitect extends BlockBuildCraft {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) {
|
||||||
|
if (renderPass < 1) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
TileArchitect tile = (TileArchitect) access.getTileEntity(x, y, z);
|
||||||
|
return tile.getIconGlowLevel(renderPass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -26,19 +26,21 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.BuildCraftBuilders;
|
||||||
import buildcraft.api.events.BlockInteractionEvent;
|
import buildcraft.api.events.BlockInteractionEvent;
|
||||||
import buildcraft.api.filler.IFillerPattern;
|
import buildcraft.api.filler.IFillerPattern;
|
||||||
|
import buildcraft.core.BlockBuildCraftLED;
|
||||||
import buildcraft.core.lib.block.BlockBuildCraft;
|
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||||
import buildcraft.core.BCCreativeTab;
|
import buildcraft.core.BCCreativeTab;
|
||||||
import buildcraft.core.GuiIds;
|
import buildcraft.core.GuiIds;
|
||||||
import buildcraft.core.lib.utils.Utils;
|
import buildcraft.core.lib.utils.Utils;
|
||||||
|
import buildcraft.factory.TileMiningWell;
|
||||||
|
|
||||||
public class BlockFiller extends BlockBuildCraft {
|
public class BlockFiller extends BlockBuildCraftLED {
|
||||||
private IIcon textureTopOff;
|
|
||||||
|
|
||||||
public BlockFiller() {
|
public BlockFiller() {
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
|
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
setCreativeTab(BCCreativeTab.get("main"));
|
setCreativeTab(BCCreativeTab.get("main"));
|
||||||
|
setRotatable(true);
|
||||||
|
setPassCount(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,23 +61,13 @@ public class BlockFiller extends BlockBuildCraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) {
|
||||||
public IIcon getIconAbsolute(IBlockAccess world, int x, int y, int z, int side, int metadata) {
|
if (renderPass == 0 || renderPass == 3) {
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
return -1;
|
||||||
if (tile != null && tile instanceof TileFiller) {
|
} else {
|
||||||
TileFiller filler = (TileFiller) tile;
|
TileFiller tile = (TileFiller) access.getTileEntity(x, y, z);
|
||||||
if (side != 1) {
|
return tile.getIconGlowLevel(renderPass);
|
||||||
if (filler.currentPattern != null) {
|
|
||||||
return filler.currentPattern.getIcon();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!filler.hasWork()) {
|
|
||||||
return textureTopOff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getIconAbsolute(side, metadata);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,13 +75,6 @@ public class BlockFiller extends BlockBuildCraft {
|
||||||
return new TileFiller();
|
return new TileFiller();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register) {
|
|
||||||
super.registerBlockIcons(register);
|
|
||||||
textureTopOff = register.registerIcon("buildcraftbuilders:fillerBlock/top_off");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock() {
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -104,4 +89,28 @@ public class BlockFiller extends BlockBuildCraft {
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconAbsolute(IBlockAccess access, int x, int y, int z, int side, int meta) {
|
||||||
|
if (renderPass < 3) {
|
||||||
|
return super.getIconAbsolute(access, x, y, z, side, meta);
|
||||||
|
} else {
|
||||||
|
if (side == 2) {
|
||||||
|
TileEntity tile = access.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof TileFiller && ((TileFiller) tile).currentPattern != null) {
|
||||||
|
return ((TileFiller) tile).currentPattern.getBlockOverlay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconAbsolute(int side, int meta) {
|
||||||
|
if (renderPass < 3) {
|
||||||
|
return super.getIconAbsolute(side, meta);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
private SimpleInventory inv = new SimpleInventory(2, "Architect", 1);
|
private SimpleInventory inv = new SimpleInventory(2, "Architect", 1);
|
||||||
|
|
||||||
private RecursiveBlueprintReader reader;
|
private RecursiveBlueprintReader reader;
|
||||||
|
private boolean isProcessing;
|
||||||
|
|
||||||
public TileArchitect() {
|
public TileArchitect() {
|
||||||
box.kind = Kind.BLUE_STRIPES;
|
box.kind = Kind.BLUE_STRIPES;
|
||||||
|
@ -74,6 +75,8 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
|
|
||||||
if (reader.isDone()) {
|
if (reader.isDone()) {
|
||||||
reader = null;
|
reader = null;
|
||||||
|
isProcessing = false;
|
||||||
|
sendNetworkUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,6 +211,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
box.writeData(stream);
|
box.writeData(stream);
|
||||||
NetworkUtils.writeUTF(stream, name);
|
NetworkUtils.writeUTF(stream, name);
|
||||||
readConfiguration.writeData(stream);
|
readConfiguration.writeData(stream);
|
||||||
|
stream.writeBoolean(reader != null);
|
||||||
stream.writeShort(subLasers.size());
|
stream.writeShort(subLasers.size());
|
||||||
for (LaserData ld: subLasers) {
|
for (LaserData ld: subLasers) {
|
||||||
ld.writeData(stream);
|
ld.writeData(stream);
|
||||||
|
@ -219,6 +223,12 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
box.readData(stream);
|
box.readData(stream);
|
||||||
name = NetworkUtils.readUTF(stream);
|
name = NetworkUtils.readUTF(stream);
|
||||||
readConfiguration.readData(stream);
|
readConfiguration.readData(stream);
|
||||||
|
boolean newIsProcessing = stream.readBoolean();
|
||||||
|
if (newIsProcessing != isProcessing) {
|
||||||
|
isProcessing = newIsProcessing;
|
||||||
|
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
int size = stream.readUnsignedShort();
|
int size = stream.readUnsignedShort();
|
||||||
subLasers.clear();
|
subLasers.clear();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
@ -239,6 +249,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
}
|
}
|
||||||
|
|
||||||
reader = new RecursiveBlueprintReader(this);
|
reader = new RecursiveBlueprintReader(this);
|
||||||
|
sendNetworkUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getComputingProgressScaled(int scale) {
|
public int getComputingProgressScaled(int scale) {
|
||||||
|
@ -336,4 +347,14 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
|
|
||||||
subLasers.add(laser);
|
subLasers.add(laser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIconGlowLevel(int renderPass) {
|
||||||
|
if (renderPass == 1) { // Red LED
|
||||||
|
return isProcessing ? 15 : 0;
|
||||||
|
} else if (renderPass == 2) { // Green LED
|
||||||
|
return box != null && box.isInitialized() ? 15 : 0;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -304,6 +304,7 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
|
||||||
box.writeData(data);
|
box.writeData(data);
|
||||||
data.writeBoolean(done);
|
data.writeBoolean(done);
|
||||||
NetworkUtils.writeUTF(data, currentPattern.getUniqueTag());
|
NetworkUtils.writeUTF(data, currentPattern.getUniqueTag());
|
||||||
|
|
||||||
NBTTagCompound parameterData = new NBTTagCompound();
|
NBTTagCompound parameterData = new NBTTagCompound();
|
||||||
writeParametersToNBT(parameterData);
|
writeParametersToNBT(parameterData);
|
||||||
NetworkUtils.writeNBT(data, parameterData);
|
NetworkUtils.writeNBT(data, parameterData);
|
||||||
|
@ -400,4 +401,14 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIconGlowLevel(int renderPass) {
|
||||||
|
if (renderPass == 1) { // Red LED
|
||||||
|
return done ? 15 : 0;
|
||||||
|
} else if (renderPass == 2) { // Green LED
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
63
common/buildcraft/core/BlockBuildCraftLED.java
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
package buildcraft.core;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import buildcraft.BuildCraftCore;
|
||||||
|
import buildcraft.api.transport.IPipeTile;
|
||||||
|
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||||
|
import buildcraft.core.lib.utils.ResourceUtils;
|
||||||
|
import buildcraft.core.lib.utils.Utils;
|
||||||
|
|
||||||
|
public abstract class BlockBuildCraftLED extends BlockBuildCraft {
|
||||||
|
private IIcon[] led;
|
||||||
|
|
||||||
|
protected BlockBuildCraftLED(Material material) {
|
||||||
|
super(material);
|
||||||
|
setPassCount(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
|
super.registerBlockIcons(register);
|
||||||
|
String base = ResourceUtils.getObjectPrefix(Block.blockRegistry.getNameForObject(this));
|
||||||
|
led = new IIcon[] {
|
||||||
|
register.registerIcon(base + "/led_red"),
|
||||||
|
register.registerIcon(base + "/led_green")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconAbsolute(IBlockAccess access, int x, int y, int z, int side, int meta) {
|
||||||
|
if (renderPass == 0) {
|
||||||
|
return super.getIconAbsolute(access, x, y, z, side, meta);
|
||||||
|
} else {
|
||||||
|
if (isRotatable()) {
|
||||||
|
return side == 2 ? led[renderPass - 1] : null;
|
||||||
|
} else {
|
||||||
|
return side >= 2 ? led[renderPass - 1] : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconAbsolute(int side, int meta) {
|
||||||
|
if (renderPass == 0) {
|
||||||
|
return super.getIconAbsolute(side, meta);
|
||||||
|
} else {
|
||||||
|
if (isRotatable()) {
|
||||||
|
return side == 2 ? led[renderPass - 1] : null;
|
||||||
|
} else {
|
||||||
|
return side >= 2 ? led[renderPass - 1] : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
import buildcraft.api.blueprints.SchematicMask;
|
import buildcraft.api.blueprints.SchematicMask;
|
||||||
import buildcraft.api.filler.IFillerPattern;
|
import buildcraft.api.filler.IFillerPattern;
|
||||||
import buildcraft.api.statements.IStatement;
|
import buildcraft.api.statements.IStatement;
|
||||||
|
@ -32,7 +33,7 @@ public abstract class FillerPattern implements IFillerPattern {
|
||||||
|
|
||||||
public static final Map<String, FillerPattern> patterns = new TreeMap<String, FillerPattern>();
|
public static final Map<String, FillerPattern> patterns = new TreeMap<String, FillerPattern>();
|
||||||
private final String tag;
|
private final String tag;
|
||||||
private IIcon icon;
|
private IIcon icon, blockIcon;
|
||||||
|
|
||||||
public FillerPattern(String tag) {
|
public FillerPattern(String tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
|
@ -62,6 +63,9 @@ public abstract class FillerPattern implements IFillerPattern {
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
icon = iconRegister.registerIcon("buildcraftcore:fillerPatterns/" + tag);
|
icon = iconRegister.registerIcon("buildcraftcore:fillerPatterns/" + tag);
|
||||||
|
if (Loader.isModLoaded("BuildCraft|Builders")) {
|
||||||
|
blockIcon = iconRegister.registerIcon("buildcraftbuilders:fillerBlockIcons/" + tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,6 +73,11 @@ public abstract class FillerPattern implements IFillerPattern {
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getBlockOverlay() {
|
||||||
|
return blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int maxParameters() {
|
public int maxParameters() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|