Merge branch 'BuildCraft-5.0.x' into BuildCraft-5.1.x

This commit is contained in:
SpaceToad 2014-04-26 13:12:48 +02:00
commit 3fc344c9b9
11 changed files with 83 additions and 59 deletions

View file

@ -14,7 +14,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
@ -26,7 +26,7 @@ group= "com.mod-buildcraft"
archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension]
minecraft {
version = "1.7.2-10.12.0.1047" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually.
version = "1.7.2-10.12.1.1060" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually.
assetDir = "run/assets" // the place for ForgeGradle to download the assets. The assets that the launcher gets and stuff

View file

@ -26,6 +26,7 @@ fillerpattern.horizon=Horizon
fillerpattern.pyramid=Pyramid
fillerpattern.stairs=Stairs
fillerpattern.box=Box
fillerpattern.cylinder=Cylinder
fluid.oil=Oil
fluid.fuel=Fuel
@ -251,4 +252,4 @@ achievement.timeForSomeLogicAchievement.desc=Craft an assembly table
achievement.refineAndRedefineAchievement=Refine and redefine
achievement.refineAndRedefineAchievement.desc=Make a refinery
achievement.tinglyLaserAchievement=Tingly laser
achievement.tinglyLaserAchievement.desc=Craft a laser
achievement.tinglyLaserAchievement.desc=Craft a laser

View file

@ -165,8 +165,8 @@ public class BuildCraftSilicon extends BuildCraftMod {
BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack());
addGateRecipe(20000, GateMaterial.IRON, Chipset.IRON, PipeWire.RED, PipeWire.BLUE);
addGateRecipe(40000, GateMaterial.GOLD, Chipset.GOLD, PipeWire.RED, PipeWire.BLUE, PipeWire.YELLOW);
addGateRecipe(80000, GateMaterial.DIAMOND, Chipset.DIAMOND, PipeWire.RED, PipeWire.BLUE, PipeWire.YELLOW, PipeWire.GREEN);
addGateRecipe(40000, GateMaterial.GOLD, Chipset.GOLD, PipeWire.RED, PipeWire.BLUE, PipeWire.GREEN);
addGateRecipe(80000, GateMaterial.DIAMOND, Chipset.DIAMOND, PipeWire.RED, PipeWire.BLUE, PipeWire.GREEN, PipeWire.YELLOW);
// REVERSAL RECIPES
EnumSet<GateMaterial> materials = EnumSet.allOf(GateMaterial.class);

View file

@ -43,12 +43,15 @@ public class BlockBlueprintLibrary extends BlockContainer {
if (entityplayer.isSneaking())
return false;
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k);
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileBlueprintLibrary) {
TileBlueprintLibrary tileBlueprint = (TileBlueprintLibrary)tile;
if (!tileBlueprint.locked || entityplayer.getDisplayName().equals(tileBlueprint.owner))
if (!world.isRemote) {
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k);
}
}
if (!tile.locked || entityplayer.getDisplayName().equals(tile.owner))
if (!world.isRemote) {
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k);
}
return true;
}
@ -72,8 +75,9 @@ public class BlockBlueprintLibrary extends BlockContainer {
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
if (!world.isRemote && entityliving instanceof EntityPlayer) {
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k);
tile.owner = ((EntityPlayer) entityliving).getDisplayName();
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileBlueprintLibrary)
((TileBlueprintLibrary)tile).owner = ((EntityPlayer) entityliving).getDisplayName();
}
}

View file

@ -90,7 +90,9 @@ public class BlockMarker extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
((TileMarker) world.getTileEntity(i, j, k)).tryConnection();
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileMarker)
((TileMarker) tile).tryConnection();
return true;
}
@ -117,7 +119,9 @@ public class BlockMarker extends BlockContainer {
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
((TileMarker) world.getTileEntity(x, y, z)).updateSignals();
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileMarker)
((TileMarker) tile).updateSignals();
dropTorchIfCantStay(world, x, y, z);
}

View file

