diff --git a/build.xml b/build.xml
index 39a6a78e..2d9627aa 100644
--- a/build.xml
+++ b/build.xml
@@ -19,12 +19,13 @@
-
+
-
+
+
@@ -99,7 +100,7 @@
-
+
diff --git a/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below25.png b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below25.png
new file mode 100644
index 00000000..a6ff8872
Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below25.png differ
diff --git a/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below50.png b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below50.png
new file mode 100644
index 00000000..33f6d298
Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below50.png differ
diff --git a/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below75.png b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below75.png
new file mode 100644
index 00000000..4ff5dc73
Binary files /dev/null and b/buildcraft_resources/assets/buildcraft/textures/items/triggers/trigger_liquidcontainer_below75.png differ
diff --git a/buildcraft_resources/lang/buildcraft/en_US.properties b/buildcraft_resources/lang/buildcraft/en_US.properties
index 6b112e2f..2f2cadc9 100644
--- a/buildcraft_resources/lang/buildcraft/en_US.properties
+++ b/buildcraft_resources/lang/buildcraft/en_US.properties
@@ -57,10 +57,11 @@ gate.trigger.engine.blue=Engine Blue
gate.trigger.engine.green=Engine Green
gate.trigger.engine.yellow=Engine Yellow
gate.trigger.engine.red=Engine Red
-gate.trigger.fluid.emtpy=Tank Empty
+gate.trigger.fluid.empty=Tank Empty
gate.trigger.fluid.contains=Fluid in Tank
gate.trigger.fluid.space=Space for Fluid
gate.trigger.fluid.full=Tank Full
+gate.trigger.fluidlevel.below=Contains < %d%%
gate.trigger.inventory.empty=Inventory Empty
gate.trigger.inventory.contains=Items in Inventory
gate.trigger.inventory.space=Space in Inventory
diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java
index 5b9e0407..ed129999 100644
--- a/common/buildcraft/BuildCraftBuilders.java
+++ b/common/buildcraft/BuildCraftBuilders.java
@@ -69,6 +69,7 @@ import buildcraft.core.InterModComms;
import buildcraft.core.Version;
import buildcraft.core.blueprints.BptPlayerIndex;
import buildcraft.core.blueprints.BptRootIndex;
+import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BCLog;
import cpw.mods.fml.common.Mod;
@@ -78,7 +79,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
-import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@@ -91,18 +92,18 @@ import java.util.LinkedList;
import java.util.TreeMap;
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.client.event.TextureStitchEvent;
-import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.Property;
-import net.minecraftforge.event.ForgeSubscribe;
+import net.minecraftforge.common.config.Property;
@Mod(name = "BuildCraft Builders", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerBuilders.class, clientSideRequired = true, serverSideRequired = true)
-public class BuildCraftBuilders {
+public class BuildCraftBuilders extends BuildCraftMod {
public static final char BPT_SEP_CHARACTER = '-';
public static final int LIBRARY_PAGE_SIZE = 12;
@@ -145,12 +146,16 @@ public class BuildCraftBuilders {
@EventHandler
public void init(FMLInitializationEvent evt) {
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-BUILDERS", new PacketHandlerBuilders());
+
// Register gui handler
- NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
+ NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
// Register save handler
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
+ /*
new BptBlock(0); // default bpt block
new BptBlockIgnore(Block.snow.blockID);
@@ -236,7 +241,7 @@ public class BuildCraftBuilders {
new BptBlockInventory(libraryBlock.blockID);
new BptBlockWallSide(markerBlock.blockID);
- new BptBlockWallSide(pathMarkerBlock.blockID);
+ new BptBlockWallSide(pathMarkerBlock.blockID);*/
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@@ -246,16 +251,6 @@ public class BuildCraftBuilders {
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
- Property templateItemId = BuildCraftCore.mainConfiguration.getItem("templateItem.id", DefaultProps.TEMPLATE_ITEM_ID);
- Property blueprintItemId = BuildCraftCore.mainConfiguration.getItem("blueprintItem.id", DefaultProps.BLUEPRINT_ITEM_ID);
- Property markerId = BuildCraftCore.mainConfiguration.getBlock("marker.id", DefaultProps.MARKER_ID);
- Property pathMarkerId = BuildCraftCore.mainConfiguration.getBlock("pathMarker.id", DefaultProps.PATH_MARKER_ID);
- Property fillerId = BuildCraftCore.mainConfiguration.getBlock("filler.id", DefaultProps.FILLER_ID);
- Property builderId = BuildCraftCore.mainConfiguration.getBlock("builder.id", DefaultProps.BUILDER_ID);
- Property architectId = BuildCraftCore.mainConfiguration.getBlock("architect.id", DefaultProps.ARCHITECT_ID);
- Property libraryId = BuildCraftCore.mainConfiguration.getBlock("blueprintLibrary.id", DefaultProps.BLUEPRINT_LIBRARY_ID);
- Property urbanistId = BuildCraftCore.mainConfiguration.getBlock("urbanist.id", DefaultProps.URBANIST_ID);
-
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "filler.destroy", DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
@@ -268,42 +263,43 @@ public class BuildCraftBuilders {
fillerLifespanNormalProp.comment = "Lifespan in ticks of items dropped by the filler from non-tough blocks (those that can be broken by hand)";
fillerLifespanNormal = fillerLifespanNormalProp.getInt(DefaultProps.FILLER_LIFESPAN_NORMAL);
- templateItem = new ItemBlueprintTemplate(templateItemId.getInt());
+
+ templateItem = new ItemBlueprintTemplate();
templateItem.setUnlocalizedName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
CoreProxy.proxy.registerItem(templateItem);
- blueprintItem = new ItemBlueprintStandard(blueprintItemId.getInt());
+ blueprintItem = new ItemBlueprintStandard();
blueprintItem.setUnlocalizedName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
CoreProxy.proxy.registerItem(blueprintItem);
- markerBlock = new BlockMarker(markerId.getInt());
- CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock"));
+ markerBlock = new BlockMarker();
+ CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
CoreProxy.proxy.addName(markerBlock, "Land Mark");
- pathMarkerBlock = new BlockPathMarker(pathMarkerId.getInt());
- CoreProxy.proxy.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"));
+ pathMarkerBlock = new BlockPathMarker();
+ CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
- fillerBlock = new BlockFiller(fillerId.getInt());
- CoreProxy.proxy.registerBlock(fillerBlock.setUnlocalizedName("fillerBlock"));
+ fillerBlock = new BlockFiller();
+ CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
CoreProxy.proxy.addName(fillerBlock, "Filler");
- builderBlock = new BlockBuilder(builderId.getInt());
- CoreProxy.proxy.registerBlock(builderBlock.setUnlocalizedName("builderBlock"));
+ builderBlock = new BlockBuilder();
+ CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
CoreProxy.proxy.addName(builderBlock, "Builder");
- architectBlock = new BlockArchitect(architectId.getInt());
- CoreProxy.proxy.registerBlock(architectBlock.setUnlocalizedName("architectBlock"));
+ architectBlock = new BlockArchitect();
+ CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
CoreProxy.proxy.addName(architectBlock, "Architect Table");
- libraryBlock = new BlockBlueprintLibrary(libraryId.getInt());
- CoreProxy.proxy.registerBlock(libraryBlock.setUnlocalizedName("libraryBlock"));
+ libraryBlock = new BlockBlueprintLibrary();
+ CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
- urbanistBlock = new BlockUrbanist (urbanistId.getInt());
- CoreProxy.proxy.registerBlock(urbanistBlock.setUnlocalizedName("urbanistBlock"));
+ urbanistBlock = new BlockUrbanist ();
+ CoreProxy.proxy.registerBlock(urbanistBlock.setBlockName("urbanistBlock"));
CoreProxy.proxy.addName(urbanistBlock, "Urbanist");
CoreProxy.proxy.registerTileEntity(TileUrbanist.class, "net.minecraft.src.builders.TileUrbanist");
@@ -347,17 +343,17 @@ public class BuildCraftBuilders {
// new ItemStack(Item.dyePowder, 1, 0), 'p', Item.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), new Object[]{"ppp", "pip", "ppp", 'i',
- new ItemStack(Item.dyePowder, 1, 4), 'p', Item.paper});
+ new ItemStack(Items.dye, 1, 4), 'p', Items.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", 'l',
- new ItemStack(Item.dyePowder, 1, 4), 'r', Block.torchRedstoneActive});
+ new ItemStack(Items.dye, 1, 4), 'r', Blocks.redstone_torch});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", 'l',
// new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
- new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
- 'c', Block.workbench, 'g', BuildCraftCore.goldGearItem, 'C', Block.chest});
+ new ItemStack(Items.dye, 1, 0), 't', markerBlock, 'y', new ItemStack(Items.dye, 1, 11),
+ 'c', Blocks.crafting_table, 'g', BuildCraftCore.goldGearItem, 'C', Blocks.chest});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
// new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
@@ -369,7 +365,7 @@ public class BuildCraftBuilders {
// new ItemStack(templateItem, 1)});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), new Object[]{"bbb", "bBb", "bbb", 'b',
- new ItemStack(blueprintItem), 'B', Block.bookShelf});
+ new ItemStack(blueprintItem), 'B', Blocks.bookshelf});
}
@EventHandler
@@ -411,8 +407,8 @@ public class BuildCraftBuilders {
return rootBptIndex;
}
- public static ItemStack getBptItemStack(int id, int damage, String name) {
- ItemStack stack = new ItemStack(id, 1, damage);
+ public static ItemStack getBptItemStack(Item item, int damage, String name) {
+ ItemStack stack = new ItemStack(item, 1, damage);
NBTTagCompound nbt = new NBTTagCompound();
if (name != null && !"".equals(name)) {
nbt.setString("BptName", name);
@@ -432,20 +428,20 @@ public class BuildCraftBuilders {
TilePathMarker.clearAvailableMarkersList();
}
- @ForgeSubscribe
+ @SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
- if (evt.map.textureType == 0) {
+ if (evt.map.getTextureType() == 0) {
for (FillerPattern pattern : FillerPattern.patterns.values()) {
pattern.registerIcon(evt.map);
}
}
}
- @ForgeSubscribe
+ @SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
- if (event.map.textureType == 1) {
+ if (event.map.getTextureType() == 1) {
UrbanistToolsIconProvider.INSTANCE.registerIcons(event.map);
}
}
diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java
index e11721a3..8053eca5 100644
--- a/common/buildcraft/BuildCraftCore.java
+++ b/common/buildcraft/BuildCraftCore.java
@@ -8,22 +8,30 @@
*/
package buildcraft;
+import static buildcraft.BuildCraftEnergy.spawnOilSprings;
+
import java.io.File;
+import java.util.EnumMap;
import java.util.TreeMap;
import net.minecraft.block.Block;
-import net.minecraft.block.BlockFluid;
import net.minecraft.entity.EntityList;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.Icon;
+import net.minecraft.network.Packet;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
import net.minecraftforge.client.event.TextureStitchEvent;
-import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.Property;
-import net.minecraftforge.event.ForgeSubscribe;
+import net.minecraftforge.common.config.Property;
import net.minecraftforge.oredict.OreDictionary;
+import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.IFluidBlock;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IIconProvider;
@@ -48,6 +56,7 @@ import buildcraft.core.SpringPopulate;
import buildcraft.core.TickHandlerCoreClient;
import buildcraft.core.Version;
import buildcraft.core.blueprints.BptItem;
+import buildcraft.core.network.BuildCraftPacket;
import buildcraft.core.network.EntityIds;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.network.PacketUpdate;
@@ -61,6 +70,7 @@ import buildcraft.core.triggers.BCTrigger;
import buildcraft.core.triggers.DefaultActionProvider;
import buildcraft.core.triggers.DefaultTriggerProvider;
import buildcraft.core.triggers.TriggerFluidContainer;
+import buildcraft.core.triggers.TriggerFluidContainerLevel;
import buildcraft.core.triggers.TriggerInventory;
import buildcraft.core.triggers.TriggerInventoryLevel;
import buildcraft.core.triggers.TriggerMachine;
@@ -73,6 +83,7 @@ import buildcraft.core.robots.EntityRobot;
import buildcraft.core.robots.EntityRobotBuilder;
import buildcraft.core.robots.EntityRobotPicker;
import buildcraft.core.triggers.TriggerRedstoneInput;
+import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@@ -81,19 +92,17 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
-import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.network.FMLEmbeddedChannel;
+import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.6.4,1.7)", dependencies = "required-after:Forge@[9.11.1.953,)")
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
-public class BuildCraftCore {
-
+@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.7.2,1.8)", dependencies = "required-after:Forge@[10.12.0.1024,)")
+public class BuildCraftCore extends BuildCraftMod {
public static enum RenderMode {
-
Full, NoDynamic
};
public static RenderMode render = RenderMode.Full;
@@ -105,7 +114,10 @@ public class BuildCraftCore {
public static int updateFactor = 10;
public static long longUpdateFactor = 40;
public static BuildCraftConfiguration mainConfiguration;
+
+ // TODO: This doesn't seem used anymore. Remove if it's the case.
public static TreeMap bufferedDescriptions = new TreeMap();
+
public static final int trackedPassiveEntityId = 156;
public static boolean continuousCurrentModel;
public static Block springBlock;
@@ -120,19 +132,18 @@ public class BuildCraftCore {
public static Item robotBuilderItem;
public static Item robotPickerItem;
@SideOnly(Side.CLIENT)
- public static Icon redLaserTexture;
+ public static IIcon redLaserTexture;
@SideOnly(Side.CLIENT)
- public static Icon blueLaserTexture;
+ public static IIcon blueLaserTexture;
@SideOnly(Side.CLIENT)
- public static Icon stripesLaserTexture;
+ public static IIcon stripesLaserTexture;
@SideOnly(Side.CLIENT)
- public static Icon transparentTexture;
+ public static IIcon transparentTexture;
@SideOnly(Side.CLIENT)
public static IIconProvider iconProvider;
public static int blockByEntityModel;
public static int legacyPipeModel;
public static int markerModel;
- public static int oilModel;
public static BCTrigger triggerMachineActive = new TriggerMachine(true);
public static BCTrigger triggerMachineInactive = new TriggerMachine(false);
public static BCTrigger triggerEmptyInventory = new TriggerInventory(TriggerInventory.State.Empty);
@@ -148,6 +159,9 @@ public class BuildCraftCore {
public static BCTrigger triggerInventoryBelow25 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_25);
public static BCTrigger triggerInventoryBelow50 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_50);
public static BCTrigger triggerInventoryBelow75 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_75);
+ public static BCTrigger triggerFluidContainerBelow25 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_25);
+ public static BCTrigger triggerFluidContainerBelow50 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_50);
+ public static BCTrigger triggerFluidContainerBelow75 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_75);
public static BCAction actionRedstone = new ActionRedstoneOutput();
public static BCAction actionOn = new ActionMachineControl(Mode.On);
public static BCAction actionOff = new ActionMachineControl(Mode.Off);
@@ -155,7 +169,7 @@ public class BuildCraftCore {
public static boolean loadDefaultRecipes = true;
public static boolean forcePneumaticPower = true;
public static boolean consumeWaterSources = false;
- public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
+ //public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
@Instance("BuildCraft|Core")
public static BuildCraftCore instance;
@@ -202,30 +216,17 @@ public class BuildCraftCore {
longFactor.comment = "delay between full client sync packets, increasing it saves bandwidth, decreasing makes for better client syncronization.";
longUpdateFactor = longFactor.getInt(40);
- Property wrenchId = BuildCraftCore.mainConfiguration.getItem("wrench.id", DefaultProps.WRENCH_ID);
-
- wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setUnlocalizedName("wrenchItem");
+ wrenchItem = (new ItemWrench()).setUnlocalizedName("wrenchItem");
LanguageRegistry.addName(wrenchItem, "Wrench");
CoreProxy.proxy.registerItem(wrenchItem);
- int springId = BuildCraftCore.mainConfiguration.getBlock("springBlock.id", DefaultProps.SPRING_ID).getInt(DefaultProps.SPRING_ID);
-
- Property woodenGearId = BuildCraftCore.mainConfiguration.getItem("woodenGearItem.id", DefaultProps.WOODEN_GEAR_ID);
- Property stoneGearId = BuildCraftCore.mainConfiguration.getItem("stoneGearItem.id", DefaultProps.STONE_GEAR_ID);
- Property ironGearId = BuildCraftCore.mainConfiguration.getItem("ironGearItem.id", DefaultProps.IRON_GEAR_ID);
- Property goldenGearId = BuildCraftCore.mainConfiguration.getItem("goldenGearItem.id", DefaultProps.GOLDEN_GEAR_ID);
- Property diamondGearId = BuildCraftCore.mainConfiguration.getItem("diamondGearItem.id", DefaultProps.DIAMOND_GEAR_ID);
- Property redstoneCrystalId = BuildCraftCore.mainConfiguration.getItem("redstoneCrystalItem.id", DefaultProps.REDSTONE_CRYSTAL_ID);
- Property robotBaseItemId = BuildCraftCore.mainConfiguration.getItem("robotBaseItem.id", DefaultProps.ROBOT_BASE_ITEM_ID);
- Property robotBuilderItemId = BuildCraftCore.mainConfiguration.getItem("robotBuilderItem.id", DefaultProps.ROBOT_BUILDER_ITEM_ID);
- Property robotPickerItemId = BuildCraftCore.mainConfiguration.getItem("robotPickerItem.id", DefaultProps.ROBOT_PICKER_ITEM_ID);
Property modifyWorldProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "modifyWorld", true);
modifyWorldProp.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
modifyWorld = modifyWorldProp.getBoolean(true);
- if (BuildCraftCore.modifyWorld && springId > 0) {
+ if (BuildCraftCore.modifyWorld) {
BlockSpring.EnumSpring.WATER.canGen = BuildCraftCore.mainConfiguration.get("worldgen", "waterSpring", true).getBoolean(true);
- springBlock = new BlockSpring(springId).setUnlocalizedName("eternalSpring");
+ springBlock = new BlockSpring().setBlockName("eternalSpring");
CoreProxy.proxy.registerBlock(springBlock, ItemSpring.class);
}
@@ -233,54 +234,37 @@ public class BuildCraftCore {
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
consumeWater.comment = "set to true if the Pump should consume water";
- woodenGearItem = (new ItemBuildCraft(woodenGearId.getInt())).setUnlocalizedName("woodenGearItem");
+ woodenGearItem = (new ItemBuildCraft()).setUnlocalizedName("woodenGearItem");
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
CoreProxy.proxy.registerItem(woodenGearItem);
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
- stoneGearItem = (new ItemBuildCraft(stoneGearId.getInt())).setUnlocalizedName("stoneGearItem");
+ stoneGearItem = (new ItemBuildCraft()).setUnlocalizedName("stoneGearItem");
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
CoreProxy.proxy.registerItem(stoneGearItem);
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
- ironGearItem = (new ItemBuildCraft(ironGearId.getInt())).setUnlocalizedName("ironGearItem");
+ ironGearItem = (new ItemBuildCraft()).setUnlocalizedName("ironGearItem");
LanguageRegistry.addName(ironGearItem, "Iron Gear");
CoreProxy.proxy.registerItem(ironGearItem);
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
- goldGearItem = (new ItemBuildCraft(goldenGearId.getInt())).setUnlocalizedName("goldGearItem");
+ goldGearItem = (new ItemBuildCraft()).setUnlocalizedName("goldGearItem");
LanguageRegistry.addName(goldGearItem, "Gold Gear");
CoreProxy.proxy.registerItem(goldGearItem);
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
- diamondGearItem = (new ItemBuildCraft(diamondGearId.getInt())).setUnlocalizedName("diamondGearItem");
+ diamondGearItem = (new ItemBuildCraft()).setUnlocalizedName("diamondGearItem");
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
CoreProxy.proxy.registerItem(diamondGearItem);
OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
- redstoneCrystal = (new ItemBuildCraft(redstoneCrystalId.getInt())).setUnlocalizedName("redstoneCrystal");
+ redstoneCrystal = (new ItemBuildCraft()).setUnlocalizedName("redstoneCrystal");
LanguageRegistry.addName(redstoneCrystal, "Redstone Crystal");
CoreProxy.proxy.registerItem(redstoneCrystal);
OreDictionary.registerOre("redstoneCrystal", new ItemStack(redstoneCrystal));
- robotBaseItem = (new ItemRobot(robotBaseItemId.getInt(), EntityRobot.class)).setUnlocalizedName("robotBaseItem");
- LanguageRegistry.addName(robotBaseItem, "Base Robot");
- CoreProxy.proxy.registerItem(robotBaseItem);
-
- robotBuilderItem = (new ItemRobot(robotBuilderItemId.getInt(), EntityRobotBuilder.class)).setUnlocalizedName("robotBuilderItem");
- LanguageRegistry.addName(robotBuilderItem, "Builder Robot");
- CoreProxy.proxy.registerItem(robotBuilderItem);
-
- robotPickerItem = (new ItemRobot(robotPickerItemId.getInt(), EntityRobotPicker.class)).setUnlocalizedName("robotPickerItem");
- LanguageRegistry.addName(robotPickerItem, "Picker Robot");
- CoreProxy.proxy.registerItem(robotPickerItem);
-
-
- Property colorBlindProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "client.colorblindmode", false);
- colorBlindProp.comment = "Set to true to enable alternate textures";
- colorBlindMode = colorBlindProp.getBoolean(false);
-
- MinecraftForge.EVENT_BUS.register(this);
+ MinecraftForge.EVENT_BUS.register(this);
} finally {
if (mainConfiguration.hasChanged()) {
mainConfiguration.save();
@@ -291,7 +275,9 @@ public class BuildCraftCore {
@EventHandler
public void initialize(FMLInitializationEvent evt) {
- // MinecraftForge.registerConnectionHandler(new ConnectionHandler());
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-CORE", new PacketHandler());
+
ActionManager.registerTriggerProvider(new DefaultTriggerProvider());
ActionManager.registerActionProvider(new DefaultActionProvider());
@@ -325,17 +311,19 @@ public class BuildCraftCore {
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
- for (Block block : Block.blocksList) {
- if (block instanceof BlockFluid || block instanceof IFluidBlock || block instanceof IPlantable) {
- BuildCraftAPI.softBlocks[block.blockID] = true;
+ for (Object o : Block.blockRegistry) {
+ Block block = (Block) o;
+
+ if (block instanceof BlockFluidBase || block instanceof IFluidBlock || block instanceof IPlantable) {
+ BuildCraftAPI.softBlocks.add(block);
}
}
-
- BuildCraftAPI.softBlocks[Block.snow.blockID] = true;
- BuildCraftAPI.softBlocks[Block.vine.blockID] = true;
- BuildCraftAPI.softBlocks[Block.fire.blockID] = true;
- TickRegistry.registerTickHandler(new TickHandlerCoreClient(), Side.CLIENT);
-
+
+ BuildCraftAPI.softBlocks.add(Blocks.snow);
+ BuildCraftAPI.softBlocks.add(Blocks.vine);
+ BuildCraftAPI.softBlocks.add(Blocks.fire);
+
+ FMLCommonHandler.instance().bus().register(new TickHandlerCoreClient());
}
@EventHandler
@@ -343,14 +331,14 @@ public class BuildCraftCore {
event.registerServerCommand(new CommandBuildCraft());
}
- @ForgeSubscribe
+ @SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
- if (event.map.textureType == 1) {
+ if (event.map.getTextureType() == 1) {
iconProvider = new CoreIconProvider();
iconProvider.registerIcons(event.map);
ActionTriggerIconProvider.INSTANCE.registerIcons(event.map);
- } else if (event.map.textureType == 0) {
+ } else if (event.map.getTextureType() == 0) {
BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraft:blockRedLaser");
BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraft:blockBlueLaser");
BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraft:blockStripesLaser");
@@ -360,13 +348,13 @@ public class BuildCraftCore {
}
public void loadRecipes() {
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Items.iron_ingot, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", 'S', "stickWood");
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", 'I', "cobblestone", 'G',
woodenGearItem);
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", 'I', Item.ingotGold, 'G', ironGearItem);
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Item.diamond, 'G', goldGearItem);
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Items.iron_ingot, 'G', stoneGearItem);
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", 'I', Items.gold_ingot, 'G', ironGearItem);
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Items.diamond, 'G', goldGearItem);
}
@EventHandler
diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java
index fa886f95..981ae76c 100644
--- a/common/buildcraft/BuildCraftEnergy.java
+++ b/common/buildcraft/BuildCraftEnergy.java
@@ -37,6 +37,7 @@ import buildcraft.energy.worldgen.BiomeGenOilDesert;
import buildcraft.energy.worldgen.BiomeGenOilOcean;
import buildcraft.energy.worldgen.BiomeInitializer;
import buildcraft.energy.worldgen.OilPopulate;
+import buildcraft.transport.network.PacketHandlerTransport;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@@ -44,7 +45,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -54,22 +55,22 @@ import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.client.event.TextureStitchEvent;
-import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.Property;
-import net.minecraftforge.event.ForgeSubscribe;
+import net.minecraftforge.common.config.Property;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, clientSideRequired = true, serverSideRequired = true)
-public class BuildCraftEnergy {
+public class BuildCraftEnergy extends BuildCraftMod {
public final static int ENERGY_REMOVE_BLOCK = 25;
public final static int ENERGY_EXTRACT_ITEM = 2;
@@ -103,22 +104,7 @@ public class BuildCraftEnergy {
public static BuildCraftEnergy instance;
@EventHandler
- public void preInit(FMLPreInitializationEvent evt) {
- Property engineId = BuildCraftCore.mainConfiguration.getBlock("engine.id", DefaultProps.ENGINE_ID);
-
- // Update oil tag
- int defaultOilId = DefaultProps.OIL_ID;
- if (BuildCraftCore.mainConfiguration.hasKey(Configuration.CATEGORY_BLOCK, "oilStill.id")) {
- defaultOilId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "oilStill.id", defaultOilId).getInt(defaultOilId);
- BuildCraftCore.mainConfiguration.getCategory(Configuration.CATEGORY_BLOCK).remove("oilStill.id");
- }
- int blockOilId = BuildCraftCore.mainConfiguration.getBlock("oil.id", defaultOilId).getInt(defaultOilId);
-
- int blockFuelId = BuildCraftCore.mainConfiguration.getBlock("fuel.id", DefaultProps.FUEL_ID).getInt(DefaultProps.FUEL_ID);
- int blockRedplasmaId = BuildCraftCore.mainConfiguration.getBlock("redPlasma.id", DefaultProps.REDPLASMA_ID).getInt(DefaultProps.REDPLASMA_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 bucketRedPlasmaId = BuildCraftCore.mainConfiguration.getItem("bucketRedPlasma.id", DefaultProps.BUCKET_REDPLASMA_ID).getInt(DefaultProps.BUCKET_REDPLASMA_ID);
+ public void preInit(FMLPreInitializationEvent evt) {
int oilDesertBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilDesert", DefaultProps.BIOME_OIL_DESERT).getInt(DefaultProps.BIOME_OIL_DESERT);
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
@@ -136,21 +122,21 @@ public class BuildCraftEnergy {
}
if (oilDesertBiomeId > 0) {
- if (BiomeGenBase.biomeList[oilDesertBiomeId] != null) {
+ if (BiomeGenBase.getBiomeGenArray () [oilDesertBiomeId] != null) {
throw new BiomeIdException("oilDesert", oilDesertBiomeId);
}
biomeOilDesert = BiomeGenOilDesert.makeBiome(oilDesertBiomeId);
}
if (oilOceanBiomeId > 0) {
- if (BiomeGenBase.biomeList[oilOceanBiomeId] != null) {
+ if (BiomeGenBase.getBiomeGenArray () [oilOceanBiomeId] != null) {
throw new BiomeIdException("oilOcean", oilOceanBiomeId);
}
biomeOilOcean = BiomeGenOilOcean.makeBiome(oilOceanBiomeId);
}
- engineBlock = new BlockEngine(engineId.getInt(DefaultProps.ENGINE_ID));
+ engineBlock = new BlockEngine();
CoreProxy.proxy.registerBlock(engineBlock, ItemEngine.class);
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
@@ -171,18 +157,14 @@ public class BuildCraftEnergy {
FluidRegistry.registerFluid(buildcraftFluidRedPlasma);
fluidRedPlasma = FluidRegistry.getFluid("redplasma");
- //buildcraftFluidRedPlasma = new BCFluid("fuel");
-
- if (fluidOil.getBlockID() == -1) {
- if (blockOilId > 0) {
- blockOil = new BlockBuildcraftFluid(blockOilId, fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
- blockOil.setUnlocalizedName("blockOil");
- CoreProxy.proxy.addName(blockOil, "Oil");
- CoreProxy.proxy.registerBlock(blockOil);
- fluidOil.setBlockID(blockOil);
- }
+ if (fluidOil.getBlock() == null) {
+ blockOil = new BlockBuildcraftFluid(fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
+ blockOil.setBlockName("blockOil");
+ CoreProxy.proxy.addName(blockOil, "Oil");
+ CoreProxy.proxy.registerBlock(blockOil);
+ fluidOil.setBlock(blockOil);
} else {
- blockOil = Block.blocksList[fluidOil.getBlockID()];
+ blockOil = fluidOil.getBlock();
}
if (blockOil != null) {
@@ -191,60 +173,57 @@ public class BuildCraftEnergy {
BlockSpring.EnumSpring.OIL.liquidBlock = blockOil;
}
- if (fluidFuel.getBlockID() == -1) {
- if (blockFuelId > 0) {
- blockFuel = new BlockBuildcraftFluid(blockFuelId, fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
- blockFuel.setUnlocalizedName("blockFuel");
- CoreProxy.proxy.addName(blockFuel, "Fuel");
- CoreProxy.proxy.registerBlock(blockFuel);
- fluidFuel.setBlockID(blockFuel);
- }
+ if (fluidFuel.getBlock() == null) {
+ blockFuel = new BlockBuildcraftFluid(fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
+ blockFuel.setBlockName("blockFuel");
+ CoreProxy.proxy.addName(blockFuel, "Fuel");
+ CoreProxy.proxy.registerBlock(blockFuel);
+ fluidFuel.setBlock(blockFuel);
} else {
- blockFuel = Block.blocksList[fluidFuel.getBlockID()];
+ blockFuel = fluidFuel.getBlock();
}
- if (fluidRedPlasma.getBlockID() == -1) {
- if (blockRedplasmaId > 0) {
- blockRedPlasma = new BlockBuildcraftFluid(blockRedplasmaId, fluidRedPlasma, Material.water).setFlammable(false).setParticleColor(0.9F, 0, 0);
- blockRedPlasma.setUnlocalizedName("blockRedPlasma");
- CoreProxy.proxy.addName(blockRedPlasma, "Red Plasma");
- CoreProxy.proxy.registerBlock(blockRedPlasma);
- fluidRedPlasma.setBlockID(blockRedPlasma);
- }
+ if (fluidRedPlasma.getBlock() == null) {
+ blockRedPlasma = new BlockBuildcraftFluid(fluidRedPlasma, Material.water).setFlammable(false).setParticleColor(0.9F, 0, 0);
+ blockRedPlasma.setBlockName("blockRedPlasma");
+ CoreProxy.proxy.addName(blockRedPlasma, "Red Plasma");
+ CoreProxy.proxy.registerBlock(blockRedPlasma);
+ fluidRedPlasma.setBlock(blockRedPlasma);
} else {
- blockRedPlasma = Block.blocksList[fluidRedPlasma.getBlockID()];
+ blockRedPlasma = fluidRedPlasma.getBlock();
}
// Buckets
- if (blockOil != null && bucketOilId > 0) {
- bucketOil = new ItemBucketBuildcraft(bucketOilId, blockOil.blockID);
- bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty);
+ if (blockOil != null) {
+ bucketOil = new ItemBucketBuildcraft(blockOil);
+ bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
LanguageRegistry.addName(bucketOil, "Oil Bucket");
CoreProxy.proxy.registerItem(bucketOil);
- FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Item.bucketEmpty));
+ FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Items.bucket));
}
- if (blockFuel != null && bucketFuelId > 0) {
- bucketFuel = new ItemBucketBuildcraft(bucketFuelId, blockFuel.blockID);
- bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty);
+ if (blockFuel != null) {
+ bucketFuel = new ItemBucketBuildcraft(blockFuel);
+ bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Items.bucket);
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
CoreProxy.proxy.registerItem(bucketFuel);
- FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Item.bucketEmpty));
+ FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Items.bucket));
}
- if (blockRedPlasma != null && bucketRedPlasmaId > 0) {
- bucketRedPlasma = new ItemBucketBuildcraft(bucketRedPlasmaId, blockRedPlasma.blockID);
- bucketRedPlasma.setUnlocalizedName("bucketRedPlasma").setContainerItem(Item.bucketEmpty);
+ if (blockRedPlasma != null) {
+ bucketRedPlasma = new ItemBucketBuildcraft(blockRedPlasma);
+ bucketRedPlasma.setUnlocalizedName("bucketRedPlasma").setContainerItem(Items.bucket);
LanguageRegistry.addName(bucketRedPlasma, "Red Plasma Bucket");
CoreProxy.proxy.registerItem(bucketRedPlasma);
- FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("redplasma", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketRedPlasma), new ItemStack(Item.bucketEmpty));
+ FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("redplasma", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketRedPlasma), new ItemStack(Items.bucket));
}
- BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
- BucketHandler.INSTANCE.buckets.put(blockFuel, bucketFuel);
- BucketHandler.INSTANCE.buckets.put(blockRedPlasma, bucketRedPlasma);
- MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
+ // TODO: Are these still really necessary? If not, remove the
+ // BucketHandler class as well.
+ //BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
+ //BucketHandler.INSTANCE.buckets.put(blockFuel, bucketFuel);
+ //MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
BuildcraftRecipes.refinery.addRecipe(new FluidStack(fluidOil, 1), new FluidStack(fluidFuel, 1), 12, 1);
@@ -255,19 +234,17 @@ public class BuildCraftEnergy {
// Iron Engine Coolants
IronEngineCoolant.addCoolant(FluidRegistry.getFluid("water"), 0.0023F);
- IronEngineCoolant.addCoolant(Block.ice.blockID, 0, FluidRegistry.getFluidStack("water", FluidContainerRegistry.BUCKET_VOLUME * 2));
+ IronEngineCoolant.addCoolant(Blocks.ice, 0, FluidRegistry.getFluidStack("water", FluidContainerRegistry.BUCKET_VOLUME * 2));
// Receiver / emitter
- Property emitterId = BuildCraftCore.mainConfiguration.getBlock("energyEmitter.id", DefaultProps.EMITTER_ID);
- emitterBlock = new BlockEnergyEmitter (emitterId.getInt());
- CoreProxy.proxy.registerBlock(emitterBlock.setUnlocalizedName("energyEmitterBlock"));
+ emitterBlock = new BlockEnergyEmitter ();
+ CoreProxy.proxy.registerBlock(emitterBlock.setBlockName("energyEmitterBlock"));
CoreProxy.proxy.addName(emitterBlock, "Energy Emitter");
CoreProxy.proxy.registerTileEntity(TileEnergyEmitter.class, "net.minecraft.src.builders.TileEnergyEmitter");
- Property receiverId = BuildCraftCore.mainConfiguration.getBlock("energyReceiver.id", DefaultProps.RECEIVER_ID);
- receiverBlock = new BlockEnergyReceiver (receiverId.getInt());
- CoreProxy.proxy.registerBlock(receiverBlock.setUnlocalizedName("energyReceiverBlock"));
+ receiverBlock = new BlockEnergyReceiver ();
+ CoreProxy.proxy.registerBlock(receiverBlock.setBlockName("energyReceiverBlock"));
CoreProxy.proxy.addName(receiverBlock, "Energy Receiver");
CoreProxy.proxy.registerTileEntity(TileEnergyReceiver.class, "net.minecraft.src.builders.TileEnergyReceiver");
@@ -276,9 +253,12 @@ public class BuildCraftEnergy {
@EventHandler
public void init(FMLInitializationEvent evt) {
- NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-ENERGY", new PacketHandlerTransport());
+
+ NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
- new BptBlockEngine(engineBlock.blockID);
+ //new BptBlockEngine(engineBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@@ -295,10 +275,10 @@ public class BuildCraftEnergy {
}
}
- @ForgeSubscribe
+ @SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
- if (event.map.textureType == 0) {
+ if (event.map.getTextureType() == 0) {
buildcraftFluidOil.setIcons(blockOil.getBlockTextureFromSide(1), blockOil.getBlockTextureFromSide(2));
buildcraftFluidFuel.setIcons(blockFuel.getBlockTextureFromSide(1), blockFuel.getBlockTextureFromSide(2));
buildcraftFluidRedPlasma.setIcons(blockRedPlasma.getBlockTextureFromSide(1), blockRedPlasma.getBlockTextureFromSide(2));
@@ -307,116 +287,16 @@ public class BuildCraftEnergy {
public static void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
- new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Block.glass, 'G',
- BuildCraftCore.woodenGearItem, 'p', Block.pistonBase});
+ new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Blocks.glass, 'G',
+ BuildCraftCore.woodenGearItem, 'p', Blocks.piston});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", 'w', "cobblestone",
- 'g', Block.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Block.pistonBase});
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Item.ingotIron,
- 'g', Block.glass, 'G', BuildCraftCore.ironGearItem, 'p', Block.pistonBase});
+ 'g', Blocks.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Blocks.piston});
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Items.iron_ingot,
+ 'g', Blocks.glass, 'G', BuildCraftCore.ironGearItem, 'p', Blocks.piston});
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
- // public static int createPollution (World world, int i, int j, int k, int
- // saturation) {
- // int remainingSaturation = saturation;
- //
- // if (world.rand.nextFloat() > 0.7) {
- // // Try to place an item on the sides
- //
- // LinkedList orientations = new LinkedList();
- //
- // 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);
- // }
- // }
}
diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java
index fc7e259c..7abb7d6c 100644
--- a/common/buildcraft/BuildCraftFactory.java
+++ b/common/buildcraft/BuildCraftFactory.java
@@ -11,6 +11,7 @@ package buildcraft;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.Version;
+import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.ConfigUtils;
import buildcraft.factory.BlockAutoWorkbench;
@@ -40,7 +41,9 @@ import buildcraft.factory.TileQuarry;
import buildcraft.factory.TileRefinery;
import buildcraft.factory.TileTank;
import buildcraft.factory.network.PacketHandlerFactory;
+
import com.google.common.collect.Lists;
+
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@@ -48,27 +51,29 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.client.event.TextureStitchEvent;
-import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.Property;
-import net.minecraftforge.event.ForgeSubscribe;
+import net.minecraftforge.common.config.Property;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true)
-public class BuildCraftFactory {
+public class BuildCraftFactory extends BuildCraftMod {
public static final int MINING_MJ_COST_PER_BLOCK = 64;
public static BlockQuarry quarryBlock;
@@ -103,7 +108,7 @@ public class BuildCraftFactory {
int quarryX = ticket.getModData().getInteger("quarryX");
int quarryY = ticket.getModData().getInteger("quarryY");
int quarryZ = ticket.getModData().getInteger("quarryZ");
- TileQuarry tq = (TileQuarry) world.getBlockTileEntity(quarryX, quarryY, quarryZ);
+ TileQuarry tq = (TileQuarry) world.getTileEntity(quarryX, quarryY, quarryZ);
tq.forceChunkLoading(ticket);
}
@@ -117,8 +122,8 @@ public class BuildCraftFactory {
int quarryY = ticket.getModData().getInteger("quarryY");
int quarryZ = ticket.getModData().getInteger("quarryZ");
- int blId = world.getBlockId(quarryX, quarryY, quarryZ);
- if (blId == quarryBlock.blockID) {
+ Block block = world.getBlock(quarryX, quarryY, quarryZ);
+ if (block == quarryBlock) {
validTickets.add(ticket);
}
}
@@ -128,7 +133,7 @@ public class BuildCraftFactory {
@EventHandler
public void load(FMLInitializationEvent evt) {
- NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
+ NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
// EntityRegistry.registerModEntity(EntityMechanicalArm.class, "bcMechanicalArm", EntityIds.MECHANICAL_ARM, instance, 50, 1, true);
@@ -143,10 +148,10 @@ public class BuildCraftFactory {
FactoryProxy.proxy.initializeTileEntities();
- new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
- new BptBlockFrame(frameBlock.blockID);
- new BptBlockRefinery(refineryBlock.blockID);
- new BptBlockTank(tankBlock.blockID);
+ //new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
+ //new BptBlockFrame(frameBlock.blockID);
+ //new BptBlockRefinery(refineryBlock.blockID);
+ //new BptBlockTank(tankBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@@ -155,6 +160,9 @@ public class BuildCraftFactory {
@EventHandler
public void initialize(FMLPreInitializationEvent evt) {
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-FACTORY", new PacketHandlerFactory());
+
ConfigUtils genCat = new ConfigUtils(BuildCraftCore.mainConfiguration, Configuration.CATEGORY_GENERAL);
allowMining = genCat.get("mining.enabled", true, "disables the recipes for automated mining machines");
@@ -168,72 +176,52 @@ public class BuildCraftFactory {
+ "Entries are comma seperated, banned fluids have precedence over allowed ones."
+ "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
pumpDimensionList = new PumpDimensionList(pumpList.getString());
-
- int miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID).getInt(DefaultProps.MINING_WELL_ID);
- int plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID).getInt(DefaultProps.DRILL_ID);
- int autoWorkbenchId = BuildCraftCore.mainConfiguration.getBlock("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID).getInt(DefaultProps.AUTO_WORKBENCH_ID);
- int frameId = BuildCraftCore.mainConfiguration.getBlock("frame.id", DefaultProps.FRAME_ID).getInt(DefaultProps.FRAME_ID);
- int quarryId = BuildCraftCore.mainConfiguration.getBlock("quarry.id", DefaultProps.QUARRY_ID).getInt(DefaultProps.QUARRY_ID);
- int pumpId = BuildCraftCore.mainConfiguration.getBlock("pump.id", DefaultProps.PUMP_ID).getInt(DefaultProps.PUMP_ID);
- int floodGateId = BuildCraftCore.mainConfiguration.getBlock("floodGate.id", DefaultProps.FLOOD_GATE_ID).getInt(DefaultProps.FLOOD_GATE_ID);
- int tankId = BuildCraftCore.mainConfiguration.getBlock("tank.id", DefaultProps.TANK_ID).getInt(DefaultProps.TANK_ID);
- int refineryId = BuildCraftCore.mainConfiguration.getBlock("refinery.id", DefaultProps.REFINERY_ID).getInt(DefaultProps.REFINERY_ID);
- int hopperId = BuildCraftCore.mainConfiguration.getBlock("hopper.id", DefaultProps.HOPPER_ID).getInt(DefaultProps.HOPPER_ID);
-
+
if (BuildCraftCore.mainConfiguration.hasChanged()) {
BuildCraftCore.mainConfiguration.save();
}
- if (miningWellId > 0) {
- miningWellBlock = new BlockMiningWell(miningWellId);
- CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"));
- CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
- }
- if (plainPipeId > 0) {
- plainPipeBlock = new BlockPlainPipe(plainPipeId);
- CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"));
- CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
- }
- if (autoWorkbenchId > 0) {
- autoWorkbenchBlock = new BlockAutoWorkbench(autoWorkbenchId);
- CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"));
- CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
- }
- if (frameId > 0) {
- frameBlock = new BlockFrame(frameId);
- CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock"));
- CoreProxy.proxy.addName(frameBlock, "Frame");
- }
- if (quarryId > 0) {
- quarryBlock = new BlockQuarry(quarryId);
- CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock"));
- CoreProxy.proxy.addName(quarryBlock, "Quarry");
- }
- if (tankId > 0) {
- tankBlock = new BlockTank(tankId);
- CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock"));
- CoreProxy.proxy.addName(tankBlock, "Tank");
- }
- if (pumpId > 0) {
- pumpBlock = new BlockPump(pumpId);
- CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"));
- CoreProxy.proxy.addName(pumpBlock, "Pump");
- }
- if (floodGateId > 0) {
- floodGateBlock = new BlockFloodGate(floodGateId);
- CoreProxy.proxy.registerBlock(floodGateBlock.setUnlocalizedName("floodGateBlock"));
- CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
- }
- if (refineryId > 0) {
- refineryBlock = new BlockRefinery(refineryId);
- CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"));
- CoreProxy.proxy.addName(refineryBlock, "Refinery");
- }
- if (hopperId > 0) {
- hopperBlock = new BlockHopper(hopperId);
- CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper"));
- CoreProxy.proxy.addName(hopperBlock, "Hopper");
- }
+
+ miningWellBlock = new BlockMiningWell();
+ CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
+ CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
+
+ plainPipeBlock = new BlockPlainPipe();
+ CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
+ CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
+
+ autoWorkbenchBlock = new BlockAutoWorkbench();
+ CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
+ CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
+
+ frameBlock = new BlockFrame();
+ CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock"));
+ CoreProxy.proxy.addName(frameBlock, "Frame");
+
+ quarryBlock = new BlockQuarry();
+ CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
+ CoreProxy.proxy.addName(quarryBlock, "Quarry");
+
+ tankBlock = new BlockTank();
+ CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock"));
+ CoreProxy.proxy.addName(tankBlock, "Tank");
+
+ pumpBlock = new BlockPump();
+ CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock"));
+ CoreProxy.proxy.addName(pumpBlock, "Pump");
+
+ floodGateBlock = new BlockFloodGate();
+ CoreProxy.proxy.registerBlock(floodGateBlock.setBlockName("floodGateBlock"));
+ CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
+
+ refineryBlock = new BlockRefinery();
+ CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock"));
+ CoreProxy.proxy.addName(refineryBlock, "Refinery");
+
+ hopperBlock = new BlockHopper();
+ CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper"));
+ CoreProxy.proxy.addName(hopperBlock, "Hopper");
+
FactoryProxy.proxy.initializeEntityRenders();
if (BuildCraftCore.mainConfiguration.hasChanged()) {
@@ -251,10 +239,10 @@ public class BuildCraftFactory {
"ipi",
"igi",
"iPi",
- 'p', Item.redstone,
- 'i', Item.ingotIron,
+ 'p', Items.redstone,
+ 'i', Items.iron_ingot,
'g', BuildCraftCore.ironGearItem,
- 'P', Item.pickaxeIron);
+ 'P', Items.iron_pickaxe);
if (quarryBlock != null)
CoreProxy.proxy.addCraftingRecipe(
@@ -263,16 +251,16 @@ public class BuildCraftFactory {
"gig",
"dDd",
'i', BuildCraftCore.ironGearItem,
- 'p', Item.redstone,
+ 'p', Items.redstone,
'g', BuildCraftCore.goldGearItem,
'd', BuildCraftCore.diamondGearItem,
- 'D', Item.pickaxeDiamond);
+ 'D', Items.diamond_pickaxe);
if (pumpBlock != null && miningWellBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock),
"T",
"W",
- 'T', tankBlock != null ? tankBlock : Block.glass,
+ 'T', tankBlock != null ? tankBlock : Blocks.glass,
'W', miningWellBlock);
}
@@ -282,9 +270,9 @@ public class BuildCraftFactory {
"iri",
"iTi",
"gpg",
- 'r', Item.redstone,
- 'i', Item.ingotIron,
- 'T', tankBlock != null ? tankBlock : Block.glass,
+ 'r', Items.redstone,
+ 'i', Items.iron_ingot,
+ 'T', tankBlock != null ? tankBlock : Blocks.glass,
'g', BuildCraftCore.ironGearItem,
'p', BuildCraftTransport.pipeFluidsGold);
}
@@ -294,7 +282,7 @@ public class BuildCraftFactory {
" g ",
"gwg",
" g ",
- 'w', Block.workbench,
+ 'w', Blocks.crafting_table,
'g', BuildCraftCore.woodenGearItem);
@@ -303,23 +291,23 @@ public class BuildCraftFactory {
"ggg",
"g g",
"ggg",
- 'g', Block.glass);
+ 'g', Blocks.glass);
if (refineryBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(refineryBlock),
"RTR",
"TGT",
- 'T', tankBlock != null ? tankBlock : Block.glass,
+ 'T', tankBlock != null ? tankBlock : Blocks.glass,
'G', BuildCraftCore.diamondGearItem,
- 'R', Block.torchRedstoneActive);
+ 'R', Blocks.redstone_torch);
if (hopperBlock != null)
CoreProxy.proxy.addCraftingRecipe(new ItemStack(hopperBlock),
"ICI",
"IGI",
" I ",
- 'I', Item.ingotIron,
- 'C', Block.chest,
+ 'I', Items.iron_ingot,
+ 'C', Blocks.chest,
'G', BuildCraftCore.stoneGearItem);
if (floodGateBlock != null)
@@ -327,10 +315,10 @@ public class BuildCraftFactory {
"IGI",
"FTF",
"IFI",
- 'I', Item.ingotIron,
- 'T', tankBlock != null ? tankBlock : Block.glass,
+ 'I', Items.iron_ingot,
+ 'T', tankBlock != null ? tankBlock : Blocks.glass,
'G', BuildCraftCore.ironGearItem,
- 'F', new ItemStack(Block.fenceIron));
+ 'F', new ItemStack(Blocks.iron_bars));
}
@EventHandler
@@ -338,10 +326,10 @@ public class BuildCraftFactory {
InterModComms.processIMC(event);
}
- @ForgeSubscribe
+ @SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
- if (evt.map.textureType == 0) {
+ if (evt.map.getTextureType() == 0) {
TextureMap terrainTextures = evt.map;
FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
diff --git a/common/buildcraft/BuildCraftMod.java b/common/buildcraft/BuildCraftMod.java
new file mode 100755
index 00000000..4612a1f2
--- /dev/null
+++ b/common/buildcraft/BuildCraftMod.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
+ * 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;
+
+import java.util.EnumMap;
+
+import cpw.mods.fml.common.network.FMLEmbeddedChannel;
+import cpw.mods.fml.common.network.FMLOutboundHandler;
+import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget;
+import cpw.mods.fml.relauncher.Side;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.network.Packet;
+import net.minecraft.world.World;
+import buildcraft.core.network.BuildCraftPacket;
+
+public class BuildCraftMod {
+ public EnumMap channels;
+
+ public void sendToPlayers(Packet packet, World world, int x, int y, int z, int maxDistance) {
+ channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
+ channels.get(Side.SERVER).writeOutbound(packet);
+ }
+
+ public void sendToPlayers(BuildCraftPacket packet, World world, int x, int y, int z, int maxDistance) {
+ channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
+ channels.get(Side.SERVER).writeOutbound(packet);
+ }
+
+ public void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) {
+ channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
+ channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityplayer);
+ channels.get(Side.SERVER).writeOutbound(packet);
+ }
+
+ public void sendToServer(BuildCraftPacket packet) {
+ channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.TOSERVER);
+ channels.get(Side.CLIENT).writeOutbound(packet);
+ }
+}
\ No newline at end of file
diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java
index 0c4f5097..b593942f 100644
--- a/common/buildcraft/BuildCraftSilicon.java
+++ b/common/buildcraft/BuildCraftSilicon.java
@@ -17,6 +17,7 @@ import buildcraft.core.InterModComms;
import buildcraft.silicon.ItemRedstoneChipset;
import buildcraft.silicon.ItemRedstoneChipset.Chipset;
import buildcraft.core.Version;
+import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.silicon.BlockLaser;
import buildcraft.silicon.BlockLaserTable;
@@ -42,20 +43,22 @@ import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
+
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.Property;
+import net.minecraftforge.common.config.Property;
@Mod(name = "BuildCraft Silicon", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Silicon", dependencies = DefaultProps.DEPENDENCY_TRANSPORT)
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerSilicon.class, clientSideRequired = true, serverSideRequired = true)
-public class BuildCraftSilicon {
+public class BuildCraftSilicon extends BuildCraftMod {
public static ItemRedstoneChipset redstoneChipset;
public static BlockLaser laserBlock;
@@ -64,27 +67,21 @@ public class BuildCraftSilicon {
public static BuildCraftSilicon instance;
@EventHandler
- public void preInit(FMLPreInitializationEvent evt) {
- Property laserId = BuildCraftCore.mainConfiguration.getBlock("laser.id", DefaultProps.LASER_ID);
-
- Property assemblyTableId = BuildCraftCore.mainConfiguration.getBlock("assemblyTable.id", DefaultProps.ASSEMBLY_TABLE_ID);
-
- Property redstoneChipsetId = BuildCraftCore.mainConfiguration.getItem("redstoneChipset.id", DefaultProps.REDSTONE_CHIPSET);
-
+ public void preInit(FMLPreInitializationEvent evt) {
BuildCraftCore.mainConfiguration.save();
- laserBlock = new BlockLaser(laserId.getInt());
- CoreProxy.proxy.addName(laserBlock.setUnlocalizedName("laserBlock"), "Laser");
+ laserBlock = new BlockLaser();
+ CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
CoreProxy.proxy.registerBlock(laserBlock);
- assemblyTableBlock = new BlockLaserTable(assemblyTableId.getInt());
+ assemblyTableBlock = new BlockLaserTable();
CoreProxy.proxy.registerBlock(assemblyTableBlock, ItemLaserTable.class);
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 0), "Assembly Table");
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 1), "Advanced Crafting Table");
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 2), "Integration Table");
- redstoneChipset = new ItemRedstoneChipset(redstoneChipsetId.getInt());
+ redstoneChipset = new ItemRedstoneChipset();
redstoneChipset.setUnlocalizedName("redstoneChipset");
CoreProxy.proxy.registerItem(redstoneChipset);
redstoneChipset.registerItemStacks();
@@ -92,14 +89,17 @@ public class BuildCraftSilicon {
@EventHandler
public void init(FMLInitializationEvent evt) {
- NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-SILICON", new PacketHandlerSilicon());
+
+ NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
CoreProxy.proxy.registerTileEntity(TileLaser.class, "net.minecraft.src.buildcraft.factory.TileLaser");
CoreProxy.proxy.registerTileEntity(TileAssemblyTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyTable");
CoreProxy.proxy.registerTileEntity(TileAdvancedCraftingTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyAdvancedWorkbench");
CoreProxy.proxy.registerTileEntity(TileIntegrationTable.class, "net.minecraft.src.buildcraft.factory.TileIntegrationTable");
- new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
- new BptBlockInventory(assemblyTableBlock.blockID);
+ //new BptBlockRotateMeta(laserBlock.blockID, new int[]{2, 5, 3, 4}, true);
+ //new BptBlockInventory(assemblyTableBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
@@ -115,51 +115,51 @@ public class BuildCraftSilicon {
"ORR",
"DDR",
"ORR",
- 'O', Block.obsidian,
- 'R', Item.redstone,
- 'D', Item.diamond);
+ 'O', Blocks.obsidian,
+ 'R', Items.redstone,
+ 'D', Items.diamond);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0),
"ORO",
"ODO",
"OGO",
- 'O', Block.obsidian,
- 'R', Item.redstone,
- 'D', Item.diamond,
+ 'O', Blocks.obsidian,
+ 'R', Items.redstone,
+ 'D', Items.diamond,
'G', BuildCraftCore.diamondGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1),
"OWO",
"OCO",
"ORO",
- 'O', Block.obsidian,
- 'W', Block.workbench,
- 'C', Block.chest,
+ 'O', Blocks.obsidian,
+ 'W', Blocks.crafting_table,
+ 'C', Blocks.chest,
'R', new ItemStack(redstoneChipset, 1, 0));
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 2),
"ORO",
"OCO",
"OGO",
- 'O', Block.obsidian,
- 'R', Item.redstone,
+ 'O', Blocks.obsidian,
+ 'R', Items.redstone,
'C', new ItemStack(redstoneChipset, 1, 0),
'G', BuildCraftCore.diamondGearItem);
// PIPE WIRE
- BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.RED.getStack(8), "dyeRed", 1, Item.redstone, Item.ingotIron);
- BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.BLUE.getStack(8), "dyeBlue", 1, Item.redstone, Item.ingotIron);
- BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.GREEN.getStack(8), "dyeGreen", 1, Item.redstone, Item.ingotIron);
- BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.YELLOW.getStack(8), "dyeYellow", 1, Item.redstone, Item.ingotIron);
+ BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.RED.getStack(8), "dyeRed", 1, Items.redstone, Items.iron_ingot);
+ BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.BLUE.getStack(8), "dyeBlue", 1, Items.redstone, Items.iron_ingot);
+ BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.GREEN.getStack(8), "dyeGreen", 1, Items.redstone, Items.iron_ingot);
+ BuildcraftRecipes.assemblyTable.addRecipe(500, PipeWire.YELLOW.getStack(8), "dyeYellow", 1, Items.redstone, Items.iron_ingot);
// CHIPSETS
- BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Item.redstone);
- BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Item.redstone, Item.ingotIron);
- BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Item.redstone, Item.ingotGold);
- BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Item.redstone, Item.diamond);
- BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Item.redstone, Item.enderPearl);
- BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Item.redstone, Item.netherQuartz);
- BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Item.redstone, Item.comparator);
+ BuildcraftRecipes.assemblyTable.addRecipe(10000, Chipset.RED.getStack(), Items.redstone);
+ BuildcraftRecipes.assemblyTable.addRecipe(20000, Chipset.IRON.getStack(), Items.redstone, Items.iron_ingot);
+ BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.GOLD.getStack(), Items.redstone, Items.gold_ingot);
+ BuildcraftRecipes.assemblyTable.addRecipe(80000, Chipset.DIAMOND.getStack(), Items.redstone, Items.diamond);
+ BuildcraftRecipes.assemblyTable.addRecipe(40000, Chipset.PULSATING.getStack(2), Items.redstone, Items.ender_pearl);
+ BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.QUARTZ.getStack(), Items.redstone, Items.quartz);
+ BuildcraftRecipes.assemblyTable.addRecipe(60000, Chipset.COMP.getStack(), Items.redstone, Items.comparator);
// GATES
BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack());
diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java
index dc422f41..1b0a9a5f 100644
--- a/common/buildcraft/BuildCraftTransport.java
+++ b/common/buildcraft/BuildCraftTransport.java
@@ -17,6 +17,7 @@ import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.Version;
+import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.triggers.BCAction;
import buildcraft.core.triggers.BCTrigger;
@@ -46,7 +47,7 @@ import buildcraft.transport.ItemPipeWire;
import buildcraft.transport.gates.GateExpansionRedstoneFader;
import buildcraft.transport.gates.GateExpansionTimer;
import buildcraft.transport.network.PacketHandlerTransport;
-import buildcraft.transport.network.TransportConnectionHandler;
+import buildcraft.transport.network.PacketPipeTransportTraveler;
import buildcraft.transport.pipes.PipeFluidsCobblestone;
import buildcraft.transport.pipes.PipeFluidsEmerald;
import buildcraft.transport.pipes.PipeFluidsGold;
@@ -100,7 +101,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@@ -108,17 +108,18 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import java.util.LinkedList;
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import net.minecraftforge.common.Configuration;
-import net.minecraftforge.common.ForgeDirection;
-import net.minecraftforge.common.Property;
+import net.minecraftforge.common.config.Configuration;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.config.Property;
@Mod(version = Version.VERSION, modid = "BuildCraft|Transport", name = "Buildcraft Transport", dependencies = DefaultProps.DEPENDENCY_CORE)
-@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerTransport.class, connectionHandler = TransportConnectionHandler.class)
-public class BuildCraftTransport {
+public class BuildCraftTransport extends BuildCraftMod {
public static BlockGenericPipe genericPipeBlock;
public static float pipeDurability;
@@ -210,22 +211,24 @@ public class BuildCraftTransport {
return testStrings(liquids, world, i, j, k);
}
- private boolean testStrings(String[] excludedBlocks, World world, int i, int j, int k) {
- int id = world.getBlockId(i, j, k);
- Block block = Block.blocksList[id];
+ private boolean testStrings(String[] excludedBlocks, World world, int i, int j, int k) {
+ Block block = world.getBlock(i, j, k);
if (block == null)
return false;
int meta = world.getBlockMetadata(i, j, k);
- for (String excluded : excludedBlocks) {
+ // TODO: the exculded list is not taken into account. This probably
+ // needs to be migrated to an implementation based on names instead
+ // of ids, low priority for now.
+ /*for (String excluded : excludedBlocks) {
if (excluded.equals(block.getUnlocalizedName()))
return false;
String[] tokens = excluded.split(":");
if (tokens[0].equals(Integer.toString(id)) && (tokens.length == 1 || tokens[1].equals(Integer.toString(meta))))
return false;
- }
+ }*/
return true;
}
}
@@ -238,7 +241,7 @@ public class BuildCraftTransport {
durability.comment = "How long a pipe will take to break";
pipeDurability = (float) durability.getDouble(DefaultProps.PIPES_DURABILITY);
- Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.item.exclusion", new String[0]);
+ Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "woodenPipe.item.exclusion", new String[0]);
String[] excludedItemBlocks = exclusionItemList.getStringList();
if (excludedItemBlocks != null) {
@@ -248,7 +251,7 @@ public class BuildCraftTransport {
} else
excludedItemBlocks = new String[0];
- Property exclusionFluidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.liquid.exclusion", new String[0]);
+ Property exclusionFluidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "woodenPipe.liquid.exclusion", new String[0]);
String[] excludedFluidBlocks = exclusionFluidList.getStringList();
if (excludedFluidBlocks != null) {
@@ -268,33 +271,28 @@ public class BuildCraftTransport {
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
groupItemsTrigger = groupItemsTriggerProp.getInt();
-
- Property genericPipeId = BuildCraftCore.mainConfiguration.getBlock("pipe.id", DefaultProps.GENERIC_PIPE_ID);
-
- Property pipeWaterproofId = BuildCraftCore.mainConfiguration.getItem("pipeWaterproof.id", DefaultProps.PIPE_WATERPROOF_ID);
-
- pipeWaterproof = new ItemBuildCraft(pipeWaterproofId.getInt());
+ pipeWaterproof = new ItemBuildCraft();
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
LanguageRegistry.addName(pipeWaterproof, "Pipe Sealant");
CoreProxy.proxy.registerItem(pipeWaterproof);
- genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt());
- CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class);
+ genericPipeBlock = new BlockGenericPipe();
+ CoreProxy.proxy.registerBlock(genericPipeBlock.setBlockName("pipeBlock"), ItemBlock.class);
- pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Block.glass, "plankWood");
- pipeItemsEmerald = buildPipe(DefaultProps.PIPE_ITEMS_EMERALD_ID, PipeItemsEmerald.class, "Emerald Transport Pipe", Item.emerald, Block.glass, Item.emerald);
- pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", "cobblestone", Block.glass, "cobblestone");
- pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", "stone", Block.glass, "stone");
- pipeItemsQuartz = buildPipe(DefaultProps.PIPE_ITEMS_QUARTZ_ID, PipeItemsQuartz.class, "Quartz Transport Pipe", Block.blockNetherQuartz, Block.glass, Block.blockNetherQuartz);
- pipeItemsIron = buildPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron);
- pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold);
- pipeItemsDiamond = buildPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond);
- pipeItemsObsidian = buildPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian);
- pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Block.blockLapis, Block.glass, Block.blockLapis);
- pipeItemsDaizuli = buildPipe(DefaultProps.PIPE_ITEMS_DAIZULI_ID, PipeItemsDaizuli.class, "Daizuli Transport Pipe", Block.blockLapis, Block.glass, Item.diamond);
- pipeItemsSandstone = buildPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Block.sandStone, Block.glass, Block.sandStone);
- pipeItemsVoid = buildPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", "dyeBlack", Block.glass, Item.redstone);
- pipeItemsEmzuli = buildPipe(DefaultProps.PIPE_ITEMS_EMZULI_ID, PipeItemsEmzuli.class, "Emzuli Transport Pipe", Block.blockLapis, Block.glass, Item.emerald);
+ pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Blocks.glass, "plankWood");
+ pipeItemsEmerald = buildPipe(DefaultProps.PIPE_ITEMS_EMERALD_ID, PipeItemsEmerald.class, "Emerald Transport Pipe", Items.emerald, Blocks.glass, Items.emerald);
+ pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", "cobblestone", Blocks.glass, "cobblestone");
+ pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", "stone", Blocks.glass, "stone");
+ pipeItemsQuartz = buildPipe(DefaultProps.PIPE_ITEMS_QUARTZ_ID, PipeItemsQuartz.class, "Quartz Transport Pipe", Blocks.quartz_block, Blocks.glass, Blocks.quartz_block);
+ pipeItemsIron = buildPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Items.iron_ingot, Blocks.glass, Items.iron_ingot);
+ pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Items.gold_ingot, Blocks.glass, Items.gold_ingot);
+ pipeItemsDiamond = buildPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Items.diamond, Blocks.glass, Items.diamond);
+ pipeItemsObsidian = buildPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Blocks.obsidian, Blocks.glass, Blocks.obsidian);
+ pipeItemsLapis = buildPipe(DefaultProps.PIPE_ITEMS_LAPIS_ID, PipeItemsLapis.class, "Lapis Transport Pipe", Blocks.lapis_block, Blocks.glass, Blocks.lapis_block);
+ pipeItemsDaizuli = buildPipe(DefaultProps.PIPE_ITEMS_DAIZULI_ID, PipeItemsDaizuli.class, "Daizuli Transport Pipe", Blocks.lapis_block, Blocks.glass, Items.diamond);
+ pipeItemsSandstone = buildPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Blocks.sandstone, Blocks.glass, Blocks.sandstone);
+ pipeItemsVoid = buildPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", "dyeBlack", Blocks.glass, Items.redstone);
+ pipeItemsEmzuli = buildPipe(DefaultProps.PIPE_ITEMS_EMZULI_ID, PipeItemsEmzuli.class, "Emzuli Transport Pipe", Blocks.lapis_block, Blocks.glass, Items.emerald);
pipeFluidsWood = buildPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeFluidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood);
pipeFluidsCobblestone = buildPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeFluidsCobblestone.class, "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone);
@@ -305,51 +303,77 @@ public class BuildCraftTransport {
pipeFluidsSandstone = buildPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeFluidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof, pipeItemsSandstone);
pipeFluidsVoid = buildPipe(DefaultProps.PIPE_LIQUIDS_VOID_ID, PipeFluidsVoid.class, "Void Waterproof Pipe", pipeWaterproof, pipeItemsVoid);
- pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Kinesis Pipe", Item.redstone, pipeItemsWood);
- pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", Item.redstone, pipeItemsCobblestone);
- pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Kinesis Pipe", Item.redstone, pipeItemsStone);
- pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Kinesis Pipe", Item.redstone, pipeItemsQuartz);
- pipePowerIron = buildPipe(DefaultProps.PIPE_POWER_IRON_ID, PipePowerIron.class, "Iron Kinesis Pipe", Item.redstone, pipeItemsIron);
- pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Item.redstone, pipeItemsGold);
- pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Item.redstone, pipeItemsDiamond);
- pipePowerHeat = buildPipe(DefaultProps.PIPE_POWER_HEAT_ID, PipePowerHeat.class, "Heat Kinesis Pipe", Block.furnaceIdle, pipeItemsDiamond);
+ pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Kinesis Pipe", Items.redstone, pipeItemsWood);
+ pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", Items.redstone, pipeItemsCobblestone);
+ pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Kinesis Pipe", Items.redstone, pipeItemsStone);
+ pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Kinesis Pipe", Items.redstone, pipeItemsQuartz);
+ pipePowerIron = buildPipe(DefaultProps.PIPE_POWER_IRON_ID, PipePowerIron.class, "Iron Kinesis Pipe", Items.redstone, pipeItemsIron);
+ pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Items.redstone, pipeItemsGold);
+ pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Items.redstone, pipeItemsDiamond);
+ pipePowerHeat = buildPipe(DefaultProps.PIPE_POWER_HEAT_ID, PipePowerHeat.class, "Heat Kinesis Pipe", Blocks.furnace, 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", Blocks.gravel, pipeItemsCobblestone);
// Fix the recipe
// pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, PipeItemsStripes.class, "Stripes Transport Pipe", new ItemStack(Item.dyePowder,
// 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11));
- int pipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeWire.id", DefaultProps.PIPE_WIRE).getInt(DefaultProps.PIPE_WIRE);
- pipeWire = new ItemPipeWire(pipeWireId);
+ pipeWire = new ItemPipeWire();
LanguageRegistry.addName(pipeWire, "Pipe Wire");
CoreProxy.proxy.registerItem(pipeWire);
PipeWire.item = pipeWire;
- Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID);
- pipeGate = new ItemGate(pipeGateId.getInt());
+ pipeGate = new ItemGate();
pipeGate.setUnlocalizedName("pipeGate");
CoreProxy.proxy.registerItem(pipeGate);
- Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID);
- facadeItem = new ItemFacade(pipeFacadeId.getInt());
+ facadeItem = new ItemFacade();
facadeItem.setUnlocalizedName("pipeFacade");
CoreProxy.proxy.registerItem(facadeItem);
- Property pipePlugId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipePlug.id", DefaultProps.PIPE_PLUG_ID);
- plugItem = new ItemPlug(pipePlugId.getInt());
+ plugItem = new ItemPlug();
plugItem.setUnlocalizedName("pipePlug");
CoreProxy.proxy.registerItem(plugItem);
- Property robotStationId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "robotStation.id", DefaultProps.ROBOT_STATION_ID);
- robotStationItem = new ItemRobotStation(robotStationId.getInt());
+ robotStationItem = new ItemRobotStation();
robotStationItem.setUnlocalizedName("robotStation");
CoreProxy.proxy.registerItem(robotStationItem);
- Property filteredBufferId = BuildCraftCore.mainConfiguration.getBlock("filteredBuffer.id", DefaultProps.FILTERED_BUFFER_ID);
- filteredBufferBlock = new BlockFilteredBuffer(filteredBufferId.getInt());
- CoreProxy.proxy.registerBlock(filteredBufferBlock.setUnlocalizedName("filteredBufferBlock"));
+ filteredBufferBlock = new BlockFilteredBuffer();
+ CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
+
CoreProxy.proxy.addName(filteredBufferBlock, "Filtered Buffer");
+
+ for (PipeContents kind : PipeContents.values()) {
+ triggerPipe[kind.ordinal()] = new TriggerPipeContents(kind);
+ }
+
+ for (PipeWire wire : PipeWire.values()) {
+ triggerPipeWireActive[wire.ordinal()] = new TriggerPipeSignal(true, wire);
+ triggerPipeWireInactive[wire.ordinal()] = new TriggerPipeSignal(false, wire);
+ actionPipeWire[wire.ordinal()] = new ActionSignalOutput(wire);
+ }
+
+ for (Time time : TriggerClockTimer.Time.VALUES) {
+ triggerTimer[time.ordinal()] = new TriggerClockTimer(time);
+ }
+
+ for (int level = 0; level < triggerRedstoneLevel.length; level++) {
+ triggerRedstoneLevel[level] = new TriggerRedstoneFaderInput(level + 1);
+ actionRedstoneLevel[level] = new ActionRedstoneFaderOutput(level + 1);
+ }
+
+ for (EnumColor color : EnumColor.VALUES) {
+ actionPipeColor[color.ordinal()] = new ActionPipeColor(color);
+ }
+
+ for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
+ actionPipeDirection[direction.ordinal()] = new ActionPipeDirection(direction);
+ }
+
+ for (PowerMode limit : PowerMode.VALUES) {
+ actionPowerLimiter[limit.ordinal()] = new ActionPowerLimiter(limit);
+ }
} finally {
BuildCraftCore.mainConfiguration.save();
}
@@ -357,6 +381,9 @@ public class BuildCraftTransport {
@EventHandler
public void init(FMLInitializationEvent evt) {
+ channels = NetworkRegistry.INSTANCE.newChannel
+ (DefaultProps.NET_CHANNEL_NAME + "-TRANSPORT", new PacketHandlerTransport());
+
// Register connection handler
// MinecraftForge.registerConnectionHandler(new ConnectionHandler());
@@ -374,14 +401,14 @@ public class BuildCraftTransport {
// ModLoader.RegisterTileEntity(TileDockingStation.class,
// "net.minecraft.src.buildcraft.TileDockingStation");
- new BptBlockPipe(genericPipeBlock.blockID);
+ //new BptBlockPipe(genericPipeBlock.blockID);
- BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
- BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
- BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
- BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
- BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
- BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
+ //BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
+ //BuildCraftCore.itemBptProps[pipeFluidsWood.itemID] = new BptItemPipeWooden();
+ //BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
+ //BuildCraftCore.itemBptProps[pipeFluidsIron.itemID] = new BptItemPipeIron();
+ //BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
+ //BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();
ActionManager.registerTriggerProvider(new PipeTriggerProvider());
@@ -390,49 +417,18 @@ public class BuildCraftTransport {
}
TransportProxy.proxy.registerRenderers();
- NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
+ NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
}
@EventHandler
public void postInit(FMLPostInitializationEvent evt) {
ItemFacade.initialize();
-
- for (PipeContents kind : PipeContents.values()) {
- triggerPipe[kind.ordinal()] = new TriggerPipeContents(kind);
- }
-
- for (PipeWire wire : PipeWire.values()) {
- triggerPipeWireActive[wire.ordinal()] = new TriggerPipeSignal(true, wire);
- triggerPipeWireInactive[wire.ordinal()] = new TriggerPipeSignal(false, wire);
- actionPipeWire[wire.ordinal()] = new ActionSignalOutput(wire);
- }
-
- for (Time time : TriggerClockTimer.Time.VALUES) {
- triggerTimer[time.ordinal()] = new TriggerClockTimer(time);
- }
-
- for (int level = 0; level < triggerRedstoneLevel.length; level++) {
- triggerRedstoneLevel[level] = new TriggerRedstoneFaderInput(level + 1);
- actionRedstoneLevel[level] = new ActionRedstoneFaderOutput(level + 1);
- }
-
- for (EnumColor color : EnumColor.VALUES) {
- actionPipeColor[color.ordinal()] = new ActionPipeColor(color);
- }
-
- for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
- actionPipeDirection[direction.ordinal()] = new ActionPipeDirection(direction);
- }
-
- for (PowerMode limit : PowerMode.VALUES) {
- actionPowerLimiter[limit.ordinal()] = new ActionPowerLimiter(limit);
- }
}
public void loadRecipes() {
// Add base recipe for pipe waterproof.
- GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Item.dyePowder, 1, 2));
+ GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.dye, 1, 2));
// Add pipe recipes
for (PipeRecipe pipe : pipeRecipes) {
@@ -445,8 +441,8 @@ public class BuildCraftTransport {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
new Object[]{"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
- BuildCraftTransport.pipeItemsDiamond, 'c', Block.chest, 'p',
- Block.pistonBase});
+ BuildCraftTransport.pipeItemsDiamond, 'c', Blocks.chest, 'p',
+ Blocks.piston});
//Facade turning helper
GameRegistry.addRecipe(facadeItem.new FacadeRecipe());
@@ -462,10 +458,7 @@ public class BuildCraftTransport {
public static Item buildPipe(int defaultID, Class extends Pipe> clas, String descr, Object... ingredients) {
String name = Character.toLowerCase(clas.getSimpleName().charAt(0)) + clas.getSimpleName().substring(1);
- Property prop = BuildCraftCore.mainConfiguration.getItem(name + ".id", defaultID);
-
- int id = prop.getInt(defaultID);
- ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
+ ItemPipe res = BlockGenericPipe.registerPipe(clas);
res.setUnlocalizedName(clas.getSimpleName());
LanguageRegistry.addName(res, descr);
@@ -495,4 +488,5 @@ public class BuildCraftTransport {
return res;
}
+
}
diff --git a/common/buildcraft/api/blueprints/BlockSignature.java b/common/buildcraft/api/blueprints/BlockSignature.java
index 51db24d4..519ce016 100644
--- a/common/buildcraft/api/blueprints/BlockSignature.java
+++ b/common/buildcraft/api/blueprints/BlockSignature.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.blueprints;
public class BlockSignature {
diff --git a/common/buildcraft/api/blueprints/BlueprintManager.java b/common/buildcraft/api/blueprints/BlueprintManager.java
index c71b710e..07df78d5 100644
--- a/common/buildcraft/api/blueprints/BlueprintManager.java
+++ b/common/buildcraft/api/blueprints/BlueprintManager.java
@@ -1,3 +1,11 @@
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
+ * 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.api.blueprints;
import buildcraft.api.core.BuildCraftAPI;
@@ -8,14 +16,14 @@ import net.minecraft.item.ItemStack;
@Deprecated
public class BlueprintManager {
- public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length];
+ //public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length];
public static ItemSignature getItemSignature(Item item) {
ItemSignature sig = new ItemSignature();
- if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
- sig.itemClassName = item.getClass().getSimpleName();
- }
+ //if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
+ // sig.itemClassName = item.getClass().getSimpleName();
+ //}
sig.itemName = item.getUnlocalizedName(new ItemStack(item));
@@ -23,13 +31,14 @@ public class BlueprintManager {
}
public static BlockSignature getBlockSignature(Block block) {
- return BlueprintManager.blockBptProps[0].getSignature(block);
+ //return BlueprintManager.blockBptProps[0].getSignature(block);
+ return null;
}
static {
// Initialize defaults for block properties.
- for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
- new BptBlock(i);
- }
+ //for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) {
+ // new BptBlock(i);
+ //}
}
}
diff --git a/common/buildcraft/api/blueprints/BptBlock.java b/common/buildcraft/api/blueprints/BptBlock.java
index 4f48d35e..305cdee4 100644
--- a/common/buildcraft/api/blueprints/BptBlock.java
+++ b/common/buildcraft/api/blueprints/BptBlock.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.blueprints;
import buildcraft.api.core.BuildCraftAPI;
@@ -49,7 +48,7 @@ public class BptBlock {
public BptBlock(int blockId) {
this.blockId = blockId;
- BlueprintManager.blockBptProps[blockId] = this;
+ //BlueprintManager.blockBptProps[blockId] = this;
}
/**
@@ -57,11 +56,11 @@ public class BptBlock {
* buildBlock.
*/
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- if (slot.blockId != 0) {
+ if (slot.block != null) {
if (slot.storedRequirements.size() != 0) {
requirements.addAll(slot.storedRequirements);
} else {
- requirements.add(new ItemStack(slot.blockId, 1, slot.meta));
+ // requirements.add(new ItemStack(slot.blockId, 1, slot.meta));
}
}
}
@@ -103,7 +102,7 @@ public class BptBlock {
if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) {
Item container = stack.getItem().getContainerItem();
- stack.itemID = container.itemID;
+ //stack.itemID = container.itemID;
stack.stackSize = 1;
stack.setItemDamage(0);
}
@@ -117,7 +116,8 @@ public class BptBlock {
* Added metadata sensitivity //Krapht
*/
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z);
+ //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z);
+ return false;
}
/**
@@ -132,19 +132,19 @@ public class BptBlock {
*/
public void buildBlock(BptSlotInfo slot, IBptContext context) {
// Meta needs to be specified twice, depending on the block behavior
- context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3);
- context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.block, slot.meta, 0);
+ //context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
- if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
- TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
+ if (slot.block instanceof BlockContainer) {
+ TileEntity tile = context.world().getTileEntity(slot.x, slot.y, slot.z);
- slot.cpt.setInteger("x", slot.x);
- slot.cpt.setInteger("y", slot.y);
- slot.cpt.setInteger("z", slot.z);
+ //slot.cpt.setInteger("x", slot.x);
+ //slot.cpt.setInteger("y", slot.y);
+ //slot.cpt.setInteger("z", slot.z);
- if (tile != null) {
- tile.readFromNBT(slot.cpt);
- }
+ //if (tile != null) {
+ // tile.readFromNBT(slot.cpt);
+ //}
}
}
@@ -162,8 +162,8 @@ public class BptBlock {
* By default, if the block is a BlockContainer, tile information will be to save / load the block.
*/
public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) {
- if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
- TileEntity tile = context.world().getBlockTileEntity(x, y, z);
+ /*if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
+ TileEntity tile = context.world().getTileEntity(x, y, z);
if (tile != null) {
tile.writeToNBT(slot.cpt);
@@ -176,7 +176,7 @@ public class BptBlock {
if (req != null) {
slot.storedRequirements.addAll(req);
}
- }
+ }*/
}
/**
@@ -194,7 +194,7 @@ public class BptBlock {
public BlockSignature getSignature(Block block) {
BlockSignature sig = new BlockSignature();
- if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
+ /*if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
sig.blockClassName = block.getClass().getSimpleName();
if (block instanceof BlockContainer) {
@@ -205,7 +205,7 @@ public class BptBlock {
sig.tileClassName = tile.getClass().getSimpleName();
}
}
- }
+ }*/
sig.blockName = block.getUnlocalizedName();
sig.replaceNullWithStar();
diff --git a/common/buildcraft/api/blueprints/BptBlockUtils.java b/common/buildcraft/api/blueprints/BptBlockUtils.java
index a46d9b12..e5dfac7e 100644
--- a/common/buildcraft/api/blueprints/BptBlockUtils.java
+++ b/common/buildcraft/api/blueprints/BptBlockUtils.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.blueprints;
import java.util.LinkedList;
@@ -55,11 +54,11 @@ public class BptBlockUtils {
ItemStack stacks[] = new ItemStack[list.tagCount()];
for (int i = 0; i < list.tagCount(); ++i) {
- ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i));
+ //ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i));
- if (stack != null && stack.itemID != 0 && stack.stackSize > 0) {
- stacks[i] = context.mapItemStack(stack);
- }
+ //if (stack != null && stack.itemID != 0 && stack.stackSize > 0) {
+ // stacks[i] = context.mapItemStack(stack);
+ //}
}
return stacks;
@@ -75,7 +74,7 @@ public class BptBlockUtils {
if (stack != null && stack.stackSize != 0) {
stack.writeToNBT(cpt);
- context.storeId(stack.itemID);
+ //context.storeId(stack.itemID);
}
}
diff --git a/common/buildcraft/api/blueprints/BptSlotInfo.java b/common/buildcraft/api/blueprints/BptSlotInfo.java
index 799a3b4f..afa74156 100644
--- a/common/buildcraft/api/blueprints/BptSlotInfo.java
+++ b/common/buildcraft/api/blueprints/BptSlotInfo.java
@@ -1,15 +1,16 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.blueprints;
import java.util.LinkedList;
+
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -20,7 +21,7 @@ import net.minecraft.nbt.NBTTagCompound;
@Deprecated
public class BptSlotInfo {
- public int blockId = 0;
+ public Block block = null;
public int meta = 0;
public int x;
public int y;
@@ -44,7 +45,7 @@ public class BptSlotInfo {
obj.x = x;
obj.y = y;
obj.z = z;
- obj.blockId = blockId;
+ obj.block = block;
obj.meta = meta;
obj.cpt = (NBTTagCompound) cpt.copy();
diff --git a/common/buildcraft/api/blueprints/IBptContext.java b/common/buildcraft/api/blueprints/IBptContext.java
index 8498bfd3..d785722b 100644
--- a/common/buildcraft/api/blueprints/IBptContext.java
+++ b/common/buildcraft/api/blueprints/IBptContext.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.blueprints;
import buildcraft.api.core.IBox;
diff --git a/common/buildcraft/api/blueprints/ItemSignature.java b/common/buildcraft/api/blueprints/ItemSignature.java
index d6bd0310..b3fa2065 100644
--- a/common/buildcraft/api/blueprints/ItemSignature.java
+++ b/common/buildcraft/api/blueprints/ItemSignature.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.blueprints;
@Deprecated
diff --git a/common/buildcraft/api/bptblocks/BptBlockBed.java b/common/buildcraft/api/bptblocks/BptBlockBed.java
index e2dae05c..e2f22e0c 100644
--- a/common/buildcraft/api/bptblocks/BptBlockBed.java
+++ b/common/buildcraft/api/bptblocks/BptBlockBed.java
@@ -1,18 +1,20 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+
import java.util.LinkedList;
+
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -26,7 +28,7 @@ public class BptBlockBed extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
if ((slot.meta & 8) == 0) {
- requirements.add(new ItemStack(Item.bed));
+ requirements.add(new ItemStack(Items.bed));
}
}
@@ -56,7 +58,7 @@ public class BptBlockBed extends BptBlock {
if ((slot.meta & 8) != 0)
return;
- context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
+ //context.world().setBlock(slot.x, slot.y, slot.z, slot.block, slot.meta,1);
int x2 = slot.x;
int z2 = slot.z;
@@ -76,7 +78,7 @@ public class BptBlockBed extends BptBlock {
break;
}
- context.world().setBlock(x2, slot.y, z2, slot.blockId, slot.meta + 8,1);
+ //context.world().setBlock(x2, slot.y, z2, slot.block, slot.meta + 8,1);
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java b/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
index 79aef15c..1087520f 100644
--- a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
+++ b/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
diff --git a/common/buildcraft/api/bptblocks/BptBlockDelegate.java b/common/buildcraft/api/bptblocks/BptBlockDelegate.java
index 035dc556..45c4891e 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDelegate.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDelegate.java
@@ -1,27 +1,29 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BlueprintManager;
import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+
import java.util.LinkedList;
+
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@Deprecated
public class BptBlockDelegate extends BptBlock {
- final int delegateTo;
+ final Block delegateTo;
- public BptBlockDelegate(int blockId, int delegateTo) {
+ public BptBlockDelegate(int blockId, Block delegateTo) {
super(blockId);
this.delegateTo = delegateTo;
@@ -30,36 +32,38 @@ public class BptBlockDelegate extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
BptSlotInfo newSlot = slot.clone();
- slot.blockId = delegateTo;
+ slot.block = delegateTo;
- if (BlueprintManager.blockBptProps[delegateTo] != null) {
- BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
- } else {
- super.addRequirements(newSlot, context, requirements);
- }
+ //if (BlueprintManager.blockBptProps[delegateTo] != null) {
+ // BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
+ //} else {
+ // super.addRequirements(newSlot, context, requirements);
+ //}
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
BptSlotInfo newSlot = slot.clone();
- slot.blockId = delegateTo;
+ slot.block = delegateTo;
- if (BlueprintManager.blockBptProps[delegateTo] != null)
- return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
- else
- return super.isValid(newSlot, context);
+ //if (BlueprintManager.blockBptProps[delegateTo] != null)
+ // return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
+ //else
+ // return super.isValid(newSlot, context);
+
+ return false;
}
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
BptSlotInfo newSlot = slot.clone();
- slot.blockId = delegateTo;
+ slot.block = delegateTo;
- if (BlueprintManager.blockBptProps[delegateTo] != null) {
- BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
- } else {
- super.rotateLeft(newSlot, context);
- }
+ //if (BlueprintManager.blockBptProps[delegateTo] != null) {
+ // BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
+ //} else {
+ // super.rotateLeft(newSlot, context);
+ //}
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockDirt.java b/common/buildcraft/api/bptblocks/BptBlockDirt.java
index 365cbc45..12720bf3 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDirt.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDirt.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -25,18 +24,19 @@ public class BptBlockDirt extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(Block.dirt));
+ //requirements.add(new ItemStack(Block.dirt));
}
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1);
+ //context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1);
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- int id = context.world().getBlockId(slot.x, slot.y, slot.z);
+ //int id = context.world().getBlockId(slot.x, slot.y, slot.z);
- return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID;
+ //return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID;
+ return false;
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockDoor.java b/common/buildcraft/api/bptblocks/BptBlockDoor.java
index 196e83b3..dedb75e8 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDoor.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDoor.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -61,8 +60,8 @@ public class BptBlockDoor extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
- context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);
+ //context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
+ //context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);
context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1);
context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);
diff --git a/common/buildcraft/api/bptblocks/BptBlockFluid.java b/common/buildcraft/api/bptblocks/BptBlockFluid.java
index 1769c394..dc5cd325 100644
--- a/common/buildcraft/api/bptblocks/BptBlockFluid.java
+++ b/common/buildcraft/api/bptblocks/BptBlockFluid.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -35,9 +34,9 @@ public class BptBlockFluid extends BptBlock {
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- if (slot.meta == 0)
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0;
- else
+ //if (slot.meta == 0)
+ // return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0;
+ //else
return true;
}
@@ -53,9 +52,9 @@ public class BptBlockFluid extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- if (slot.meta == 0) {
- context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
- }
+ //if (slot.meta == 0) {
+ // context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
+ //}
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnore.java b/common/buildcraft/api/bptblocks/BptBlockIgnore.java
index 12a058bc..465143ca 100644
--- a/common/buildcraft/api/bptblocks/BptBlockIgnore.java
+++ b/common/buildcraft/api/bptblocks/BptBlockIgnore.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -24,7 +23,7 @@ public class BptBlockIgnore extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 0, 0));
+ //requirements.add(new ItemStack(slot.blockId, 0, 0));
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
index 7f39f637..4f60fb2f 100644
--- a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
+++ b/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -24,11 +23,12 @@ public class BptBlockIgnoreMeta extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ return false;
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockInventory.java b/common/buildcraft/api/bptblocks/BptBlockInventory.java
index 0cebe58f..e307eb18 100644
--- a/common/buildcraft/api/bptblocks/BptBlockInventory.java
+++ b/common/buildcraft/api/bptblocks/BptBlockInventory.java
@@ -1,3 +1,12 @@
+
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -17,7 +26,7 @@ public class BptBlockInventory extends BptBlock {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
super.buildBlock(slot, context);
- IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
+ IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z);
for (int i = 0; i < inv.getSizeInventory(); ++i) {
inv.setInventorySlotContents(i, null);
diff --git a/common/buildcraft/api/bptblocks/BptBlockLever.java b/common/buildcraft/api/bptblocks/BptBlockLever.java
index b9a8e1c4..d731c238 100644
--- a/common/buildcraft/api/bptblocks/BptBlockLever.java
+++ b/common/buildcraft/api/bptblocks/BptBlockLever.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptSlotInfo;
@@ -23,7 +22,7 @@ public class BptBlockLever extends BptBlockWallSide {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockPiston.java b/common/buildcraft/api/bptblocks/BptBlockPiston.java
index b12693bd..8e3950cb 100644
--- a/common/buildcraft/api/bptblocks/BptBlockPiston.java
+++ b/common/buildcraft/api/bptblocks/BptBlockPiston.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BptSlotInfo;
@@ -23,7 +22,7 @@ public class BptBlockPiston extends BptBlockRotateMeta {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
int meta = slot.meta & 7;
- context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1);
+ //context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1);
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java b/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
index 16049346..4eff9e4c 100644
--- a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
+++ b/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -24,12 +23,13 @@ public class BptBlockPumpkin extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ return false;
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
index 8ac4f023..8852cb98 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -25,7 +24,7 @@ public class BptBlockRedstoneRepeater extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(Item.redstoneRepeater));
+ //requirements.add(new ItemStack(Item.redstoneRepeater));
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
index 6fcc30a8..e0b9bd67 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
@@ -1,3 +1,11 @@
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptSlotInfo;
@@ -16,7 +24,7 @@ public class BptBlockRotateInventory extends BptBlockRotateMeta {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
super.buildBlock(slot, context);
- IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
+ IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z);
for (int i = 0; i < inv.getSizeInventory(); ++i) {
inv.setInventorySlotContents(i, null);
diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
index 4352b660..9066ee62 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -43,12 +42,13 @@ public class BptBlockRotateMeta extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ return false;
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockSign.java b/common/buildcraft/api/bptblocks/BptBlockSign.java
index f7bd1338..29af85d4 100644
--- a/common/buildcraft/api/bptblocks/BptBlockSign.java
+++ b/common/buildcraft/api/bptblocks/BptBlockSign.java
@@ -1,12 +1,11 @@
/**
- * Copyright (c) SpaceToad, 2011
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* 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.api.bptblocks;
import buildcraft.api.blueprints.BlockSignature;
@@ -31,7 +30,7 @@ public class BptBlockSign extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(Item.sign));
+ //requirements.add(new ItemStack(Item.sign));
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockStairs.java b/common/buildcraft/api/bptblocks/BptBlockStairs.java
index 4dc061a4..391112c9 100644
--- a/common/buildcraft/api/bptblocks/BptBlockStairs.java
+++ b/common/buildcraft/api/bptblocks/BptBlockStairs.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -24,12 +23,13 @@ public class BptBlockStairs extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
- return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z);
+ return false;
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockWallSide.java b/common/buildcraft/api/bptblocks/BptBlockWallSide.java
index 74ff3f0f..ac0d8ada 100644
--- a/common/buildcraft/api/bptblocks/BptBlockWallSide.java
+++ b/common/buildcraft/api/bptblocks/BptBlockWallSide.java
@@ -1,12 +1,11 @@
-/**
- * Copyright (c) SpaceToad, 2011
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * 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.api.bptblocks;
import buildcraft.api.blueprints.BptBlock;
@@ -24,7 +23,7 @@ public class BptBlockWallSide extends BptBlock {
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
- requirements.add(new ItemStack(slot.blockId, 1, 0));
+ //requirements.add(new ItemStack(slot.blockId, 1, 0));
}
@Override
diff --git a/common/buildcraft/api/builder/BlockHandler.java b/common/buildcraft/api/builder/BlockHandler.java
index a6670091..160a200f 100644
--- a/common/buildcraft/api/builder/BlockHandler.java
+++ b/common/buildcraft/api/builder/BlockHandler.java
@@ -1,3 +1,11 @@
+/**
+ * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
+ * 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.api.builder;
import java.util.ArrayList;
@@ -5,8 +13,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import buildcraft.builders.blueprints.IBlueprintBuilderAgent;
-import buildcraft.builders.blueprints.BlueprintBuilder.SchematicBuilder;
import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@@ -14,7 +20,9 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
-import net.minecraftforge.common.ForgeDirection;
+import net.minecraftforge.common.util.ForgeDirection;
+import buildcraft.builders.blueprints.BlueprintBuilder.SchematicBuilder;
+import buildcraft.builders.blueprints.IBlueprintBuilderAgent;
/**
* BlockHandlers are used to serialize blocks for saving/loading from
@@ -22,41 +30,45 @@ import net.minecraftforge.common.ForgeDirection;
*
* To implement your own, you should extend this class and override the
* functions as needed.
- *
- * @author CovertJaguar
*/
public class BlockHandler {
- private static final Map handlers = new HashMap();
+ private static final Map