made progress with 1.7.2 port

This commit is contained in:
SpaceToad 2014-02-08 14:47:31 +01:00
parent 87562542c9
commit 2bc0a85bbe
183 changed files with 1126 additions and 1325 deletions

View file

@ -86,6 +86,8 @@ import java.util.LinkedList;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -129,6 +131,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
// Register save handler
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
/*
new BptBlock(0); // default bpt block
new BptBlockIgnore(Block.snow.blockID);
@ -214,7 +217,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
new BptBlockInventory(libraryBlock.blockID);
new BptBlockWallSide(markerBlock.blockID);
new BptBlockWallSide(pathMarkerBlock.blockID);
new BptBlockWallSide(pathMarkerBlock.blockID);*/
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@ -224,15 +227,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
Property templateItemId = BuildCraftCore.mainConfiguration.getItem("templateItem.id", DefaultProps.TEMPLATE_ITEM_ID);
Property blueprintItemId = BuildCraftCore.mainConfiguration.getItem("blueprintItem.id", DefaultProps.BLUEPRINT_ITEM_ID);
Property markerId = BuildCraftCore.mainConfiguration.getBlock("marker.id", DefaultProps.MARKER_ID);
Property pathMarkerId = BuildCraftCore.mainConfiguration.getBlock("pathMarker.id", DefaultProps.PATH_MARKER_ID);
Property fillerId = BuildCraftCore.mainConfiguration.getBlock("filler.id", DefaultProps.FILLER_ID);
Property builderId = BuildCraftCore.mainConfiguration.getBlock("builder.id", DefaultProps.BUILDER_ID);
Property architectId = BuildCraftCore.mainConfiguration.getBlock("architect.id", DefaultProps.ARCHITECT_ID);
Property libraryId = BuildCraftCore.mainConfiguration.getBlock("blueprintLibrary.id", DefaultProps.BLUEPRINT_LIBRARY_ID);
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "filler.destroy", DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
@ -245,38 +239,38 @@ public class BuildCraftBuilders extends BuildCraftMod {
fillerLifespanNormalProp.comment = "Lifespan in ticks of items dropped by the filler from non-tough blocks (those that can be broken by hand)";
fillerLifespanNormal = fillerLifespanNormalProp.getInt(DefaultProps.FILLER_LIFESPAN_NORMAL);
templateItem = new ItemBptTemplate(templateItemId.getInt());
templateItem.setUnlocalizedName("templateItem");
templateItem = new ItemBptTemplate();
templateItem.setBlockName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
CoreProxy.proxy.registerItem(templateItem);
blueprintItem = new ItemBptBluePrint(blueprintItemId.getInt());
blueprintItem.setUnlocalizedName("blueprintItem");
blueprintItem = new ItemBptBluePrint();
blueprintItem.setBlockName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
CoreProxy.proxy.registerItem(blueprintItem);
markerBlock = new BlockMarker(markerId.getInt());
CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock"));
markerBlock = new BlockMarker();
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
CoreProxy.proxy.addName(markerBlock, "Land Mark");
pathMarkerBlock = new BlockPathMarker(pathMarkerId.getInt());
CoreProxy.proxy.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"));
pathMarkerBlock = new BlockPathMarker();
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
fillerBlock = new BlockFiller(fillerId.getInt());
CoreProxy.proxy.registerBlock(fillerBlock.setUnlocalizedName("fillerBlock"));
fillerBlock = new BlockFiller();
CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
CoreProxy.proxy.addName(fillerBlock, "Filler");
builderBlock = new BlockBuilder(builderId.getInt());
CoreProxy.proxy.registerBlock(builderBlock.setUnlocalizedName("builderBlock"));
builderBlock = new BlockBuilder();
CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
CoreProxy.proxy.addName(builderBlock, "Builder");
architectBlock = new BlockArchitect(architectId.getInt());
CoreProxy.proxy.registerBlock(architectBlock.setUnlocalizedName("architectBlock"));
architectBlock = new BlockArchitect();
CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
CoreProxy.proxy.addName(architectBlock, "Architect Table");
libraryBlock = new BlockBlueprintLibrary(libraryId.getInt());
CoreProxy.proxy.registerBlock(libraryBlock.setUnlocalizedName("libraryBlock"));
libraryBlock = new BlockBlueprintLibrary();
CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
GameRegistry.registerTileEntity(TileMarker.class, "Marker");
@ -322,14 +316,14 @@ public class BuildCraftBuilders extends BuildCraftMod {
// new ItemStack(Item.dyePowder, 1, 4), 'p', Item.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", 'l',
new ItemStack(Item.dyePowder, 1, 4), 'r', Block.torchRedstoneActive});
new ItemStack(Items.dye, 1, 4), 'r', Blocks.redstone_torch});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", 'l',
// new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
'c', Block.workbench, 'g', BuildCraftCore.goldGearItem, 'C', Block.chest});
new ItemStack(Items.dye, 1, 0), 't', markerBlock, 'y', new ItemStack(Items.dye, 1, 11),
'c', Blocks.crafting_table, 'g', BuildCraftCore.goldGearItem, 'C', Blocks.chest});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
// new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
@ -383,7 +377,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
return rootBptIndex;
}
public static ItemStack getBptItemStack(int id, int damage, String name) {
/*public static ItemStack getBptItemStack(int id, int damage, String name) {
ItemStack stack = new ItemStack(id, 1, damage);
NBTTagCompound nbt = new NBTTagCompound();
if (name != null && !"".equals(name)) {
@ -391,7 +385,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
stack.setTagCompound(nbt);
}
return stack;
}
}*/
public static void addHook(IBuilderHook hook) {
if (!hooks.contains(hook)) {

View file

@ -18,6 +18,8 @@ import net.minecraft.block.BlockFluid;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
@ -156,7 +158,7 @@ public class BuildCraftCore extends BuildCraftMod {
public static boolean loadDefaultRecipes = true;
public static boolean forcePneumaticPower = true;
public static boolean consumeWaterSources = false;
public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
//public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
@Instance("BuildCraft|Core")
public static BuildCraftCore instance;
@ -206,26 +208,17 @@ public class BuildCraftCore extends BuildCraftMod {
longFactor.comment = "delay between full client sync packets, increasing it saves bandwidth, decreasing makes for better client syncronization.";
longUpdateFactor = longFactor.getInt(40);
Property wrenchId = BuildCraftCore.mainConfiguration.getItem("wrench.id", DefaultProps.WRENCH_ID);
wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setUnlocalizedName("wrenchItem");
wrenchItem = (new ItemWrench()).setBlockName("wrenchItem");
LanguageRegistry.addName(wrenchItem, "Wrench");
CoreProxy.proxy.registerItem(wrenchItem);
int springId = BuildCraftCore.mainConfiguration.getBlock("springBlock.id", DefaultProps.SPRING_ID).getInt(DefaultProps.SPRING_ID);
Property woodenGearId = BuildCraftCore.mainConfiguration.getItem("woodenGearItem.id", DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration.getItem("stoneGearItem.id", DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration.getItem("ironGearItem.id", DefaultProps.IRON_GEAR_ID);
Property goldenGearId = BuildCraftCore.mainConfiguration.getItem("goldenGearItem.id", DefaultProps.GOLDEN_GEAR_ID);
Property diamondGearId = BuildCraftCore.mainConfiguration.getItem("diamondGearItem.id", DefaultProps.DIAMOND_GEAR_ID);
Property modifyWorldProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "modifyWorld", true);
modifyWorldProp.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
modifyWorld = modifyWorldProp.getBoolean(true);
if (BuildCraftCore.modifyWorld && springId > 0) {
if (BuildCraftCore.modifyWorld) {
BlockSpring.EnumSpring.WATER.canGen = BuildCraftCore.mainConfiguration.get("worldgen", "waterSpring", true).getBoolean(true);
springBlock = new BlockSpring(springId).setUnlocalizedName("eternalSpring");
springBlock = new BlockSpring().setBlockName("eternalSpring");
CoreProxy.proxy.registerBlock(springBlock, ItemSpring.class);
}
@ -233,27 +226,27 @@ public class BuildCraftCore extends BuildCraftMod {
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
consumeWater.comment = "set to true if the Pump should consume water";
woodenGearItem = (new ItemBuildCraft(woodenGearId.getInt())).setUnlocalizedName("woodenGearItem");
woodenGearItem = (new ItemBuildCraft()).setBlockName("woodenGearItem");
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
CoreProxy.proxy.registerItem(woodenGearItem);
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
stoneGearItem = (new ItemBuildCraft(stoneGearId.getInt())).setUnlocalizedName("stoneGearItem");
stoneGearItem = (new ItemBuildCraft()).setBlockName("stoneGearItem");
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
CoreProxy.proxy.registerItem(stoneGearItem);
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
ironGearItem = (new ItemBuildCraft(ironGearId.getInt())).setUnlocalizedName("ironGearItem");
ironGearItem = (new ItemBuildCraft()).setBlockName("ironGearItem");
LanguageRegistry.addName(ironGearItem, "Iron Gear");
CoreProxy.proxy.registerItem(ironGearItem);
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
goldGearItem = (new ItemBuildCraft(goldenGearId.getInt())).setUnlocalizedName("goldGearItem");
goldGearItem = (new ItemBuildCraft()).setBlockName("goldGearItem");
LanguageRegistry.addName(goldGearItem, "Gold Gear");
CoreProxy.proxy.registerItem(goldGearItem);
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
diamondGearItem = (new ItemBuildCraft(diamondGearId.getInt())).setUnlocalizedName("diamondGearItem");
diamondGearItem = (new ItemBuildCraft()).setBlockName("diamondGearItem");
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
CoreProxy.proxy.registerItem(diamondGearItem);
OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
@ -311,7 +304,7 @@ public class BuildCraftCore extends BuildCraftMod {
}
}
BuildCraftAPI.softBlocks[Block.snow.blockID] = true;
BuildCraftAPI.softBlocks[Blocks.snow.blockID] = true;
BuildCraftAPI.softBlocks[Block.vine.blockID] = true;
BuildCraftAPI.softBlocks[Block.fire.blockID] = true;
TickRegistry.registerTickHandler(new TickHandlerCoreClient(), Side.CLIENT);
@ -340,13 +333,13 @@ public class BuildCraftCore extends BuildCraftMod {
}
public void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Items.iron_ingot, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", 'S', "stickWood");
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", 'I', "cobblestone", 'G',
woodenGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", 'I', Item.ingotGold, 'G', ironGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Item.diamond, 'G', goldGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Items.iron_ingot, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", 'I', Items.gold_ingot, 'G', ironGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Items.diamond, 'G', goldGearItem);
}
@EventHandler

View file

@ -40,14 +40,17 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
@ -91,19 +94,13 @@ public class BuildCraftEnergy extends BuildCraftMod {
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
Property engineId = BuildCraftCore.mainConfiguration.getBlock("engine.id", DefaultProps.ENGINE_ID);
// Update oil tag
int defaultOilId = DefaultProps.OIL_ID;
if (BuildCraftCore.mainConfiguration.hasKey(Configuration.CATEGORY_BLOCK, "oilStill.id")) {
defaultOilId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "oilStill.id", defaultOilId).getInt(defaultOilId);
BuildCraftCore.mainConfiguration.getCategory(Configuration.CATEGORY_BLOCK).remove("oilStill.id");
}
int blockOilId = BuildCraftCore.mainConfiguration.getBlock("oil.id", defaultOilId).getInt(defaultOilId);
int blockFuelId = BuildCraftCore.mainConfiguration.getBlock("fuel.id", DefaultProps.FUEL_ID).getInt(DefaultProps.FUEL_ID);
int bucketOilId = BuildCraftCore.mainConfiguration.getItem("bucketOil.id", DefaultProps.BUCKET_OIL_ID).getInt(DefaultProps.BUCKET_OIL_ID);
int bucketFuelId = BuildCraftCore.mainConfiguration.getItem("bucketFuel.id", DefaultProps.BUCKET_FUEL_ID).getInt(DefaultProps.BUCKET_FUEL_ID);
int oilDesertBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilDesert", DefaultProps.BIOME_OIL_DESERT).getInt(DefaultProps.BIOME_OIL_DESERT);
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
@ -135,7 +132,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
}
engineBlock = new BlockEngine(engineId.getInt(DefaultProps.ENGINE_ID));
engineBlock = new BlockEngine();
CoreProxy.proxy.registerBlock(engineBlock, ItemEngine.class);
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
@ -153,16 +150,14 @@ public class BuildCraftEnergy extends BuildCraftMod {
FluidRegistry.registerFluid(buildcraftFluidFuel);
fluidFuel = FluidRegistry.getFluid("fuel");
if (fluidOil.getBlockID() == -1) {
if (blockOilId > 0) {
blockOil = new BlockBuildcraftFluid(blockOilId, fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
blockOil.setUnlocalizedName("blockOil");
CoreProxy.proxy.addName(blockOil, "Oil");
CoreProxy.proxy.registerBlock(blockOil);
fluidOil.setBlockID(blockOil);
}
if (fluidOil.getBlock() == null) {
blockOil = new BlockBuildcraftFluid(fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
blockOil.setBlockName("blockOil");
CoreProxy.proxy.addName(blockOil, "Oil");
CoreProxy.proxy.registerBlock(blockOil);
fluidOil.setBlock(blockOil);
} else {
blockOil = Block.blocksList[fluidOil.getBlockID()];
blockOil = fluidOil.getBlock();
}
if (blockOil != null) {
@ -171,34 +166,32 @@ public class BuildCraftEnergy extends BuildCraftMod {
BlockSpring.EnumSpring.OIL.liquidBlock = blockOil;
}
if (fluidFuel.getBlockID() == -1) {
if (blockFuelId > 0) {
blockFuel = new BlockBuildcraftFluid(blockFuelId, fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
blockFuel.setUnlocalizedName("blockFuel");
CoreProxy.proxy.addName(blockFuel, "Fuel");
CoreProxy.proxy.registerBlock(blockFuel);
fluidFuel.setBlockID(blockFuel);
}
if (fluidFuel.getBlock() == null) {
blockFuel = new BlockBuildcraftFluid(fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
blockFuel.setBlockName("blockFuel");
CoreProxy.proxy.addName(blockFuel, "Fuel");
CoreProxy.proxy.registerBlock(blockFuel);
fluidFuel.setBlock(blockFuel);
} else {
blockFuel = Block.blocksList[fluidFuel.getBlockID()];
blockFuel = fluidFuel.getBlock();
}
// Buckets
if (blockOil != null && bucketOilId > 0) {
bucketOil = new ItemBucketBuildcraft(bucketOilId, blockOil.blockID);
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty);
if (blockOil != null) {
bucketOil = new ItemBucketBuildcraft(blockOil);
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
LanguageRegistry.addName(bucketOil, "Oil Bucket");
CoreProxy.proxy.registerItem(bucketOil);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Item.bucketEmpty));
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Items.bucket));
}
if (blockFuel != null && bucketFuelId > 0) {
bucketFuel = new ItemBucketBuildcraft(bucketFuelId, blockFuel.blockID);
bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty);
if (blockFuel != null) {
bucketFuel = new ItemBucketBuildcraft(blockFuel);
bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Items.bucket);
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
CoreProxy.proxy.registerItem(bucketFuel);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Item.bucketEmpty));
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Items.bucket));
}
BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
@ -214,7 +207,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
// Iron Engine Coolants
IronEngineCoolant.addCoolant(FluidRegistry.getFluid("water"), 0.0023F);
IronEngineCoolant.addCoolant(Block.ice.blockID, 0, FluidRegistry.getFluidStack("water", FluidContainerRegistry.BUCKET_VOLUME * 2));
IronEngineCoolant.addCoolant(Blocks.ice, 0, FluidRegistry.getFluidStack("water", FluidContainerRegistry.BUCKET_VOLUME * 2));
MinecraftForge.EVENT_BUS.register(this);
}
@ -223,7 +216,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
public void init(FMLInitializationEvent evt) {
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
new BptBlockEngine(engineBlock.blockID);
//new BptBlockEngine(engineBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@ -251,116 +244,16 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Block.glass, 'G',
BuildCraftCore.woodenGearItem, 'p', Block.pistonBase});
new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Blocks.glass, 'G',
BuildCraftCore.woodenGearItem, 'p', Blocks.piston});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", 'w', "cobblestone",
'g', Block.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Block.pistonBase});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Item.ingotIron,
'g', Block.glass, 'G', BuildCraftCore.ironGearItem, 'p', Block.pistonBase});
'g', Blocks.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Blocks.piston});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Items.iron_ingot,
'g', Blocks.glass, 'G', BuildCraftCore.ironGearItem, 'p', Blocks.piston});
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
// public static int createPollution (World world, int i, int j, int k, int
// saturation) {
// int remainingSaturation = saturation;
//
// if (world.rand.nextFloat() > 0.7) {
// // Try to place an item on the sides
//
// LinkedList<BlockIndex> orientations = new LinkedList<BlockIndex>();
//
// for (int id = -1; id <= 1; id += 2) {
// for (int kd = -1; kd <= 1; kd += 2) {
// if (canPollute(world, i + id, j, k + kd)) {
// orientations.add(new BlockIndex(i + id, j, k + kd));
// }
// }
// }
//
// if (orientations.size() > 0) {
// BlockIndex toPollute =
// orientations.get(world.rand.nextInt(orientations.size()));
//
// int x = toPollute.i;
// int y = toPollute.j;
// int z = toPollute.k;
//
// if (world.getBlockId(x, y, z) == 0) {
// world.setBlock(x, y, z,
// BuildCraftEnergy.pollution.blockID,
// saturation * 16 / 100);
//
// saturationStored.put(new BlockIndex(x, y, z), new Integer(
// saturation));
// remainingSaturation = 0;
// } else if (world.getBlockTileEntity(z, y, z) instanceof TilePollution) {
// remainingSaturation = updateExitingPollution(world, x, y, z, saturation);
// }
// }
// }
//
// if (remainingSaturation > 0) {
// if (world.getBlockId(i, j + 1, k) == 0) {
// if (j + 1 < 128) {
// world.setBlock(i, j + 1, k,
// BuildCraftEnergy.pollution.blockID,
// saturation * 16 / 100);
// saturationStored.put(new BlockIndex(i, j + 1, k),
// new Integer(remainingSaturation));
// }
//
// remainingSaturation = 0;
// } else if (world.getBlockTileEntity(i, j + 1, k) instanceof
// TilePollution) {
// remainingSaturation = updateExitingPollution(world, i, j + 1,
// k, remainingSaturation);
// }
// }
//
// if (remainingSaturation == 0) {
// System.out.println ("EXIT 1");
// return 0;
// } else if (remainingSaturation == saturation) {
// System.out.println ("EXIT 2");
// return saturation;
// } else {
// System.out.println ("EXIT 3");
// return createPollution (world, i, j, k, remainingSaturation);
// }
// }
//
// private static int updateExitingPollution (World world, int i, int j, int
// k, int saturation) {
// int remainingSaturation = saturation;
//
// TilePollution tile = (TilePollution) world.getBlockTileEntity(
// i, j, k);
//
// if (tile.saturation + saturation <= 100) {
// remainingSaturation = 0;
// tile.saturation += saturation;
// } else {
// remainingSaturation = (tile.saturation + saturation) - 100;
// tile.saturation += saturation - remainingSaturation;
// }
//
// world.setBlockMetadata(i, j, k, saturation * 16 / 100);
// world.markBlockNeedsUpdate(i, j, k);
//
// return remainingSaturation;
// }
//
// private static boolean canPollute (World world, int i, int j, int k) {
// if (world.getBlockId(i, j, k) == 0) {
// return true;
// } else {
// TileEntity tile = world.getBlockTileEntity(i, j, k);
//
// return (tile instanceof TilePollution && ((TilePollution)
// tile).saturation < 100);
// }
// }
}

