made progress with 1.7.2 port
This commit is contained in:
parent
87562542c9
commit
2bc0a85bbe
183 changed files with 1126 additions and 1325 deletions
|
@ -86,6 +86,8 @@ import java.util.LinkedList;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -129,6 +131,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
// Register save handler
|
// Register save handler
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
|
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
|
||||||
|
|
||||||
|
/*
|
||||||
new BptBlock(0); // default bpt block
|
new BptBlock(0); // default bpt block
|
||||||
|
|
||||||
new BptBlockIgnore(Block.snow.blockID);
|
new BptBlockIgnore(Block.snow.blockID);
|
||||||
|
@ -214,7 +217,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
new BptBlockInventory(libraryBlock.blockID);
|
new BptBlockInventory(libraryBlock.blockID);
|
||||||
|
|
||||||
new BptBlockWallSide(markerBlock.blockID);
|
new BptBlockWallSide(markerBlock.blockID);
|
||||||
new BptBlockWallSide(pathMarkerBlock.blockID);
|
new BptBlockWallSide(pathMarkerBlock.blockID);*/
|
||||||
|
|
||||||
if (BuildCraftCore.loadDefaultRecipes) {
|
if (BuildCraftCore.loadDefaultRecipes) {
|
||||||
loadRecipes();
|
loadRecipes();
|
||||||
|
@ -224,15 +227,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent evt) {
|
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);
|
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.";
|
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
|
||||||
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
|
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)";
|
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);
|
fillerLifespanNormal = fillerLifespanNormalProp.getInt(DefaultProps.FILLER_LIFESPAN_NORMAL);
|
||||||
|
|
||||||
templateItem = new ItemBptTemplate(templateItemId.getInt());
|
templateItem = new ItemBptTemplate();
|
||||||
templateItem.setUnlocalizedName("templateItem");
|
templateItem.setBlockName("templateItem");
|
||||||
LanguageRegistry.addName(templateItem, "Template");
|
LanguageRegistry.addName(templateItem, "Template");
|
||||||
CoreProxy.proxy.registerItem(templateItem);
|
CoreProxy.proxy.registerItem(templateItem);
|
||||||
|
|
||||||
blueprintItem = new ItemBptBluePrint(blueprintItemId.getInt());
|
blueprintItem = new ItemBptBluePrint();
|
||||||
blueprintItem.setUnlocalizedName("blueprintItem");
|
blueprintItem.setBlockName("blueprintItem");
|
||||||
LanguageRegistry.addName(blueprintItem, "Blueprint");
|
LanguageRegistry.addName(blueprintItem, "Blueprint");
|
||||||
CoreProxy.proxy.registerItem(blueprintItem);
|
CoreProxy.proxy.registerItem(blueprintItem);
|
||||||
|
|
||||||
markerBlock = new BlockMarker(markerId.getInt());
|
markerBlock = new BlockMarker();
|
||||||
CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock"));
|
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
|
||||||
CoreProxy.proxy.addName(markerBlock, "Land Mark");
|
CoreProxy.proxy.addName(markerBlock, "Land Mark");
|
||||||
|
|
||||||
pathMarkerBlock = new BlockPathMarker(pathMarkerId.getInt());
|
pathMarkerBlock = new BlockPathMarker();
|
||||||
CoreProxy.proxy.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"));
|
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
|
||||||
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
|
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
|
||||||
|
|
||||||
fillerBlock = new BlockFiller(fillerId.getInt());
|
fillerBlock = new BlockFiller();
|
||||||
CoreProxy.proxy.registerBlock(fillerBlock.setUnlocalizedName("fillerBlock"));
|
CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
|
||||||
CoreProxy.proxy.addName(fillerBlock, "Filler");
|
CoreProxy.proxy.addName(fillerBlock, "Filler");
|
||||||
|
|
||||||
builderBlock = new BlockBuilder(builderId.getInt());
|
builderBlock = new BlockBuilder();
|
||||||
CoreProxy.proxy.registerBlock(builderBlock.setUnlocalizedName("builderBlock"));
|
CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
|
||||||
CoreProxy.proxy.addName(builderBlock, "Builder");
|
CoreProxy.proxy.addName(builderBlock, "Builder");
|
||||||
|
|
||||||
architectBlock = new BlockArchitect(architectId.getInt());
|
architectBlock = new BlockArchitect();
|
||||||
CoreProxy.proxy.registerBlock(architectBlock.setUnlocalizedName("architectBlock"));
|
CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
|
||||||
CoreProxy.proxy.addName(architectBlock, "Architect Table");
|
CoreProxy.proxy.addName(architectBlock, "Architect Table");
|
||||||
|
|
||||||
libraryBlock = new BlockBlueprintLibrary(libraryId.getInt());
|
libraryBlock = new BlockBlueprintLibrary();
|
||||||
CoreProxy.proxy.registerBlock(libraryBlock.setUnlocalizedName("libraryBlock"));
|
CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
|
||||||
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
|
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileMarker.class, "Marker");
|
GameRegistry.registerTileEntity(TileMarker.class, "Marker");
|
||||||
|
@ -322,14 +316,14 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
// new ItemStack(Item.dyePowder, 1, 4), 'p', Item.paper});
|
// new ItemStack(Item.dyePowder, 1, 4), 'p', Item.paper});
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", 'l',
|
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',
|
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", 'l',
|
||||||
// new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
|
// new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
|
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),
|
new ItemStack(Items.dye, 1, 0), 't', markerBlock, 'y', new ItemStack(Items.dye, 1, 11),
|
||||||
'c', Block.workbench, 'g', BuildCraftCore.goldGearItem, 'C', Block.chest});
|
'c', Blocks.crafting_table, 'g', BuildCraftCore.goldGearItem, 'C', Blocks.chest});
|
||||||
|
|
||||||
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
|
// 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),
|
// 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;
|
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);
|
ItemStack stack = new ItemStack(id, 1, damage);
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
if (name != null && !"".equals(name)) {
|
if (name != null && !"".equals(name)) {
|
||||||
|
@ -391,7 +385,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
stack.setTagCompound(nbt);
|
stack.setTagCompound(nbt);
|
||||||
}
|
}
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public static void addHook(IBuilderHook hook) {
|
public static void addHook(IBuilderHook hook) {
|
||||||
if (!hooks.contains(hook)) {
|
if (!hooks.contains(hook)) {
|
||||||
|
|
|
@ -18,6 +18,8 @@ import net.minecraft.block.BlockFluid;
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
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.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
|
@ -156,7 +158,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
public static boolean loadDefaultRecipes = true;
|
public static boolean loadDefaultRecipes = true;
|
||||||
public static boolean forcePneumaticPower = true;
|
public static boolean forcePneumaticPower = true;
|
||||||
public static boolean consumeWaterSources = false;
|
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")
|
@Instance("BuildCraft|Core")
|
||||||
public static BuildCraftCore instance;
|
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.";
|
longFactor.comment = "delay between full client sync packets, increasing it saves bandwidth, decreasing makes for better client syncronization.";
|
||||||
longUpdateFactor = longFactor.getInt(40);
|
longUpdateFactor = longFactor.getInt(40);
|
||||||
|
|
||||||
Property wrenchId = BuildCraftCore.mainConfiguration.getItem("wrench.id", DefaultProps.WRENCH_ID);
|
wrenchItem = (new ItemWrench()).setBlockName("wrenchItem");
|
||||||
|
|
||||||
wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setUnlocalizedName("wrenchItem");
|
|
||||||
LanguageRegistry.addName(wrenchItem, "Wrench");
|
LanguageRegistry.addName(wrenchItem, "Wrench");
|
||||||
CoreProxy.proxy.registerItem(wrenchItem);
|
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);
|
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)";
|
modifyWorldProp.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
|
||||||
modifyWorld = modifyWorldProp.getBoolean(true);
|
modifyWorld = modifyWorldProp.getBoolean(true);
|
||||||
|
|
||||||
if (BuildCraftCore.modifyWorld && springId > 0) {
|
if (BuildCraftCore.modifyWorld) {
|
||||||
BlockSpring.EnumSpring.WATER.canGen = BuildCraftCore.mainConfiguration.get("worldgen", "waterSpring", true).getBoolean(true);
|
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);
|
CoreProxy.proxy.registerBlock(springBlock, ItemSpring.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,27 +226,27 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
|
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
|
||||||
consumeWater.comment = "set to true if the Pump should consume water";
|
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");
|
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
|
||||||
CoreProxy.proxy.registerItem(woodenGearItem);
|
CoreProxy.proxy.registerItem(woodenGearItem);
|
||||||
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
|
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
|
||||||
|
|
||||||
stoneGearItem = (new ItemBuildCraft(stoneGearId.getInt())).setUnlocalizedName("stoneGearItem");
|
stoneGearItem = (new ItemBuildCraft()).setBlockName("stoneGearItem");
|
||||||
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
|
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
|
||||||
CoreProxy.proxy.registerItem(stoneGearItem);
|
CoreProxy.proxy.registerItem(stoneGearItem);
|
||||||
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
|
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
|
||||||
|
|
||||||
ironGearItem = (new ItemBuildCraft(ironGearId.getInt())).setUnlocalizedName("ironGearItem");
|
ironGearItem = (new ItemBuildCraft()).setBlockName("ironGearItem");
|
||||||
LanguageRegistry.addName(ironGearItem, "Iron Gear");
|
LanguageRegistry.addName(ironGearItem, "Iron Gear");
|
||||||
CoreProxy.proxy.registerItem(ironGearItem);
|
CoreProxy.proxy.registerItem(ironGearItem);
|
||||||
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
|
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
|
||||||
|
|
||||||
goldGearItem = (new ItemBuildCraft(goldenGearId.getInt())).setUnlocalizedName("goldGearItem");
|
goldGearItem = (new ItemBuildCraft()).setBlockName("goldGearItem");
|
||||||
LanguageRegistry.addName(goldGearItem, "Gold Gear");
|
LanguageRegistry.addName(goldGearItem, "Gold Gear");
|
||||||
CoreProxy.proxy.registerItem(goldGearItem);
|
CoreProxy.proxy.registerItem(goldGearItem);
|
||||||
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
|
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
|
||||||
|
|
||||||
diamondGearItem = (new ItemBuildCraft(diamondGearId.getInt())).setUnlocalizedName("diamondGearItem");
|
diamondGearItem = (new ItemBuildCraft()).setBlockName("diamondGearItem");
|
||||||
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
|
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
|
||||||
CoreProxy.proxy.registerItem(diamondGearItem);
|
CoreProxy.proxy.registerItem(diamondGearItem);
|
||||||
OreDictionary.registerOre("gearDiamond", new ItemStack(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.vine.blockID] = true;
|
||||||
BuildCraftAPI.softBlocks[Block.fire.blockID] = true;
|
BuildCraftAPI.softBlocks[Block.fire.blockID] = true;
|
||||||
TickRegistry.registerTickHandler(new TickHandlerCoreClient(), Side.CLIENT);
|
TickRegistry.registerTickHandler(new TickHandlerCoreClient(), Side.CLIENT);
|
||||||
|
@ -340,13 +333,13 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadRecipes() {
|
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(woodenGearItem), " S ", "S S", " S ", 'S', "stickWood");
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", 'I', "cobblestone", 'G',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", 'I', "cobblestone", 'G',
|
||||||
woodenGearItem);
|
woodenGearItem);
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
|
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', Item.ingotGold, 'G', ironGearItem);
|
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', Item.diamond, 'G', goldGearItem);
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Items.diamond, 'G', goldGearItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
@ -40,14 +40,17 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
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.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
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.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
@ -91,19 +94,13 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent evt) {
|
public void preInit(FMLPreInitializationEvent evt) {
|
||||||
Property engineId = BuildCraftCore.mainConfiguration.getBlock("engine.id", DefaultProps.ENGINE_ID);
|
|
||||||
|
|
||||||
// Update oil tag
|
// Update oil tag
|
||||||
int defaultOilId = DefaultProps.OIL_ID;
|
int defaultOilId = DefaultProps.OIL_ID;
|
||||||
if (BuildCraftCore.mainConfiguration.hasKey(Configuration.CATEGORY_BLOCK, "oilStill.id")) {
|
if (BuildCraftCore.mainConfiguration.hasKey(Configuration.CATEGORY_BLOCK, "oilStill.id")) {
|
||||||
defaultOilId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "oilStill.id", defaultOilId).getInt(defaultOilId);
|
defaultOilId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "oilStill.id", defaultOilId).getInt(defaultOilId);
|
||||||
BuildCraftCore.mainConfiguration.getCategory(Configuration.CATEGORY_BLOCK).remove("oilStill.id");
|
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 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);
|
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);
|
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);
|
CoreProxy.proxy.registerBlock(engineBlock, ItemEngine.class);
|
||||||
|
|
||||||
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
|
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
|
||||||
|
@ -153,16 +150,14 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
FluidRegistry.registerFluid(buildcraftFluidFuel);
|
FluidRegistry.registerFluid(buildcraftFluidFuel);
|
||||||
fluidFuel = FluidRegistry.getFluid("fuel");
|
fluidFuel = FluidRegistry.getFluid("fuel");
|
||||||
|
|
||||||
if (fluidOil.getBlockID() == -1) {
|
if (fluidOil.getBlock() == null) {
|
||||||
if (blockOilId > 0) {
|
blockOil = new BlockBuildcraftFluid(fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
|
||||||
blockOil = new BlockBuildcraftFluid(blockOilId, fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
|
blockOil.setBlockName("blockOil");
|
||||||
blockOil.setUnlocalizedName("blockOil");
|
|
||||||
CoreProxy.proxy.addName(blockOil, "Oil");
|
CoreProxy.proxy.addName(blockOil, "Oil");
|
||||||
CoreProxy.proxy.registerBlock(blockOil);
|
CoreProxy.proxy.registerBlock(blockOil);
|
||||||
fluidOil.setBlockID(blockOil);
|
fluidOil.setBlock(blockOil);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
blockOil = Block.blocksList[fluidOil.getBlockID()];
|
blockOil = fluidOil.getBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockOil != null) {
|
if (blockOil != null) {
|
||||||
|
@ -171,34 +166,32 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
BlockSpring.EnumSpring.OIL.liquidBlock = blockOil;
|
BlockSpring.EnumSpring.OIL.liquidBlock = blockOil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fluidFuel.getBlockID() == -1) {
|
if (fluidFuel.getBlock() == null) {
|
||||||
if (blockFuelId > 0) {
|
blockFuel = new BlockBuildcraftFluid(fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
|
||||||
blockFuel = new BlockBuildcraftFluid(blockFuelId, fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
|
blockFuel.setBlockName("blockFuel");
|
||||||
blockFuel.setUnlocalizedName("blockFuel");
|
|
||||||
CoreProxy.proxy.addName(blockFuel, "Fuel");
|
CoreProxy.proxy.addName(blockFuel, "Fuel");
|
||||||
CoreProxy.proxy.registerBlock(blockFuel);
|
CoreProxy.proxy.registerBlock(blockFuel);
|
||||||
fluidFuel.setBlockID(blockFuel);
|
fluidFuel.setBlock(blockFuel);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
blockFuel = Block.blocksList[fluidFuel.getBlockID()];
|
blockFuel = fluidFuel.getBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buckets
|
// Buckets
|
||||||
|
|
||||||
if (blockOil != null && bucketOilId > 0) {
|
if (blockOil != null) {
|
||||||
bucketOil = new ItemBucketBuildcraft(bucketOilId, blockOil.blockID);
|
bucketOil = new ItemBucketBuildcraft(blockOil);
|
||||||
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty);
|
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
|
||||||
LanguageRegistry.addName(bucketOil, "Oil Bucket");
|
LanguageRegistry.addName(bucketOil, "Oil Bucket");
|
||||||
CoreProxy.proxy.registerItem(bucketOil);
|
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) {
|
if (blockFuel != null) {
|
||||||
bucketFuel = new ItemBucketBuildcraft(bucketFuelId, blockFuel.blockID);
|
bucketFuel = new ItemBucketBuildcraft(blockFuel);
|
||||||
bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty);
|
bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Items.bucket);
|
||||||
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
|
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
|
||||||
CoreProxy.proxy.registerItem(bucketFuel);
|
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);
|
BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
|
||||||
|
@ -214,7 +207,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
|
|
||||||
// Iron Engine Coolants
|
// Iron Engine Coolants
|
||||||
IronEngineCoolant.addCoolant(FluidRegistry.getFluid("water"), 0.0023F);
|
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);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +216,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
public void init(FMLInitializationEvent evt) {
|
public void init(FMLInitializationEvent evt) {
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
||||||
|
|
||||||
new BptBlockEngine(engineBlock.blockID);
|
//new BptBlockEngine(engineBlock.blockID);
|
||||||
|
|
||||||
if (BuildCraftCore.loadDefaultRecipes) {
|
if (BuildCraftCore.loadDefaultRecipes) {
|
||||||
loadRecipes();
|
loadRecipes();
|
||||||
|
@ -251,116 +244,16 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
|
|
||||||
public static void loadRecipes() {
|
public static void loadRecipes() {
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
|
||||||
new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Block.glass, 'G',
|
new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Blocks.glass, 'G',
|
||||||
BuildCraftCore.woodenGearItem, 'p', Block.pistonBase});
|
BuildCraftCore.woodenGearItem, 'p', Blocks.piston});
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", 'w', "cobblestone",
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", 'w', "cobblestone",
|
||||||
'g', Block.glass, 'G', BuildCraftCore.stoneGearItem, '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', Item.ingotIron,
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Items.iron_ingot,
|
||||||
'g', Block.glass, 'G', BuildCraftCore.ironGearItem, 'p', Block.pistonBase});
|
'g', Blocks.glass, 'G', BuildCraftCore.ironGearItem, 'p', Blocks.piston});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
|
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
|
||||||
InterModComms.processIMC(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);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,8 @@ import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
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.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -106,7 +108,7 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
int quarryX = ticket.getModData().getInteger("quarryX");
|
int quarryX = ticket.getModData().getInteger("quarryX");
|
||||||
int quarryY = ticket.getModData().getInteger("quarryY");
|
int quarryY = ticket.getModData().getInteger("quarryY");
|
||||||
int quarryZ = ticket.getModData().getInteger("quarryZ");
|
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);
|
tq.forceChunkLoading(ticket);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -146,10 +148,10 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
|
|
||||||
FactoryProxy.proxy.initializeTileEntities();
|
FactoryProxy.proxy.initializeTileEntities();
|
||||||
|
|
||||||
new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
|
//new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
|
||||||
new BptBlockFrame(frameBlock.blockID);
|
//new BptBlockFrame(frameBlock.blockID);
|
||||||
new BptBlockRefinery(refineryBlock.blockID);
|
//new BptBlockRefinery(refineryBlock.blockID);
|
||||||
new BptBlockTank(tankBlock.blockID);
|
//new BptBlockTank(tankBlock.blockID);
|
||||||
|
|
||||||
if (BuildCraftCore.loadDefaultRecipes) {
|
if (BuildCraftCore.loadDefaultRecipes) {
|
||||||
loadRecipes();
|
loadRecipes();
|
||||||
|
@ -175,71 +177,51 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
+ "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
|
+ "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
|
||||||
pumpDimensionList = new PumpDimensionList(pumpList.getString());
|
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()) {
|
if (BuildCraftCore.mainConfiguration.hasChanged()) {
|
||||||
BuildCraftCore.mainConfiguration.save();
|
BuildCraftCore.mainConfiguration.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (miningWellId > 0) {
|
|
||||||
miningWellBlock = new BlockMiningWell(miningWellId);
|
miningWellBlock = new BlockMiningWell();
|
||||||
CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"));
|
CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
|
||||||
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
|
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
|
||||||
}
|
|
||||||
if (plainPipeId > 0) {
|
plainPipeBlock = new BlockPlainPipe();
|
||||||
plainPipeBlock = new BlockPlainPipe(plainPipeId);
|
CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
|
||||||
CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"));
|
|
||||||
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
|
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
|
||||||
}
|
|
||||||
if (autoWorkbenchId > 0) {
|
autoWorkbenchBlock = new BlockAutoWorkbench();
|
||||||
autoWorkbenchBlock = new BlockAutoWorkbench(autoWorkbenchId);
|
CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
|
||||||
CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"));
|
|
||||||
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
|
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
|
||||||
}
|
|
||||||
if (frameId > 0) {
|
frameBlock = new BlockFrame();
|
||||||
frameBlock = new BlockFrame(frameId);
|
CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock"));
|
||||||
CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock"));
|
|
||||||
CoreProxy.proxy.addName(frameBlock, "Frame");
|
CoreProxy.proxy.addName(frameBlock, "Frame");
|
||||||
}
|
|
||||||
if (quarryId > 0) {
|
quarryBlock = new BlockQuarry();
|
||||||
quarryBlock = new BlockQuarry(quarryId);
|
CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
|
||||||
CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock"));
|
|
||||||
CoreProxy.proxy.addName(quarryBlock, "Quarry");
|
CoreProxy.proxy.addName(quarryBlock, "Quarry");
|
||||||
}
|
|
||||||
if (tankId > 0) {
|
tankBlock = new BlockTank();
|
||||||
tankBlock = new BlockTank(tankId);
|
CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock"));
|
||||||
CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock"));
|
|
||||||
CoreProxy.proxy.addName(tankBlock, "Tank");
|
CoreProxy.proxy.addName(tankBlock, "Tank");
|
||||||
}
|
|
||||||
if (pumpId > 0) {
|
pumpBlock = new BlockPump();
|
||||||
pumpBlock = new BlockPump(pumpId);
|
CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock"));
|
||||||
CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"));
|
|
||||||
CoreProxy.proxy.addName(pumpBlock, "Pump");
|
CoreProxy.proxy.addName(pumpBlock, "Pump");
|
||||||
}
|
|
||||||
if (floodGateId > 0) {
|
floodGateBlock = new BlockFloodGate();
|
||||||
floodGateBlock = new BlockFloodGate(floodGateId);
|
CoreProxy.proxy.registerBlock(floodGateBlock.setBlockName("floodGateBlock"));
|
||||||
CoreProxy.proxy.registerBlock(floodGateBlock.setUnlocalizedName("floodGateBlock"));
|
|
||||||
CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
|
CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
|
||||||
}
|
|
||||||
if (refineryId > 0) {
|
refineryBlock = new BlockRefinery();
|
||||||
refineryBlock = new BlockRefinery(refineryId);
|
CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock"));
|
||||||
CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"));
|
|
||||||
CoreProxy.proxy.addName(refineryBlock, "Refinery");
|
CoreProxy.proxy.addName(refineryBlock, "Refinery");
|
||||||
}
|
|
||||||
if (hopperId > 0) {
|
hopperBlock = new BlockHopper();
|
||||||
hopperBlock = new BlockHopper(hopperId);
|
CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper"));
|
||||||
CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper"));
|
|
||||||
CoreProxy.proxy.addName(hopperBlock, "Hopper");
|
CoreProxy.proxy.addName(hopperBlock, "Hopper");
|
||||||
}
|
|
||||||
|
|
||||||
FactoryProxy.proxy.initializeEntityRenders();
|
FactoryProxy.proxy.initializeEntityRenders();
|
||||||
if (BuildCraftCore.mainConfiguration.hasChanged()) {
|
if (BuildCraftCore.mainConfiguration.hasChanged()) {
|
||||||
|
@ -257,10 +239,10 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
"ipi",
|
"ipi",
|
||||||
"igi",
|
"igi",
|
||||||
"iPi",
|
"iPi",
|
||||||
'p', Item.redstone,
|
'p', Items.redstone,
|
||||||
'i', Item.ingotIron,
|
'i', Items.iron_ingot,
|
||||||
'g', BuildCraftCore.ironGearItem,
|
'g', BuildCraftCore.ironGearItem,
|
||||||
'P', Item.pickaxeIron);
|
'P', Items.iron_pickaxe);
|
||||||
|
|
||||||
if (quarryBlock != null)
|
if (quarryBlock != null)
|
||||||
CoreProxy.proxy.addCraftingRecipe(
|
CoreProxy.proxy.addCraftingRecipe(
|
||||||
|
@ -269,16 +251,16 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
"gig",
|
"gig",
|
||||||
"dDd",
|
"dDd",
|
||||||
'i', BuildCraftCore.ironGearItem,
|
'i', BuildCraftCore.ironGearItem,
|
||||||
'p', Item.redstone,
|
'p', Items.redstone,
|
||||||
'g', BuildCraftCore.goldGearItem,
|
'g', BuildCraftCore.goldGearItem,
|
||||||
'd', BuildCraftCore.diamondGearItem,
|
'd', BuildCraftCore.diamondGearItem,
|
||||||
'D', Item.pickaxeDiamond);
|
'D', Items.diamond_pickaxe);
|
||||||
|
|
||||||
if (pumpBlock != null && miningWellBlock != null)
|
if (pumpBlock != null && miningWellBlock != null)
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock),
|
||||||
"T",
|
"T",
|
||||||
"W",
|
"W",
|
||||||
'T', tankBlock != null ? tankBlock : Block.glass,
|
'T', tankBlock != null ? tankBlock : Blocks.glass,
|
||||||
'W', miningWellBlock);
|
'W', miningWellBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,9 +270,9 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
"iri",
|
"iri",
|
||||||
"iTi",
|
"iTi",
|
||||||
"gpg",
|
"gpg",
|
||||||
'r', Item.redstone,
|
'r', Items.redstone,
|
||||||
'i', Item.ingotIron,
|
'i', Items.iron_ingot,
|
||||||
'T', tankBlock != null ? tankBlock : Block.glass,
|
'T', tankBlock != null ? tankBlock : Blocks.glass,
|
||||||
'g', BuildCraftCore.ironGearItem,
|
'g', BuildCraftCore.ironGearItem,
|
||||||
'p', BuildCraftTransport.pipeFluidsGold);
|
'p', BuildCraftTransport.pipeFluidsGold);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +282,7 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
" g ",
|
" g ",
|
||||||
"gwg",
|
"gwg",
|
||||||
" g ",
|
" g ",
|
||||||
'w', Block.workbench,
|
'w', Blocks.crafting_table,
|
||||||
'g', BuildCraftCore.woodenGearItem);
|
'g', BuildCraftCore.woodenGearItem);
|
||||||
|
|
||||||
|
|
||||||
|
@ -309,23 +291,23 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
"ggg",
|
"ggg",
|
||||||
"g g",
|
"g g",
|
||||||
"ggg",
|
"ggg",
|
||||||
'g', Block.glass);
|
'g', Blocks.glass);
|
||||||
|
|
||||||
if (refineryBlock != null)
|
if (refineryBlock != null)
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(refineryBlock),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(refineryBlock),
|
||||||
"RTR",
|
"RTR",
|
||||||
"TGT",
|
"TGT",
|
||||||
'T', tankBlock != null ? tankBlock : Block.glass,
|
'T', tankBlock != null ? tankBlock : Blocks.glass,
|
||||||
'G', BuildCraftCore.diamondGearItem,
|
'G', BuildCraftCore.diamondGearItem,
|
||||||
'R', Block.torchRedstoneActive);
|
'R', Blocks.redstone_torch);
|
||||||
|
|
||||||
if (hopperBlock != null)
|
if (hopperBlock != null)
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(hopperBlock),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(hopperBlock),
|
||||||
"ICI",
|
"ICI",
|
||||||
"IGI",
|
"IGI",
|
||||||
" I ",
|
" I ",
|
||||||
'I', Item.ingotIron,
|
'I', Items.iron_ingot,
|
||||||
'C', Block.chest,
|
'C', Blocks.chest,
|
||||||
'G', BuildCraftCore.stoneGearItem);
|
'G', BuildCraftCore.stoneGearItem);
|
||||||
|
|
||||||
if (floodGateBlock != null)
|
if (floodGateBlock != null)
|
||||||
|
@ -333,10 +315,10 @@ public class BuildCraftFactory extends BuildCraftMod {
|
||||||
"IGI",
|
"IGI",
|
||||||
"FTF",
|
"FTF",
|
||||||
"IFI",
|
"IFI",
|
||||||
'I', Item.ingotIron,
|
'I', Items.iron_ingot,
|
||||||
'T', tankBlock != null ? tankBlock : Block.glass,
|
'T', tankBlock != null ? tankBlock : Blocks.glass,
|
||||||
'G', BuildCraftCore.ironGearItem,
|
'G', BuildCraftCore.ironGearItem,
|
||||||
'F', new ItemStack(Block.fenceIron));
|
'F', new ItemStack(Blocks.iron_bars));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
@ -42,7 +42,6 @@ import cpw.mods.fml.common.Mod.Instance;
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
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.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
|
@ -51,6 +50,8 @@ import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.config.Property;
|
import net.minecraftforge.common.config.Property;
|
||||||
|
@ -66,27 +67,21 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent evt) {
|
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);
|
|
||||||
|
|
||||||
BuildCraftCore.mainConfiguration.save();
|
BuildCraftCore.mainConfiguration.save();
|
||||||
|
|
||||||
laserBlock = new BlockLaser(laserId.getInt());
|
laserBlock = new BlockLaser();
|
||||||
CoreProxy.proxy.addName(laserBlock.setUnlocalizedName("laserBlock"), "Laser");
|
CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
|
||||||
CoreProxy.proxy.registerBlock(laserBlock);
|
CoreProxy.proxy.registerBlock(laserBlock);
|
||||||
|
|
||||||
assemblyTableBlock = new BlockLaserTable(assemblyTableId.getInt());
|
assemblyTableBlock = new BlockLaserTable();
|
||||||
CoreProxy.proxy.registerBlock(assemblyTableBlock, ItemLaserTable.class);
|
CoreProxy.proxy.registerBlock(assemblyTableBlock, ItemLaserTable.class);
|
||||||
|
|
||||||
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 0), "Assembly Table");
|
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, 1), "Advanced Crafting Table");
|
||||||
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 2), "Integration Table");
|
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 2), "Integration Table");
|
||||||
|
|
||||||
redstoneChipset = new ItemRedstoneChipset(redstoneChipsetId.getInt());
|
redstoneChipset = new ItemRedstoneChipset();
|
||||||
redstoneChipset.setUnlocalizedName("redstoneChipset");
|
redstoneChipset.setBlockName("redstoneChipset");
|
||||||
CoreProxy.proxy.registerItem(redstoneChipset);
|
CoreProxy.proxy.registerItem(redstoneChipset);
|
||||||
redstoneChipset.registerItemStacks();
|
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(TileAdvancedCraftingTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyAdvancedWorkbench");
|
||||||
CoreProxy.proxy.registerTileEntity(TileIntegrationTable.class, "net.minecraft.src.buildcraft.factory.TileIntegrationTable");
|
CoreProxy.proxy.registerTileEntity(TileIntegrationTable.class, "net.minecraft.src.buildcraft.factory.TileIntegrationTable");
|
||||||
|
|
||||||
new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
|
//new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
|
||||||
new BptBlockInventory(assemblyTableBlock.blockID);
|
//new BptBlockInventory(assemblyTableBlock.blockID);
|
||||||
|
|
||||||
if (BuildCraftCore.loadDefaultRecipes) {
|
if (BuildCraftCore.loadDefaultRecipes) {
|
||||||
loadRecipes();
|
loadRecipes();
|
||||||
|
@ -119,51 +114,51 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
||||||
"ORR",
|
"ORR",
|
||||||
"DDR",
|
"DDR",
|
||||||
"ORR",
|
"ORR",
|
||||||
'O', Block.obsidian,
|
'O', Blocks.obsidian,
|
||||||
'R', Item.redstone,
|
'R', Items.redstone,
|
||||||
'D', Item.diamond);
|
'D', Items.diamond);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0),
|
||||||
"ORO",
|
"ORO",
|
||||||
"ODO",
|
"ODO",
|
||||||
"OGO",
|
"OGO",
|
||||||
'O', Block.obsidian,
|
'O', Blocks.obsidian,
|
||||||
'R', Item.redstone,
|
'R', Items.redstone,
|
||||||
'D', Item.diamond,
|
'D', Items.diamond,
|
||||||
'G', BuildCraftCore.diamondGearItem);
|
'G', BuildCraftCore.diamondGearItem);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1),
|
||||||
"OWO",
|
"OWO",
|
||||||
"OCO",
|
"OCO",
|
||||||
"ORO",
|
"ORO",
|
||||||
'O', Block.obsidian,
|
'O', Blocks.obsidian,
|
||||||
'W', Block.workbench,
|
'W', Blocks.crafting_table,
|
||||||
'C', Block.chest,
|
'C', Blocks.chest,
|
||||||
'R', new ItemStack(redstoneChipset, 1, 0));
|
'R', new ItemStack(redstoneChipset, 1, 0));
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 2),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 2),
|
||||||
"ORO",
|
"ORO",
|
||||||
"OCO",
|
"OCO",
|
||||||
"OGO",
|
"OGO",
|
||||||
'O', Block.obsidian,
|
'O', Blocks.obsidian,
|
||||||
'R', Item.redstone,
|
'R', Items.redstone,
|
||||||
'C', new ItemStack(redstoneChipset, 1, 0),
|
'C', new ItemStack(redstoneChipset, 1, 0),
|
||||||
'G', BuildCraftCore.diamondGearItem);
|
'G', BuildCraftCore.diamondGearItem);
|
||||||
|
|
||||||
// PIPE WIRE
|
// PIPE WIRE
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.RED.getStack(8), "dyeRed", 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, Item.redstone, Item.ingotIron);
|
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, Item.redstone, Item.ingotIron);
|
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, Item.redstone, Item.ingotIron);
|
BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.YELLOW.getStack(8), "dyeYellow", 1, Items.redstone, Items.iron_ingot);
|
||||||
|
|
||||||
// CHIPSETS
|
// CHIPSETS
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Item.redstone);
|
BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Items.redstone);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Item.redstone, Item.ingotIron);
|
BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Items.redstone, Items.iron_ingot);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Item.redstone, Item.ingotGold);
|
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Items.redstone, Items.gold_ingot);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Item.redstone, Item.diamond);
|
BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Items.redstone, Items.diamond);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Item.redstone, Item.enderPearl);
|
BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Items.redstone, Items.ender_pearl);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Item.redstone, Item.netherQuartz);
|
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Items.redstone, Items.quartz);
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Item.redstone, Item.comparator);
|
BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Items.redstone, Items.comparator);
|
||||||
|
|
||||||
// GATES
|
// GATES
|
||||||
BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack());
|
BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack());
|
||||||
|
|
|
@ -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.FMLInterModComms.IMCEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
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.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
@ -106,6 +105,8 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
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";
|
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
|
||||||
groupItemsTrigger = groupItemsTriggerProp.getInt();
|
groupItemsTrigger = groupItemsTriggerProp.getInt();
|
||||||
|
|
||||||
|
pipeWaterproof = new ItemBuildCraft();
|
||||||
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.setUnlocalizedName("pipeWaterproof");
|
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
|
||||||
LanguageRegistry.addName(pipeWaterproof, "Pipe Sealant");
|
LanguageRegistry.addName(pipeWaterproof, "Pipe Sealant");
|
||||||
CoreProxy.proxy.registerItem(pipeWaterproof);
|
CoreProxy.proxy.registerItem(pipeWaterproof);
|
||||||
|
|
||||||
genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt());
|
genericPipeBlock = new BlockGenericPipe();
|
||||||
CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class);
|
CoreProxy.proxy.registerBlock(genericPipeBlock.setBlockName("pipeBlock"), ItemBlock.class);
|
||||||
|
|
||||||
pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Block.glass, "plankWood");
|
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", Item.emerald, Block.glass, Item.emerald);
|
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", Block.glass, "cobblestone");
|
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", Block.glass, "stone");
|
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", Block.blockNetherQuartz, Block.glass, Block.blockNetherQuartz);
|
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", Item.ingotIron, Block.glass, Item.ingotIron);
|
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", Item.ingotGold, Block.glass, Item.ingotGold);
|
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", Item.diamond, Block.glass, Item.diamond);
|
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", Block.obsidian, Block.glass, Block.obsidian);
|
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", Block.blockLapis, Block.glass, Block.blockLapis);
|
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", Block.blockLapis, Block.glass, Item.diamond);
|
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", Block.sandStone, Block.glass, Block.sandStone);
|
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", Block.glass, Item.redstone);
|
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", Block.blockLapis, Block.glass, Item.emerald);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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", Item.redstone, pipeItemsCobblestone);
|
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", Item.redstone, pipeItemsStone);
|
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", Item.redstone, pipeItemsQuartz);
|
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", Item.redstone, pipeItemsIron);
|
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", Item.redstone, pipeItemsGold);
|
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", Item.redstone, pipeItemsDiamond);
|
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);
|
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,
|
// 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));
|
// 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();
|
||||||
pipeWire = new ItemPipeWire(pipeWireId);
|
|
||||||
LanguageRegistry.addName(pipeWire, "Pipe Wire");
|
LanguageRegistry.addName(pipeWire, "Pipe Wire");
|
||||||
CoreProxy.proxy.registerItem(pipeWire);
|
CoreProxy.proxy.registerItem(pipeWire);
|
||||||
PipeWire.item = pipeWire;
|
PipeWire.item = pipeWire;
|
||||||
|
|
||||||
Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID);
|
pipeGate = new ItemGate();
|
||||||
pipeGate = new ItemGate(pipeGateId.getInt());
|
|
||||||
pipeGate.setUnlocalizedName("pipeGate");
|
pipeGate.setUnlocalizedName("pipeGate");
|
||||||
CoreProxy.proxy.registerItem(pipeGate);
|
CoreProxy.proxy.registerItem(pipeGate);
|
||||||
|
|
||||||
Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID);
|
facadeItem = new ItemFacade();
|
||||||
facadeItem = new ItemFacade(pipeFacadeId.getInt());
|
facadeItem.setBlockName("pipeFacade");
|
||||||
facadeItem.setUnlocalizedName("pipeFacade");
|
|
||||||
CoreProxy.proxy.registerItem(facadeItem);
|
CoreProxy.proxy.registerItem(facadeItem);
|
||||||
|
|
||||||
Property pipePlugId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipePlug.id", DefaultProps.PIPE_PLUG_ID);
|
plugItem = new ItemPlug();
|
||||||
plugItem = new ItemPlug(pipePlugId.getInt());
|
|
||||||
plugItem.setUnlocalizedName("pipePlug");
|
plugItem.setUnlocalizedName("pipePlug");
|
||||||
CoreProxy.proxy.registerItem(plugItem);
|
CoreProxy.proxy.registerItem(plugItem);
|
||||||
|
|
||||||
Property filteredBufferId = BuildCraftCore.mainConfiguration.getBlock("filteredBuffer.id", DefaultProps.FILTERED_BUFFER_ID);
|
filteredBufferBlock = new BlockFilteredBuffer();
|
||||||
filteredBufferBlock = new BlockFilteredBuffer(filteredBufferId.getInt());
|
CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
|
||||||
CoreProxy.proxy.registerBlock(filteredBufferBlock.setUnlocalizedName("filteredBufferBlock"));
|
|
||||||
CoreProxy.proxy.addName(filteredBufferBlock, "Filtered Buffer");
|
CoreProxy.proxy.addName(filteredBufferBlock, "Filtered Buffer");
|
||||||
} finally {
|
} finally {
|
||||||
BuildCraftCore.mainConfiguration.save();
|
BuildCraftCore.mainConfiguration.save();
|
||||||
|
@ -367,14 +358,14 @@ public class BuildCraftTransport extends BuildCraftMod {
|
||||||
// ModLoader.RegisterTileEntity(TileDockingStation.class,
|
// ModLoader.RegisterTileEntity(TileDockingStation.class,
|
||||||
// "net.minecraft.src.buildcraft.TileDockingStation");
|
// "net.minecraft.src.buildcraft.TileDockingStation");
|
||||||
|
|
||||||
new BptBlockPipe(genericPipeBlock.blockID);
|
//new BptBlockPipe(genericPipeBlock.blockID);
|
||||||
|
|
||||||
BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
|
//BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
|
||||||
BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
|
//BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
|
||||||
BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
|
//BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
|
||||||
BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
|
//BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
|
||||||
BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
|
//BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
|
||||||
BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
|
//BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
|
||||||
|
|
||||||
ActionManager.registerTriggerProvider(new PipeTriggerProvider());
|
ActionManager.registerTriggerProvider(new PipeTriggerProvider());
|
||||||
|
|
||||||
|
@ -425,7 +416,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
||||||
public void loadRecipes() {
|
public void loadRecipes() {
|
||||||
|
|
||||||
// Add base recipe for pipe waterproof.
|
// 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
|
// Add pipe recipes
|
||||||
for (PipeRecipe pipe : pipeRecipes) {
|
for (PipeRecipe pipe : pipeRecipes) {
|
||||||
|
@ -438,8 +429,8 @@ public class BuildCraftTransport extends BuildCraftMod {
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
|
||||||
new Object[]{"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
|
new Object[]{"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
|
||||||
BuildCraftTransport.pipeItemsDiamond, 'c', Block.chest, 'p',
|
BuildCraftTransport.pipeItemsDiamond, 'c', Blocks.chest, 'p',
|
||||||
Block.pistonBase});
|
Blocks.piston});
|
||||||
|
|
||||||
//Facade turning helper
|
//Facade turning helper
|
||||||
GameRegistry.addRecipe(facadeItem.new FacadeRecipe());
|
GameRegistry.addRecipe(facadeItem.new FacadeRecipe());
|
||||||
|
@ -459,7 +450,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
||||||
|
|
||||||
int id = prop.getInt(defaultID);
|
int id = prop.getInt(defaultID);
|
||||||
ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
|
ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
|
||||||
res.setUnlocalizedName(clas.getSimpleName());
|
res.setBlockName(clas.getSimpleName());
|
||||||
LanguageRegistry.addName(res, descr);
|
LanguageRegistry.addName(res, descr);
|
||||||
|
|
||||||
// Add appropriate recipe to temporary list
|
// Add appropriate recipe to temporary list
|
||||||
|
|
|
@ -8,14 +8,14 @@ import net.minecraft.item.ItemStack;
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class BlueprintManager {
|
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) {
|
public static ItemSignature getItemSignature(Item item) {
|
||||||
ItemSignature sig = new ItemSignature();
|
ItemSignature sig = new ItemSignature();
|
||||||
|
|
||||||
if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
|
//if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
|
||||||
sig.itemClassName = item.getClass().getSimpleName();
|
// sig.itemClassName = item.getClass().getSimpleName();
|
||||||
}
|
//}
|
||||||
|
|
||||||
sig.itemName = item.getUnlocalizedName(new ItemStack(item));
|
sig.itemName = item.getUnlocalizedName(new ItemStack(item));
|
||||||
|
|
||||||
|
@ -23,13 +23,14 @@ public class BlueprintManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlockSignature getBlockSignature(Block block) {
|
public static BlockSignature getBlockSignature(Block block) {
|
||||||
return BlueprintManager.blockBptProps[0].getSignature(block);
|
//return BlueprintManager.blockBptProps[0].getSignature(block);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Initialize defaults for block properties.
|
// Initialize defaults for block properties.
|
||||||
for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
|
//for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
|
||||||
new BptBlock(i);
|
// new BptBlock(i);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BptBlock {
|
||||||
public BptBlock(int blockId) {
|
public BptBlock(int blockId) {
|
||||||
this.blockId = blockId;
|
this.blockId = blockId;
|
||||||
|
|
||||||
BlueprintManager.blockBptProps[blockId] = this;
|
//BlueprintManager.blockBptProps[blockId] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +61,7 @@ public class BptBlock {
|
||||||
if (slot.storedRequirements.size() != 0) {
|
if (slot.storedRequirements.size() != 0) {
|
||||||
requirements.addAll(slot.storedRequirements);
|
requirements.addAll(slot.storedRequirements);
|
||||||
} else {
|
} 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) {
|
if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) {
|
||||||
Item container = stack.getItem().getContainerItem();
|
Item container = stack.getItem().getContainerItem();
|
||||||
|
|
||||||
stack.itemID = container.itemID;
|
//stack.itemID = container.itemID;
|
||||||
stack.stackSize = 1;
|
stack.stackSize = 1;
|
||||||
stack.setItemDamage(0);
|
stack.setItemDamage(0);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,8 @@ public class BptBlock {
|
||||||
* Added metadata sensitivity //Krapht
|
* Added metadata sensitivity //Krapht
|
||||||
*/
|
*/
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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) {
|
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
||||||
// Meta needs to be specified twice, depending on the block behavior
|
// 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().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().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
|
||||||
|
|
||||||
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
|
/*if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
|
||||||
TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
|
TileEntity tile = context.world().getTileEntity(slot.x, slot.y, slot.z);
|
||||||
|
|
||||||
slot.cpt.setInteger("x", slot.x);
|
slot.cpt.setInteger("x", slot.x);
|
||||||
slot.cpt.setInteger("y", slot.y);
|
slot.cpt.setInteger("y", slot.y);
|
||||||
|
@ -145,7 +146,7 @@ public class BptBlock {
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
tile.readFromNBT(slot.cpt);
|
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.
|
* 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) {
|
public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) {
|
||||||
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
|
/*if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
|
||||||
TileEntity tile = context.world().getBlockTileEntity(x, y, z);
|
TileEntity tile = context.world().getTileEntity(x, y, z);
|
||||||
|
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
tile.writeToNBT(slot.cpt);
|
tile.writeToNBT(slot.cpt);
|
||||||
|
@ -176,7 +177,7 @@ public class BptBlock {
|
||||||
if (req != null) {
|
if (req != null) {
|
||||||
slot.storedRequirements.addAll(req);
|
slot.storedRequirements.addAll(req);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,7 +195,7 @@ public class BptBlock {
|
||||||
public BlockSignature getSignature(Block block) {
|
public BlockSignature getSignature(Block block) {
|
||||||
BlockSignature sig = new BlockSignature();
|
BlockSignature sig = new BlockSignature();
|
||||||
|
|
||||||
if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
|
/*if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
|
||||||
sig.blockClassName = block.getClass().getSimpleName();
|
sig.blockClassName = block.getClass().getSimpleName();
|
||||||
|
|
||||||
if (block instanceof BlockContainer) {
|
if (block instanceof BlockContainer) {
|
||||||
|
@ -205,7 +206,7 @@ public class BptBlock {
|
||||||
sig.tileClassName = tile.getClass().getSimpleName();
|
sig.tileClassName = tile.getClass().getSimpleName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
sig.blockName = block.getUnlocalizedName();
|
sig.blockName = block.getUnlocalizedName();
|
||||||
sig.replaceNullWithStar();
|
sig.replaceNullWithStar();
|
||||||
|
|
|
@ -55,11 +55,11 @@ public class BptBlockUtils {
|
||||||
ItemStack stacks[] = new ItemStack[list.tagCount()];
|
ItemStack stacks[] = new ItemStack[list.tagCount()];
|
||||||
|
|
||||||
for (int i = 0; i < list.tagCount(); ++i) {
|
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) {
|
//if (stack != null && stack.itemID != 0 && stack.stackSize > 0) {
|
||||||
stacks[i] = context.mapItemStack(stack);
|
// stacks[i] = context.mapItemStack(stack);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
return stacks;
|
return stacks;
|
||||||
|
@ -75,7 +75,7 @@ public class BptBlockUtils {
|
||||||
|
|
||||||
if (stack != null && stack.stackSize != 0) {
|
if (stack != null && stack.stackSize != 0) {
|
||||||
stack.writeToNBT(cpt);
|
stack.writeToNBT(cpt);
|
||||||
context.storeId(stack.itemID);
|
//context.storeId(stack.itemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
package buildcraft.api.blueprints;
|
package buildcraft.api.blueprints;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,10 @@ package buildcraft.api.bptblocks;
|
||||||
import buildcraft.api.blueprints.BptBlock;
|
import buildcraft.api.blueprints.BptBlock;
|
||||||
import buildcraft.api.blueprints.BptSlotInfo;
|
import buildcraft.api.blueprints.BptSlotInfo;
|
||||||
import buildcraft.api.blueprints.IBptContext;
|
import buildcraft.api.blueprints.IBptContext;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@ -26,7 +29,7 @@ public class BptBlockBed extends BptBlock {
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
||||||
if ((slot.meta & 8) == 0) {
|
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)
|
if ((slot.meta & 8) != 0)
|
||||||
return;
|
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 x2 = slot.x;
|
||||||
int z2 = slot.z;
|
int z2 = slot.z;
|
||||||
|
@ -76,7 +79,7 @@ public class BptBlockBed extends BptBlock {
|
||||||
break;
|
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
|
@Override
|
||||||
|
|
|
@ -32,11 +32,11 @@ public class BptBlockDelegate extends BptBlock {
|
||||||
BptSlotInfo newSlot = slot.clone();
|
BptSlotInfo newSlot = slot.clone();
|
||||||
slot.blockId = delegateTo;
|
slot.blockId = delegateTo;
|
||||||
|
|
||||||
if (BlueprintManager.blockBptProps[delegateTo] != null) {
|
//if (BlueprintManager.blockBptProps[delegateTo] != null) {
|
||||||
BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
|
// BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
|
||||||
} else {
|
//} else {
|
||||||
super.addRequirements(newSlot, context, requirements);
|
// super.addRequirements(newSlot, context, requirements);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,10 +44,12 @@ public class BptBlockDelegate extends BptBlock {
|
||||||
BptSlotInfo newSlot = slot.clone();
|
BptSlotInfo newSlot = slot.clone();
|
||||||
slot.blockId = delegateTo;
|
slot.blockId = delegateTo;
|
||||||
|
|
||||||
if (BlueprintManager.blockBptProps[delegateTo] != null)
|
//if (BlueprintManager.blockBptProps[delegateTo] != null)
|
||||||
return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
|
// return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
|
||||||
else
|
//else
|
||||||
return super.isValid(newSlot, context);
|
// return super.isValid(newSlot, context);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,11 +57,11 @@ public class BptBlockDelegate extends BptBlock {
|
||||||
BptSlotInfo newSlot = slot.clone();
|
BptSlotInfo newSlot = slot.clone();
|
||||||
slot.blockId = delegateTo;
|
slot.blockId = delegateTo;
|
||||||
|
|
||||||
if (BlueprintManager.blockBptProps[delegateTo] != null) {
|
//if (BlueprintManager.blockBptProps[delegateTo] != null) {
|
||||||
BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
|
// BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
|
||||||
} else {
|
//} else {
|
||||||
super.rotateLeft(newSlot, context);
|
// super.rotateLeft(newSlot, context);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,18 +25,19 @@ public class BptBlockDirt extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
||||||
requirements.add(new ItemStack(Block.dirt));
|
//requirements.add(new ItemStack(Block.dirt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
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
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,8 @@ public class BptBlockDoor extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
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, 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 + 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 + 1, slot.z, slot.meta + 8,1);
|
||||||
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);
|
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);
|
||||||
|
|
|
@ -35,9 +35,9 @@ public class BptBlockFluid extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
||||||
if (slot.meta == 0)
|
//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;
|
// return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0;
|
||||||
else
|
//else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@ public class BptBlockFluid extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
||||||
if (slot.meta == 0) {
|
//if (slot.meta == 0) {
|
||||||
context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
|
// context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class BptBlockIgnore extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
|
|
|
@ -24,11 +24,12 @@ public class BptBlockIgnoreMeta extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class BptBlockInventory extends BptBlock {
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
||||||
super.buildBlock(slot, 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) {
|
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||||
inv.setInventorySlotContents(i, null);
|
inv.setInventorySlotContents(i, null);
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class BptBlockLever extends BptBlockWallSide {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class BptBlockPiston extends BptBlockRotateMeta {
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
||||||
int meta = slot.meta & 7;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,13 @@ public class BptBlockPumpkin extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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
|
@Override
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class BptBlockRedstoneRepeater extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
||||||
requirements.add(new ItemStack(Item.redstoneRepeater));
|
//requirements.add(new ItemStack(Item.redstoneRepeater));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class BptBlockRotateInventory extends BptBlockRotateMeta {
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
||||||
super.buildBlock(slot, 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) {
|
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||||
inv.setInventorySlotContents(i, null);
|
inv.setInventorySlotContents(i, null);
|
||||||
|
|
|
@ -43,12 +43,13 @@ public class BptBlockRotateMeta extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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
|
@Override
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class BptBlockSign extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
||||||
requirements.add(new ItemStack(Item.sign));
|
//requirements.add(new ItemStack(Item.sign));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,12 +24,13 @@ public class BptBlockStairs extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
public boolean isValid(BptSlotInfo slot, IBptContext context) {
|
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
|
@Override
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class BptBlockWallSide extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
|
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
|
@Override
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class StackWrapper {
|
||||||
if (getClass() != obj.getClass())
|
if (getClass() != obj.getClass())
|
||||||
return false;
|
return false;
|
||||||
final StackWrapper other = (StackWrapper) obj;
|
final StackWrapper other = (StackWrapper) obj;
|
||||||
if (stack.itemID != other.stack.itemID)
|
if (stack.getItem() != other.stack.getItem())
|
||||||
return false;
|
return false;
|
||||||
if (stack.getHasSubtypes() && stack.getItemDamage() != other.stack.getItemDamage())
|
if (stack.getHasSubtypes() && stack.getItemDamage() != other.stack.getItemDamage())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -8,8 +8,11 @@
|
||||||
package buildcraft.api.fuels;
|
package buildcraft.api.fuels;
|
||||||
|
|
||||||
import buildcraft.api.core.StackWrapper;
|
import buildcraft.api.core.StackWrapper;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
@ -60,7 +63,7 @@ public final class IronEngineCoolant {
|
||||||
* @param coolant
|
* @param coolant
|
||||||
*/
|
*/
|
||||||
public static void addCoolant(final ItemStack stack, final FluidStack 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);
|
solidCoolants.put(new StackWrapper(stack), coolant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,8 +76,12 @@ public final class IronEngineCoolant {
|
||||||
* @param stack
|
* @param stack
|
||||||
* @param coolant
|
* @param coolant
|
||||||
*/
|
*/
|
||||||
public static void addCoolant(final int itemId, final int metadata, final FluidStack coolant) {
|
public static void addCoolant(final Item item, final int metadata, final FluidStack coolant) {
|
||||||
addCoolant(new ItemStack(itemId, 1, metadata), 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) {
|
public static boolean isCoolant(Fluid fluid) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class TriggerParameter implements ITriggerParameter {
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||||
stack.writeToNBT(tagCompound);
|
stack.writeToNBT(tagCompound);
|
||||||
compound.setCompoundTag("stack", tagCompound);
|
compound.setTag("stack", tagCompound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ public final class PowerHandler {
|
||||||
public void writeToNBT(NBTTagCompound data, String tag) {
|
public void writeToNBT(NBTTagCompound data, String tag) {
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
nbt.setDouble("energyStored", energyStored);
|
nbt.setDouble("energyStored", energyStored);
|
||||||
data.setCompoundTag(tag, nbt);
|
data.setTag(tag, nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class PowerReceiver {
|
public final class PowerReceiver {
|
||||||
|
|
|
@ -17,7 +17,10 @@ import buildcraft.core.proxy.CoreProxy;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -39,14 +42,14 @@ public class BlockArchitect extends BlockContainer {
|
||||||
IIcon blockTextureTopNeg;
|
IIcon blockTextureTopNeg;
|
||||||
IIcon blockTextureTopArchitect;
|
IIcon blockTextureTopArchitect;
|
||||||
|
|
||||||
public BlockArchitect(int i) {
|
public BlockArchitect() {
|
||||||
super(i, Material.iron);
|
super(Material.iron);
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileArchitect();
|
return new TileArchitect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,10 +95,10 @@ public class BlockArchitect extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Utils.preDestroyBlock(world, i, j, k);
|
||||||
|
|
||||||
super.breakBlock(world, i, j, k, par5, par6);
|
super.breakBlock(world, i, j, k, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -139,7 +142,7 @@ public class BlockArchitect extends BlockContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister)
|
public void registerBlockIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
blockTextureSides = par1IconRegister.registerIcon("buildcraft:architect_sides");
|
blockTextureSides = par1IconRegister.registerIcon("buildcraft:architect_sides");
|
||||||
blockTextureTopNeg = par1IconRegister.registerIcon("buildcraft:architect_top_neg");
|
blockTextureTopNeg = par1IconRegister.registerIcon("buildcraft:architect_top_neg");
|
||||||
|
|
|
@ -30,8 +30,8 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
||||||
private IIcon textureTop;
|
private IIcon textureTop;
|
||||||
private IIcon textureSide;
|
private IIcon textureSide;
|
||||||
|
|
||||||
public BlockBlueprintLibrary(int i) {
|
public BlockBlueprintLibrary() {
|
||||||
super(i, Material.wood);
|
super(Material.wood);
|
||||||
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
||||||
if (entityplayer.isSneaking())
|
if (entityplayer.isSneaking())
|
||||||
return false;
|
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 (!tile.locked || entityplayer.username.equals(tile.owner))
|
||||||
if (!CoreProxy.proxy.isRenderWorld(world)) {
|
if (!CoreProxy.proxy.isRenderWorld(world)) {
|
||||||
|
@ -55,7 +55,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileBlueprintLibrary();
|
return new TileBlueprintLibrary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
|
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
|
||||||
if (CoreProxy.proxy.isSimulating(world) && entityliving instanceof EntityPlayer) {
|
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;
|
tile.owner = ((EntityPlayer) entityliving).username;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister)
|
public void registerBlockIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
textureTop = par1IconRegister.registerIcon("buildcraft:library_topbottom");
|
textureTop = par1IconRegister.registerIcon("buildcraft:library_topbottom");
|
||||||
textureSide = par1IconRegister.registerIcon("buildcraft:library_side");
|
textureSide = par1IconRegister.registerIcon("buildcraft:library_side");
|
||||||
|
|
|
@ -15,7 +15,10 @@ import buildcraft.core.proxy.CoreProxy;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -34,14 +37,14 @@ public class BlockBuilder extends BlockContainer {
|
||||||
IIcon blockTextureSide;
|
IIcon blockTextureSide;
|
||||||
IIcon blockTextureFront;
|
IIcon blockTextureFront;
|
||||||
|
|
||||||
public BlockBuilder(int i) {
|
public BlockBuilder() {
|
||||||
super(i, Material.iron);
|
super(Material.iron);
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
setCreativeTab(null);
|
setCreativeTab(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileBuilder();
|
return new TileBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,9 +114,9 @@ public class BlockBuilder extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
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"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
|
@ -124,7 +127,7 @@ public class BlockBuilder extends BlockContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||||
blockTextureTop = par1IconRegister.registerIcon("buildcraft:builder_top");
|
blockTextureTop = par1IconRegister.registerIcon("buildcraft:builder_top");
|
||||||
blockTextureSide = par1IconRegister.registerIcon("buildcraft:builder_side");
|
blockTextureSide = par1IconRegister.registerIcon("buildcraft:builder_side");
|
||||||
blockTextureFront = par1IconRegister.registerIcon("buildcraft:builder_front");
|
blockTextureFront = par1IconRegister.registerIcon("buildcraft:builder_front");
|
||||||
|
|
|
@ -17,7 +17,10 @@ import buildcraft.core.proxy.CoreProxy;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -35,8 +38,8 @@ public class BlockFiller extends BlockContainer {
|
||||||
IIcon textureTopOff;
|
IIcon textureTopOff;
|
||||||
public IFillerPattern currentPattern;
|
public IFillerPattern currentPattern;
|
||||||
|
|
||||||
public BlockFiller(int i) {
|
public BlockFiller() {
|
||||||
super(i, Material.iron);
|
super(Material.iron);
|
||||||
|
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
|
@ -59,7 +62,7 @@ public class BlockFiller extends BlockContainer {
|
||||||
@Override
|
@Override
|
||||||
public IIcon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
|
public IIcon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
int m = world.getBlockMetadata(x, y, z);
|
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) {
|
if (tile != null && tile instanceof TileFiller) {
|
||||||
TileFiller filler = (TileFiller) tile;
|
TileFiller filler = (TileFiller) tile;
|
||||||
|
@ -86,14 +89,14 @@ public class BlockFiller extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileFiller();
|
return new TileFiller();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
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" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
|
@ -104,7 +107,7 @@ public class BlockFiller extends BlockContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||||
textureTopOn = par1IconRegister.registerIcon("buildcraft:blockFillerTopOn");
|
textureTopOn = par1IconRegister.registerIcon("buildcraft:blockFillerTopOn");
|
||||||
textureTopOff = par1IconRegister.registerIcon("buildcraft:blockFillerTopOff");
|
textureTopOff = par1IconRegister.registerIcon("buildcraft:blockFillerTopOff");
|
||||||
textureSides = par1IconRegister.registerIcon("buildcraft:blockFillerSides");
|
textureSides = par1IconRegister.registerIcon("buildcraft:blockFillerSides");
|
||||||
|
|
|
@ -13,7 +13,10 @@ import buildcraft.core.CreativeTabBuildCraft;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -27,8 +30,8 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class BlockMarker extends BlockContainer {
|
public class BlockMarker extends BlockContainer {
|
||||||
|
|
||||||
public BlockMarker(int i) {
|
public BlockMarker() {
|
||||||
super(i, Material.circuits);
|
super(Material.circuits);
|
||||||
|
|
||||||
setLightValue(0.5F);
|
setLightValue(0.5F);
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
|
@ -80,20 +83,20 @@ public class BlockMarker extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileMarker();
|
return new TileMarker();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Utils.preDestroyBlock(world, x, y, z);
|
||||||
super.breakBlock(world, x, y, z, par5, par6);
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,8 +115,8 @@ public class BlockMarker extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, int x, int y, int z, int blockId) {
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||||
((TileMarker) world.getBlockTileEntity(x, y, z)).updateSignals();
|
((TileMarker) world.getTileEntity(x, y, z)).updateSignals();
|
||||||
dropTorchIfCantStay(world, x, y, z);
|
dropTorchIfCantStay(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +141,7 @@ public class BlockMarker extends BlockContainer {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
|
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
|
||||||
dropBlockAsItem(world, x, y, z, BuildCraftBuilders.markerBlock.blockID, 0);
|
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
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
this.blockIcon = iconRegister.registerIcon("buildcraft:blockMarker");
|
this.blockIcon = iconRegister.registerIcon("buildcraft:blockMarker");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,10 @@ package buildcraft.builders;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -24,25 +27,24 @@ public class BlockPathMarker extends BlockMarker {
|
||||||
|
|
||||||
private IIcon activeMarker;
|
private IIcon activeMarker;
|
||||||
|
|
||||||
public BlockPathMarker(int i) {
|
public BlockPathMarker() {
|
||||||
super(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TilePathMarker();
|
return new TilePathMarker();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Utils.preDestroyBlock(world, x, y, z);
|
||||||
super.breakBlock(world, x, y, z, par5, par6);
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "all" })
|
@SuppressWarnings({ "all" })
|
||||||
// @Override (client only)
|
// @Override (client only)
|
||||||
public IIcon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
|
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))
|
if (l == 1 || (marker != null && marker.tryingToConnect))
|
||||||
return activeMarker;
|
return activeMarker;
|
||||||
|
@ -58,7 +60,7 @@ public class BlockPathMarker extends BlockMarker {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister)
|
public void registerBlockIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
blockIcon = par1IconRegister.registerIcon("buildcraft:blockPathMarker");
|
blockIcon = par1IconRegister.registerIcon("buildcraft:blockPathMarker");
|
||||||
activeMarker = par1IconRegister.registerIcon("buildcraft:blockPathMarkerActive");
|
activeMarker = par1IconRegister.registerIcon("buildcraft:blockPathMarkerActive");
|
||||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.World;
|
||||||
public class BuildersProxy {
|
public class BuildersProxy {
|
||||||
|
|
||||||
public static boolean canPlaceTorch(World world, int i, int j, int k) {
|
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())
|
if (block == null || !block.renderAsNormalBlock())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
if (!world.blockExists(x, y, z))
|
if (!world.blockExists(x, y, z))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
switch (ID) {
|
switch (ID) {
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
if (!world.blockExists(x, y, z))
|
if (!world.blockExists(x, y, z))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
switch (ID) {
|
switch (ID) {
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
public abstract class ItemBptBase extends ItemBuildCraft {
|
public abstract class ItemBptBase extends ItemBuildCraft {
|
||||||
|
|
||||||
public ItemBptBase(int i) {
|
public ItemBptBase() {
|
||||||
super(i);
|
super();
|
||||||
|
|
||||||
maxStackSize = 1;
|
maxStackSize = 1;
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
|
|
|
@ -19,8 +19,8 @@ public class ItemBptBluePrint extends ItemBptBase {
|
||||||
private IIcon cleanBlueprint;
|
private IIcon cleanBlueprint;
|
||||||
private IIcon usedBlueprint;
|
private IIcon usedBlueprint;
|
||||||
|
|
||||||
public ItemBptBluePrint(int i) {
|
public ItemBptBluePrint() {
|
||||||
super(i);
|
super();
|
||||||
setCreativeTab(null);
|
setCreativeTab(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class ItemBptTemplate extends ItemBptBase {
|
public class ItemBptTemplate extends ItemBptBase {
|
||||||
private IIcon usedTemplate;
|
private IIcon usedTemplate;
|
||||||
public ItemBptTemplate(int i) {
|
public ItemBptTemplate() {
|
||||||
super(i);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -228,7 +228,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "Template";
|
return "Template";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
|
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -360,10 +360,15 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,15 +236,15 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
|
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -289,4 +289,9 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
|
||||||
setInventorySlotContents(2, null);
|
setInventorySlotContents(2, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
for (int x = xCoord - 1; x <= xCoord + 1; ++x) {
|
for (int x = xCoord - 1; x <= xCoord + 1; ++x) {
|
||||||
for (int y = yCoord - 1; y <= yCoord + 1; ++y) {
|
for (int y = yCoord - 1; y <= yCoord + 1; ++y) {
|
||||||
for (int z = zCoord - 1; z <= zCoord + 1; ++z) {
|
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) {
|
if (tile instanceof TilePathMarker) {
|
||||||
path = ((TilePathMarker) tile).getPath();
|
path = ((TilePathMarker) tile).getPath();
|
||||||
|
@ -425,7 +425,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "Builder";
|
return "Builder";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
|
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -542,11 +542,11 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@ -624,4 +624,9 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
public boolean allowAction(IAction action) {
|
public boolean allowAction(IAction action) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "Filler";
|
return "Filler";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||||
if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
|
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||||
return false;
|
return false;
|
||||||
return entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64D;
|
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
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -336,4 +336,9 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
|
||||||
public void readGuiData(DataInputStream data, EntityPlayer player) throws IOException {
|
public void readGuiData(DataInputStream data, EntityPlayer player) throws IOException {
|
||||||
setPattern(FillerManager.registry.getPattern(data.readUTF()));
|
setPattern(FillerManager.registry.getPattern(data.readUTF()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import buildcraft.core.network.PacketUpdate;
|
||||||
import buildcraft.core.network.TileNetworkData;
|
import buildcraft.core.network.TileNetworkData;
|
||||||
import buildcraft.core.proxy.CoreProxy;
|
import buildcraft.core.proxy.CoreProxy;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (marker == null) {
|
if (marker == null) {
|
||||||
marker = (TileMarker) world.getBlockTileEntity(x, y, z);
|
marker = (TileMarker) world.getTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
return marker;
|
return marker;
|
||||||
|
@ -145,7 +146,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
if (initVect[i] != null) {
|
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) {
|
void setVect(int n) {
|
||||||
int markerId = BuildCraftBuilders.markerBlock.blockID;
|
|
||||||
|
|
||||||
int[] coords = new int[3];
|
int[] coords = new int[3];
|
||||||
|
|
||||||
coords[0] = xCoord;
|
coords[0] = xCoord;
|
||||||
|
@ -177,10 +176,10 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
for (int j = 1; j < maxSize; ++j) {
|
for (int j = 1; j < maxSize; ++j) {
|
||||||
coords[n] += 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) {
|
if (block == BuildCraftBuilders.markerBlock) {
|
||||||
TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]);
|
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (linkTo(marker, n)) {
|
if (linkTo(marker, n)) {
|
||||||
break;
|
break;
|
||||||
|
@ -190,10 +189,10 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
coords[n] -= j;
|
coords[n] -= j;
|
||||||
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) {
|
if (block == BuildCraftBuilders.markerBlock) {
|
||||||
TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]);
|
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (linkTo(marker, n)) {
|
if (linkTo(marker, n)) {
|
||||||
break;
|
break;
|
||||||
|
@ -405,13 +404,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
|
|
||||||
for (TileWrapper m : o.vect.clone()) {
|
for (TileWrapper m : o.vect.clone()) {
|
||||||
if (m.isSet()) {
|
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);
|
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);
|
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, BuildCraftBuilders.markerBlock.blockID, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
double nearestDistance = 0, distance; // The initialization of nearestDistance is only to make the compiler shut up
|
||||||
|
|
||||||
for (TilePathMarker t : availableMarkers) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public class TilePathMarker extends TileMarker {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadLink0) {
|
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) {
|
if (links[0] != e0 && links[1] != e0 && e0 instanceof TilePathMarker) {
|
||||||
createLaserAndConnect((TilePathMarker) e0);
|
createLaserAndConnect((TilePathMarker) e0);
|
||||||
|
@ -183,7 +183,7 @@ public class TilePathMarker extends TileMarker {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadLink1) {
|
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) {
|
if (links[0] != e1 && links[1] != e1 && e1 instanceof TilePathMarker) {
|
||||||
createLaserAndConnect((TilePathMarker) e1);
|
createLaserAndConnect((TilePathMarker) e1);
|
||||||
|
@ -259,7 +259,7 @@ public class TilePathMarker extends TileMarker {
|
||||||
public static void clearAvailableMarkersList(World w) {
|
public static void clearAvailableMarkersList(World w) {
|
||||||
for (Iterator<TilePathMarker> it = availableMarkers.iterator(); it.hasNext();) {
|
for (Iterator<TilePathMarker> it = availableMarkers.iterator(); it.hasNext();) {
|
||||||
TilePathMarker t = it.next();
|
TilePathMarker t = it.next();
|
||||||
if (t.worldObj.provider.dimensionId != w.provider.dimensionId) {
|
if (t.getWorldObj().provider.dimensionId != w.provider.dimensionId) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ public abstract class FillerPattern implements IFillerPattern {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void breakBlock(World world, int x, int y, int z) {
|
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)
|
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);
|
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) {
|
if (BuildCraftBuilders.fillerDestroy) {
|
||||||
|
|
|
@ -27,22 +27,22 @@ public class PatternBox extends FillerPattern {
|
||||||
int yMax = (int) box.pMax().y;
|
int yMax = (int) box.pMax().y;
|
||||||
int zMax = (int) box.pMax().z;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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 false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -27,6 +27,6 @@ public class PatternClear extends FillerPattern {
|
||||||
int yMax = (int) box.pMax().y;
|
int yMax = (int) box.pMax().y;
|
||||||
int zMax = (int) box.pMax().z;
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class PatternCylinder extends FillerPattern {
|
||||||
int zRadius = (zMax-zMin)/2;
|
int zRadius = (zMax-zMin)/2;
|
||||||
|
|
||||||
if(xRadius == 0 || zRadius == 0) {
|
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;
|
int dx = xRadius, dz = 0;
|
||||||
|
@ -52,7 +52,7 @@ public class PatternCylinder extends FillerPattern {
|
||||||
int stoppingZ = 0;
|
int stoppingZ = 0;
|
||||||
|
|
||||||
while(stoppingX >= stoppingZ) {
|
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;
|
return false;
|
||||||
++dz;
|
++dz;
|
||||||
stoppingZ += twoASquare;
|
stoppingZ += twoASquare;
|
||||||
|
@ -75,7 +75,7 @@ public class PatternCylinder extends FillerPattern {
|
||||||
stoppingZ = twoASquare*zRadius;
|
stoppingZ = twoASquare*zRadius;
|
||||||
|
|
||||||
while(stoppingX <= stoppingZ) {
|
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;
|
return false;
|
||||||
++dx;
|
++dx;
|
||||||
stoppingX += twoBSquare;
|
stoppingX += twoBSquare;
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class PatternFill extends FillerPattern {
|
||||||
int yMax = (int) box.pMax().y;
|
int yMax = (int) box.pMax().y;
|
||||||
int zMax = (int) box.pMax().z;
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,9 @@ public class PatternFlatten extends FillerPattern {
|
||||||
int yMax = (int) box.pMax().y;
|
int yMax = (int) box.pMax().y;
|
||||||
int zMax = (int) box.pMax().z;
|
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 false;
|
||||||
}
|
}
|
||||||
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.worldObj);
|
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.getWorldObj());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ public class PatternHorizon extends FillerPattern {
|
||||||
int xMax = (int) box.pMax().x;
|
int xMax = (int) box.pMax().x;
|
||||||
int zMax = (int) box.pMax().z;
|
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 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class PatternPyramid extends FillerPattern {
|
||||||
}
|
}
|
||||||
|
|
||||||
while (step <= xSize / 2 && step <= zSize / 2 && height >= yMin && height <= yMax) {
|
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;
|
return false;
|
||||||
|
|
||||||
step++;
|
step++;
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class PatternStairs extends FillerPattern {
|
||||||
if (kind == 0) {
|
if (kind == 0) {
|
||||||
while (x2 - x1 + 1 > 0 && z2 - z1 + 1 > 0 && x2 - x1 < sizeX && z2 - z1 < sizeZ && height >= yMin && height <= yMax) {
|
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;
|
return false;
|
||||||
|
|
||||||
if (heightStep == 1) {
|
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;
|
return false;
|
||||||
|
|
||||||
dimX += stepDiagX;
|
dimX += stepDiagX;
|
||||||
|
|
|
@ -55,14 +55,14 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onArchitectName(EntityPlayer player, PacketUpdate packet) {
|
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) {
|
if (te instanceof TileArchitect) {
|
||||||
((TileArchitect) te).handleClientInput((char) ((PacketPayloadArrays)packet.payload).intPayload[0]);
|
((TileArchitect) te).handleClientInput((char) ((PacketPayloadArrays)packet.payload).intPayload[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLibraryAction(EntityPlayer player, PacketLibraryAction packet) {
|
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) {
|
if (te instanceof TileBlueprintLibrary) {
|
||||||
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
|
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
|
||||||
switch (packet.actionId) {
|
switch (packet.actionId) {
|
||||||
|
@ -84,7 +84,7 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLibrarySelect(EntityPlayer player, PacketLibraryAction packet) {
|
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) {
|
if (te instanceof TileBlueprintLibrary) {
|
||||||
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
|
TileBlueprintLibrary tbl = (TileBlueprintLibrary) te;
|
||||||
int ySlot = packet.actionId;
|
int ySlot = packet.actionId;
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package buildcraft.core;
|
package buildcraft.core;
|
||||||
|
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -15,8 +18,8 @@ public abstract class BlockBuildCraft extends BlockContainer {
|
||||||
protected static boolean keepInventory = false;
|
protected static boolean keepInventory = false;
|
||||||
protected final Random rand = new Random();
|
protected final Random rand = new Random();
|
||||||
|
|
||||||
protected BlockBuildCraft(int id, Material material) {
|
protected BlockBuildCraft(Material material) {
|
||||||
super(id, material);
|
super(material);
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
setHardness(5F);
|
setHardness(5F);
|
||||||
}
|
}
|
||||||
|
@ -24,21 +27,21 @@ public abstract class BlockBuildCraft extends BlockContainer {
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||||
super.onBlockPlacedBy(world, x, y, z, entity, 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) {
|
if (tile instanceof TileBuildCraft) {
|
||||||
((TileBuildCraft) tile).onBlockPlacedBy(entity, stack);
|
((TileBuildCraft) tile).onBlockPlacedBy(entity, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Utils.preDestroyBlock(world, x, y, z);
|
||||||
super.breakBlock(world, x, y, z, par5, par6);
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
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())
|
if (tile instanceof IMachine && ((IMachine) tile).isActive())
|
||||||
return super.getLightValue(world, x, y, z) + 8;
|
return super.getLightValue(world, x, y, z) + 8;
|
||||||
return super.getLightValue(world, x, y, z);
|
return super.getLightValue(world, x, y, z);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
package buildcraft.core;
|
package buildcraft.core;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -67,8 +68,8 @@ public class BlockIndex implements Comparable<BlockIndex> {
|
||||||
c.setInteger("k", z);
|
c.setInteger("k", z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockId(World world) {
|
public Block getBlock(World world) {
|
||||||
return world.getBlockId(x, y, z);
|
return world.getBlock(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,12 +2,16 @@ package buildcraft.core;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -17,7 +21,7 @@ public class BlockSpring extends Block {
|
||||||
|
|
||||||
public enum EnumSpring {
|
public enum EnumSpring {
|
||||||
|
|
||||||
WATER(5, -1, Block.waterStill),
|
WATER(5, -1, Blocks.water),
|
||||||
OIL(6000, 8, null); // Set in BuildCraftEnergy
|
OIL(6000, 8, null); // Set in BuildCraftEnergy
|
||||||
public static final EnumSpring[] VALUES = values();
|
public static final EnumSpring[] VALUES = values();
|
||||||
public final int tickRate, chance;
|
public final int tickRate, chance;
|
||||||
|
@ -38,8 +42,8 @@ public class BlockSpring extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockSpring(int id) {
|
public BlockSpring() {
|
||||||
super(id, Material.rock);
|
super(Material.rock);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
setResistance(6000000.0F);
|
setResistance(6000000.0F);
|
||||||
setStepSound(soundStoneFootstep);
|
setStepSound(soundStoneFootstep);
|
||||||
|
@ -49,7 +53,7 @@ public class BlockSpring extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubBlocks(int id, CreativeTabs tab, List list) {
|
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||||
for (EnumSpring type : EnumSpring.VALUES) {
|
for (EnumSpring type : EnumSpring.VALUES) {
|
||||||
list.add(new ItemStack(this, 1, type.ordinal()));
|
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) {
|
public void onBlockAdded(World world, int x, int y, int z) {
|
||||||
super.onBlockAdded(world, x, y, z);
|
super.onBlockAdded(world, x, y, z);
|
||||||
int meta = world.getBlockMetadata(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) {
|
private void assertSpring(World world, int x, int y, int z) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
EnumSpring spring = EnumSpring.fromMeta(meta);
|
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) {
|
if (!spring.canGen || spring.liquidBlock == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +93,7 @@ public class BlockSpring extends Block {
|
||||||
if (spring.chance != -1 && rand.nextInt(spring.chance) != 0) {
|
if (spring.chance != -1 && rand.nextInt(spring.chance) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
world.setBlock(x, y + 1, z, spring.liquidBlock.blockID);
|
world.setBlock(x, y + 1, z, spring.liquidBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevents updates on chunk generation
|
// Prevents updates on chunk generation
|
||||||
|
@ -100,7 +104,7 @@ public class BlockSpring extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||||
blockIcon = par1IconRegister.registerIcon("bedrock");
|
blockIcon = par1IconRegister.registerIcon("bedrock");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,13 @@ package buildcraft.core;
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.core.utils.Localization;
|
import buildcraft.core.utils.Localization;
|
||||||
import buildcraft.transport.ItemFacade;
|
import buildcraft.transport.ItemFacade;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public enum CreativeTabBuildCraft {
|
public enum CreativeTabBuildCraft {
|
||||||
|
@ -33,7 +37,7 @@ public enum CreativeTabBuildCraft {
|
||||||
private ItemStack getItem() {
|
private ItemStack getItem() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case FACADES:
|
case FACADES:
|
||||||
return ItemFacade.getStack(Block.stoneBrick, 0);
|
return ItemFacade.getStack(Blocks.brick_block, 0);
|
||||||
default:
|
default:
|
||||||
return new ItemStack(BuildCraftCore.diamondGearItem);
|
return new ItemStack(BuildCraftCore.diamondGearItem);
|
||||||
}
|
}
|
||||||
|
@ -55,5 +59,10 @@ public enum CreativeTabBuildCraft {
|
||||||
public String getTranslatedTabLabel() {
|
public String getTranslatedTabLabel() {
|
||||||
return translate();
|
return translate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getTabIconItem() {
|
||||||
|
return getItem().getItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
package buildcraft.core;
|
package buildcraft.core;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@ -16,9 +17,9 @@ public interface ITileBufferHolder {
|
||||||
|
|
||||||
public void blockRemoved(ForgeDirection from);
|
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);
|
public TileEntity getTile(ForgeDirection to);
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ public class ItemBuildCraft extends Item {
|
||||||
private String iconName;
|
private String iconName;
|
||||||
private boolean passSneakClick = false;
|
private boolean passSneakClick = false;
|
||||||
|
|
||||||
public ItemBuildCraft(int i) {
|
public ItemBuildCraft() {
|
||||||
super(i);
|
super();
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ public class ItemBuildCraft extends Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item setUnlocalizedName(String par1Str) {
|
public Item setBlockName(String par1Str) {
|
||||||
iconName = par1Str;
|
iconName = par1Str;
|
||||||
return super.setUnlocalizedName(par1Str);
|
return super.setBlockName(par1Str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,8 +16,8 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
|
||||||
|
|
||||||
private final Set<Class<? extends Block>> shiftRotations = new HashSet<Class<? extends Block>>();
|
private final Set<Class<? extends Block>> shiftRotations = new HashSet<Class<? extends Block>>();
|
||||||
|
|
||||||
public ItemWrench(int i) {
|
public ItemWrench() {
|
||||||
super(i);
|
super();
|
||||||
setFull3D();
|
setFull3D();
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
shiftRotations.add(BlockLever.class);
|
shiftRotations.add(BlockLever.class);
|
||||||
|
|
|
@ -15,9 +15,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public final class TileBuffer {
|
public final class TileBuffer {
|
||||||
|
|
||||||
private int blockID = 0;
|
private Block block = null;
|
||||||
private TileEntity tile;
|
private TileEntity tile;
|
||||||
private final SafeTimeTracker tracker = new SafeTimeTracker();
|
private final SafeTimeTracker tracker = new SafeTimeTracker(20);
|
||||||
private final World world;
|
private final World world;
|
||||||
final int x, y, z;
|
final int x, y, z;
|
||||||
private final boolean loadUnloaded;
|
private final boolean loadUnloaded;
|
||||||
|
@ -34,43 +34,42 @@ public final class TileBuffer {
|
||||||
|
|
||||||
public final void refresh() {
|
public final void refresh() {
|
||||||
tile = null;
|
tile = null;
|
||||||
blockID = 0;
|
block = null;
|
||||||
if (!loadUnloaded && !world.blockExists(x, y, z)) {
|
if (!loadUnloaded && !world.blockExists(x, y, z)) {
|
||||||
return;
|
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))) {
|
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) {
|
public void set(Block block, TileEntity tile) {
|
||||||
this.blockID = blockID;
|
this.block = block;
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
tracker.markTime(world);
|
tracker.markTime(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockID() {
|
public Block getBlock() {
|
||||||
if (tile != null && !tile.isInvalid())
|
if (tile != null && !tile.isInvalid())
|
||||||
return blockID;
|
return block;
|
||||||
|
|
||||||
if (tracker.markTimeIfDelay(world, 20)) {
|
if (tracker.markTimeIfDelay(world)) {
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
if (tile != null && !tile.isInvalid())
|
if (tile != null && !tile.isInvalid())
|
||||||
return blockID;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntity getTile() {
|
public TileEntity getTile() {
|
||||||
if (tile != null && !tile.isInvalid())
|
if (tile != null && !tile.isInvalid())
|
||||||
return tile;
|
return tile;
|
||||||
|
|
||||||
if (tracker.markTimeIfDelay(world, 20)) {
|
if (tracker.markTimeIfDelay(world)) {
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
if (tile != null && !tile.isInvalid())
|
if (tile != null && !tile.isInvalid())
|
||||||
|
|
|
@ -57,11 +57,11 @@ public class BptBlueprint extends BptBase {
|
||||||
slot.x = (int) (x - context.surroundingBox().pMin().x);
|
slot.x = (int) (x - context.surroundingBox().pMin().x);
|
||||||
slot.y = (int) (y - context.surroundingBox().pMin().y);
|
slot.y = (int) (y - context.surroundingBox().pMin().y);
|
||||||
slot.z = (int) (z - context.surroundingBox().pMin().z);
|
slot.z = (int) (z - context.surroundingBox().pMin().z);
|
||||||
slot.blockId = anchorTile.worldObj.getBlockId(x, y, z);
|
slot.blockId = anchorTile.getWorldObj().getBlockId(x, y, z);
|
||||||
slot.meta = anchorTile.worldObj.getBlockMetadata(x, y, z);
|
slot.meta = anchorTile.getWorldObj().getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
|
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) {
|
if (tile != null && tile instanceof IBptContributor) {
|
||||||
IBptContributor contributor = (IBptContributor) tile;
|
IBptContributor contributor = (IBptContributor) tile;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class InventoryConcatenator implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,11 +89,11 @@ public class InventoryConcatenator implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,8 +68,8 @@ public class InventoryCopy implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return orignal.getInvName();
|
return orignal.getInventoryName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,11 +87,11 @@ public class InventoryCopy implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,8 +63,8 @@ public class InventoryMapper implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return inv.getInvName();
|
return inv.getInventoryName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStackSizeLimit(int limit) {
|
public void setStackSizeLimit(int limit) {
|
||||||
|
@ -87,13 +87,13 @@ public class InventoryMapper implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
inv.openChest();
|
inv.openInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
inv.closeChest();
|
inv.closeInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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 decrStackSize(int slotIndex, int amount) { return inventory.decrStackSize(slotIndex, amount); }
|
||||||
@Override public ItemStack getStackInSlotOnClosing(int slotIndex) { return inventory.getStackInSlotOnClosing(slotIndex); }
|
@Override public ItemStack getStackInSlotOnClosing(int slotIndex) { return inventory.getStackInSlotOnClosing(slotIndex); }
|
||||||
@Override public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { inventory.setInventorySlotContents(slotIndex, itemstack); }
|
@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 boolean isInvNameLocalized() { return inventory.isInvNameLocalized(); }
|
||||||
@Override public int getInventoryStackLimit() { return inventory.getInventoryStackLimit(); }
|
@Override public int getInventoryStackLimit() { return inventory.getInventoryStackLimit(); }
|
||||||
@Override public void onInventoryChanged() { inventory.onInventoryChanged(); }
|
@Override public void onInventoryChanged() { inventory.onInventoryChanged(); }
|
||||||
@Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { return inventory.isUseableByPlayer(entityplayer); }
|
@Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { return inventory.isUseableByPlayer(entityplayer); }
|
||||||
@Override public void openChest() { inventory.openChest(); }
|
@Override public void openInventory() { inventory.openInventory(); }
|
||||||
@Override public void closeChest() { inventory.closeChest(); }
|
@Override public void closeInventory() { inventory.closeInventory(); }
|
||||||
@Override public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { return inventory.isItemValidForSlot(slotIndex, itemstack); }
|
@Override public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { return inventory.isItemValidForSlot(slotIndex, itemstack); }
|
||||||
|
|
||||||
/* STATIC HELPER */
|
/* STATIC HELPER */
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class SimpleInventory implements IInventory, INBTTagable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,11 +90,11 @@ public class SimpleInventory implements IInventory, INBTTagable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class PacketGuiReturn extends BuildCraftPacket {
|
||||||
int y = data.readInt();
|
int y = data.readInt();
|
||||||
int z = data.readInt();
|
int z = data.readInt();
|
||||||
|
|
||||||
TileEntity t = world.getBlockTileEntity(x, y, z);
|
TileEntity t = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
if (t instanceof IGuiReturnHandler)
|
if (t instanceof IGuiReturnHandler)
|
||||||
((IGuiReturnHandler) t).readGuiData(data, sender);
|
((IGuiReturnHandler) t).readGuiData(data, sender);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class PacketHandler extends BuildCraftChannelHandler {
|
||||||
PacketTileState pkt = (PacketTileState) packet;
|
PacketTileState pkt = (PacketTileState) packet;
|
||||||
pkt.readData(data);
|
pkt.readData(data);
|
||||||
World world = player.worldObj;
|
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) {
|
if (tile instanceof ISyncedTile) {
|
||||||
pkt.applyStates(data, (ISyncedTile) tile);
|
pkt.applyStates(data, (ISyncedTile) tile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class PacketTileUpdate extends PacketUpdate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntity getTarget(World world) {
|
public TileEntity getTarget(World world) {
|
||||||
return world.getBlockTileEntity(posX, posY, posZ);
|
return world.getTileEntity(posX, posY, posZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class CoreProxy {
|
||||||
|
|
||||||
/* ENTITY HANDLING */
|
/* ENTITY HANDLING */
|
||||||
public void removeEntity(Entity entity) {
|
public void removeEntity(Entity entity) {
|
||||||
entity.worldObj.removeEntity(entity);
|
entity.getWorldObj().removeEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WRAPPER */
|
/* WRAPPER */
|
||||||
|
|
|
@ -66,8 +66,8 @@ public class CoreProxyClient extends CoreProxy {
|
||||||
public void removeEntity(Entity entity) {
|
public void removeEntity(Entity entity) {
|
||||||
super.removeEntity(entity);
|
super.removeEntity(entity);
|
||||||
|
|
||||||
if (isRenderWorld(entity.worldObj)) {
|
if (isRenderWorld(entity.getWorldObj())) {
|
||||||
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId);
|
((WorldClient) entity.getWorldObj()).removeEntityFromWorld(entity.entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,17 +8,21 @@
|
||||||
package buildcraft.core.render;
|
package buildcraft.core.render;
|
||||||
|
|
||||||
import buildcraft.core.render.RenderEntityBlock.RenderInfo;
|
import buildcraft.core.render.RenderEntityBlock.RenderInfo;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,11 +89,11 @@ public class FluidRenderer {
|
||||||
|
|
||||||
diplayLists = new int[DISPLAY_STAGES];
|
diplayLists = new int[DISPLAY_STAGES];
|
||||||
|
|
||||||
if (fluid.getBlockID() > 0) {
|
if (fluid.getBlock() != null) {
|
||||||
liquidBlock.baseBlock = Block.blocksList[fluid.getBlockID()];
|
liquidBlock.baseBlock = fluid.getBlock();
|
||||||
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
|
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
|
||||||
} else {
|
} else {
|
||||||
liquidBlock.baseBlock = Block.waterStill;
|
liquidBlock.baseBlock = Blocks.water;
|
||||||
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
|
liquidBlock.texture = getFluidTexture(fluidStack, flowing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,20 @@
|
||||||
package buildcraft.core.render;
|
package buildcraft.core.render;
|
||||||
|
|
||||||
import buildcraft.core.EntityBlock;
|
import buildcraft.core.EntityBlock;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class RenderEntityBlock extends Render {
|
public class RenderEntityBlock extends Render {
|
||||||
|
@ -37,7 +41,7 @@ public class RenderEntityBlock extends Render {
|
||||||
public double maxX;
|
public double maxX;
|
||||||
public double maxY;
|
public double maxY;
|
||||||
public double maxZ;
|
public double maxZ;
|
||||||
public Block baseBlock = Block.sand;
|
public Block baseBlock = Blocks.sand;
|
||||||
public IIcon texture = null;
|
public IIcon texture = null;
|
||||||
public IIcon[] textureArray = null;
|
public IIcon[] textureArray = null;
|
||||||
public boolean[] renderSide = new boolean[6];
|
public boolean[] renderSide = new boolean[6];
|
||||||
|
@ -48,7 +52,7 @@ public class RenderEntityBlock extends Render {
|
||||||
setRenderAllSides();
|
setRenderAllSides();
|
||||||
}
|
}
|
||||||
|
|
||||||
public RenderInfo(Block template, Icon[] texture) {
|
public RenderInfo(Block template, IIcon[] texture) {
|
||||||
this();
|
this();
|
||||||
this.baseBlock = template;
|
this.baseBlock = template;
|
||||||
this.textureArray = texture;
|
this.textureArray = texture;
|
||||||
|
@ -60,7 +64,7 @@ public class RenderEntityBlock extends Render {
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
|
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) {
|
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;
|
float light = 0;
|
||||||
if (doLight) {
|
if (doLight) {
|
||||||
if (info.light < 0) {
|
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);
|
light = light + ((1.0f - light) * 0.4f);
|
||||||
} else
|
} else
|
||||||
light = info.light;
|
light = info.light;
|
||||||
|
@ -249,93 +253,4 @@ public class RenderEntityBlock extends Render {
|
||||||
if (doTessellating && tessellator.isDrawing)
|
if (doTessellating && tessellator.isDrawing)
|
||||||
tessellator.draw();
|
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();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender3DInInventory() {
|
public boolean shouldRender3DInInventory(int modelId) {
|
||||||
return true;
|
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);
|
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.instance;
|
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) {
|
if (Block.lightValue[block.blockID] > 0) {
|
||||||
f = 1.0F;
|
f = 1.0F;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender3DInInventory() {
|
public boolean shouldRender3DInInventory(int modelId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,5 +228,4 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
|
||||||
face[j][3] = tmp;
|
face[j][3] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class RenderingOil implements ISimpleBlockRenderingHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender3DInInventory() {
|
public boolean shouldRender3DInInventory(int modelId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,5 +31,4 @@ public class RenderingOil implements ISimpleBlockRenderingHandler {
|
||||||
public int getRenderId() {
|
public int getRenderId() {
|
||||||
return BuildCraftCore.oilModel;
|
return BuildCraftCore.oilModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import buildcraft.core.triggers.TriggerInventoryLevel.TriggerType;
|
||||||
import buildcraft.core.utils.StringUtils;
|
import buildcraft.core.utils.StringUtils;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
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.FluidContainerRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.block.BlockFluid;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.Packet60Explosion;
|
import net.minecraft.network.Packet60Explosion;
|
||||||
import net.minecraft.world.ChunkPosition;
|
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) {
|
public static boolean isAnObstructingBlock(Block block, World world, int x, int y, int z) {
|
||||||
Block block = Block.blocksList[blockID];
|
if (block == null || block.isAirBlock(world, x, y, z))
|
||||||
|
|
||||||
if (blockID == 0 || block == null || block.isAirBlock(world, x, y, z))
|
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -96,19 +95,17 @@ public class BlockUtil {
|
||||||
return canChangeBlock(world.getBlockId(x, y, z), world, x, y, z);
|
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) {
|
public static boolean canChangeBlock(Block block, World world, int x, int y, int z) {
|
||||||
Block block = Block.blocksList[blockID];
|
if (block == null || block.isAirBlock(world, x, y, z))
|
||||||
|
|
||||||
if (blockID == 0 || block == null || block.isAirBlock(world, x, y, z))
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (block.getBlockHardness(world, x, y, z) < 0)
|
if (block.getBlockHardness(world, x, y, z) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (blockID == BuildCraftEnergy.blockOil.blockID)
|
if (block == BuildCraftEnergy.blockOil)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (blockID == Block.lavaStill.blockID || blockID == Block.lavaMoving.blockID)
|
if (block == Blocks.lava || block == Blocks.lava)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -118,10 +115,8 @@ public class BlockUtil {
|
||||||
return isSoftBlock(world.getBlockId(x, y, z), world, x, y, z);
|
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) {
|
public static boolean isSoftBlock(Block block, World world, int x, int y, int z) {
|
||||||
Block block = Block.blocksList[blockID];
|
return block == null || BuildCraftAPI.softBlocks[blockID] || block.isAirBlock(world, x, y, z);
|
||||||
|
|
||||||
return blockID == 0 || block == null || BuildCraftAPI.softBlocks[blockID] || block.isAirBlock(world, x, y, z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -142,35 +137,34 @@ public class BlockUtil {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Fluid getFluid(int blockId) {
|
public static Fluid getFluid(Block block) {
|
||||||
Block block = Block.blocksList[blockId];
|
|
||||||
if (block instanceof IFluidBlock) {
|
if (block instanceof IFluidBlock) {
|
||||||
return ((IFluidBlock) block).getFluid();
|
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;
|
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 FluidRegistry.LAVA;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FluidStack drainBlock(World world, int x, int y, int z, boolean doDrain) {
|
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) {
|
public static FluidStack drainBlock(Block block, World world, int x, int y, int z, boolean doDrain) {
|
||||||
if (Block.blocksList[blockId] instanceof IFluidBlock) {
|
if (block instanceof IFluidBlock) {
|
||||||
IFluidBlock fluidBlock = (IFluidBlock) Block.blocksList[blockId];
|
IFluidBlock fluidBlock = (IFluidBlock) block;
|
||||||
if (fluidBlock.canDrain(world, x, y, z))
|
if (fluidBlock.canDrain(world, x, y, z))
|
||||||
return fluidBlock.drain(world, x, y, z, doDrain);
|
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);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta != 0)
|
if (meta != 0)
|
||||||
return null;
|
return null;
|
||||||
if (doDrain)
|
if (doDrain)
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
return new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME);
|
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);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta != 0)
|
if (meta != 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class Utils {
|
||||||
Position pos = new Position(x, y, z, orientation);
|
Position pos = new Position(x, y, z, orientation);
|
||||||
pos.moveForwards(1.0);
|
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);
|
ITransactor transactor = Transactor.getTransactorFor(tileInventory);
|
||||||
if (transactor != null && !(tileInventory instanceof TileEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
|
if (transactor != null && !(tileInventory instanceof TileEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
|
||||||
return transactor.add(stack, orientation.getOpposite(), true).stackSize;
|
return transactor.add(stack, orientation.getOpposite(), true).stackSize;
|
||||||
|
@ -150,7 +150,7 @@ public class Utils {
|
||||||
|
|
||||||
pos.moveForwards(1.0);
|
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) {
|
if (tile instanceof IPipeTile) {
|
||||||
IPipeTile pipe = (IPipeTile) tile;
|
IPipeTile pipe = (IPipeTile) tile;
|
||||||
|
@ -179,16 +179,16 @@ public class Utils {
|
||||||
tmp.orientation = step;
|
tmp.orientation = step;
|
||||||
tmp.moveForwards(1.0);
|
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) {
|
public static IAreaProvider getNearbyAreaProvider(World world, int i, int j, int k) {
|
||||||
TileEntity a1 = world.getBlockTileEntity(i + 1, j, k);
|
TileEntity a1 = world.getTileEntity(i + 1, j, k);
|
||||||
TileEntity a2 = world.getBlockTileEntity(i - 1, j, k);
|
TileEntity a2 = world.getTileEntity(i - 1, j, k);
|
||||||
TileEntity a3 = world.getBlockTileEntity(i, j, k + 1);
|
TileEntity a3 = world.getTileEntity(i, j, k + 1);
|
||||||
TileEntity a4 = world.getBlockTileEntity(i, j, k - 1);
|
TileEntity a4 = world.getTileEntity(i, j, k - 1);
|
||||||
TileEntity a5 = world.getBlockTileEntity(i, j + 1, k);
|
TileEntity a5 = world.getTileEntity(i, j + 1, k);
|
||||||
TileEntity a6 = world.getBlockTileEntity(i, j - 1, k);
|
TileEntity a6 = world.getTileEntity(i, j - 1, k);
|
||||||
|
|
||||||
if (a1 instanceof IAreaProvider) {
|
if (a1 instanceof IAreaProvider) {
|
||||||
return (IAreaProvider) a1;
|
return (IAreaProvider) a1;
|
||||||
|
@ -309,7 +309,7 @@ public class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void preDestroyBlock(World world, int i, int j, int k) {
|
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 IInventory && !CoreProxy.proxy.isRenderWorld(world)) {
|
||||||
if (!(tile instanceof IDropControlInventory) || ((IDropControlInventory) tile).doDrop()) {
|
if (!(tile instanceof IDropControlInventory) || ((IDropControlInventory) tile).doDrop()) {
|
||||||
|
|
|
@ -12,7 +12,10 @@ import buildcraft.energy.render.EntityDropParticleFX;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.particle.EntityFX;
|
import net.minecraft.client.particle.EntityFX;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -33,8 +36,8 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
|
||||||
protected float particleGreen;
|
protected float particleGreen;
|
||||||
protected float particleBlue;
|
protected float particleBlue;
|
||||||
|
|
||||||
public BlockBuildcraftFluid(int id, Fluid fluid, Material material) {
|
public BlockBuildcraftFluid(Fluid fluid, Material material) {
|
||||||
super(id, fluid, material);
|
super(fluid, material);
|
||||||
}
|
}
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
protected IIcon[] theIcon;
|
protected IIcon[] theIcon;
|
||||||
|
@ -48,13 +51,13 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
this.theIcon = new Icon[] { iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow") };
|
this.theIcon = new IIcon[] { iconRegister.registerIcon("buildcraft:" + fluidName + "_still"), iconRegister.registerIcon("buildcraft:" + fluidName + "_flow") };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, int x, int y, int z, int blockId) {
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||||
super.onNeighborBlockChange(world, x, y, z, blockId);
|
super.onNeighborBlockChange(world, x, y, z, block);
|
||||||
if (flammable && world.provider.dimensionId == -1) {
|
if (flammable && world.provider.dimensionId == -1) {
|
||||||
world.newExplosion(null, x, y, z, 4F, true, true);
|
world.newExplosion(null, x, y, z, 4F, true, true);
|
||||||
world.setBlockToAir(x, y, z);
|
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) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
super.randomDisplayTick(world, x, y, z, 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 px = (double) ((float) x + rand.nextFloat());
|
||||||
double py = (double) y - 1.05D;
|
double py = (double) y - 1.05D;
|
||||||
double pz = (double) ((float) z + rand.nextFloat());
|
double pz = (double) ((float) z + rand.nextFloat());
|
||||||
|
@ -115,14 +118,14 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
|
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 false;
|
||||||
return super.canDisplace(world, x, y, z);
|
return super.canDisplace(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean displaceIfPossible(World world, int x, int y, int z) {
|
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 false;
|
||||||
return super.displaceIfPossible(world, x, y, z);
|
return super.displaceIfPossible(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,15 +12,20 @@ import buildcraft.core.BlockBuildCraft;
|
||||||
import buildcraft.core.IItemPipe;
|
import buildcraft.core.IItemPipe;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@ -30,9 +35,9 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
private static IIcon stoneTexture;
|
private static IIcon stoneTexture;
|
||||||
private static IIcon ironTexture;
|
private static IIcon ironTexture;
|
||||||
|
|
||||||
public BlockEngine(int i) {
|
public BlockEngine() {
|
||||||
super(i, Material.iron);
|
super(Material.iron);
|
||||||
setUnlocalizedName("engineBlock");
|
setBlockName("engineBlock");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +52,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||||
woodTexture = par1IconRegister.registerIcon("buildcraft:engineWoodBottom");
|
woodTexture = par1IconRegister.registerIcon("buildcraft:engineWoodBottom");
|
||||||
stoneTexture = par1IconRegister.registerIcon("buildcraft:engineStoneBottom");
|
stoneTexture = par1IconRegister.registerIcon("buildcraft:engineStoneBottom");
|
||||||
ironTexture = par1IconRegister.registerIcon("buildcraft:engineIronBottom");
|
ironTexture = par1IconRegister.registerIcon("buildcraft:engineIronBottom");
|
||||||
|
@ -69,8 +74,8 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
|
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
if (tile instanceof TileEngine) {
|
if (tile instanceof TileEngine) {
|
||||||
return ((TileEngine) tile).orientation.getOpposite() == side;
|
return ((TileEngine) tile).orientation.getOpposite() == side;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +84,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
|
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) {
|
if (tile instanceof TileEngine) {
|
||||||
return ((TileEngine) tile).switchOrientation(false);
|
return ((TileEngine) tile).switchOrientation(false);
|
||||||
}
|
}
|
||||||
|
@ -89,7 +94,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int side, float par7, float par8, float par9) {
|
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
|
// Drop through if the player is sneaking
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
|
@ -111,7 +116,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPostBlockPlaced(World world, int x, int y, int z, int par5) {
|
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;
|
tile.orientation = ForgeDirection.UP;
|
||||||
if (!tile.isOrientationValid())
|
if (!tile.isOrientationValid())
|
||||||
tile.switchOrientation(true);
|
tile.switchOrientation(true);
|
||||||
|
@ -125,7 +130,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
@SuppressWarnings({"all"})
|
@SuppressWarnings({"all"})
|
||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick(World world, int i, int j, int k, Random random) {
|
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())
|
if (!tile.isBurning())
|
||||||
return;
|
return;
|
||||||
|
@ -144,15 +149,15 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
@Override
|
@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, 0));
|
||||||
itemList.add(new ItemStack(this, 1, 1));
|
itemList.add(new ItemStack(this, 1, 1));
|
||||||
itemList.add(new ItemStack(this, 1, 2));
|
itemList.add(new ItemStack(this, 1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l) {
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||||
TileEngine tile = (TileEngine) world.getBlockTileEntity(i, j, k);
|
TileEngine tile = (TileEngine) world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
tile.checkRedstonePower();
|
tile.checkRedstonePower();
|
||||||
|
@ -175,7 +180,7 @@ public class BlockEngine extends BlockBuildCraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -35,7 +35,7 @@ public class BptBlockEngine extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) {
|
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());
|
bptSlot.cpt.setInteger("orientation", engine.orientation.ordinal());
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class BptBlockEngine extends BptBlock {
|
||||||
public void buildBlock(BptSlotInfo slot, IBptContext context) {
|
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, 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"));
|
engine.orientation = ForgeDirection.getOrientation(slot.cpt.getInteger("orientation"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,11 @@ public class BucketHandler {
|
||||||
|
|
||||||
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
|
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]);
|
Item bucket = buckets.get(Block.blocksList[blockID]);
|
||||||
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
|
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);
|
return new ItemStack(bucket);
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
if (!world.blockExists(x, y, z))
|
if (!world.blockExists(x, y, z))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
if (!(tile instanceof TileEngineWithInventory))
|
if (!(tile instanceof TileEngineWithInventory))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
if (!world.blockExists(x, y, z))
|
if (!world.blockExists(x, y, z))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
if (!(tile instanceof TileEngineWithInventory))
|
if (!(tile instanceof TileEngineWithInventory))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ import buildcraft.core.CreativeTabBuildCraft;
|
||||||
import buildcraft.core.utils.StringUtils;
|
import buildcraft.core.utils.StringUtils;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBucket;
|
import net.minecraft.item.ItemBucket;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -20,10 +22,10 @@ public class ItemBucketBuildcraft extends ItemBucket {
|
||||||
|
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
||||||
public ItemBucketBuildcraft(int i, int blockId) {
|
public ItemBucketBuildcraft(Block block) {
|
||||||
super(i, blockId);
|
super(block);
|
||||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||||
setContainerItem(Item.bucketEmpty);
|
setContainerItem(Items.bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,9 +34,9 @@ public class ItemBucketBuildcraft extends ItemBucket {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item setUnlocalizedName(String par1Str) {
|
public Item setBlockName(String par1Str) {
|
||||||
iconName = par1Str;
|
iconName = par1Str;
|
||||||
return super.setUnlocalizedName(par1Str);
|
return super.setBlockName(par1Str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -431,4 +431,9 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
|
||||||
|
|
||||||
return triggers;
|
return triggers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class TileEngineLegacy extends TileEngine {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
worldObj.removeBlockTileEntity(xCoord, yCoord, zCoord);
|
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
|
||||||
TileEntity newTile = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord);
|
TileEntity newTile = worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||||
if (newTile instanceof TileEngine) {
|
if (newTile instanceof TileEngine) {
|
||||||
newTile.readFromNBT(nbt);
|
newTile.readFromNBT(nbt);
|
||||||
sendNetworkUpdate();
|
sendNetworkUpdate();
|
||||||
|
|
|
@ -162,4 +162,9 @@ public class TileEngineStone extends TileEngineWithInventory {
|
||||||
|
|
||||||
return triggers;
|
return triggers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -47,7 +47,7 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInvName() {
|
public String getInventoryName() {
|
||||||
return "Engine";
|
return "Engine";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,15 +58,15 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
|
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -80,7 +80,7 @@ public class EntityDropParticleFX extends EntityFX {
|
||||||
this.motionZ *= 0.699999988079071D;
|
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()) {
|
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))));
|
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))));
|
||||||
|
|
|
@ -20,12 +20,12 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import static net.minecraftforge.common.ForgeDirection.DOWN;
|
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||||
import static net.minecraftforge.common.ForgeDirection.EAST;
|
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||||
import static net.minecraftforge.common.ForgeDirection.NORTH;
|
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||||
import static net.minecraftforge.common.ForgeDirection.SOUTH;
|
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||||
import static net.minecraftforge.common.ForgeDirection.UP;
|
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||||
import static net.minecraftforge.common.ForgeDirection.WEST;
|
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer {
|
public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer {
|
||||||
|
|
|
@ -30,8 +30,8 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
|
||||||
IIcon topTexture;
|
IIcon topTexture;
|
||||||
IIcon sideTexture;
|
IIcon sideTexture;
|
||||||
|
|
||||||
public BlockAutoWorkbench(int i) {
|
public BlockAutoWorkbench() {
|
||||||
super(i, Material.wood);
|
super(Material.wood);
|
||||||
setHardness(3.0F);
|
setHardness(3.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileAutoWorkbench();
|
return new TileAutoWorkbench();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister par1IconRegister)
|
public void registerBlockIcons(IIconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
topTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_top");
|
topTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_top");
|
||||||
sideTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_side");
|
sideTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_side");
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue