project essence, part 1

This commit is contained in:
asiekierka 2015-03-11 22:07:02 +01:00
parent c5408d95d6
commit e3f28b5826
119 changed files with 745 additions and 163 deletions

View file

@ -8,7 +8,9 @@
*/
package buildcraft.api.filler;
import net.minecraft.util.IIcon;
import buildcraft.api.statements.IStatement;
public interface IFillerPattern extends IStatement {
IIcon getBlockOverlay();
}

View file

@ -6,7 +6,7 @@
* Please check the contents of the license, which should be located
* 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;
import cpw.mods.fml.common.API;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 824 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -172,6 +172,7 @@ public class BuildCraftCore extends BuildCraftMod {
@SideOnly(Side.CLIENT)
public static IIconProvider iconProvider;
public static int blockByEntityModel;
public static int multipassModel;
public static int legacyPipeModel;
public static int markerModel;
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.blueLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockBlueLaser");
BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockStripesLaser");
BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:laserBox/blockTransparentLaser");
BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:misc/transparent");
}
}

View file

@ -8,23 +8,32 @@
*/
package buildcraft.builders;
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.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftBuilders;
import buildcraft.BuildCraftCore;
import buildcraft.core.BlockBuildCraftLED;
import buildcraft.core.lib.block.BlockBuildCraft;
import buildcraft.core.BCCreativeTab;
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() {
super(Material.iron, BCCreativeTab.get("main"));
super(Material.iron);
setRotatable(true);
}
@ -63,6 +72,16 @@ public class BlockArchitect extends BlockBuildCraft {
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
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return 1;

View file

@ -26,19 +26,21 @@ import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.events.BlockInteractionEvent;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.BlockBuildCraftLED;
import buildcraft.core.lib.block.BlockBuildCraft;
import buildcraft.core.BCCreativeTab;
import buildcraft.core.GuiIds;
import buildcraft.core.lib.utils.Utils;
import buildcraft.factory.TileMiningWell;
public class BlockFiller extends BlockBuildCraft {
private IIcon textureTopOff;
public class BlockFiller extends BlockBuildCraftLED {
public BlockFiller() {
super(Material.iron);
setHardness(5F);
setCreativeTab(BCCreativeTab.get("main"));
setRotatable(true);
setPassCount(4);
}
@Override
@ -59,23 +61,13 @@ public class BlockFiller extends BlockBuildCraft {
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconAbsolute(IBlockAccess world, int x, int y, int z, int side, int metadata) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileFiller) {
TileFiller filler = (TileFiller) tile;
if (side != 1) {
if (filler.currentPattern != null) {
return filler.currentPattern.getIcon();
}
} else {
if (!filler.hasWork()) {
return textureTopOff;
}
}
public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) {
if (renderPass == 0 || renderPass == 3) {
return -1;
} else {
TileFiller tile = (TileFiller) access.getTileEntity(x, y, z);
return tile.getIconGlowLevel(renderPass);
}
return super.getIconAbsolute(side, metadata);
}
@Override
@ -83,13 +75,6 @@ public class BlockFiller extends BlockBuildCraft {
return new TileFiller();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
super.registerBlockIcons(register);
textureTopOff = register.registerIcon("buildcraftbuilders:fillerBlock/top_off");
}
@Override
public boolean renderAsNormalBlock() {
return false;
@ -104,4 +89,28 @@ public class BlockFiller extends BlockBuildCraft {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
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;
}
}
}

View file

@ -59,6 +59,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
private SimpleInventory inv = new SimpleInventory(2, "Architect", 1);
private RecursiveBlueprintReader reader;
private boolean isProcessing;
public TileArchitect() {
box.kind = Kind.BLUE_STRIPES;
@ -74,6 +75,8 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
if (reader.isDone()) {
reader = null;
isProcessing = false;
sendNetworkUpdate();
}
}
}
@ -208,6 +211,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
box.writeData(stream);
NetworkUtils.writeUTF(stream, name);
readConfiguration.writeData(stream);
stream.writeBoolean(reader != null);
stream.writeShort(subLasers.size());
for (LaserData ld: subLasers) {
ld.writeData(stream);
@ -219,6 +223,12 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
box.readData(stream);
name = NetworkUtils.readUTF(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();
subLasers.clear();
for (int i = 0; i < size; i++) {
@ -239,6 +249,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
}
reader = new RecursiveBlueprintReader(this);
sendNetworkUpdate();
}
public int getComputingProgressScaled(int scale) {
@ -336,4 +347,14 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
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;
}
}
}

View file

@ -304,6 +304,7 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
box.writeData(data);
data.writeBoolean(done);
NetworkUtils.writeUTF(data, currentPattern.getUniqueTag());
NBTTagCompound parameterData = new NBTTagCompound();
writeParametersToNBT(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;
}
}
}

View 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;
}
}

View file

@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import buildcraft.api.blueprints.SchematicMask;
import buildcraft.api.filler.IFillerPattern;
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>();
private final String tag;
private IIcon icon;
private IIcon icon, blockIcon;
public FillerPattern(String tag) {
this.tag = tag;
@ -62,6 +63,9 @@ public abstract class FillerPattern implements IFillerPattern {
@Override
public void registerIcons(IIconRegister iconRegister) {
icon = iconRegister.registerIcon("buildcraftcore:fillerPatterns/" + tag);
if (Loader.isModLoaded("BuildCraft|Builders")) {
blockIcon = iconRegister.registerIcon("buildcraftbuilders:fillerBlockIcons/" + tag);
}
}
@Override
@ -69,6 +73,11 @@ public abstract class FillerPattern implements IFillerPattern {
return icon;
}
@Override
public IIcon getBlockOverlay() {
return blockIcon;
}
@Override
public int maxParameters() {
return 0;

Some files were not shown because too many files have changed in this diff Show more