View file

@ -59,6 +59,8 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@ -106,7 +108,7 @@ public class BuildCraftFactory extends BuildCraftMod {
int quarryX = ticket.getModData().getInteger("quarryX");
int quarryY = ticket.getModData().getInteger("quarryY");
int quarryZ = ticket.getModData().getInteger("quarryZ");
TileQuarry tq = (TileQuarry) world.getBlockTileEntity(quarryX, quarryY, quarryZ);
TileQuarry tq = (TileQuarry) world.getTileEntity(quarryX, quarryY, quarryZ);
tq.forceChunkLoading(ticket);
}
@ -146,10 +148,10 @@ public class BuildCraftFactory extends BuildCraftMod {
FactoryProxy.proxy.initializeTileEntities();
new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
new BptBlockFrame(frameBlock.blockID);
new BptBlockRefinery(refineryBlock.blockID);
new BptBlockTank(tankBlock.blockID);
//new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
//new BptBlockFrame(frameBlock.blockID);
//new BptBlockRefinery(refineryBlock.blockID);
//new BptBlockTank(tankBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@ -174,72 +176,52 @@ public class BuildCraftFactory extends BuildCraftMod {
+ "Entries are comma seperated, banned fluids have precedence over allowed ones."
+ "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
pumpDimensionList = new PumpDimensionList(pumpList.getString());
int miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID).getInt(DefaultProps.MINING_WELL_ID);
int plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID).getInt(DefaultProps.DRILL_ID);
int autoWorkbenchId = BuildCraftCore.mainConfiguration.getBlock("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID).getInt(DefaultProps.AUTO_WORKBENCH_ID);
int frameId = BuildCraftCore.mainConfiguration.getBlock("frame.id", DefaultProps.FRAME_ID).getInt(DefaultProps.FRAME_ID);
int quarryId = BuildCraftCore.mainConfiguration.getBlock("quarry.id", DefaultProps.QUARRY_ID).getInt(DefaultProps.QUARRY_ID);
int pumpId = BuildCraftCore.mainConfiguration.getBlock("pump.id", DefaultProps.PUMP_ID).getInt(DefaultProps.PUMP_ID);
int floodGateId = BuildCraftCore.mainConfiguration.getBlock("floodGate.id", DefaultProps.FLOOD_GATE_ID).getInt(DefaultProps.FLOOD_GATE_ID);
int tankId = BuildCraftCore.mainConfiguration.getBlock("tank.id", DefaultProps.TANK_ID).getInt(DefaultProps.TANK_ID);
int refineryId = BuildCraftCore.mainConfiguration.getBlock("refinery.id", DefaultProps.REFINERY_ID).getInt(DefaultProps.REFINERY_ID);
int hopperId = BuildCraftCore.mainConfiguration.getBlock("hopper.id", DefaultProps.HOPPER_ID).getInt(DefaultProps.HOPPER_ID);
if (BuildCraftCore.mainConfiguration.hasChanged()) {
BuildCraftCore.mainConfiguration.save();
}
if (miningWellId > 0) {
miningWellBlock = new BlockMiningWell(miningWellId);
CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"));
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
}
if (plainPipeId > 0) {
plainPipeBlock = new BlockPlainPipe(plainPipeId);
CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"));
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
}
if (autoWorkbenchId > 0) {
autoWorkbenchBlock = new BlockAutoWorkbench(autoWorkbenchId);
CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"));
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
}
if (frameId > 0) {
frameBlock = new BlockFrame(frameId);
CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock"));
CoreProxy.proxy.addName(frameBlock, "Frame");
}
if (quarryId > 0) {
quarryBlock = new BlockQuarry(quarryId);
CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock"));
CoreProxy.proxy.addName(quarryBlock, "Quarry");
}
if (tankId > 0) {
tankBlock = new BlockTank(tankId);
CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock"));
CoreProxy.proxy.addName(tankBlock, "Tank");
}
if (pumpId > 0) {
pumpBlock = new BlockPump(pumpId);
CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"));
CoreProxy.proxy.addName(pumpBlock, "Pump");
}
if (floodGateId > 0) {
floodGateBlock = new BlockFloodGate(floodGateId);
CoreProxy.proxy.registerBlock(floodGateBlock.setUnlocalizedName("floodGateBlock"));
CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
}
if (refineryId > 0) {
refineryBlock = new BlockRefinery(refineryId);
CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"));
CoreProxy.proxy.addName(refineryBlock, "Refinery");
}
if (hopperId > 0) {
hopperBlock = new BlockHopper(hopperId);
CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper"));
CoreProxy.proxy.addName(hopperBlock, "Hopper");
}
miningWellBlock = new BlockMiningWell();
CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
plainPipeBlock = new BlockPlainPipe();
CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
autoWorkbenchBlock = new BlockAutoWorkbench();
CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
frameBlock = new BlockFrame();
CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock"));
CoreProxy.proxy.addName(frameBlock, "Frame");
quarryBlock = new BlockQuarry();
CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
CoreProxy.proxy.addName(quarryBlock, "Quarry");
tankBlock = new BlockTank();
CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock"));
CoreProxy.proxy.addName(tankBlock, "Tank");
pumpBlock = new BlockPump();
CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock"));
CoreProxy.proxy.addName(pumpBlock, "Pump");
floodGateBlock = new BlockFloodGate();
CoreProxy.proxy.registerBlock(floodGateBlock.setBlockName("floodGateBlock"));
CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
refineryBlock = new BlockRefinery();
CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock"));
CoreProxy.proxy.addName(refineryBlock, "Refinery");
hopperBlock = new BlockHopper();
CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper"));
CoreProxy.proxy.addName(hopperBlock, "Hopper");
FactoryProxy.proxy.initializeEntityRenders();
if (BuildCraftCore.mainConfiguration.hasChanged()) {
@ -257,10 +239,10 @@ public class BuildCraftFactory extends BuildCraftMod {
"ipi",
"igi",
"iPi",
'p', Item.redstone,
'i', Item.ingotIron,
'p', Items.redstone,
'i', Items.iron_ingot,
'g', BuildCraftCore.ironGearItem,
'P', Item.pickaxeIron);
'P', Items.iron_pickaxe);
if (quarryBlock != null)
CoreProxy.proxy.addCraftingRecipe(
@ -269,16 +251,16 @@ public class BuildCraftFactory extends BuildCraftMod {
"gig",
"dDd",
'i', BuildCraftCore.ironGearItem,
'p', Item.redstone,
'p', Items.redstone,
'g', BuildCraftCore.goldGearItem,
'd', BuildCraftCore.diamondGearItem,
'D', Item.pickaxeDiamond);
'D', Items.diamond_pickaxe);
if (pumpBlock != null && miningWellBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock),
"T",
"W",
'T', tankBlock != null ? tankBlock : Block.glass,
'T', tankBlock != null ? tankBlock : Blocks.glass,
'W', miningWellBlock);
}
@ -288,9 +270,9 @@ public class BuildCraftFactory extends BuildCraftMod {
"iri",
"iTi",
"gpg",
'r', Item.redstone,
'i', Item.ingotIron,
'T', tankBlock != null ? tankBlock : Block.glass,
'r', Items.redstone,
'i', Items.iron_ingot,
'T', tankBlock != null ? tankBlock : Blocks.glass,
'g', BuildCraftCore.ironGearItem,
'p', BuildCraftTransport.pipeFluidsGold);
}
@ -300,7 +282,7 @@ public class BuildCraftFactory extends BuildCraftMod {
" g ",
"gwg",
" g ",
'w', Block.workbench,
'w', Blocks.crafting_table,
'g', BuildCraftCore.woodenGearItem);
@ -309,23 +291,23 @@ public class BuildCraftFactory extends BuildCraftMod {
"ggg",
"g g",
"ggg",
'g', Block.glass);
'g', Blocks.glass);
if (refineryBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(refineryBlock),
"RTR",
"TGT",
'T', tankBlock != null ? tankBlock : Block.glass,
'T', tankBlock != null ? tankBlock : Blocks.glass,
'G', BuildCraftCore.diamondGearItem,
'R', Block.torchRedstoneActive);
'R', Blocks.redstone_torch);
if (hopperBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(hopperBlock),
"ICI",
"IGI",
" I ",
'I', Item.ingotIron,
'C', Block.chest,
'I', Items.iron_ingot,
'C', Blocks.chest,
'G', BuildCraftCore.stoneGearItem);
if (floodGateBlock != null)
@ -333,10 +315,10 @@ public class BuildCraftFactory extends BuildCraftMod {
"IGI",
"FTF",
"IFI",
'I', Item.ingotIron,
'T', tankBlock != null ? tankBlock : Block.glass,
'I', Items.iron_ingot,
'T', tankBlock != null ? tankBlock : Blocks.glass,
'G', BuildCraftCore.ironGearItem,
'F', new ItemStack(Block.fenceIron));
'F', new ItemStack(Blocks.iron_bars));
}
@EventHandler

