the commit i missed + safer DFCs
@ -133,10 +133,12 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc
|
|||||||
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
|
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
|
||||||
|
|
||||||
TileEntityFoundryCastingBase cast = (TileEntityFoundryCastingBase) world.getTileEntity(x, y, z);
|
TileEntityFoundryCastingBase cast = (TileEntityFoundryCastingBase) world.getTileEntity(x, y, z);
|
||||||
ItemStack scrap = ItemScraps.create(new MaterialStack(cast.type, cast.amount));
|
if(cast.amount > 0) {
|
||||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
ItemStack scrap = ItemScraps.create(new MaterialStack(cast.type, cast.amount));
|
||||||
world.spawnEntityInWorld(item);
|
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
||||||
cast.amount = 0; //just for safety
|
world.spawnEntityInWorld(item);
|
||||||
|
cast.amount = 0; //just for safety
|
||||||
|
}
|
||||||
|
|
||||||
for(ItemStack stack : cast.slots) {
|
for(ItemStack stack : cast.slots) {
|
||||||
if(stack != null) {
|
if(stack != null) {
|
||||||
|
|||||||
@ -68,6 +68,8 @@ public class ItemScraps extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack create(MaterialStack stack) {
|
public static ItemStack create(MaterialStack stack) {
|
||||||
|
if(stack.material == null)
|
||||||
|
return new ItemStack(ModItems.nothing); //why do i bother adding checks for fucking everything when they don't work
|
||||||
ItemStack scrap = new ItemStack(ModItems.scraps, 1, stack.material.id);
|
ItemStack scrap = new ItemStack(ModItems.scraps, 1, stack.material.id);
|
||||||
scrap.stackTagCompound = new NBTTagCompound();
|
scrap.stackTagCompound = new NBTTagCompound();
|
||||||
scrap.stackTagCompound.setInteger("amount", stack.amount);
|
scrap.stackTagCompound.setInteger("amount", stack.amount);
|
||||||
|
|||||||
@ -59,6 +59,9 @@ public class RenderFoundryBasin implements ISimpleBlockRenderingHandler {
|
|||||||
float mulZ = 0.8F;
|
float mulZ = 0.8F;
|
||||||
float mulX = 0.6F;
|
float mulX = 0.6F;
|
||||||
|
|
||||||
|
int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
|
||||||
|
tessellator.setBrightness(brightness);
|
||||||
|
|
||||||
if(EntityRenderer.anaglyphEnable) {
|
if(EntityRenderer.anaglyphEnable) {
|
||||||
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
||||||
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
||||||
|
|||||||
@ -59,6 +59,9 @@ public class RenderFoundryMold implements ISimpleBlockRenderingHandler {
|
|||||||
float mulZ = 0.8F;
|
float mulZ = 0.8F;
|
||||||
float mulX = 0.6F;
|
float mulX = 0.6F;
|
||||||
|
|
||||||
|
int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
|
||||||
|
tessellator.setBrightness(brightness);
|
||||||
|
|
||||||
if(EntityRenderer.anaglyphEnable) {
|
if(EntityRenderer.anaglyphEnable) {
|
||||||
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
||||||
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
public int heat;
|
public int heat;
|
||||||
public int color;
|
public int color;
|
||||||
public FluidTank[] tanks;
|
public FluidTank[] tanks;
|
||||||
|
private boolean lastTickValid = false;
|
||||||
|
|
||||||
public TileEntityCore() {
|
public TileEntityCore() {
|
||||||
super(3);
|
super(3);
|
||||||
@ -45,7 +46,15 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
if(heat > 0 && heat >= field) {
|
int chunkX = xCoord << 4;
|
||||||
|
int chunkZ = zCoord << 4;
|
||||||
|
|
||||||
|
lastTickValid = worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ + 1) &&
|
||||||
|
worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ - 1) &&
|
||||||
|
worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ + 1) &&
|
||||||
|
worldObj.getChunkProvider().chunkExists(chunkX - 1, chunkZ - 1);
|
||||||
|
|
||||||
|
if(lastTickValid && heat > 0 && heat >= field) {
|
||||||
|
|
||||||
int fill = tanks[0].getFill() + tanks[1].getFill();
|
int fill = tanks[0].getFill() + tanks[1].getFill();
|
||||||
int max = tanks[0].getMaxFill() + tanks[1].getMaxFill();
|
int max = tanks[0].getMaxFill() + tanks[1].getMaxFill();
|
||||||
@ -87,7 +96,11 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
networkPack(data, 250);
|
networkPack(data, 250);
|
||||||
|
|
||||||
heat = 0;
|
heat = 0;
|
||||||
field = 0;
|
|
||||||
|
if(lastTickValid && field > 0) {
|
||||||
|
field -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -139,6 +152,9 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
|
|
||||||
public boolean isReady() {
|
public boolean isReady() {
|
||||||
|
|
||||||
|
if(!lastTickValid)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(getCore() == 0)
|
if(getCore() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -241,6 +257,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
|
|
||||||
tanks[0].readFromNBT(nbt, "fuel1");
|
tanks[0].readFromNBT(nbt, "fuel1");
|
||||||
tanks[1].readFromNBT(nbt, "fuel2");
|
tanks[1].readFromNBT(nbt, "fuel2");
|
||||||
|
this.field = nbt.getInteger("field");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -249,6 +266,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
|||||||
|
|
||||||
tanks[0].writeToNBT(nbt, "fuel1");
|
tanks[0].writeToNBT(nbt, "fuel1");
|
||||||
tanks[1].writeToNBT(nbt, "fuel2");
|
tanks[1].writeToNBT(nbt, "fuel2");
|
||||||
|
nbt.setInteger("field", this.field);
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB bb = null;
|
AxisAlignedBB bb = null;
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
|||||||
if(te instanceof TileEntityCore) {
|
if(te instanceof TileEntityCore) {
|
||||||
|
|
||||||
TileEntityCore core = (TileEntityCore)te;
|
TileEntityCore core = (TileEntityCore)te;
|
||||||
core.field = watts;
|
core.field = Math.max(core.field, watts);
|
||||||
this.power -= demand;
|
this.power -= demand;
|
||||||
beam = i;
|
beam = i;
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 360 B |
|
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 763 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 265 B |