@ -95,7 +95,7 @@ public class BlockEngine extends BlockBuildCraft {
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int side, float par7, float par8, float par9) {
TileEngine tile = (TileEngine) world.getTileEntity(i, j, k);
TileEntity tile = world.getTileEntity(i, j, k);
// Drop through if the player is sneaking
if (player.isSneaking())
@ -117,10 +117,13 @@ public class BlockEngine extends BlockBuildCraft {
@Override
public void onPostBlockPlaced(World world, int x, int y, int z, int par5) {
TileEngine tile = (TileEngine) world.getTileEntity(x, y, z);
tile.orientation = ForgeDirection.UP;
if (!tile.isOrientationValid())
tile.switchOrientation(true);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEngine) {
TileEngine engine = (TileEngine)tile;
engine.orientation = ForgeDirection.UP;
if (!engine.isOrientationValid())
engine.switchOrientation(true);
}
}
@Override
@ -131,9 +134,9 @@ public class BlockEngine extends BlockBuildCraft {
@SuppressWarnings({"all"})
@Override
public void randomDisplayTick(World world, int i, int j, int k, Random random) {
TileEngine tile = (TileEngine) world.getTileEntity(i, j, k);
TileEntity tile = world.getTileEntity(i, j, k);
if (!tile.isBurning())
if (tile instanceof TileEngine && !((TileEngine) tile).isBurning())
return;
float f = (float) i + 0.5F;
@ -158,10 +161,10 @@ public class BlockEngine extends BlockBuildCraft {
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
TileEngine tile = (TileEngine) world.getTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null) {
tile.checkRedstonePower();
if (tile instanceof TileEngine) {
((TileEngine) tile).checkRedstonePower();
}
}

View file

@ -19,6 +19,7 @@ import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockStaticLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
@ -260,7 +261,7 @@ public class OilPopulate {
private boolean isReplaceableFluid(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
return (block instanceof BlockFluidBase || block instanceof IFluidBlock) && block.getMaterial() != Material.lava;
return (block instanceof BlockStaticLiquid || block instanceof BlockFluidBase || block instanceof IFluidBlock) && block.getMaterial() != Material.lava;
}
private boolean isOil(World world, int x, int y, int z) {
@ -357,6 +358,10 @@ public class OilPopulate {
continue;
}
if (block instanceof BlockStaticLiquid) {
return y;
}
if (block instanceof BlockFluidBase) {
return y;
}

View file

@ -57,8 +57,9 @@ public class BlockQuarry extends BlockBuildCraft {
world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(), 1);
if (entityliving instanceof EntityPlayer) {
TileQuarry tq = (TileQuarry) world.getTileEntity(i, j, k);
tq.placedBy = (EntityPlayer) entityliving;
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileQuarry)
((TileQuarry) tile).placedBy = (EntityPlayer) entityliving;
}
}

View file

@ -92,44 +92,47 @@ public class BlockTank extends BlockContainer {
if (current != null) {
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
TileTank tank = (TileTank) world.getTileEntity(i, j, k);
TileEntity tile = world.getTileEntity(i, j, k);
if(tile instanceof TileTank)
{
TileTank tank = (TileTank)tile;
// Handle filled containers
if (liquid != null) {
int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
// Handle filled containers
if (liquid != null) {
int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
if (qty != 0 && !BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current));
}
if (qty != 0 && !BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current));
}
return true;
return true;
// Handle empty containers
} else {
FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
// Handle empty containers
} else {
FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid;
if (available != null) {
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current);
if (available != null) {
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current);
liquid = FluidContainerRegistry.getFluidForFilledItem(filled);
liquid = FluidContainerRegistry.getFluidForFilledItem(filled);
if (liquid != null) {
if (!BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) {
if (current.stackSize > 1) {
if (!entityplayer.inventory.addItemStackToInventory(filled))
return false;
else {
if (liquid != null) {
if (!BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) {
if (current.stackSize > 1) {
if (!entityplayer.inventory.addItemStackToInventory(filled))
return false;
else {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current));
}
} else {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current));
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, filled);
}
} else {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current));
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, filled);
}
tank.drain(ForgeDirection.UNKNOWN, liquid.amount, true);
return true;
}
tank.drain(ForgeDirection.UNKNOWN, liquid.amount, true);
return true;
}
}
}

View file

@ -1020,9 +1020,12 @@ public class BlockGenericPipe extends BlockBuildCraft {
boolean placed = world.setBlock(i, j, k, block, meta, 3);
if (placed) {
TileGenericPipe tile = (TileGenericPipe) world.getTileEntity(i, j, k);
tile.initialize(pipe);
tile.sendUpdateToClient();
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof TileGenericPipe) {
TileGenericPipe tilePipe = (TileGenericPipe) tile;
tilePipe.initialize(pipe);
tilePipe.sendUpdateToClient();
}
}
return placed;

View file

@ -337,7 +337,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
private void moveFluids() {
short newTimeSlot = (short) (container.getWorldObj().getTotalWorldTime() % travelDelay);
short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot);
short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot > 0 && newTimeSlot < travelDelay ? newTimeSlot : 0);
moveFromPipe(outputCount);
moveFromCenter(outputCount);
moveToCenter();