View file

@ -42,7 +42,6 @@ import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@ -51,6 +50,8 @@ import java.util.EnumSet;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Property;
@ -65,28 +66,22 @@ public class BuildCraftSilicon extends BuildCraftMod {
public static BuildCraftSilicon instance;
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
Property laserId = BuildCraftCore.mainConfiguration.getBlock("laser.id", DefaultProps.LASER_ID);
Property assemblyTableId = BuildCraftCore.mainConfiguration.getBlock("assemblyTable.id", DefaultProps.ASSEMBLY_TABLE_ID);
Property redstoneChipsetId = BuildCraftCore.mainConfiguration.getItem("redstoneChipset.id", DefaultProps.REDSTONE_CHIPSET);
public void preInit(FMLPreInitializationEvent evt) {
BuildCraftCore.mainConfiguration.save();
laserBlock = new BlockLaser(laserId.getInt());
CoreProxy.proxy.addName(laserBlock.setUnlocalizedName("laserBlock"), "Laser");
laserBlock = new BlockLaser();
CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
CoreProxy.proxy.registerBlock(laserBlock);
assemblyTableBlock = new BlockLaserTable(assemblyTableId.getInt());
assemblyTableBlock = new BlockLaserTable();
CoreProxy.proxy.registerBlock(assemblyTableBlock, ItemLaserTable.class);
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 0), "Assembly Table");
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 1), "Advanced Crafting Table");
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 2), "Integration Table");
redstoneChipset = new ItemRedstoneChipset(redstoneChipsetId.getInt());
redstoneChipset.setUnlocalizedName("redstoneChipset");
redstoneChipset = new ItemRedstoneChipset();
redstoneChipset.setBlockName("redstoneChipset");
CoreProxy.proxy.registerItem(redstoneChipset);
redstoneChipset.registerItemStacks();
}
@ -102,8 +97,8 @@ public class BuildCraftSilicon extends BuildCraftMod {
CoreProxy.proxy.registerTileEntity(TileAdvancedCraftingTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyAdvancedWorkbench");
CoreProxy.proxy.registerTileEntity(TileIntegrationTable.class, "net.minecraft.src.buildcraft.factory.TileIntegrationTable");
new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
new BptBlockInventory(assemblyTableBlock.blockID);
//new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
//new BptBlockInventory(assemblyTableBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@ -119,51 +114,51 @@ public class BuildCraftSilicon extends BuildCraftMod {
"ORR",
"DDR",
"ORR",
'O', Block.obsidian,
'R', Item.redstone,
'D', Item.diamond);
'O', Blocks.obsidian,
'R', Items.redstone,
'D', Items.diamond);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0),
"ORO",
"ODO",
"OGO",
'O', Block.obsidian,
'R', Item.redstone,
'D', Item.diamond,
'O', Blocks.obsidian,
'R', Items.redstone,
'D', Items.diamond,
'G', BuildCraftCore.diamondGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1),
"OWO",
"OCO",
"ORO",
'O', Block.obsidian,
'W', Block.workbench,
'C', Block.chest,
'O', Blocks.obsidian,
'W', Blocks.crafting_table,
'C', Blocks.chest,
'R', new ItemStack(redstoneChipset, 1, 0));
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 2),
"ORO",
"OCO",
"OGO",
'O', Block.obsidian,
'R', Item.redstone,
'O', Blocks.obsidian,
'R', Items.redstone,
'C', new ItemStack(redstoneChipset, 1, 0),
'G', BuildCraftCore.diamondGearItem);
// PIPE WIRE
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.RED.getStack(8), "dyeRed", 1, Item.redstone, Item.ingotIron);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.BLUE.getStack(8), "dyeBlue", 1, Item.redstone, Item.ingotIron);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.GREEN.getStack(8), "dyeGreen", 1, Item.redstone, Item.ingotIron);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.YELLOW.getStack(8), "dyeYellow", 1, Item.redstone, Item.ingotIron);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.RED.getStack(8), "dyeRed", 1, Items.redstone, Items.iron_ingot);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.BLUE.getStack(8), "dyeBlue", 1, Items.redstone, Items.iron_ingot);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.GREEN.getStack(8), "dyeGreen", 1, Items.redstone, Items.iron_ingot);
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.YELLOW.getStack(8), "dyeYellow", 1, Items.redstone, Items.iron_ingot);
// CHIPSETS
BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Item.redstone);
BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Item.redstone, Item.ingotIron);
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Item.redstone, Item.ingotGold);
BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Item.redstone, Item.diamond);
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Item.redstone, Item.enderPearl);
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Item.redstone, Item.netherQuartz);
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Item.redstone, Item.comparator);
BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Items.redstone);
BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Items.redstone, Items.iron_ingot);
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Items.redstone, Items.gold_ingot);
BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Items.redstone, Items.diamond);
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Items.redstone, Items.ender_pearl);
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Items.redstone, Items.quartz);
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Items.redstone, Items.comparator);
// GATES
BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack());

View file

@ -98,7 +98,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@ -106,6 +105,8 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import java.util.LinkedList;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -264,33 +265,28 @@ public class BuildCraftTransport extends BuildCraftMod {
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
groupItemsTrigger = groupItemsTriggerProp.getInt();
Property genericPipeId = BuildCraftCore.mainConfiguration.getBlock("pipe.id", DefaultProps.GENERIC_PIPE_ID);
Property pipeWaterproofId = BuildCraftCore.mainConfiguration.getItem("pipeWaterproof.id", DefaultProps.PIPE_WATERPROOF_ID);
pipeWaterproof = new ItemBuildCraft(pipeWaterproofId.getInt());
pipeWaterproof = new ItemBuildCraft();
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
LanguageRegistry.addName(pipeWaterproof, "Pipe Sealant");
CoreProxy.proxy.registerItem(pipeWaterproof);
genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt());
CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class);
genericPipeBlock = new BlockGenericPipe();
CoreProxy.proxy.registerBlock(genericPipeBlock.setBlockName("pipeBlock"), ItemBlock.class);
pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Block.glass, "plankWood");
pipeItemsEmerald = buildPipe(DefaultProps.PIPE_ITEMS_EMERALD_ID, PipeItemsEmerald.class, "Emerald Transport Pipe", Item.emerald, Block.glass, Item.emerald);
pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", "cobblestone", Block.glass, "cobblestone");
pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", "stone", Block.glass, "stone");
pipeItemsQuartz = buildPipe(DefaultProps.PIPE_ITEMS_QUARTZ_ID, PipeItemsQuartz.class, "Quartz Transport Pipe", Block.blockNetherQuartz, Block.glass, Block.blockNetherQuartz);
pipeItemsIron = buildPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron);
pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold);
pipeItemsDiamond = buildPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond);
pipeItemsObsidian = buildPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian);
pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Block.blockLapis, Block.glass, Block.blockLapis);
pipeItemsDaizuli = buildPipe(DefaultProps.PIPE_ITEMS_DAIZULI_ID, PipeItemsDaizuli.class, "Daizuli Transport Pipe", Block.blockLapis, Block.glass, Item.diamond);
pipeItemsSandstone = buildPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Block.sandStone, Block.glass, Block.sandStone);
pipeItemsVoid = buildPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", "dyeBlack", Block.glass, Item.redstone);
pipeItemsEmzuli = buildPipe(DefaultProps.PIPE_ITEMS_EMZULI_ID, PipeItemsEmzuli.class, "Emzuli Transport Pipe", Block.blockLapis, Block.glass, Item.emerald);
pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Blocks.glass, "plankWood");
pipeItemsEmerald = buildPipe(DefaultProps.PIPE_ITEMS_EMERALD_ID, PipeItemsEmerald.class, "Emerald Transport Pipe", Items.emerald, Blocks.glass, Items.emerald);
pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", "cobblestone", Blocks.glass, "cobblestone");
pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", "stone", Blocks.glass, "stone");
pipeItemsQuartz = buildPipe(DefaultProps.PIPE_ITEMS_QUARTZ_ID, PipeItemsQuartz.class, "Quartz Transport Pipe", Blocks.quartz_block, Blocks.glass, Blocks.quartz_block);
pipeItemsIron = buildPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Items.iron_ingot, Blocks.glass, Items.iron_ingot);
pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Items.gold_ingot, Blocks.glass, Items.gold_ingot);
pipeItemsDiamond = buildPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Items.diamond, Blocks.glass, Items.diamond);
pipeItemsObsidian = buildPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Blocks.obsidian, Blocks.glass, Blocks.obsidian);
pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Blocks.lapis_block, Blocks.glass, Blocks.lapis_block);
pipeItemsDaizuli = buildPipe(DefaultProps.PIPE_ITEMS_DAIZULI_ID, PipeItemsDaizuli.class, "Daizuli Transport Pipe", Blocks.lapis_block, Blocks.glass, Items.diamond);
pipeItemsSandstone = buildPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Blocks.sandstone, Blocks.glass, Blocks.sandstone);
pipeItemsVoid = buildPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", "dyeBlack", Blocks.glass, Items.redstone);
pipeItemsEmzuli = buildPipe(DefaultProps.PIPE_ITEMS_EMZULI_ID, PipeItemsEmzuli.class, "Emzuli Transport Pipe", Blocks.lapis_block, Blocks.glass, Items.emerald);
pipeFluidsWood = buildPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeFluidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood);
pipeFluidsCobblestone = buildPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeFluidsCobblestone.class, "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone);
@ -301,13 +297,13 @@ public class BuildCraftTransport extends BuildCraftMod {
pipeFluidsSandstone = buildPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeFluidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof, pipeItemsSandstone);
pipeFluidsVoid = buildPipe(DefaultProps.PIPE_LIQUIDS_VOID_ID, PipeFluidsVoid.class, "Void Waterproof Pipe", pipeWaterproof, pipeItemsVoid);
pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Kinesis Pipe", Item.redstone, pipeItemsWood);
pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", Item.redstone, pipeItemsCobblestone);
pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Kinesis Pipe", Item.redstone, pipeItemsStone);
pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Kinesis Pipe", Item.redstone, pipeItemsQuartz);
pipePowerIron = buildPipe(DefaultProps.PIPE_POWER_IRON_ID, PipePowerIron.class, "Iron Kinesis Pipe", Item.redstone, pipeItemsIron);
pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Item.redstone, pipeItemsGold);
pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Item.redstone, pipeItemsDiamond);
pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Kinesis Pipe", Items.redstone, pipeItemsWood);
pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", Items.redstone, pipeItemsCobblestone);
pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Kinesis Pipe", Items.redstone, pipeItemsStone);
pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Kinesis Pipe", Items.redstone, pipeItemsQuartz);
pipePowerIron = buildPipe(DefaultProps.PIPE_POWER_IRON_ID, PipePowerIron.class, "Iron Kinesis Pipe", Items.redstone, pipeItemsIron);
pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Items.redstone, pipeItemsGold);
pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Items.redstone, pipeItemsDiamond);
pipeStructureCobblestone = buildPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, "Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone);
@ -315,30 +311,25 @@ public class BuildCraftTransport extends BuildCraftMod {
// pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, PipeItemsStripes.class, "Stripes Transport Pipe", new ItemStack(Item.dyePowder,
// 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11));
int pipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeWire.id", DefaultProps.PIPE_WIRE).getInt(DefaultProps.PIPE_WIRE);
pipeWire = new ItemPipeWire(pipeWireId);
pipeWire = new ItemPipeWire();
LanguageRegistry.addName(pipeWire, "Pipe Wire");
CoreProxy.proxy.registerItem(pipeWire);
PipeWire.item = pipeWire;
Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID);
pipeGate = new ItemGate(pipeGateId.getInt());
pipeGate = new ItemGate();
pipeGate.setUnlocalizedName("pipeGate");
CoreProxy.proxy.registerItem(pipeGate);
Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID);
facadeItem = new ItemFacade(pipeFacadeId.getInt());
facadeItem.setUnlocalizedName("pipeFacade");
facadeItem = new ItemFacade();
facadeItem.setBlockName("pipeFacade");
CoreProxy.proxy.registerItem(facadeItem);
Property pipePlugId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipePlug.id", DefaultProps.PIPE_PLUG_ID);
plugItem = new ItemPlug(pipePlugId.getInt());
plugItem = new ItemPlug();
plugItem.setUnlocalizedName("pipePlug");
CoreProxy.proxy.registerItem(plugItem);
Property filteredBufferId = BuildCraftCore.mainConfiguration.getBlock("filteredBuffer.id", DefaultProps.FILTERED_BUFFER_ID);
filteredBufferBlock = new BlockFilteredBuffer(filteredBufferId.getInt());
CoreProxy.proxy.registerBlock(filteredBufferBlock.setUnlocalizedName("filteredBufferBlock"));
filteredBufferBlock = new BlockFilteredBuffer();
CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
CoreProxy.proxy.addName(filteredBufferBlock, "Filtered Buffer");
} finally {
BuildCraftCore.mainConfiguration.save();
@ -367,14 +358,14 @@ public class BuildCraftTransport extends BuildCraftMod {
// ModLoader.RegisterTileEntity(TileDockingStation.class,
// "net.minecraft.src.buildcraft.TileDockingStation");
new BptBlockPipe(genericPipeBlock.blockID);
//new BptBlockPipe(genericPipeBlock.blockID);
BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
//BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
//BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
//BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
//BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
//BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
//BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
ActionManager.registerTriggerProvider(new PipeTriggerProvider());
@ -425,7 +416,7 @@ public class BuildCraftTransport extends BuildCraftMod {
public void loadRecipes() {
// Add base recipe for pipe waterproof.
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Item.dyePowder, 1, 2));
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.dye, 1, 2));
// Add pipe recipes
for (PipeRecipe pipe : pipeRecipes) {
@ -438,8 +429,8 @@ public class BuildCraftTransport extends BuildCraftMod {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
new Object[]{"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
BuildCraftTransport.pipeItemsDiamond, 'c', Block.chest, 'p',
Block.pistonBase});
BuildCraftTransport.pipeItemsDiamond, 'c', Blocks.chest, 'p',
Blocks.piston});
//Facade turning helper
GameRegistry.addRecipe(facadeItem.new FacadeRecipe());
@ -459,7 +450,7 @@ public class BuildCraftTransport extends BuildCraftMod {
int id = prop.getInt(defaultID);
ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
res.setUnlocalizedName(clas.getSimpleName());
res.setBlockName(clas.getSimpleName());
LanguageRegistry.addName(res, descr);
// Add appropriate recipe to temporary list

View file

@ -8,14 +8,14 @@ import net.minecraft.item.ItemStack;
@Deprecated
public class BlueprintManager {
public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length];
//public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length];
public static ItemSignature getItemSignature(Item item) {
ItemSignature sig = new ItemSignature();
if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
sig.itemClassName = item.getClass().getSimpleName();
}
//if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
// sig.itemClassName = item.getClass().getSimpleName();
//}
sig.itemName = item.getUnlocalizedName(new ItemStack(item));
@ -23,13 +23,14 @@ public class BlueprintManager {
}
public static BlockSignature getBlockSignature(Block block) {
return BlueprintManager.blockBptProps[0].getSignature(block);
//return BlueprintManager.blockBptProps[0].getSignature(block);
return null;
}
static {
// Initialize defaults for block properties.
for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
new BptBlock(i);
}
//for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
// new BptBlock(i);
//}
}
}

View file

@ -49,7 +49,7 @@ public class BptBlock {
public BptBlock(int blockId) {
this.blockId = blockId;
BlueprintManager.blockBptProps[blockId] = this;
//BlueprintManager.blockBptProps[blockId] = this;
}
/**
@ -61,7 +61,7 @@ public class BptBlock {
if (slot.storedRequirements.size() != 0) {
requirements.addAll(slot.storedRequirements);
} else {
requirements.add(new ItemStack(slot.blockId, 1, slot.meta));
// requirements.add(new ItemStack(slot.blockId, 1, slot.meta));
}
}
}
@ -103,7 +103,7 @@ public class BptBlock {
if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) {
Item container = stack.getItem().getContainerItem();
stack.itemID = container.itemID;
//stack.itemID = container.itemID;
stack.stackSize = 1;
stack.setItemDamage(0);
}
@ -117,7 +117,8 @@ public class BptBlock {
* Added metadata sensitivity //Krapht
*/
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z);
//return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z);
return false;
}
/**
@ -132,11 +133,11 @@ public class BptBlock {
*/
public void buildBlock(BptSlotInfo slot, IBptContext context) {
// Meta needs to be specified twice, depending on the block behavior
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
//context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3);
//context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
/*if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getTileEntity(slot.x, slot.y, slot.z);
slot.cpt.setInteger("x", slot.x);
slot.cpt.setInteger("y", slot.y);
@ -145,7 +146,7 @@ public class BptBlock {
if (tile != null) {
tile.readFromNBT(slot.cpt);
}
}
}*/
}
/**
@ -162,8 +163,8 @@ public class BptBlock {
* By default, if the block is a BlockContainer, tile information will be to save / load the block.
*/
public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) {
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(x, y, z);
/*if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getTileEntity(x, y, z);
if (tile != null) {
tile.writeToNBT(slot.cpt);
@ -176,7 +177,7 @@ public class BptBlock {
if (req != null) {
slot.storedRequirements.addAll(req);
}
}
}*/
}
/**
@ -194,7 +195,7 @@ public class BptBlock {
public BlockSignature getSignature(Block block) {
BlockSignature sig = new BlockSignature();
if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
/*if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
sig.blockClassName = block.getClass().getSimpleName();
if (block instanceof BlockContainer) {
@ -205,7 +206,7 @@ public class BptBlock {
sig.tileClassName = tile.getClass().getSimpleName();
}
}
}
}*/
sig.blockName = block.getUnlocalizedName();
sig.replaceNullWithStar();

View file

@ -55,11 +55,11 @@ public class BptBlockUtils {
ItemStack stacks[] = new ItemStack[list.tagCount()];
for (int i = 0; i < list.tagCount(); ++i) {
ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i));
//ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i));
if (stack != null && stack.itemID != 0 && stack.stackSize > 0) {
stacks[i] = context.mapItemStack(stack);
}
//if (stack != null && stack.itemID != 0 && stack.stackSize > 0) {
// stacks[i] = context.mapItemStack(stack);
//}
}
return stacks;
@ -75,7 +75,7 @@ public class BptBlockUtils {
if (stack != null && stack.stackSize != 0) {
stack.writeToNBT(cpt);
context.storeId(stack.itemID);
//context.storeId(stack.itemID);
}
}

View file

@ -10,6 +10,8 @@
package buildcraft.api.blueprints;
import java.util.LinkedList;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

View file

@ -12,7 +12,10 @@ package buildcraft.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
import java.util.LinkedList;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -26,7 +29,7 @@ public class BptBlockBed extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
if ((slot.meta & 8) == 0) {
requirements.add(new ItemStack(Item.bed));
requirements.add(new ItemStack(Items.bed));
}
}
@ -56,7 +59,7 @@ public class BptBlockBed extends BptBlock {
if ((slot.meta & 8) != 0)
return;
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
//context.world().setBlock(slot.x, slot.y, slot.z, slot.block, slot.meta,1);
int x2 = slot.x;
int z2 = slot.z;
@ -76,7 +79,7 @@ public class BptBlockBed extends BptBlock {
break;
}
context.world().setBlock(x2, slot.y, z2, slot.blockId, slot.meta + 8,1);
//context.world().setBlock(x2, slot.y, z2, slot.block, slot.meta + 8,1);
}
@Override

View file

@ -32,11 +32,11 @@ public class BptBlockDelegate extends BptBlock {
BptSlotInfo newSlot = slot.clone();
slot.blockId = delegateTo;
if (BlueprintManager.blockBptProps[delegateTo] != null) {
BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
} else {
super.addRequirements(newSlot, context, requirements);
}
//if (BlueprintManager.blockBptProps[delegateTo] != null) {
// BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
//} else {
// super.addRequirements(newSlot, context, requirements);
//}
}
@Override
@ -44,10 +44,12 @@ public class BptBlockDelegate extends BptBlock {
BptSlotInfo newSlot = slot.clone();
slot.blockId = delegateTo;
if (BlueprintManager.blockBptProps[delegateTo] != null)
return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
else
return super.isValid(newSlot, context);
//if (BlueprintManager.blockBptProps[delegateTo] != null)
// return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
//else
// return super.isValid(newSlot, context);
return false;
}
@Override
@ -55,11 +57,11 @@ public class BptBlockDelegate extends BptBlock {
BptSlotInfo newSlot = slot.clone();
slot.blockId = delegateTo;
if (BlueprintManager.blockBptProps[delegateTo] != null) {
BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
} else {
super.rotateLeft(newSlot, context);
}
//if (BlueprintManager.blockBptProps[delegateTo] != null) {
// BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
//} else {
// super.rotateLeft(newSlot, context);
//}
}
}

View file

@ -25,18 +25,19 @@ public class BptBlockDirt extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Block.dirt));
//requirements.add(new ItemStack(Block.dirt));
}
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1);
//context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1);
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
int id = context.world().getBlockId(slot.x, slot.y, slot.z);
//int id = context.world().getBlockId(slot.x, slot.y, slot.z);
return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID;
//return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID;
return false;
}
}

View file

@ -61,8 +61,8 @@ public class BptBlockDoor extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);
//context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
//context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);
context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);

View file

@ -35,9 +35,9 @@ public class BptBlockFluid extends BptBlock {
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
if (slot.meta == 0)
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0;
else
//if (slot.meta == 0)
// return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0;
//else
return true;
}
@ -53,9 +53,9 @@ public class BptBlockFluid extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
if (slot.meta == 0) {
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
}
//if (slot.meta == 0) {
// context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
//}
}
}

View file

@ -24,7 +24,7 @@ public class BptBlockIgnore extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 0, 0));
//requirements.add(new ItemStack(slot.blockId, 0, 0));
}
@Override

View file

@ -24,11 +24,12 @@ public class BptBlockIgnoreMeta extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
//return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
return false;
}
}

View file

@ -17,7 +17,7 @@ public class BptBlockInventory extends BptBlock {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
super.buildBlock(slot, context);
IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z);
for (int i = 0; i < inv.getSizeInventory(); ++i) {
inv.setInventorySlotContents(i, null);

View file

@ -23,7 +23,7 @@ public class BptBlockLever extends BptBlockWallSide {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override

View file

@ -23,7 +23,7 @@ public class BptBlockPiston extends BptBlockRotateMeta {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
int meta = slot.meta & 7;
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1);
//context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1);
}
}

View file

@ -24,12 +24,13 @@ public class BptBlockPumpkin extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
//return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
return false;
}
@Override

View file

@ -25,7 +25,7 @@ public class BptBlockRedstoneRepeater extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Item.redstoneRepeater));
//requirements.add(new ItemStack(Item.redstoneRepeater));
}
@Override

View file

@ -16,7 +16,7 @@ public class BptBlockRotateInventory extends BptBlockRotateMeta {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
super.buildBlock(slot, context);
IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z);
for (int i = 0; i < inv.getSizeInventory(); ++i) {
inv.setInventorySlotContents(i, null);

View file

@ -43,12 +43,13 @@ public class BptBlockRotateMeta extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
//return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
return false;
}
@Override

View file

@ -31,7 +31,7 @@ public class BptBlockSign extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Item.sign));
//requirements.add(new ItemStack(Item.sign));
}
@Override

View file

@ -24,12 +24,13 @@ public class BptBlockStairs extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
//return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
return false;
}
@Override

View file

@ -24,7 +24,7 @@ public class BptBlockWallSide extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(slot.blockId, 1, 0));
//requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override

View file

@ -39,7 +39,7 @@ public class StackWrapper {
if (getClass() != obj.getClass())
return false;
final StackWrapper other = (StackWrapper) obj;
if (stack.itemID != other.stack.itemID)
if (stack.getItem() != other.stack.getItem())
return false;
if (stack.getHasSubtypes() && stack.getItemDamage() != other.stack.getItemDamage())
return false;

View file

@ -8,8 +8,11 @@
package buildcraft.api.fuels;
import buildcraft.api.core.StackWrapper;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@ -60,7 +63,7 @@ public final class IronEngineCoolant {
* @param coolant
*/
public static void addCoolant(final ItemStack stack, final FluidStack coolant) {
if (stack != null && Item.itemsList[stack.itemID] != null && coolant != null) {
if (stack != null && stack.getItem() != null && coolant != null) {
solidCoolants.put(new StackWrapper(stack), coolant);
}
}
@ -73,8 +76,12 @@ public final class IronEngineCoolant {
* @param stack
* @param coolant
*/
public static void addCoolant(final int itemId, final int metadata, final FluidStack coolant) {
addCoolant(new ItemStack(itemId, 1, metadata), coolant);
public static void addCoolant(final Item item, final int metadata, final FluidStack coolant) {
addCoolant(new ItemStack(item, 1, metadata), coolant);
}
public static void addCoolant(final Block block, final int metadata, final FluidStack coolant) {
addCoolant(new ItemStack(block, 1, metadata), coolant);
}
public static boolean isCoolant(Fluid fluid) {

View file

@ -49,7 +49,7 @@ public class TriggerParameter implements ITriggerParameter {
if (stack != null) {
NBTTagCompound tagCompound = new NBTTagCompound();
stack.writeToNBT(tagCompound);
compound.setCompoundTag("stack", tagCompound);
compound.setTag("stack", tagCompound);
}
}

View file

@ -335,7 +335,7 @@ public final class PowerHandler {
public void writeToNBT(NBTTagCompound data, String tag) {
NBTTagCompound nbt = new NBTTagCompound();
nbt.setDouble("energyStored", energyStored);
data.setCompoundTag(tag, nbt);
data.setTag(tag, nbt);
}
public final class PowerReceiver {

View file

@ -17,7 +17,10 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -39,14 +42,14 @@ public class BlockArchitect extends BlockContainer {
IIcon blockTextureTopNeg;
IIcon blockTextureTopArchitect;
public BlockArchitect(int i) {
super(i, Material.iron);
public BlockArchitect() {
super(Material.iron);
setHardness(5F);
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileArchitect();
}
@ -92,10 +95,10 @@ public class BlockArchitect extends BlockContainer {
}
@Override
public void breakBlock(World world, int i, int j, int k, int par5, int par6) {
public void breakBlock(World world, int i, int j, int k, Block block, int par6) {
Utils.preDestroyBlock(world, i, j, k);
super.breakBlock(world, i, j, k, par5, par6);
super.breakBlock(world, i, j, k, block, par6);
}
@Override
@ -139,7 +142,7 @@ public class BlockArchitect extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
blockTextureSides = par1IconRegister.registerIcon("buildcraft:architect_sides");
blockTextureTopNeg = par1IconRegister.registerIcon("buildcraft:architect_top_neg");

View file

@ -30,8 +30,8 @@ public class BlockBlueprintLibrary extends BlockContainer {
private IIcon textureTop;
private IIcon textureSide;
public BlockBlueprintLibrary(int i) {
super(i, Material.wood);
public BlockBlueprintLibrary() {
super(Material.wood);
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
setHardness(5F);
}
@ -44,7 +44,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
if (entityplayer.isSneaking())
return false;
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k);
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k);
if (!tile.locked || entityplayer.username.equals(tile.owner))
if (!CoreProxy.proxy.isRenderWorld(world)) {
@ -55,7 +55,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileBlueprintLibrary();
}
@ -73,7 +73,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
if (CoreProxy.proxy.isSimulating(world) && entityliving instanceof EntityPlayer) {
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k);
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k);
tile.owner = ((EntityPlayer) entityliving).username;
}
}
@ -86,7 +86,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
textureTop = par1IconRegister.registerIcon("buildcraft:library_topbottom");
textureSide = par1IconRegister.registerIcon("buildcraft:library_side");

View file

@ -15,7 +15,10 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -34,14 +37,14 @@ public class BlockBuilder extends BlockContainer {
IIcon blockTextureSide;
IIcon blockTextureFront;
public BlockBuilder(int i) {
super(i, Material.iron);
public BlockBuilder() {
super(Material.iron);
setHardness(5F);
setCreativeTab(null);
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileBuilder();
}
@ -111,9 +114,9 @@ public class BlockBuilder extends BlockContainer {
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
Utils.preDestroyBlock(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
super.breakBlock(world, x, y, z, block, par6);
}
@SuppressWarnings({"unchecked", "rawtypes"})
@ -124,7 +127,7 @@ public class BlockBuilder extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister par1IconRegister) {
blockTextureTop = par1IconRegister.registerIcon("buildcraft:builder_top");
blockTextureSide = par1IconRegister.registerIcon("buildcraft:builder_side");
blockTextureFront = par1IconRegister.registerIcon("buildcraft:builder_front");

View file

@ -17,7 +17,10 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -35,8 +38,8 @@ public class BlockFiller extends BlockContainer {
IIcon textureTopOff;
public IFillerPattern currentPattern;
public BlockFiller(int i) {
super(i, Material.iron);
public BlockFiller() {
super(Material.iron);
setHardness(5F);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
@ -59,7 +62,7 @@ public class BlockFiller extends BlockContainer {
@Override
public IIcon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
int m = world.getBlockMetadata(x, y, z);
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileFiller) {
TileFiller filler = (TileFiller) tile;
@ -86,14 +89,14 @@ public class BlockFiller extends BlockContainer {
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileFiller();
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
Utils.preDestroyBlock(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
super.breakBlock(world, x, y, z, block, par6);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@ -104,7 +107,7 @@ public class BlockFiller extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister par1IconRegister) {
textureTopOn = par1IconRegister.registerIcon("buildcraft:blockFillerTopOn");
textureTopOff = par1IconRegister.registerIcon("buildcraft:blockFillerTopOff");
textureSides = par1IconRegister.registerIcon("buildcraft:blockFillerSides");

View file

@ -13,7 +13,10 @@ import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.utils.Utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -27,8 +30,8 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BlockMarker extends BlockContainer {
public BlockMarker(int i) {
super(i, Material.circuits);
public BlockMarker() {
super(Material.circuits);
setLightValue(0.5F);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
@ -80,20 +83,20 @@ public class BlockMarker extends BlockContainer {
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileMarker();
}
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
((TileMarker) world.getBlockTileEntity(i, j, k)).tryConnection();
((TileMarker) world.getTileEntity(i, j, k)).tryConnection();
return true;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
Utils.preDestroyBlock(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
super.breakBlock(world, x, y, z, block, par6);
}
@Override
@ -112,8 +115,8 @@ public class BlockMarker extends BlockContainer {
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockId) {
((TileMarker) world.getBlockTileEntity(x, y, z)).updateSignals();
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
((TileMarker) world.getTileEntity(x, y, z)).updateSignals();
dropTorchIfCantStay(world, x, y, z);
}
@ -138,7 +141,7 @@ public class BlockMarker extends BlockContainer {
int meta = world.getBlockMetadata(x, y, z);
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
dropBlockAsItem(world, x, y, z, BuildCraftBuilders.markerBlock.blockID, 0);
world.setBlock(x, y, z, 0);
world.setBlock(x, y, z, null);
}
}
@ -150,7 +153,7 @@ public class BlockMarker extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("buildcraft:blockMarker");
}
}

View file

@ -12,7 +12,10 @@ package buildcraft.builders;
import buildcraft.core.utils.Utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -24,25 +27,24 @@ public class BlockPathMarker extends BlockMarker {
private IIcon activeMarker;
public BlockPathMarker(int i) {
super(i);
public BlockPathMarker() {
}
@Override
public TileEntity createNewTileEntity(World var1) {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TilePathMarker();
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
Utils.preDestroyBlock(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
super.breakBlock(world, x, y, z, block, par6);
}
@SuppressWarnings({ "all" })
// @Override (client only)
public IIcon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
TilePathMarker marker = (TilePathMarker) iblockaccess.getBlockTileEntity(i, j, k);
TilePathMarker marker = (TilePathMarker) iblockaccess.getTileEntity(i, j, k);
if (l == 1 || (marker != null && marker.tryingToConnect))
return activeMarker;
@ -58,7 +60,7 @@ public class BlockPathMarker extends BlockMarker {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
blockIcon = par1IconRegister.registerIcon("buildcraft:blockPathMarker");
activeMarker = par1IconRegister.registerIcon("buildcraft:blockPathMarkerActive");

View file

@ -15,7 +15,7 @@ import net.minecraft.world.World;
public class BuildersProxy {
public static boolean canPlaceTorch(World world, int i, int j, int k) {
Block block = Block.blocksList[world.getBlockId(i, j, k)];
Block block = world.getBlock(i, j, k);
if (block == null || !block.renderAsNormalBlock())
return false;

View file

@ -22,7 +22,7 @@ public class GuiHandler implements IGuiHandler {
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
switch (ID) {
@ -58,7 +58,7 @@ public class GuiHandler implements IGuiHandler {
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
switch (ID) {

View file

@ -23,8 +23,8 @@ import net.minecraft.world.World;
public abstract class ItemBptBase extends ItemBuildCraft {
public ItemBptBase(int i) {
super(i);
public ItemBptBase() {
super();
maxStackSize = 1;
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());

View file

@ -19,8 +19,8 @@ public class ItemBptBluePrint extends ItemBptBase {
private IIcon cleanBlueprint;
private IIcon usedBlueprint;
public ItemBptBluePrint(int i) {
super(i);
public ItemBptBluePrint() {
super();
setCreativeTab(null);
}

View file

@ -7,8 +7,8 @@ import net.minecraft.util.IIcon;
public class ItemBptTemplate extends ItemBptBase {
private IIcon usedTemplate;
public ItemBptTemplate(int i) {
super(i);
public ItemBptTemplate() {
super();
}
@Override

View file

@ -228,7 +228,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
}
@Override
public String getInvName() {
public String getInventoryName() {
return "Template";
}
@ -245,7 +245,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
}
@Override
@ -360,10 +360,15 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -219,7 +219,7 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
}
@Override
public String getInvName() {
public String getInventoryName() {
return "";
}
@ -236,15 +236,15 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override
@ -289,4 +289,9 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
setInventorySlotContents(2, null);
}
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -183,7 +183,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
for (int x = xCoord - 1; x <= xCoord + 1; ++x) {
for (int y = yCoord - 1; y <= yCoord + 1; ++y) {
for (int z = zCoord - 1; z <= zCoord + 1; ++z) {
TileEntity tile = worldObj.getBlockTileEntity(x, y, z);
TileEntity tile = worldObj.getTileEntity(x, y, z);
if (tile instanceof TilePathMarker) {
path = ((TilePathMarker) tile).getPath();
@ -425,7 +425,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
}
@Override
public String getInvName() {
public String getInventoryName() {
return "Builder";
}
@ -441,7 +441,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
}
@Override
@ -542,11 +542,11 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
// @Override
@ -624,4 +624,9 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
public boolean allowAction(IAction action) {
return false;
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -167,7 +167,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
}
@Override
public String getInvName() {
public String getInventoryName() {
return "Filler";
}
@ -214,7 +214,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
return false;
return entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64D;
}
@ -296,11 +296,11 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override
@ -336,4 +336,9 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
public void readGuiData(DataInputStream data, EntityPlayer player) throws IOException {
setPattern(FillerManager.registry.getPattern(data.readUTF()));
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -19,6 +19,7 @@ import buildcraft.core.network.PacketUpdate;
import buildcraft.core.network.TileNetworkData;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@ -54,7 +55,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
return null;
if (marker == null) {
marker = (TileMarker) world.getBlockTileEntity(x, y, z);
marker = (TileMarker) world.getTileEntity(x, y, z);
}
return marker;
@ -145,7 +146,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
for (int i = 0; i < 3; ++i) {
if (initVect[i] != null) {
linkTo((TileMarker) worldObj.getBlockTileEntity((int) initVect[i].x, (int) initVect[i].y, (int) initVect[i].z), i);
linkTo((TileMarker) worldObj.getTileEntity((int) initVect[i].x, (int) initVect[i].y, (int) initVect[i].z), i);
}
}
}
@ -165,8 +166,6 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
}
void setVect(int n) {
int markerId = BuildCraftBuilders.markerBlock.blockID;
int[] coords = new int[3];
coords[0] = xCoord;
@ -177,10 +176,10 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
for (int j = 1; j < maxSize; ++j) {
coords[n] += j;
int blockId = worldObj.getBlockId(coords[0], coords[1], coords[2]);
Block block = worldObj.getBlock(coords[0], coords[1], coords[2]);
if (blockId == markerId) {
TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]);
if (block == BuildCraftBuilders.markerBlock) {
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
if (linkTo(marker, n)) {
break;
@ -190,10 +189,10 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
coords[n] -= j;
coords[n] -= j;
blockId = worldObj.getBlockId(coords[0], coords[1], coords[2]);
block = worldObj.getBlock(coords[0], coords[1], coords[2]);
if (blockId == markerId) {
TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]);
if (block == BuildCraftBuilders.markerBlock) {
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
if (linkTo(marker, n)) {
break;
@ -405,13 +404,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
for (TileWrapper m : o.vect.clone()) {
if (m.isSet()) {
worldObj.setBlock(m.x, m.y, m.z, 0);
worldObj.setBlock(m.x, m.y, m.z, null);
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, BuildCraftBuilders.markerBlock.blockID, 0);
}
}
worldObj.setBlock(o.vectO.x, o.vectO.y, o.vectO.z, 0);
worldObj.setBlock(o.vectO.x, o.vectO.y, o.vectO.z, null);
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, BuildCraftBuilders.markerBlock.blockID, 0);
}

View file

@ -72,7 +72,7 @@ public class TilePathMarker extends TileMarker {
double nearestDistance = 0, distance; // The initialization of nearestDistance is only to make the compiler shut up
for (TilePathMarker t : availableMarkers) {
if (t == this || t == this.links[0] || t == this.links[1] || t.worldObj.provider.dimensionId != this.worldObj.provider.dimensionId) {
if (t == this || t == this.links[0] || t == this.links[1] || t.getWorldObj().provider.dimensionId != this.getWorldObj().provider.dimensionId) {
continue;
}
@ -173,7 +173,7 @@ public class TilePathMarker extends TileMarker {
}
if (loadLink0) {
TileEntity e0 = worldObj.getBlockTileEntity(x0, y0, z0);
TileEntity e0 = worldObj.getTileEntity(x0, y0, z0);
if (links[0] != e0 && links[1] != e0 && e0 instanceof TilePathMarker) {
createLaserAndConnect((TilePathMarker) e0);
@ -183,7 +183,7 @@ public class TilePathMarker extends TileMarker {
}
if (loadLink1) {
TileEntity e1 = worldObj.getBlockTileEntity(x1, y1, z1);
TileEntity e1 = worldObj.getTileEntity(x1, y1, z1);
if (links[0] != e1 && links[1] != e1 && e1 instanceof TilePathMarker) {
createLaserAndConnect((TilePathMarker) e1);
@ -259,7 +259,7 @@ public class TilePathMarker extends TileMarker {
public static void clearAvailableMarkersList(World w) {
for (Iterator<TilePathMarker> it = availableMarkers.iterator(); it.hasNext();) {
TilePathMarker t = it.next();
if (t.worldObj.provider.dimensionId != w.provider.dimensionId) {
if (t.getWorldObj().provider.dimensionId != w.provider.dimensionId) {
it.remove();
}
}

View file

@ -195,7 +195,7 @@ public abstract class FillerPattern implements IFillerPattern {
}
private static void breakBlock(World world, int x, int y, int z) {
Block block = Block.blocksList[world.getBlockId(x, y, z)];
Block block = world.getBlock(x, y, z);
if (block != null)
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
if (BuildCraftBuilders.fillerDestroy) {

View file

@ -27,22 +27,22 @@ public class PatternBox extends FillerPattern {
int yMax = (int) box.pMax().y;
int zMax = (int) box.pMax().z;
if (fill(xMin, yMin, zMin, xMax, yMin, zMax, stackToPlace, tile.worldObj))
if (fill(xMin, yMin, zMin, xMax, yMin, zMax, stackToPlace, tile.getWorldObj()))
return false;
if (fill(xMin, yMin, zMin, xMin, yMax, zMax, stackToPlace, tile.worldObj))
if (fill(xMin, yMin, zMin, xMin, yMax, zMax, stackToPlace, tile.getWorldObj()))
return false;
if (fill(xMin, yMin, zMin, xMax, yMax, zMin, stackToPlace, tile.worldObj))
if (fill(xMin, yMin, zMin, xMax, yMax, zMin, stackToPlace, tile.getWorldObj()))
return false;
if (fill(xMax, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj))
if (fill(xMax, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.getWorldObj()))
return false;
if (fill(xMin, yMin, zMax, xMax, yMax, zMax, stackToPlace, tile.worldObj))
if (fill(xMin, yMin, zMax, xMax, yMax, zMax, stackToPlace, tile.getWorldObj()))
return false;
if (fill(xMin, yMax, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj))
if (fill(xMin, yMax, zMin, xMax, yMax, zMax, stackToPlace, tile.getWorldObj()))
return false;
return true;

View file

@ -27,6 +27,6 @@ public class PatternClear extends FillerPattern {
int yMax = (int) box.pMax().y;
int zMax = (int) box.pMax().z;
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.worldObj);
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.getWorldObj());
}
}

View file

@ -39,7 +39,7 @@ public class PatternCylinder extends FillerPattern {
int zRadius = (zMax-zMin)/2;
if(xRadius == 0 || zRadius == 0) {
return !fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj);
return !fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.getWorldObj());
}
int dx = xRadius, dz = 0;
@ -52,7 +52,7 @@ public class PatternCylinder extends FillerPattern {
int stoppingZ = 0;
while(stoppingX >= stoppingZ) {
if(!fillFourColumns(xCenter,zCenter,dx,dz,xFix,zFix,yMin,yMax,stackToPlace,tile.worldObj))
if(!fillFourColumns(xCenter,zCenter,dx,dz,xFix,zFix,yMin,yMax,stackToPlace,tile.getWorldObj()))
return false;
++dz;
stoppingZ += twoASquare;
@ -75,7 +75,7 @@ public class PatternCylinder extends FillerPattern {
stoppingZ = twoASquare*zRadius;
while(stoppingX <= stoppingZ) {
if(!fillFourColumns(xCenter,zCenter,dx,dz,xFix,zFix,yMin,yMax,stackToPlace,tile.worldObj))
if(!fillFourColumns(xCenter,zCenter,dx,dz,xFix,zFix,yMin,yMax,stackToPlace,tile.getWorldObj()))
return false;
++dx;
stoppingX += twoBSquare;

View file

@ -29,7 +29,7 @@ public class PatternFill extends FillerPattern {
int yMax = (int) box.pMax().y;
int zMax = (int) box.pMax().z;
return !fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj);
return !fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.getWorldObj());
}
}

View file

@ -27,9 +27,9 @@ public class PatternFlatten extends FillerPattern {
int yMax = (int) box.pMax().y;
int zMax = (int) box.pMax().z;
if (flatten(xMin, 1, zMin, xMax, yMin - 1, zMax, tile.worldObj, stackToPlace)) {
if (flatten(xMin, 1, zMin, xMax, yMin - 1, zMax, tile.getWorldObj(), stackToPlace)) {
return false;
}
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.worldObj);
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.getWorldObj());
}
}

View file

@ -26,9 +26,9 @@ public class PatternHorizon extends FillerPattern {
int xMax = (int) box.pMax().x;
int zMax = (int) box.pMax().z;
if (stackToPlace != null && flatten(xMin, 1, zMin, xMax, yMin - 1, zMax, tile.worldObj, stackToPlace)) {
if (stackToPlace != null && flatten(xMin, 1, zMin, xMax, yMin - 1, zMax, tile.getWorldObj(), stackToPlace)) {
return false;
}
return !empty(xMin, yMin, zMin, xMax, tile.worldObj.getActualHeight(), zMax, tile.worldObj);
return !empty(xMin, yMin, zMin, xMax, tile.getWorldObj().getActualHeight(), zMax, tile.getWorldObj());
}
}

View file

@ -48,7 +48,7 @@ public class PatternPyramid extends FillerPattern {
}
while (step <= xSize / 2 && step <= zSize / 2 && height >= yMin && height <= yMax) {
if (fill(xMin + step, height, zMin + step, xMax - step, height, zMax - step, stackToPlace, tile.worldObj))
if (fill(xMin + step, height, zMin + step, xMax - step, height, zMax - step, stackToPlace, tile.getWorldObj()))
return false;
step++;

View file

@ -121,7 +121,7 @@ public class PatternStairs extends FillerPattern {
if (kind == 0) {
while (x2 - x1 + 1 > 0 && z2 - z1 + 1 > 0 && x2 - x1 < sizeX && z2 - z1 < sizeZ && height >= yMin && height <= yMax) {
if (fill(x1, height, z1, x2, height, z2, stackToPlace, tile.worldObj))
if (fill(x1, height, z1, x2, height, z2, stackToPlace, tile.getWorldObj()))
return false;
if (heightStep == 1) {
@ -176,7 +176,7 @@ public class PatternStairs extends FillerPattern {
}
if (fill(x1, height, z1, x2, height, z2, stackToPlace, tile.worldObj))
if (fill(x1, height, z1, x2, height, z2, stackToPlace, tile.getWorldObj()))
return false;
dimX += stepDiagX;

View file

@ -55,14 +55,14 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
}
private void onArchitectName(EntityPlayer player, PacketUpdate packet) {
TileEntity te = player.worldObj.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
TileEntity te = player.worldObj.getTileEntity(packet.posX, packet.posY, packet.posZ);
if (te instanceof TileArchitect) {
((TileArchitect) te).handleClientInput((char) ((PacketPayloadArrays)packet.payload).intPayload[0]);
}
}
private void onLibraryAction(EntityPlayer player, PacketLibraryAction packet) {
TileEntity te = player.worldObj.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
TileEntity te = player.worldObj.getTileEntity(packet.posX, packet.posY, packet.posZ);
if (te instanceof TileBlueprintLibrary) {
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
switch (packet.actionId) {
@ -84,7 +84,7 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
}
private void onLibrarySelect(EntityPlayer player, PacketLibraryAction packet) {
TileEntity te = player.worldObj.getBlockTileEntity(packet.posX, packet.posY, packet.posZ);
TileEntity te = player.worldObj.getTileEntity(packet.posX, packet.posY, packet.posZ);
if (te instanceof TileBlueprintLibrary) {
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
int ySlot = packet.actionId;

View file

@ -1,7 +1,10 @@
package buildcraft.core;
import buildcraft.core.utils.Utils;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
@ -15,8 +18,8 @@ public abstract class BlockBuildCraft extends BlockContainer {
protected static boolean keepInventory = false;
protected final Random rand = new Random();
protected BlockBuildCraft(int id, Material material) {
super(id, material);
protected BlockBuildCraft(Material material) {
super(material);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
setHardness(5F);
}
@ -24,21 +27,21 @@ public abstract class BlockBuildCraft extends BlockContainer {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, entity, stack);
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileBuildCraft) {
((TileBuildCraft) tile).onBlockPlacedBy(entity, stack);
}
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
Utils.preDestroyBlock(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
super.breakBlock(world, x, y, z, block, par6);
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof IMachine && ((IMachine) tile).isActive())
return super.getLightValue(world, x, y, z) + 8;
return super.getLightValue(world, x, y, z);

View file

@ -9,6 +9,7 @@
package buildcraft.core;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@ -67,8 +68,8 @@ public class BlockIndex implements Comparable<BlockIndex> {
c.setInteger("k", z);
}
public int getBlockId(World world) {
return world.getBlockId(x, y, z);
public Block getBlock(World world) {
return world.getBlock(x, y, z);
}
@Override

View file

@ -2,12 +2,16 @@ package buildcraft.core;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@ -17,7 +21,7 @@ public class BlockSpring extends Block {
public enum EnumSpring {
WATER(5, -1, Block.waterStill),
WATER(5, -1, Blocks.water),
OIL(6000, 8, null); // Set in BuildCraftEnergy
public static final EnumSpring[] VALUES = values();
public final int tickRate, chance;
@ -38,8 +42,8 @@ public class BlockSpring extends Block {
}
}
public BlockSpring(int id) {
super(id, Material.rock);
public BlockSpring() {
super(Material.rock);
setBlockUnbreakable();
setResistance(6000000.0F);
setStepSound(soundStoneFootstep);
@ -49,7 +53,7 @@ public class BlockSpring extends Block {
}
@Override
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
for (EnumSpring type : EnumSpring.VALUES) {
list.add(new ItemStack(this, 1, type.ordinal()));
}
@ -73,13 +77,13 @@ public class BlockSpring extends Block {
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);
int meta = world.getBlockMetadata(x, y, z);
world.scheduleBlockUpdate(x, y, z, blockID, EnumSpring.fromMeta(meta).tickRate);
world.scheduleBlockUpdate(x, y, z, this, EnumSpring.fromMeta(meta).tickRate);
}
private void assertSpring(World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
EnumSpring spring = EnumSpring.fromMeta(meta);
world.scheduleBlockUpdate(x, y, z, blockID, spring.tickRate);
world.scheduleBlockUpdate(x, y, z, this, spring.tickRate);
if (!spring.canGen || spring.liquidBlock == null) {
return;
}
@ -89,7 +93,7 @@ public class BlockSpring extends Block {
if (spring.chance != -1 && rand.nextInt(spring.chance) != 0) {
return;
}
world.setBlock(x, y + 1, z, spring.liquidBlock.blockID);
world.setBlock(x, y + 1, z, spring.liquidBlock);
}
// Prevents updates on chunk generation
@ -100,7 +104,7 @@ public class BlockSpring extends Block {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister par1IconRegister) {
blockIcon = par1IconRegister.registerIcon("bedrock");
}
}

View file

@ -3,9 +3,13 @@ package buildcraft.core;
import buildcraft.BuildCraftCore;
import buildcraft.core.utils.Localization;
import buildcraft.transport.ItemFacade;
import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public enum CreativeTabBuildCraft {
@ -33,7 +37,7 @@ public enum CreativeTabBuildCraft {
private ItemStack getItem() {
switch (this) {
case FACADES:
return ItemFacade.getStack(Block.stoneBrick, 0);
return ItemFacade.getStack(Blocks.brick_block, 0);
default:
return new ItemStack(BuildCraftCore.diamondGearItem);
}
@ -55,5 +59,10 @@ public enum CreativeTabBuildCraft {
public String getTranslatedTabLabel() {
return translate();
}
@Override
public Item getTabIconItem() {
return getItem().getItem();
}
}
}

View file

@ -9,6 +9,7 @@
package buildcraft.core;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@ -16,9 +17,9 @@ public interface ITileBufferHolder {
public void blockRemoved(ForgeDirection from);
public void blockCreated(ForgeDirection from, int blockID, TileEntity tile);
public void blockCreated(ForgeDirection from, Block block, TileEntity tile);
public int getBlockId(ForgeDirection to);
public Block getBlock(ForgeDirection to);
public TileEntity getTile(ForgeDirection to);

View file

@ -20,8 +20,8 @@ public class ItemBuildCraft extends Item {
private String iconName;
private boolean passSneakClick = false;
public ItemBuildCraft(int i) {
super(i);
public ItemBuildCraft() {
super();
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@ -31,9 +31,9 @@ public class ItemBuildCraft extends Item {
}
@Override
public Item setUnlocalizedName(String par1Str) {
public Item setBlockName(String par1Str) {
iconName = par1Str;
return super.setUnlocalizedName(par1Str);
return super.setBlockName(par1Str);
}
@Override

View file

@ -16,8 +16,8 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
private final Set<Class<? extends Block>> shiftRotations = new HashSet<Class<? extends Block>>();
public ItemWrench(int i) {
super(i);
public ItemWrench() {
super();
setFull3D();
setMaxStackSize(1);
shiftRotations.add(BlockLever.class);

View file

@ -15,9 +15,9 @@ import net.minecraftforge.common.util.ForgeDirection;
public final class TileBuffer {
private int blockID = 0;
private Block block = null;
private TileEntity tile;
private final SafeTimeTracker tracker = new SafeTimeTracker();
private final SafeTimeTracker tracker = new SafeTimeTracker(20);
private final World world;
final int x, y, z;
private final boolean loadUnloaded;
@ -34,43 +34,42 @@ public final class TileBuffer {
public final void refresh() {
tile = null;
blockID = 0;
block = null;
if (!loadUnloaded && !world.blockExists(x, y, z)) {
return;
}
blockID = world.getBlockId(this.x, this.y, this.z);
block = world.getBlock(this.x, this.y, this.z);
Block block = Block.blocksList[blockID];
if (block != null && block.hasTileEntity(world.getBlockMetadata(this.x, this.y, this.z))) {
tile = world.getBlockTileEntity(this.x, this.y, this.z);
tile = world.getTileEntity(this.x, this.y, this.z);
}
}
public void set(int blockID, TileEntity tile) {
this.blockID = blockID;
public void set(Block block, TileEntity tile) {
this.block = block;
this.tile = tile;
tracker.markTime(world);
}
public int getBlockID() {
public Block getBlock() {
if (tile != null && !tile.isInvalid())
return blockID;
return block;
if (tracker.markTimeIfDelay(world, 20)) {
if (tracker.markTimeIfDelay(world)) {
refresh();
if (tile != null && !tile.isInvalid())
return blockID;
return block;
}
return 0;
return null;
}
public TileEntity getTile() {
if (tile != null && !tile.isInvalid())
return tile;
if (tracker.markTimeIfDelay(world, 20)) {
if (tracker.markTimeIfDelay(world)) {
refresh();
if (tile != null && !tile.isInvalid())

View file

@ -57,11 +57,11 @@ public class BptBlueprint extends BptBase {
slot.x = (int) (x - context.surroundingBox().pMin().x);
slot.y = (int) (y - context.surroundingBox().pMin().y);
slot.z = (int) (z - context.surroundingBox().pMin().z);
slot.blockId = anchorTile.worldObj.getBlockId(x, y, z);
slot.meta = anchorTile.worldObj.getBlockMetadata(x, y, z);
slot.blockId = anchorTile.getWorldObj().getBlockId(x, y, z);
slot.meta = anchorTile.getWorldObj().getBlockMetadata(x, y, z);
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = anchorTile.worldObj.getBlockTileEntity(x, y, z);
TileEntity tile = anchorTile.getWorldObj().getTileEntity(x, y, z);
if (tile != null && tile instanceof IBptContributor) {
IBptContributor contributor = (IBptContributor) tile;

View file

@ -65,7 +65,7 @@ public class InventoryConcatenator implements IInventory {
}
@Override
public String getInvName() {
public String getInventoryName() {
return "";
}
@ -89,11 +89,11 @@ public class InventoryConcatenator implements IInventory {
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override

View file

@ -68,8 +68,8 @@ public class InventoryCopy implements IInventory {
}
@Override
public String getInvName() {
return orignal.getInvName();
public String getInventoryName() {
return orignal.getInventoryName();
}
@Override
@ -87,11 +87,11 @@ public class InventoryCopy implements IInventory {
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override

View file

@ -63,8 +63,8 @@ public class InventoryMapper implements IInventory {
}
@Override
public String getInvName() {
return inv.getInvName();
public String getInventoryName() {
return inv.getInventoryName();
}
public void setStackSizeLimit(int limit) {
@ -87,13 +87,13 @@ public class InventoryMapper implements IInventory {
}
@Override
public void openChest() {
inv.openChest();
public void openInventory() {
inv.openInventory();
}
@Override
public void closeChest() {
inv.closeChest();
public void closeInventory() {
inv.closeInventory();
}
@Override

View file

@ -19,13 +19,13 @@ public abstract class InventoryWrapper implements ISidedInventory {
@Override public ItemStack decrStackSize(int slotIndex, int amount) { return inventory.decrStackSize(slotIndex, amount); }
@Override public ItemStack getStackInSlotOnClosing(int slotIndex) { return inventory.getStackInSlotOnClosing(slotIndex); }
@Override public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { inventory.setInventorySlotContents(slotIndex, itemstack); }
@Override public String getInvName() { return inventory.getInvName(); }
@Override public String getInventoryName() { return inventory.getInventoryName(); }
@Override public boolean isInvNameLocalized() { return inventory.isInvNameLocalized(); }
@Override public int getInventoryStackLimit() { return inventory.getInventoryStackLimit(); }
@Override public void onInventoryChanged() { inventory.onInventoryChanged(); }
@Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { return inventory.isUseableByPlayer(entityplayer); }
@Override public void openChest() { inventory.openChest(); }
@Override public void closeChest() { inventory.closeChest(); }
@Override public void openInventory() { inventory.openInventory(); }
@Override public void closeInventory() { inventory.closeInventory(); }
@Override public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { return inventory.isItemValidForSlot(slotIndex, itemstack); }
/* STATIC HELPER */

View file

@ -68,7 +68,7 @@ public class SimpleInventory implements IInventory, INBTTagable {
}
@Override
public String getInvName() {
public String getInventoryName() {
return _name;
}
@ -90,11 +90,11 @@ public class SimpleInventory implements IInventory, INBTTagable {
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override

View file

@ -66,7 +66,7 @@ public class PacketGuiReturn extends BuildCraftPacket {
int y = data.readInt();
int z = data.readInt();
TileEntity t = world.getBlockTileEntity(x, y, z);
TileEntity t = world.getTileEntity(x, y, z);
if (t instanceof IGuiReturnHandler)
((IGuiReturnHandler) t).readGuiData(data, sender);

View file

@ -54,7 +54,7 @@ public class PacketHandler extends BuildCraftChannelHandler {
PacketTileState pkt = (PacketTileState) packet;
pkt.readData(data);
World world = player.worldObj;
TileEntity tile = world.getBlockTileEntity(pkt.posX, pkt.posY, pkt.posZ);
TileEntity tile = world.getTileEntity(pkt.posX, pkt.posY, pkt.posZ);
if (tile instanceof ISyncedTile) {
pkt.applyStates(data, (ISyncedTile) tile);
}

View file

@ -28,7 +28,7 @@ public class PacketTileUpdate extends PacketUpdate {
}
public TileEntity getTarget(World world) {
return world.getBlockTileEntity(posX, posY, posZ);
return world.getTileEntity(posX, posY, posZ);
}
}

View file

@ -73,7 +73,7 @@ public class CoreProxy {
/* ENTITY HANDLING */
public void removeEntity(Entity entity) {
entity.worldObj.removeEntity(entity);
entity.getWorldObj().removeEntity(entity);
}
/* WRAPPER */
@ -199,7 +199,7 @@ public class CoreProxy {
if (CoreProxy.buildCraftPlayer == null) {
CoreProxy.buildCraftPlayer = createNewPlayer(world);
} else {
CoreProxy.buildCraftPlayer.worldObj = world;
CoreProxy.buildCraftPlayer.worldObj= world;
}
return CoreProxy.buildCraftPlayer;

View file

@ -66,8 +66,8 @@ public class CoreProxyClient extends CoreProxy {
public void removeEntity(Entity entity) {
super.removeEntity(entity);
if (isRenderWorld(entity.worldObj)) {
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId);
if (isRenderWorld(entity.getWorldObj())) {
((WorldClient) entity.getWorldObj()).removeEntityFromWorld(entity.entityId);
}
}

View file

@ -8,17 +8,21 @@
package buildcraft.core.render;
import buildcraft.core.render.RenderEntityBlock.RenderInfo;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
/**
@ -85,11 +89,11 @@ public class FluidRenderer {
diplayLists = new int[DISPLAY_STAGES];
if (fluid.getBlockID() > 0) {
liquidBlock.baseBlock = Block.blocksList[fluid.getBlockID()];
if (fluid.getBlock() != null) {
liquidBlock.baseBlock = fluid.getBlock();
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
} else {
liquidBlock.baseBlock = Block.waterStill;
liquidBlock.baseBlock = Blocks.water;
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
}

View file

@ -8,16 +8,20 @@
package buildcraft.core.render;
import buildcraft.core.EntityBlock;
import java.util.Arrays;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
public class RenderEntityBlock extends Render {
@ -37,7 +41,7 @@ public class RenderEntityBlock extends Render {
public double maxX;
public double maxY;
public double maxZ;
public Block baseBlock = Block.sand;
public Block baseBlock = Blocks.sand;
public IIcon texture = null;
public IIcon[] textureArray = null;
public boolean[] renderSide = new boolean[6];
@ -48,7 +52,7 @@ public class RenderEntityBlock extends Render {
setRenderAllSides();
}
public RenderInfo(Block template, Icon[] texture) {
public RenderInfo(Block template, IIcon[] texture) {
this();
this.baseBlock = template;
this.textureArray = texture;
@ -60,7 +64,7 @@ public class RenderEntityBlock extends Render {
}
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
return baseBlock.getBlockBrightness(iblockaccess, i, j, k);
return baseBlock.getMixedBrightnessForBlock(iblockaccess, i, j, k);
}
public final void setBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
@ -194,7 +198,7 @@ public class RenderEntityBlock extends Render {
float light = 0;
if (doLight) {
if (info.light < 0) {
light = info.baseBlock.getBlockBrightness(blockAccess, (int) lightX, (int) lightY, (int) lightZ);
light = info.baseBlock.getMixedBrightnessForBlock(blockAccess, (int) lightX, (int) lightY, (int) lightZ);
light = light + ((1.0f - light) * 0.4f);
} else
light = info.light;
@ -249,93 +253,4 @@ public class RenderEntityBlock extends Render {
if (doTessellating && tessellator.isDrawing)
tessellator.draw();
}
//
// public void renderBlock(RenderInfo block, IBlockAccess blockAccess, int i, int j, int k, boolean doLight, boolean doTessellating) {
// float f = 0.5F;
// float f1 = 1.0F;
// float f2 = 0.8F;
// float f3 = 0.6F;
//
// renderBlocks.renderMaxX = block.maxX;
// renderBlocks.renderMinX = block.minX;
// renderBlocks.renderMaxY = block.maxY;
// renderBlocks.renderMinY = block.minY;
// renderBlocks.renderMaxZ = block.maxZ;
// renderBlocks.renderMinZ = block.minZ;
// renderBlocks.enableAO = false;
//
//
// Tessellator tessellator = Tessellator.instance;
//
// if (doTessellating) {
// tessellator.startDrawingQuads();
// }
//
// float f4 = 0, f5 = 0;
//
// if (doLight) {
// f4 = block.getBlockBrightness(blockAccess, i, j, k);
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f * f5, f * f5, f * f5);
// }
//
// renderBlocks.renderFaceYNeg(null, 0, 0, 0, block.getBlockTextureFromSide(0));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5);
// }
//
// renderBlocks.renderFaceYPos(null, 0, 0, 0, block.getBlockTextureFromSide(1));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
// }
//
// renderBlocks.renderFaceZNeg(null, 0, 0, 0, block.getBlockTextureFromSide(2));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
// }
//
// renderBlocks.renderFaceZPos(null, 0, 0, 0, block.getBlockTextureFromSide(3));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
// }
//
// renderBlocks.renderFaceXNeg(null, 0, 0, 0, block.getBlockTextureFromSide(4));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
// }
//
// renderBlocks.renderFaceXPos(null, 0, 0, 0, block.getBlockTextureFromSide(5));
//
// if (doTessellating) {
// tessellator.draw();
// }
// }
}

View file

@ -106,7 +106,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
}
@Override
public boolean shouldRender3DInInventory() {
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@ -162,4 +162,6 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
}

View file

@ -22,7 +22,7 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
float f = block.getBlockBrightness(world, x, y, z);
float f = block.getMixedBrightnessForBlock(world, x, y, z);
if (Block.lightValue[block.blockID] > 0) {
f = 1.0F;
}
@ -33,7 +33,7 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
}
@Override
public boolean shouldRender3DInInventory() {
public boolean shouldRender3DInInventory(int modelId) {
return false;
}
@ -228,5 +228,4 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
face[j][3] = tmp;
}
}
}

View file

@ -23,7 +23,7 @@ public class RenderingOil implements ISimpleBlockRenderingHandler {
}
@Override
public boolean shouldRender3DInInventory() {
public boolean shouldRender3DInInventory(int modelId) {
return false;
}
@ -31,5 +31,4 @@ public class RenderingOil implements ISimpleBlockRenderingHandler {
public int getRenderId() {
return BuildCraftCore.oilModel;
}
}

View file

@ -28,7 +28,7 @@ public class DefaultActionProvider implements IActionProvider {
if (machine.allowAction(BuildCraftCore.actionLoop))
res.add(BuildCraftCore.actionLoop);
}
} catch (Throwable error) {
} catch (Throwable error) {
FMLLog.log("Buildcraft", Level.SEVERE, "Outdated API detected, please update your mods!");
}

View file

@ -13,7 +13,7 @@ import buildcraft.core.triggers.TriggerInventoryLevel.TriggerType;
import buildcraft.core.utils.StringUtils;
import java.util.Locale;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;

View file

@ -21,6 +21,7 @@ import net.minecraft.block.BlockFluid;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet60Explosion;
import net.minecraft.world.ChunkPosition;
@ -81,13 +82,11 @@ public class BlockUtil {
}
}
world.setBlock(x, y, z, 0);
world.setBlock(x, y, z, null);
}
public static boolean isAnObstructingBlock(int blockID, World world, int x, int y, int z) {
Block block = Block.blocksList[blockID];
if (blockID == 0 || block == null || block.isAirBlock(world, x, y, z))
public static boolean isAnObstructingBlock(Block block, World world, int x, int y, int z) {
if (block == null || block.isAirBlock(world, x, y, z))
return false;
return true;
}
@ -96,19 +95,17 @@ public class BlockUtil {
return canChangeBlock(world.getBlockId(x, y, z), world, x, y, z);
}
public static boolean canChangeBlock(int blockID, World world, int x, int y, int z) {
Block block = Block.blocksList[blockID];
if (blockID == 0 || block == null || block.isAirBlock(world, x, y, z))
public static boolean canChangeBlock(Block block, World world, int x, int y, int z) {
if (block == null || block.isAirBlock(world, x, y, z))
return true;
if (block.getBlockHardness(world, x, y, z) < 0)
return false;
if (blockID == BuildCraftEnergy.blockOil.blockID)
if (block == BuildCraftEnergy.blockOil)
return false;
if (blockID == Block.lavaStill.blockID || blockID == Block.lavaMoving.blockID)
if (block == Blocks.lava || block == Blocks.lava)
return false;
return true;
@ -118,10 +115,8 @@ public class BlockUtil {
return isSoftBlock(world.getBlockId(x, y, z), world, x, y, z);
}
public static boolean isSoftBlock(int blockID, World world, int x, int y, int z) {
Block block = Block.blocksList[blockID];
return blockID == 0 || block == null || BuildCraftAPI.softBlocks[blockID] || block.isAirBlock(world, x, y, z);
public static boolean isSoftBlock(Block block, World world, int x, int y, int z) {
return block == null || BuildCraftAPI.softBlocks[blockID] || block.isAirBlock(world, x, y, z);
}
/**
@ -142,35 +137,34 @@ public class BlockUtil {
return false;
}
public static Fluid getFluid(int blockId) {
Block block = Block.blocksList[blockId];
public static Fluid getFluid(Block block) {
if (block instanceof IFluidBlock) {
return ((IFluidBlock) block).getFluid();
} else if (blockId == Block.waterStill.blockID || blockId == Block.waterMoving.blockID) {
} else if (block == Blocks.water || block == Blocks.flowing_water) {
return FluidRegistry.WATER;
} else if (blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID) {
} else if (block == Blocks.lava || block == Blocks.flowing_lava) {
return FluidRegistry.LAVA;
}
return null;
}
public static FluidStack drainBlock(World world, int x, int y, int z, boolean doDrain) {
return drainBlock(world.getBlockId(x, y, z), world, x, y, z, doDrain);
return drainBlock(world.getBlock(x, y, z), world, x, y, z, doDrain);
}
public static FluidStack drainBlock(int blockId, World world, int x, int y, int z, boolean doDrain) {
if (Block.blocksList[blockId] instanceof IFluidBlock) {
IFluidBlock fluidBlock = (IFluidBlock) Block.blocksList[blockId];
public static FluidStack drainBlock(Block block, World world, int x, int y, int z, boolean doDrain) {
if (block instanceof IFluidBlock) {
IFluidBlock fluidBlock = (IFluidBlock) block;
if (fluidBlock.canDrain(world, x, y, z))
return fluidBlock.drain(world, x, y, z, doDrain);
} else if (blockId == Block.waterStill.blockID || blockId == Block.waterMoving.blockID) {
} else if (block == Blocks.water || block == Blocks.flowing_water) {
int meta = world.getBlockMetadata(x, y, z);
if (meta != 0)
return null;
if (doDrain)
world.setBlockToAir(x, y, z);
return new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME);
} else if (blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID) {
} else if (block == Blocks.lava || block == Blocks.lava) {
int meta = world.getBlockMetadata(x, y, z);
if (meta != 0)
return null;

View file

@ -74,7 +74,7 @@ public class Utils {
Position pos = new Position(x, y, z, orientation);
pos.moveForwards(1.0);
TileEntity tileInventory = world.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
TileEntity tileInventory = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
ITransactor transactor = Transactor.getTransactorFor(tileInventory);
if (transactor != null && !(tileInventory instanceof TileEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
return transactor.add(stack, orientation.getOpposite(), true).stackSize;
@ -150,7 +150,7 @@ public class Utils {
pos.moveForwards(1.0);
TileEntity tile = world.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
TileEntity tile = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
if (tile instanceof IPipeTile) {
IPipeTile pipe = (IPipeTile) tile;
@ -179,16 +179,16 @@ public class Utils {
tmp.orientation = step;
tmp.moveForwards(1.0);
return world.getBlockTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z);
return world.getTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z);
}
public static IAreaProvider getNearbyAreaProvider(World world, int i, int j, int k) {
TileEntity a1 = world.getBlockTileEntity(i + 1, j, k);
TileEntity a2 = world.getBlockTileEntity(i - 1, j, k);
TileEntity a3 = world.getBlockTileEntity(i, j, k + 1);
TileEntity a4 = world.getBlockTileEntity(i, j, k - 1);
TileEntity a5 = world.getBlockTileEntity(i, j + 1, k);
TileEntity a6 = world.getBlockTileEntity(i, j - 1, k);
TileEntity a1 = world.getTileEntity(i + 1, j, k);
TileEntity a2 = world.getTileEntity(i - 1, j, k);
TileEntity a3 = world.getTileEntity(i, j, k + 1);
TileEntity a4 = world.getTileEntity(i, j, k - 1);
TileEntity a5 = world.getTileEntity(i, j + 1, k);
TileEntity a6 = world.getTileEntity(i, j - 1, k);
if (a1 instanceof IAreaProvider) {
return (IAreaProvider) a1;
@ -309,7 +309,7 @@ public class Utils {
}
public static void preDestroyBlock(World world, int i, int j, int k) {
TileEntity tile = world.getBlockTileEntity(i, j, k);
TileEntity tile = world.getTileEntity(i, j, k);
if (tile instanceof IInventory && !CoreProxy.proxy.isRenderWorld(world)) {
if (!(tile instanceof IDropControlInventory) || ((IDropControlInventory) tile).doDrop()) {

View file

@ -12,7 +12,10 @@ import buildcraft.energy.render.EntityDropParticleFX;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -33,8 +36,8 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
protected float particleGreen;
protected float particleBlue;
public BlockBuildcraftFluid(int id, Fluid fluid, Material material) {
super(id, fluid, material);
public BlockBuildcraftFluid(Fluid fluid, Material material) {
super(fluid, material);
}
@SideOnly(Side.CLIENT)
protected IIcon[] theIcon;
@ -48,13 +51,13 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.theIcon = new Icon[] { iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow") };
public void registerBlockIcons(IIconRegister iconRegister) {
this.theIcon = new IIcon[] { iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow") };
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockId) {
super.onNeighborBlockChange(world, x, y, z, blockId);
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
super.onNeighborBlockChange(world, x, y, z, block);
if (flammable && world.provider.dimensionId == -1) {
world.newExplosion(null, x, y, z, 4F, true, true);
world.setBlockToAir(x, y, z);
@ -103,7 +106,7 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
super.randomDisplayTick(world, x, y, z, rand);
if (rand.nextInt(10) == 0 && world.doesBlockHaveSolidTopSurface(x, y - 1, z) && !world.getBlockMaterial(x, y - 2, z).blocksMovement()) {
if (rand.nextInt(10) == 0 && world.doesBlockHaveSolidTopSurface(x, y - 1, z) && !world.getBlock(x, y - 2, z).getMaterial().blocksMovement()) {
double px = (double) ((float) x + rand.nextFloat());
double py = (double) y - 1.05D;
double pz = (double) ((float) z + rand.nextFloat());
@ -115,14 +118,14 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
if (world.getBlockMaterial(x, y, z).isLiquid())
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.canDisplace(world, x, y, z);
}
@Override
public boolean displaceIfPossible(World world, int x, int y, int z) {
if (world.getBlockMaterial(x, y, z).isLiquid())
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.displaceIfPossible(world, x, y, z);
}

View file

@ -12,15 +12,20 @@ import buildcraft.core.BlockBuildCraft;
import buildcraft.core.IItemPipe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
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;
@ -30,9 +35,9 @@ public class BlockEngine extends BlockBuildCraft {
private static IIcon stoneTexture;
private static IIcon ironTexture;
public BlockEngine(int i) {
super(i, Material.iron);
setUnlocalizedName("engineBlock");
public BlockEngine() {
super(Material.iron);
setBlockName("engineBlock");
}
@Override
@ -47,7 +52,7 @@ public class BlockEngine extends BlockBuildCraft {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister par1IconRegister) {
woodTexture = par1IconRegister.registerIcon("buildcraft:engineWoodBottom");
stoneTexture = par1IconRegister.registerIcon("buildcraft:engineStoneBottom");
ironTexture = par1IconRegister.registerIcon("buildcraft:engineIronBottom");
@ -69,8 +74,8 @@ public class BlockEngine extends BlockBuildCraft {
}
@Override
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
TileEntity tile = world.getBlockTileEntity(x, y, z);
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEngine) {
return ((TileEngine) tile).orientation.getOpposite() == side;
}
@ -79,7 +84,7 @@ public class BlockEngine extends BlockBuildCraft {
@Override
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEngine) {
return ((TileEngine) tile).switchOrientation(false);
}
@ -89,7 +94,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.getBlockTileEntity(i, j, k);
TileEngine tile = (TileEngine) world.getTileEntity(i, j, k);
// Drop through if the player is sneaking
if (player.isSneaking())
@ -111,7 +116,7 @@ public class BlockEngine extends BlockBuildCraft {
@Override
public void onPostBlockPlaced(World world, int x, int y, int z, int par5) {
TileEngine tile = (TileEngine) world.getBlockTileEntity(x, y, z);
TileEngine tile = (TileEngine) world.getTileEntity(x, y, z);
tile.orientation = ForgeDirection.UP;
if (!tile.isOrientationValid())
tile.switchOrientation(true);
@ -125,7 +130,7 @@ 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.getBlockTileEntity(i, j, k);
TileEngine tile = (TileEngine) world.getTileEntity(i, j, k);
if (!tile.isBurning())
return;
@ -144,15 +149,15 @@ public class BlockEngine extends BlockBuildCraft {
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void getSubBlocks(int blockid, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) {
itemList.add(new ItemStack(this, 1, 0));
itemList.add(new ItemStack(this, 1, 1));
itemList.add(new ItemStack(this, 1, 2));
}
@Override
public void onNeighborBlockChange(World world, int i, int j, int k, int l) {
TileEngine tile = (TileEngine) world.getBlockTileEntity(i, j, k);
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
TileEngine tile = (TileEngine) world.getTileEntity(x, y, z);
if (tile != null) {
tile.checkRedstonePower();
@ -175,7 +180,7 @@ public class BlockEngine extends BlockBuildCraft {
}
@Override
public TileEntity createNewTileEntity(World world) {
public TileEntity createNewTileEntity(World world, int metadata) {
return null;
}
}

View file

@ -1,47 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockPollution extends BlockContainer {
public BlockPollution(int i) {
super(i, Material.air);
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public TileEntity createNewTileEntity(World var1) {
return new TilePollution();
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
par1IconRegister.registerIcon("buildcraft:blockPollution");
}
}

View file

@ -35,7 +35,7 @@ public class BptBlockEngine extends BptBlock {
@Override
public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) {
TileEngine engine = (TileEngine) context.world().getBlockTileEntity(x, y, z);
TileEngine engine = (TileEngine) context.world().getTileEntity(x, y, z);
bptSlot.cpt.setInteger("orientation", engine.orientation.ordinal());
}
@ -44,7 +44,7 @@ public class BptBlockEngine extends BptBlock {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
TileEngine engine = (TileEngine) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
TileEngine engine = (TileEngine) context.world().getTileEntity(slot.x, slot.y, slot.z);
engine.orientation = ForgeDirection.getOrientation(slot.cpt.getInteger("orientation"));
}

View file

@ -41,11 +41,11 @@ public class BucketHandler {
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
int blockID = world.getBlockId(pos.blockX, pos.blockY, pos.blockZ);
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Item bucket = buckets.get(Block.blocksList[blockID]);
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, null);
return new ItemStack(bucket);
} else
return null;

View file

@ -17,7 +17,7 @@ public class GuiHandler implements IGuiHandler {
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileEngineWithInventory))
return null;
@ -42,7 +42,7 @@ public class GuiHandler implements IGuiHandler {
if (!world.blockExists(x, y, z))
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileEngineWithInventory))
return null;

View file

@ -11,7 +11,9 @@ import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.utils.StringUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
@ -20,10 +22,10 @@ public class ItemBucketBuildcraft extends ItemBucket {
private String iconName;
public ItemBucketBuildcraft(int i, int blockId) {
super(i, blockId);
public ItemBucketBuildcraft(Block block) {
super(block);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
setContainerItem(Item.bucketEmpty);
setContainerItem(Items.bucket);
}
@Override
@ -32,9 +34,9 @@ public class ItemBucketBuildcraft extends ItemBucket {
}
@Override
public Item setUnlocalizedName(String par1Str) {
public Item setBlockName(String par1Str) {
iconName = par1Str;
return super.setUnlocalizedName(par1Str);
return super.setBlockName(par1Str);
}
@Override

View file

@ -431,4 +431,9 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
return triggers;
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -24,8 +24,8 @@ public class TileEngineLegacy extends TileEngine {
@Override
public void updateEntity() {
worldObj.removeBlockTileEntity(xCoord, yCoord, zCoord);
TileEntity newTile = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord);
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
TileEntity newTile = worldObj.getTileEntity(xCoord, yCoord, zCoord);
if (newTile instanceof TileEngine) {
newTile.readFromNBT(nbt);
sendNetworkUpdate();

View file

@ -162,4 +162,9 @@ public class TileEngineStone extends TileEngineWithInventory {
return triggers;
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
}

View file

@ -47,7 +47,7 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
}
@Override
public String getInvName() {
public String getInventoryName() {
return "Engine";
}
@ -58,15 +58,15 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
}
@Override
public void openChest() {
public void openInventory() {
}
@Override
public void closeChest() {
public void closeInventory() {
}
@Override

View file

@ -1,54 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.core.BlockIndex;
import net.minecraft.tileentity.TileEntity;
public class TilePollution extends TileEntity {
public boolean init = false;
public SafeTimeTracker timeTracker = new SafeTimeTracker();
public int saturation = 0; /* from 0 to 100 */
@Override
public void updateEntity() {
if (!init) {
init = true;
timeTracker.markTime(worldObj);
BlockIndex index = new BlockIndex(xCoord, yCoord, zCoord);
if (BuildCraftEnergy.saturationStored.containsKey(index)) {
saturation = BuildCraftEnergy.saturationStored.remove(index);
} else {
saturation = 1;
}
} else {
if (timeTracker.markTimeIfDelay(worldObj, 20)) {
// int remaining = BuildCraftEnergy.createPollution(worldObj,
// xCoord, yCoord, zCoord, saturation);
//
// saturation = remaining;
//
// if (remaining == 0) {
// worldObj.setBlockWithNotify(xCoord, yCoord, zCoord, 0);
// } else {
// worldObj.setBlockMetadata(xCoord, yCoord, zCoord,
// saturation * 16 / 100);
// worldObj.markBlockNeedsUpdate(zCoord, yCoord, zCoord);
// }
}
}
}
}

View file

@ -80,7 +80,7 @@ public class EntityDropParticleFX extends EntityFX {
this.motionZ *= 0.699999988079071D;
}
Material material = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial();
if (material.isLiquid() || material.isSolid()) {
double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));

View file

@ -20,12 +20,12 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import static net.minecraftforge.common.ForgeDirection.DOWN;
import static net.minecraftforge.common.ForgeDirection.EAST;
import static net.minecraftforge.common.ForgeDirection.NORTH;
import static net.minecraftforge.common.ForgeDirection.SOUTH;
import static net.minecraftforge.common.ForgeDirection.UP;
import static net.minecraftforge.common.ForgeDirection.WEST;
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
import static net.minecraftforge.common.util.ForgeDirection.EAST;
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
import static net.minecraftforge.common.util.ForgeDirection.UP;
import static net.minecraftforge.common.util.ForgeDirection.WEST;
import org.lwjgl.opengl.GL11;
public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer {

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