Remove mod_ files, clean up client server separation a bit

This commit is contained in:
Christian 2012-08-24 13:25:54 -04:00
parent dae6a2d344
commit a2d9670fdc
45 changed files with 1128 additions and 1400 deletions

View file

@ -1,9 +1,9 @@
[
{
"modid": "mod_BuildCraftCore",
"name": "BuildCraft 3",
"modid": "BuildCraft|Core",
"name": "BuildCraft",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more!",
"version": "",
"version": "4",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"mcversion": "",
@ -17,7 +17,7 @@
]
},
{
"modid": "mod_BuildCraftBuilders",
"modid": "BuildCraft|Builders",
"name": "BC Builders",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Builders Component)",
"version": "",
@ -27,14 +27,14 @@
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "Krapht", "SirSengir", "Others" ],
"parent": "mod_BuildCraftCore",
"parent": "BuildCraft|Core",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"
]
},
{
"modid": "mod_BuildCraftEnergy",
"modid": "BuildCraft|Energy",
"name": "BC Energy",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Energy Component)",
"version": "",
@ -44,14 +44,14 @@
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "Krapht", "SirSengir", "Others" ],
"parent": "mod_BuildCraftCore",
"parent": "BuildCraft|Core",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"
]
},
{
"modid": "mod_BuildCraftFactory",
"modid": "BuildCraft|Factory",
"name": "BC Factory",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Factory Component)",
"version": "",
@ -61,14 +61,14 @@
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "Krapht", "SirSengir", "Others" ],
"parent": "mod_BuildCraftCore",
"parent": "BuildCraft|Core",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"
]
},
{
"modid": "mod_BuildCraftSilicon",
"modid": "BuildCraft|Silicon",
"name": "BC Silicon",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Silicon Component)",
"version": "",
@ -78,14 +78,14 @@
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "Krapht", "SirSengir", "Others" ],
"parent": "mod_BuildCraftCore",
"parent": "BuildCraft|Core",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"
]
},
{
"modid": "mod_BuildCraftTransport",
"modid": "BuildCraf|tTransport",
"name": "BC Transport",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Transport Component)",
"version": "",
@ -95,7 +95,7 @@
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "Krapht", "SirSengir", "Others" ],
"parent": "mod_BuildCraftCore",
"parent": "BuildCraft|Core",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"

View file

@ -13,10 +13,17 @@ import java.io.IOException;
import java.util.LinkedList;
import java.util.TreeMap;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.mod_BuildCraftCore;
import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.bptblocks.BptBlockBed;
import buildcraft.api.bptblocks.BptBlockCustomStack;
@ -44,6 +51,7 @@ import buildcraft.builders.BlockFiller;
import buildcraft.builders.BlockMarker;
import buildcraft.builders.BlockPathMarker;
import buildcraft.builders.BptBlockFiller;
import buildcraft.builders.ClientBuilderHook;
import buildcraft.builders.EventHandlerBuilders;
import buildcraft.builders.FillerFillAll;
import buildcraft.builders.FillerFillPyramid;
@ -66,6 +74,7 @@ import buildcraft.core.BptPlayerIndex;
import buildcraft.core.BptRootIndex;
import buildcraft.core.DefaultProps;
import buildcraft.core.ProxyCore;
import buildcraft.core.network.PacketHandler;
import net.minecraft.src.Block;
import net.minecraft.src.Item;
@ -74,6 +83,8 @@ import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
@Mod(name="BuildCraft Builders", version=DefaultProps.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftBuilders {
public static final int LIBRARY_PAGE_SIZE = 12;
@ -90,123 +101,25 @@ public class BuildCraftBuilders {
public static ItemBptBluePrint blueprintItem;
public static boolean fillerDestroy;
private static boolean initialized = false;
private static BptRootIndex rootBptIndex;
public static TreeMap<String, BptPlayerIndex> playerLibrary = new TreeMap<String, BptPlayerIndex>();
private static LinkedList<IBuilderHook> hooks = new LinkedList<IBuilderHook>();
public static void load() {
@Instance
public static BuildCraftBuilders instance;
@Init
public void load(FMLInitializationEvent evt) {
// Create filler registry
FillerManager.registry = new FillerRegistry();
// Register gui handler
NetworkRegistry.instance().registerGuiHandler(mod_BuildCraftBuilders.instance, new GuiHandler());
NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
// Register save handler
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
}
public static void initialize() {
if (initialized)
return;
else
initialized = true;
mod_BuildCraftCore.initialize();
BuildCraftCore.initializeGears();
Property templateItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("templateItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.TEMPLATE_ITEM_ID);
Property blueprintItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("blueprintItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.BLUEPRINT_ITEM_ID);
Property markerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID);
Property pathMarkerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pathMarker.id",
DefaultProps.PATH_MARKER_ID);
Property fillerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID);
Property builderId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("builder.id", DefaultProps.BUILDER_ID);
Property architectId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("architect.id",
DefaultProps.ARCHITECT_ID);
Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id",
DefaultProps.BLUEPRINT_LIBRARY_ID);
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("filler.destroy",
Configuration.CATEGORY_GENERAL, DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = Boolean.parseBoolean(fillerDestroyProp.value);
BuildCraftCore.mainConfiguration.save();
templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));
templateItem.setItemName("templateItem");
ProxyCore.proxy.addName(templateItem, "Template");
blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value));
blueprintItem.setItemName("blueprintItem");
ProxyCore.proxy.addName(blueprintItem, "Blueprint");
markerBlock = new BlockMarker(Integer.parseInt(markerId.value));
ProxyCore.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
ProxyCore.proxy.addName(markerBlock, "Land Mark");
pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value));
ProxyCore.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
ProxyCore.proxy.addName(pathMarkerBlock, "Path Mark");
fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value));
ProxyCore.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
ProxyCore.proxy.addName(fillerBlock, "Filler");
builderBlock = new BlockBuilder(Integer.parseInt(builderId.value));
ProxyCore.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
ProxyCore.proxy.addName(builderBlock, "Builder");
architectBlock = new BlockArchitect(Integer.parseInt(architectId.value));
ProxyCore.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
ProxyCore.proxy.addName(architectBlock, "Architect Table");
libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value));
ProxyCore.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
ProxyCore.proxy.addName(libraryBlock, "Blueprint Library");
ProxyCore.proxy.registerTileEntity(TileMarker.class, "Marker");
ProxyCore.proxy.registerTileEntity(TileFiller.class, "Filler");
ProxyCore.proxy.registerTileEntity(TileBuilder.class, "net.minecraft.src.builders.TileBuilder");
ProxyCore.proxy.registerTileEntity(TileArchitect.class, "net.minecraft.src.builders.TileTemplate");
ProxyCore.proxy.registerTileEntity(TilePathMarker.class, "net.minecraft.src.builders.TilePathMarker");
ProxyCore.proxy.registerTileEntity(TileBlueprintLibrary.class, "net.minecraft.src.builders.TileBlueprintLibrary");
// / INIT FILLER PATTERNS
FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] { "bbb", "bbb", "bbb", Character.valueOf('b'),
new ItemStack(Block.brick, 1) });
FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] { " ", "ggg", "bbb", Character.valueOf('g'),
Block.glass, Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerRemover(), new Object[] { "ggg", "ggg", "ggg", Character.valueOf('g'),
Block.glass });
FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] { "bbb", "b b", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] { " ", " b ", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] { " b", " bb", "bbb", Character.valueOf('b'),
Block.brick });
BuildCraftCore.mainConfiguration.save();
// public static final Block music;
// public static final Block cloth;
// public static final Block tilledField;
// public static final BlockPortal portal;
// public static final Block trapdoor;
// STANDARD BLOCKS
new BptBlock(0); // default bpt block
@ -296,9 +209,77 @@ public class BuildCraftBuilders {
new BptBlockFiller(fillerBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
{
loadRecipes();
}
}
@PreInit
public void initialize(FMLPreInitializationEvent evt) {
Property templateItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("templateItem.id", Configuration.CATEGORY_ITEM, DefaultProps.TEMPLATE_ITEM_ID);
Property blueprintItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("blueprintItem.id", Configuration.CATEGORY_ITEM, DefaultProps.BLUEPRINT_ITEM_ID);
Property markerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID);
Property pathMarkerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pathMarker.id", DefaultProps.PATH_MARKER_ID);
Property fillerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID);
Property builderId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("builder.id", DefaultProps.BUILDER_ID);
Property architectId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("architect.id", DefaultProps.ARCHITECT_ID);
Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id", DefaultProps.BLUEPRINT_LIBRARY_ID);
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("filler.destroy", Configuration.CATEGORY_GENERAL, DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));
templateItem.setItemName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value));
blueprintItem.setItemName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
markerBlock = new BlockMarker(Integer.parseInt(markerId.value));
GameRegistry.registerBlock(markerBlock.setBlockName("markerBlock"));
LanguageRegistry.addName(markerBlock, "Land Mark");
pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value));
GameRegistry.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
LanguageRegistry.addName(pathMarkerBlock, "Path Mark");
fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value));
GameRegistry.registerBlock(fillerBlock.setBlockName("fillerBlock"));
LanguageRegistry.addName(fillerBlock, "Filler");
builderBlock = new BlockBuilder(Integer.parseInt(builderId.value));
GameRegistry.registerBlock(builderBlock.setBlockName("builderBlock"));
LanguageRegistry.addName(builderBlock, "Builder");
architectBlock = new BlockArchitect(Integer.parseInt(architectId.value));
GameRegistry.registerBlock(architectBlock.setBlockName("architectBlock"));
LanguageRegistry.addName(architectBlock, "Architect Table");
libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value));
GameRegistry.registerBlock(libraryBlock.setBlockName("libraryBlock"));
LanguageRegistry.addName(libraryBlock, "Blueprint Library");
GameRegistry.registerTileEntity(TileMarker.class, "Marker");
GameRegistry.registerTileEntity(TileFiller.class, "Filler");
GameRegistry.registerTileEntity(TileBuilder.class, "net.minecraft.src.builders.TileBuilder");
GameRegistry.registerTileEntity(TileArchitect.class, "net.minecraft.src.builders.TileTemplate");
GameRegistry.registerTileEntity(TilePathMarker.class, "net.minecraft.src.builders.TilePathMarker");
GameRegistry.registerTileEntity(TileBlueprintLibrary.class, "net.minecraft.src.builders.TileBlueprintLibrary");
BuildCraftCore.mainConfiguration.save();
// public static final Block music;
// public static final Block cloth;
// public static final Block tilledField;
// public static final BlockPortal portal;
// public static final Block trapdoor;
// STANDARD BLOCKS
}
public static void loadRecipes() {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'),
@ -330,6 +311,24 @@ public class BuildCraftBuilders {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), new Object[] { "bbb", "bBb", "bbb", Character.valueOf('b'),
new ItemStack(blueprintItem), Character.valueOf('B'), Block.bookShelf });
// / INIT FILLER PATTERNS
FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] { "bbb", "bbb", "bbb", Character.valueOf('b'),
new ItemStack(Block.brick, 1) });
FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] { " ", "ggg", "bbb", Character.valueOf('g'),
Block.glass, Character.valueOf('b'), Block.brick });
FillerManager.registry.addRecipe(new FillerRemover(), new Object[] { "ggg", "ggg", "ggg", Character.valueOf('g'),
Block.glass });
FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] { "bbb", "b b", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] { " ", " b ", "bbb", Character.valueOf('b'),
Block.brick });
FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] { " b", " bb", "bbb", Character.valueOf('b'),
Block.brick });
}
public static BptPlayerIndex getPlayerIndex(String name) {

View file

@ -13,6 +13,16 @@ import java.util.TreeMap;
import java.util.logging.Logger;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.gates.Action;
@ -30,6 +40,9 @@ import buildcraft.core.BuildCraftConfiguration;
import buildcraft.core.DefaultActionProvider;
import buildcraft.core.DefaultProps;
import buildcraft.core.DefaultTriggerProvider;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityLaser;
import buildcraft.core.EntityRobot;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.ItemWrench;
import buildcraft.core.ProxyCore;
@ -38,8 +51,11 @@ import buildcraft.core.TriggerInventory;
import buildcraft.core.TriggerLiquidContainer;
import buildcraft.core.TriggerMachine;
import buildcraft.core.ActionMachineControl.Mode;
import buildcraft.core.network.EntityIds;
import buildcraft.core.network.PacketHandler;
//import buildcraft.core.network.ConnectionHandler;
import buildcraft.core.network.PacketUpdate;
import buildcraft.core.utils.Localization;
import buildcraft.transport.TriggerRedstoneInput;
import net.minecraft.src.Block;
@ -48,8 +64,9 @@ import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
@Mod(name="BuildCraft", version=DefaultProps.VERSION, useMetadata = false, modid = "BuildCraft|Core")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftCore {
public static enum RenderMode {
Full, NoDynamic
};
@ -60,9 +77,7 @@ public class BuildCraftCore {
public static boolean modifyWorld = false;
public static boolean trackNetworkUsage = false;
public static boolean dropBrokenBlocks = true; // Set to false to prevent
// the filler from dropping
// broken blocks.
public static boolean dropBrokenBlocks = true; // Set to false to prevent the filler from dropping broken blocks.
public static int updateFactor = 10;
@ -74,9 +89,6 @@ public class BuildCraftCore {
public static boolean continuousCurrentModel;
private static boolean initialized = false;
private static boolean gearsInitialized = false;
public static Item woodenGearItem;
public static Item stoneGearItem;
public static Item ironGearItem;
@ -96,22 +108,14 @@ public class BuildCraftCore {
public static Trigger triggerMachineActive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_ACTIVE, true);
public static Trigger triggerMachineInactive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_INACTIVE, false);
public static Trigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY,
TriggerInventory.State.Empty);
public static Trigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY,
TriggerInventory.State.Contains);
public static Trigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY,
TriggerInventory.State.Space);
public static Trigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY,
TriggerInventory.State.Full);
public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID,
TriggerLiquidContainer.State.Empty);
public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID,
TriggerLiquidContainer.State.Contains);
public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID,
TriggerLiquidContainer.State.Space);
public static Trigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID,
TriggerLiquidContainer.State.Full);
public static Trigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY, TriggerInventory.State.Empty);
public static Trigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY, TriggerInventory.State.Contains);
public static Trigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY, TriggerInventory.State.Space);
public static Trigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY, TriggerInventory.State.Full);
public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID, TriggerLiquidContainer.State.Empty);
public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID, TriggerLiquidContainer.State.Contains);
public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID, TriggerLiquidContainer.State.Space);
public static Trigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID, TriggerLiquidContainer.State.Full);
public static Trigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
@ -121,29 +125,26 @@ public class BuildCraftCore {
public static Action actionLoop = new ActionMachineControl(DefaultProps.ACTION_LOOP, Mode.Loop);
public static boolean loadDefaultRecipes = true;
public static boolean forcePneumaticPower = false;
public static boolean forcePneumaticPower = true;
public static boolean consumeWaterSources = true;
public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
public static Logger bcLog = Logger.getLogger("Buildcraft");
public static void load() {
//MinecraftForge.registerConnectionHandler(new ConnectionHandler());
}
public static void initialize() {
if (initialized)
return;
@Instance
public static BuildCraftCore instance;
@PreInit
public void loadConfiguration(FMLPreInitializationEvent evt) {
bcLog.setParent(FMLLog.getLogger());
bcLog.info("Starting BuildCraft " + DefaultProps.VERSION);
bcLog.info("Copyright (c) SpaceToad, 2011");
bcLog.info("http://www.mod-buildcraft.com");
initialized = true;
mainConfiguration = new BuildCraftConfiguration(new File(ProxyCore.proxy.getBuildCraftBase(), "config/buildcraft/main.conf"));
mainConfiguration = new BuildCraftConfiguration(new File(evt.getModConfigurationDirectory(), "buildcraft/main.conf"));
try
{
mainConfiguration.load();
redLaserTexture = 0 * 16 + 2;
@ -151,66 +152,74 @@ public class BuildCraftCore {
stripesLaserTexture = 0 * 16 + 3;
transparentTexture = 0 * 16 + 0;
Property continuousCurrent = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("current.continuous",
Configuration.CATEGORY_GENERAL, DefaultProps.CURRENT_CONTINUOUS);
Property continuousCurrent = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("current.continuous", Configuration.CATEGORY_GENERAL, DefaultProps.CURRENT_CONTINUOUS);
continuousCurrent.comment = "set to true for allowing machines to be driven by continuous current";
continuousCurrentModel = continuousCurrent.getBoolean(DefaultProps.CURRENT_CONTINUOUS);
continuousCurrentModel = Boolean.parseBoolean(continuousCurrent.value);
Property trackNetwork = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("trackNetworkUsage", Configuration.CATEGORY_GENERAL, false);
trackNetworkUsage = trackNetwork.getBoolean(false);
Property trackNetwork = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("trackNetworkUsage",
Configuration.CATEGORY_GENERAL, false);
trackNetworkUsage = Boolean.parseBoolean(trackNetwork.value);
Property dropBlock = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("dropBrokenBlocks",
Configuration.CATEGORY_GENERAL, true);
Property dropBlock = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("dropBrokenBlocks", Configuration.CATEGORY_GENERAL, true);
dropBlock.comment = "set to false to prevent fillers from dropping blocks.";
dropBrokenBlocks = Boolean.parseBoolean(dropBlock.value);
dropBrokenBlocks = dropBlock.getBoolean(true);
Property powerFrameworkClass = BuildCraftCore.mainConfiguration.getOrCreateProperty("power.framework",
Configuration.CATEGORY_GENERAL, "buildcraft.energy.PneumaticPowerFramework");
Property powerFrameworkClass = BuildCraftCore.mainConfiguration.getOrCreateProperty("power.framework", Configuration.CATEGORY_GENERAL, "buildcraft.energy.PneumaticPowerFramework");
Property factor = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("network.updateFactor",
Configuration.CATEGORY_GENERAL, 10);
Property factor = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("network.updateFactor", Configuration.CATEGORY_GENERAL, 10);
factor.comment = "increasing this number will decrease network update frequency, useful for overloaded servers";
updateFactor = factor.getInt(10);
updateFactor = Integer.parseInt(factor.value);
String prefix = "";
if (BuildCraftCore.class.getName().startsWith("net.minecraft.src."))
prefix = "net.minecraft.src.";
if (forcePneumaticPower)
try {
PowerFramework.currentFramework = (PowerFramework) Class
.forName(prefix + "buildcraft.energy.PneumaticPowerFramework").getConstructor().newInstance();
} catch (Throwable e) {
e.printStackTrace();
String powerFrameworkClassName = "buildcraft.energy.PneumaticPowerFramework";
if (!forcePneumaticPower)
{
powerFrameworkClassName = powerFrameworkClass.value;
}
else
try {
String className = powerFrameworkClass.value;
if (className.startsWith("net.minecraft.src."))
className = className.replace("net.minecraft.src.", "");
PowerFramework.currentFramework = (PowerFramework) Class.forName(prefix + className).getConstructor()
.newInstance();
PowerFramework.currentFramework = (PowerFramework) Class.forName(powerFrameworkClassName).getConstructor().newInstance();
} catch (Throwable e) {
e.printStackTrace();
bcLog.throwing("BuildCraftCore", "loadConfiguration", e);
PowerFramework.currentFramework = new RedstonePowerFramework();
}
Property wrenchId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("wrench.id", Configuration.CATEGORY_ITEM,
DefaultProps.WRENCH_ID);
Property wrenchId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("wrench.id", Configuration.CATEGORY_ITEM, DefaultProps.WRENCH_ID);
wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem");
LanguageRegistry.addName(wrenchItem, "Wrench");
Property woodenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("woodenGearItem.id", Configuration.CATEGORY_ITEM, DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("stoneGearItem.id", Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("ironGearItem.id", Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID);
Property goldenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("goldenGearItem.id", Configuration.CATEGORY_ITEM, DefaultProps.GOLDEN_GEAR_ID);
Property diamondGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("diamondGearItem.id", Configuration.CATEGORY_ITEM, DefaultProps.DIAMOND_GEAR_ID);
Property modifyWorld = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("modifyWorld", Configuration.CATEGORY_GENERAL, true);
modifyWorld.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
BuildCraftCore.modifyWorld = modifyWorld.getBoolean(true);
woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName("woodenGearItem");
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName("stoneGearItem");
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName("ironGearItem");
LanguageRegistry.addName(ironGearItem, "Iron Gear");
goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName("goldGearItem");
LanguageRegistry.addName(goldGearItem, "Gold Gear");
diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName("diamondGearItem");
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
}
finally
{
mainConfiguration.save();
}
}
initializeGears();
wrenchItem = (new ItemWrench(Integer.parseInt(wrenchId.value))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem");
ProxyCore.proxy.addName(wrenchItem, "Wrench");
@Init
public void initialize(FMLInitializationEvent evt) {
//MinecraftForge.registerConnectionHandler(new ConnectionHandler());
LiquidManager.liquids.add(new LiquidData(new LiquidStack(Block.waterStill, BuildCraftAPI.BUCKET_VOLUME), new LiquidStack(Block.waterMoving, BuildCraftAPI.BUCKET_VOLUME), new ItemStack(Item.bucketWater), new ItemStack(Item.bucketEmpty)));
LiquidManager.liquids.add(new LiquidData(new LiquidStack(Block.lavaStill, BuildCraftAPI.BUCKET_VOLUME), new LiquidStack(Block.lavaMoving, BuildCraftAPI.BUCKET_VOLUME), new ItemStack(Item.bucketLava), new ItemStack(Item.bucketEmpty)));
@ -219,81 +228,30 @@ public class BuildCraftCore {
BuildCraftAPI.softBlocks[Block.waterMoving.blockID] = true;
BuildCraftAPI.softBlocks[Block.waterStill.blockID] = true;
mainConfiguration.save();
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
}
public static void loadRecipes() {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(wrenchItem), new Object[] { "I I", " G ", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('G'), stoneGearItem });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(woodenGearItem), new Object[] { " S ", "S S", " S ", Character.valueOf('S'),
Item.stick });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Block.cobblestone, Character.valueOf('G'), woodenGearItem });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(ironGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.ingotIron, Character.valueOf('G'), stoneGearItem });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(goldGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.ingotGold, Character.valueOf('G'), ironGearItem });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'),
Item.diamond, Character.valueOf('G'), goldGearItem });
}
public static void initializeGears() {
if (gearsInitialized)
return;
Property woodenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("woodenGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("stoneGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("ironGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID);
Property goldenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("goldenGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.GOLDEN_GEAR_ID);
Property diamondGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("diamondGearItem.id",
Configuration.CATEGORY_ITEM, DefaultProps.DIAMOND_GEAR_ID);
Property modifyWorld = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("modifyWorld",
Configuration.CATEGORY_GENERAL, true);
modifyWorld.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)";
BuildCraftCore.mainConfiguration.save();
BuildCraftCore.modifyWorld = modifyWorld.value.equals("true");
gearsInitialized = true;
woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName(
"woodenGearItem");
ProxyCore.proxy.addName(woodenGearItem, "Wooden Gear");
stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName(
"stoneGearItem");
ProxyCore.proxy.addName(stoneGearItem, "Stone Gear");
ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName(
"ironGearItem");
ProxyCore.proxy.addName(ironGearItem, "Iron Gear");
goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName(
"goldGearItem");
ProxyCore.proxy.addName(goldGearItem, "Gold Gear");
diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName(
"diamondGearItem");
ProxyCore.proxy.addName(diamondGearItem, "Diamond Gear");
BuildCraftCore.mainConfiguration.save();
ActionManager.registerTriggerProvider(new DefaultTriggerProvider());
ActionManager.registerActionProvider(new DefaultActionProvider());
if (BuildCraftCore.loadDefaultRecipes)
{
loadRecipes();
}
EntityRegistry.registerModEntity(EntityRobot.class, "bcRobot", EntityIds.ROBOT, instance, 50, 1, true);
EntityRegistry.registerModEntity(EntityLaser.class, "bcLaser", EntityIds.LASER, instance, 50, 1, true);
EntityRegistry.registerModEntity(EntityEnergyLaser.class, "bcEnergyLaser", EntityIds.ENERGY_LASER, instance, 50, 1, true);
ProxyCore.proxy.initializeRendering();
ProxyCore.proxy.initializeEntityRendering();
Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE);
}
public void loadRecipes() {
GameRegistry.addRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), stoneGearItem);
GameRegistry.addRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", Character.valueOf('S'), Item.stick);
GameRegistry.addRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Block.cobblestone, Character.valueOf('G'), woodenGearItem);
GameRegistry.addRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), stoneGearItem);
GameRegistry.addRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotGold, Character.valueOf('G'), ironGearItem);
GameRegistry.addRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", Character.valueOf('I'),Item.diamond, Character.valueOf('G'), goldGearItem);
}
}

View file

@ -10,7 +10,16 @@ package buildcraft;
import java.util.TreeMap;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.fuels.IronEngineCoolant;
@ -24,18 +33,25 @@ import buildcraft.core.BlockIndex;
import buildcraft.core.DefaultProps;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.ProxyCore;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.energy.BlockEngine;
import buildcraft.energy.BlockOilFlowing;
import buildcraft.energy.BlockOilStill;
import buildcraft.energy.BptBlockEngine;
import buildcraft.energy.EnergyProxy;
import buildcraft.energy.GuiHandler;
import buildcraft.energy.ItemBucketOil;
import buildcraft.energy.ItemEngine;
import buildcraft.energy.OilBucketHandler;
import buildcraft.energy.OilPopulate;
import buildcraft.energy.TriggerEngineHeat;
import buildcraft.energy.Engine.EnergyStage;
import buildcraft.energy.render.RenderEngine;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
@ -43,6 +59,8 @@ import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
@Mod(name="BuildCraft Energy", version=DefaultProps.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftEnergy {
public final static int ENERGY_REMOVE_BLOCK = 25;
@ -68,70 +86,68 @@ public class BuildCraftEnergy {
EnergyStage.Yellow);
public static Trigger triggerRedEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red);
public static void load() {
// Register gui handler
NetworkRegistry.instance().registerGuiHandler(mod_BuildCraftBuilders.instance, new GuiHandler());
@Instance
public static BuildCraftEnergy instance;
// MinecraftForge.registerEntity(EntityMechanicalArm.class,
// mod_BuildCraftEnergy.instance, EntityIds.MECHANICAL_ARM, 50, 10,
// true);
@Init
public static void load(FMLInitializationEvent evt) {
NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
GameRegistry.registerWorldGenerator(new OilPopulate());
new BptBlockEngine(engineBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
{
loadRecipes();
}
EnergyProxy.proxy.registerBlockRenderers();
EnergyProxy.proxy.registerTileEntities();
EnergyProxy.proxy.registerTextureFX();
}
public static void initialize() {
if (initialized)
return;
else
initialized = true;
BuildCraftCore.initialize();
@PreInit
public void initialize(FMLPreInitializationEvent evt) {
Property engineId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("engine.id", DefaultProps.ENGINE_ID);
Property oilStillId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilStill.id",
DefaultProps.OIL_STILL_ID);
Property oilMovingId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilMoving.id",
DefaultProps.OIL_MOVING_ID);
Property bucketOilId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketOil.id",
Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID);
Property bucketFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketFuel.id",
Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_FUEL_ID);
Property itemFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM,
DefaultProps.FUEL_ID);
Property oilStillId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilStill.id", DefaultProps.OIL_STILL_ID);
Property oilMovingId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilMoving.id", DefaultProps.OIL_MOVING_ID);
Property bucketOilId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketOil.id", Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID);
Property bucketFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketFuel.id", Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_FUEL_ID);
Property itemFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM, DefaultProps.FUEL_ID);
BuildCraftCore.mainConfiguration.save();
engineBlock = new BlockEngine(Integer.parseInt(engineId.value));
engineBlock = new BlockEngine(engineId.getInt(DefaultProps.ENGINE_ID));
GameRegistry.registerBlock(engineBlock, ItemEngine.class);
Item.itemsList[engineBlock.blockID] = null;
Item.itemsList[engineBlock.blockID] = (new ItemEngine(engineBlock.blockID - 256));
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine");
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine");
ProxyCore.proxy.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine");
ProxyCore.proxy.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine");
ProxyCore.proxy.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine");
oilStill = (new BlockOilStill(oilStillId.getInt(DefaultProps.OIL_STILL_ID), Material.water)).setBlockName("oil");
LanguageRegistry.addName(oilStill.setBlockName("oilStill"), "Oil");
GameRegistry.registerBlock(oilStill);
oilMoving = (new BlockOilFlowing(Integer.parseInt(oilMovingId.value), Material.water)).setBlockName("oil");
ProxyCore.proxy.addName(oilMoving.setBlockName("oilMoving"), "Oil");
ProxyCore.proxy.registerBlock(oilMoving);
oilStill = (new BlockOilStill(Integer.parseInt(oilStillId.value), Material.water)).setBlockName("oil");
ProxyCore.proxy.addName(oilStill.setBlockName("oilStill"), "Oil");
ProxyCore.proxy.registerBlock(oilStill);
oilMoving = (new BlockOilFlowing(oilMovingId.getInt(DefaultProps.OIL_MOVING_ID), Material.water)).setBlockName("oil");
LanguageRegistry.addName(oilMoving.setBlockName("oilMoving"), "Oil");
GameRegistry.registerBlock(oilMoving);
// Oil and fuel
if (oilMoving.blockID + 1 != oilStill.blockID)
{
throw new RuntimeException("Oil Still id must be Oil Moving id + 1");
}
fuel = new ItemBuildCraft(itemFuelId.getInt(DefaultProps.FUEL_ID)).setItemName("fuel");
LanguageRegistry.addName(fuel, "Fuel");
MinecraftForge.EVENT_BUS.register(new OilBucketHandler());
bucketOil = (new ItemBucketOil(Integer.parseInt(bucketOilId.value))).setItemName("bucketOil").setContainerItem(
Item.bucketEmpty);
ProxyCore.proxy.addName(bucketOil, "Oil Bucket");
bucketOil = (new ItemBucketOil(bucketOilId.getInt(DefaultProps.BUCKET_OIL_ID))).setItemName("bucketOil").setContainerItem(Item.bucketEmpty);
LanguageRegistry.addName(bucketOil, "Oil Bucket");
fuel = new ItemBuildCraft(Integer.parseInt(itemFuelId.value)).setItemName("fuel");
ProxyCore.proxy.addName(fuel, "Fuel");
bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setIconIndex(0 * 16 + 3).setItemName("bucketFuel")
.setMaxStackSize(1).setContainerItem(Item.bucketEmpty);
ProxyCore.proxy.addName(bucketFuel, "Fuel Bucket");
bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setItemName("bucketFuel").setContainerItem(Item.bucketEmpty);
bucketFuel.setIconIndex(0 * 16 + 3).setMaxStackSize(1).setTabToDisplayOn(CreativeTabs.tabMisc);
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
RefineryRecipe.registerRefineryRecipe(new RefineryRecipe(new LiquidStack(oilStill.blockID, 1, 0), null, new LiquidStack(fuel.shiftedIndex, 1, 0), 10, 1));
@ -148,15 +164,9 @@ public class BuildCraftEnergy {
BuildCraftAPI.softBlocks[oilMoving.blockID] = true;
BuildCraftAPI.softBlocks[oilStill.blockID] = true;
new BptBlockEngine(engineBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
}
public static void loadRecipes() {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0), new Object[] { "www", " g ", "GpG", Character.valueOf('w'),
Block.planks, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.woodenGearItem,
Character.valueOf('p'), Block.pistonBase });

View file

@ -8,10 +8,23 @@
package buildcraft;
import java.lang.reflect.Method;
import cpw.mods.fml.client.registry.ClientRegistry;
import buildcraft.mod_BuildCraftCore;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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.EntityRegistry;
import buildcraft.core.DefaultProps;
import buildcraft.core.ProxyCore;
import buildcraft.core.network.EntityIds;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.factory.BlockAutoWorkbench;
@ -27,6 +40,9 @@ import buildcraft.factory.BptBlockAutoWorkbench;
import buildcraft.factory.BptBlockFrame;
import buildcraft.factory.BptBlockRefinery;
import buildcraft.factory.BptBlockTank;
import buildcraft.factory.EntityMechanicalArm;
import buildcraft.factory.FactoryProxy;
import buildcraft.factory.GuiHandler;
import buildcraft.factory.TileAssemblyTable;
import buildcraft.factory.TileAutoWorkbench;
import buildcraft.factory.TileHopper;
@ -35,6 +51,8 @@ import buildcraft.factory.TilePump;
import buildcraft.factory.TileQuarry;
import buildcraft.factory.TileRefinery;
import buildcraft.factory.TileTank;
import buildcraft.factory.gui.GuiAutoCrafting;
import buildcraft.factory.network.PacketHandlerFactory;
import buildcraft.factory.render.RenderHopper;
import buildcraft.factory.render.RenderRefinery;
import buildcraft.factory.render.RenderTank;
@ -45,6 +63,8 @@ import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
@Mod(name="BuildCraft Factory", version=DefaultProps.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 static BlockQuarry quarryBlock;
@ -60,45 +80,69 @@ public class BuildCraftFactory {
public static int drillTexture;
private static boolean initialized = false;
public static boolean allowMining = true;
public static void load() {
// Register gui handler
//MinecraftForge.setGuiHandler(mod_BuildCraftFactory.instance, new GuiHandler());
@Instance
public static BuildCraftFactory instance;
// MinecraftForge.registerEntity(EntityMechanicalArm.class,
// mod_BuildCraftFactory.instance, EntityIds.MECHANICAL_ARM, 50, 10,
// true);
@PostInit
public void postInit(FMLPostInitializationEvent evt)
{
try {
Class<?> neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer");
Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class);
method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11);
BuildCraftCore.bcLog.fine("NEI detected, adding NEI overlay");
} catch (Exception e) {
BuildCraftCore.bcLog.fine("NEI not detected.");
}
}
@Init
public void load(FMLInitializationEvent evt) {
NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
EntityRegistry.registerModEntity(EntityMechanicalArm.class, "bcMechanicalArm", EntityIds.MECHANICAL_ARM, instance, 50, 1, true);
ProxyCore.proxy.registerTileEntity(TileQuarry.class, "Machine");
ProxyCore.proxy.registerTileEntity(TileMiningWell.class, "MiningWell");
ProxyCore.proxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench");
ProxyCore.proxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump");
ProxyCore.proxy.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank");
ProxyCore.proxy.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery");
ProxyCore.proxy.registerTileEntity(TileLaser.class, "net.minecraft.src.buildcraft.factory.TileLaser");
ProxyCore.proxy.registerTileEntity(TileAssemblyTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyTable");
if (!hopperDisabled) {
ProxyCore.proxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper");
}
public static void initialize() {
if (initialized)
return;
else
initialized = true;
FactoryProxy.proxy.initializeTileEntities();
FactoryProxy.proxy.initializeEntityRenders();
drillTexture = 2 * 16 + 1;
mod_BuildCraftCore.initialize();
BuildCraftCore.initializeGears();
new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
new BptBlockFrame(frameBlock.blockID);
new BptBlockRefinery(refineryBlock.blockID);
new BptBlockTank(tankBlock.blockID);
allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("mining.enabled",
Configuration.CATEGORY_GENERAL, true).value);
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
}
Property minigWellId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("miningWell.id",
DefaultProps.MINING_WELL_ID);
@PreInit
public void initialize(FMLPreInitializationEvent evt) {
allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("mining.enabled", Configuration.CATEGORY_GENERAL, true).value);
Property minigWellId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("miningWell.id", DefaultProps.MINING_WELL_ID);
Property plainPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("drill.id", DefaultProps.DRILL_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("autoWorkbench.id",
DefaultProps.AUTO_WORKBENCH_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID);
Property frameId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("frame.id", DefaultProps.FRAME_ID);
Property quarryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("quarry.id", DefaultProps.QUARRY_ID);
Property pumpId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pump.id", DefaultProps.PUMP_ID);
Property tankId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("tank.id", DefaultProps.TANK_ID);
Property refineryId = BuildCraftCore.mainConfiguration
.getOrCreateBlockIdProperty("refinery.id", DefaultProps.REFINERY_ID);
Property refineryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("refinery.id", DefaultProps.REFINERY_ID);
Property hopperId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("hopper.id", DefaultProps.HOPPER_ID);
Property hopperDisable = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("hopper.disabled", "Block Savers",
false);
Property hopperDisable = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("hopper.disabled", "Block Savers", false);
BuildCraftCore.mainConfiguration.save();
@ -141,42 +185,7 @@ public class BuildCraftFactory {
ProxyCore.proxy.addName(hopperBlock, "Hopper");
}
ProxyCore.proxy.registerTileEntity(TileQuarry.class, "Machine");
ProxyCore.proxy.registerTileEntity(TileMiningWell.class, "MiningWell");
ProxyCore.proxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench");
ProxyCore.proxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump");
ProxyCore.proxy.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank");
ProxyCore.proxy.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery");
ProxyCore.proxy.registerTileEntity(TileLaser.class, "net.minecraft.src.buildcraft.factory.TileLaser");
ProxyCore.proxy.registerTileEntity(TileAssemblyTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyTable");
if (!hopperDisabled) {
ProxyCore.proxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper");
}
/// FIXME: Render registration needs to move into a client side proxy.
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
ClientRegistry.bindTileEntitySpecialRenderer(TileRefinery.class, new RenderRefinery());
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0),
new RenderRefinery());
if(!hopperDisabled) {
ClientRegistry.bindTileEntitySpecialRenderer(TileHopper.class, new RenderHopper());
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper());
}
drillTexture = 2 * 16 + 1;
BuildCraftCore.mainConfiguration.save();
new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
new BptBlockFrame(frameBlock.blockID);
new BptBlockRefinery(refineryBlock.blockID);
new BptBlockTank(tankBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
}
public static void loadRecipes() {

View file

@ -8,9 +8,10 @@
package buildcraft;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.network.NetworkRegistry;
import buildcraft.mod_BuildCraftCore;
import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Property;
import buildcraft.api.bptblocks.BptBlockInventory;
import buildcraft.api.bptblocks.BptBlockRotateMeta;
import buildcraft.api.recipes.AssemblyRecipe;
@ -20,38 +21,46 @@ import buildcraft.core.ProxyCore;
import buildcraft.silicon.BlockAssemblyTable;
import buildcraft.silicon.BlockLaser;
import buildcraft.silicon.GuiHandler;
import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Property;
import buildcraft.silicon.SiliconProxy;
import buildcraft.silicon.network.PacketHandlerSilicon;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
@Mod(name="BuildCraft Silicon", version=DefaultProps.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 static int laserBlockModel;
public static Item redstoneChipset;
public static BlockLaser laserBlock;
public static BlockAssemblyTable assemblyTableBlock;
private static boolean initialized = false;
@Instance
public static BuildCraftSilicon instance;
public static void load() {
// Register gui handler
NetworkRegistry.instance().registerGuiHandler(mod_BuildCraftBuilders.instance, new GuiHandler());
@Init
public void load(FMLInitializationEvent evt) {
NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockInventory(assemblyTableBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
SiliconProxy.proxy.registerRenderers();
}
public static void initialize() {
if (initialized)
return;
initialized = true;
mod_BuildCraftCore.initialize();
@PreInit
public void initialize(FMLPreInitializationEvent evt) {
Property laserId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("laser.id", DefaultProps.LASER_ID);
Property assemblyTableId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("assemblyTable.id",
DefaultProps.ASSEMBLY_TABLE_ID);
Property assemblyTableId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("assemblyTable.id", DefaultProps.ASSEMBLY_TABLE_ID);
BuildCraftCore.mainConfiguration.save();
@ -66,6 +75,56 @@ public class BuildCraftSilicon {
redstoneChipset = new ItemRedstoneChipset(DefaultProps.REDSTONE_CHIPSET);
redstoneChipset.setItemName("redstoneChipset");
}
public static void loadRecipes() {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(laserBlock), new Object[] { "ORR", "DDR", "ORR", Character.valueOf('O'),
Block.obsidian, Character.valueOf('R'), Item.redstone, Character.valueOf('D'), Item.diamond, });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock),
new Object[] { "ORO", "ODO", "OGO", Character.valueOf('O'), Block.obsidian, Character.valueOf('R'),
Item.redstone, Character.valueOf('D'), Item.diamond, Character.valueOf('G'),
BuildCraftCore.diamondGearItem, });
//Add reverse recipies for all gates
//Iron
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 2),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 1)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 1),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 2)});
//Gold
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 4),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 3)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 3),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 4)});
//Diamond
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 6),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 5)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 5),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 6)});
//Iron - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2)});
//Gold - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4)});
//Diamond - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6)});
// / REDSTONE CHIPSETS
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone) }, 10000,
new ItemStack(redstoneChipset, 1, 0)));
@ -153,67 +212,5 @@ public class BuildCraftSilicon {
new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6)));
ProxyCore.proxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6), "Autarchic Diamond OR Gate");
new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockInventory(assemblyTableBlock.blockID);
if (BuildCraftCore.loadDefaultRecipes)
loadRecipes();
}
public static void loadRecipes() {
ProxyCore.proxy.addCraftingRecipe(new ItemStack(laserBlock), new Object[] { "ORR", "DDR", "ORR", Character.valueOf('O'),
Block.obsidian, Character.valueOf('R'), Item.redstone, Character.valueOf('D'), Item.diamond, });
ProxyCore.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock),
new Object[] { "ORO", "ODO", "OGO", Character.valueOf('O'), Block.obsidian, Character.valueOf('R'),
Item.redstone, Character.valueOf('D'), Item.diamond, Character.valueOf('G'),
BuildCraftCore.diamondGearItem, });
//Add reverse recipies for all gates
//Iron
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 2),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 1)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 1),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 2)});
//Gold
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 4),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 3)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 3),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 4)});
//Diamond
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 6),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 5)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGate, 1, 5),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGate, 1, 6)});
//Iron - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2)});
//Gold - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4)});
//Diamond - Autarchic
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5)});
ProxyCore.proxy.addShapelessRecipe(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5),
new Object[]{new ItemStack(redstoneChipset, 1, 0), new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6)});
}
public static void initializeModel() {
laserBlockModel = RenderingRegistry.getNextAvailableRenderId();
}
}

View file

@ -11,9 +11,17 @@ package buildcraft;
import java.util.LinkedList;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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;
import buildcraft.mod_BuildCraftCore;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.api.gates.Action;
import buildcraft.api.gates.ActionManager;
import buildcraft.api.gates.Trigger;
@ -31,6 +39,7 @@ import buildcraft.transport.BptBlockPipe;
import buildcraft.transport.BptItemPipeDiamond;
import buildcraft.transport.BptItemPipeIron;
import buildcraft.transport.BptItemPipeWodden;
import buildcraft.transport.GuiHandler;
import buildcraft.transport.ItemFacade;
import buildcraft.transport.ItemGate;
import buildcraft.transport.ItemPipe;
@ -43,6 +52,7 @@ import buildcraft.transport.TransportProxy;
import buildcraft.transport.TriggerPipeContents;
import buildcraft.transport.TriggerPipeSignal;
import buildcraft.transport.TriggerPipeContents.Kind;
import buildcraft.transport.network.PacketHandlerTransport;
import buildcraft.transport.pipes.PipeItemsCobblestone;
import buildcraft.transport.pipes.PipeItemsDiamond;
import buildcraft.transport.pipes.PipeItemsGold;
@ -72,10 +82,9 @@ import net.minecraft.src.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
@Mod(version = DefaultProps.VERSION, modid="BuildCraft|Transport", name = "Buildcraft Transport", dependencies=DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels={DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerTransport.class)
public class BuildCraftTransport {
private static boolean initialized = false;
public static BlockGenericPipe genericPipeBlock;
public static int[] diamondTextures = new int[6];
@ -124,22 +133,14 @@ public class BuildCraftTransport {
public static Trigger triggerPipeItems = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems);
public static Trigger triggerPipeLiquids = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids);
public static Trigger triggerPipeEnergy = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy);
public static Trigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true,
IPipe.WireColor.Red);
public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false,
IPipe.WireColor.Red);
public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true,
IPipe.WireColor.Blue);
public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false,
IPipe.WireColor.Blue);
public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true,
IPipe.WireColor.Green);
public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false,
IPipe.WireColor.Green);
public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true,
IPipe.WireColor.Yellow);
public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false,
IPipe.WireColor.Yellow);
public static Trigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red);
public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false, IPipe.WireColor.Red);
public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue);
public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false, IPipe.WireColor.Blue);
public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true, IPipe.WireColor.Green);
public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, IPipe.WireColor.Green);
public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, IPipe.WireColor.Yellow);
public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, IPipe.WireColor.Yellow);
public static Action actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
public static Action actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
@ -147,25 +148,15 @@ public class BuildCraftTransport {
public static Action actionYellowSignal = new ActionSignalOutput(DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow);
public static Action actionEnergyPulser = new ActionEnergyPulser(DefaultProps.ACTION_ENERGY_PULSER);
public static int pipeModel;
@Instance
public static BuildCraftTransport instance;
private static class PipeRecipe {
boolean isShapeless = false; // pipe recipes come shaped and unshaped.
ItemStack result;
Object[] input;
}
private static LinkedList<PipeRecipe> pipeRecipes = new LinkedList<PipeRecipe>();
public static void load() {
// Register connection handler
//MinecraftForge.registerConnectionHandler(new ConnectionHandler());
// Register gui handler
//MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, new GuiHandler());
}
private static class ExtractionHandler implements IExtractionHandler {
private final String[] items;
private final String[] liquids;
@ -205,121 +196,110 @@ public class BuildCraftTransport {
}
}
public static void initialize() {
if (initialized)
return;
private static LinkedList<PipeRecipe> pipeRecipes = new LinkedList<PipeRecipe>();
initialized = true;
mod_BuildCraftCore.initialize();
Property alwaysConnect = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("pipes.alwaysConnect",
Configuration.CATEGORY_GENERAL, DefaultProps.PIPES_ALWAYS_CONNECT);
@PreInit
public void preInitialize(FMLPreInitializationEvent evt)
{
try
{
Property alwaysConnect = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("pipes.alwaysConnect", Configuration.CATEGORY_GENERAL, DefaultProps.PIPES_ALWAYS_CONNECT);
alwaysConnect.comment = "set to false to deactivate pipe connection rules, true by default";
alwaysConnectPipes = alwaysConnect.getBoolean(DefaultProps.PIPES_ALWAYS_CONNECT);
Property PipeLoss = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("power.usePipeLoss",
Configuration.CATEGORY_GENERAL, DefaultProps.USE_PIPELOSS);
PipeLoss.comment = "Set to false to turn off energy loss over distance on all power pipes";
Property pipeLoss = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("power.usePipeLoss", Configuration.CATEGORY_GENERAL, DefaultProps.USE_PIPELOSS);
pipeLoss.comment = "Set to false to turn off energy loss over distance on all power pipes";
usePipeLoss = pipeLoss.getBoolean(DefaultProps.USE_PIPELOSS);
Property exclusionItemList = BuildCraftCore.mainConfiguration.getOrCreateProperty("woodenPipe.item.exclusion", Configuration.CATEGORY_BLOCK, "");
String[] excludedItemBlocks = exclusionItemList.value.split(",");
for (int j = 0; j < excludedItemBlocks.length; ++j)
{
excludedItemBlocks[j] = excludedItemBlocks[j].trim();
}
Property exclusionLiquidList = BuildCraftCore.mainConfiguration.getOrCreateProperty("woodenPipe.liquid.exclusion", Configuration.CATEGORY_BLOCK, "");
String[] excludedLiquidBlocks = exclusionLiquidList.value.split(",");
for (int j = 0; j < excludedLiquidBlocks.length; ++j)
{
excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
}
PipeManager.registerExtractionHandler(new ExtractionHandler(excludedItemBlocks, excludedLiquidBlocks));
Property maxItemInPipesProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.maxItems",
Configuration.CATEGORY_GENERAL, 100);
Property maxItemInPipesProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.maxItems", Configuration.CATEGORY_GENERAL, 100);
maxItemInPipesProp.comment = "pipes containing more than this amount of items will explode, not dropping any item";
maxItemsInPipes = Integer.parseInt(maxItemInPipesProp.value);
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.groupItemsTrigger",
Configuration.CATEGORY_GENERAL, 32);
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.groupItemsTrigger", Configuration.CATEGORY_GENERAL, 32);
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
groupItemsTrigger = Integer.parseInt(groupItemsTriggerProp.value);
Property genericPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pipe.id",
DefaultProps.GENERIC_PIPE_ID);
BuildCraftCore.mainConfiguration.save();
Property genericPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pipe.id", DefaultProps.GENERIC_PIPE_ID);
pipeWaterproof = new ItemBuildCraft(DefaultProps.PIPE_WATERPROOF_ID).setIconIndex(2 * 16 + 1);
pipeWaterproof.setItemName("pipeWaterproof");
ProxyCore.proxy.addName(pipeWaterproof, "Pipe Waterproof");
LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof");
genericPipeBlock = new BlockGenericPipe(Integer.parseInt(genericPipeId.value));
ProxyCore.proxy.registerBlock(genericPipeBlock);
TransportProxy.proxy.registerTileEntities();
GameRegistry.registerBlock(genericPipeBlock);
// Fixing retro-compatiblity
pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks,
Block.glass, Block.planks);
pipeItemsCobblestone = createPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class,
"Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone);
pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone,
Block.glass, Block.stone);
pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron,
Block.glass, Item.ingotIron);
pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold,
Block.glass, Item.ingotGold);
pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe",
Item.diamond, Block.glass, Item.diamond);
pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe",
Block.obsidian, Block.glass, Block.obsidian);
pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks, Block.glass, Block.planks);
pipeItemsCobblestone = createPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone);
pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone, Block.glass, Block.stone);
pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron);
pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold);
pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, Block.glass, Item.diamond);
pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian);
pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe",
pipeWaterproof, pipeItemsWood, null);
pipeLiquidsCobblestone = createPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class,
"Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null);
pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe",
pipeWaterproof, pipeItemsStone, null);
pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe",
pipeWaterproof, pipeItemsIron, null);
pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe",
pipeWaterproof, pipeItemsGold, null);
pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood, null);
pipeLiquidsCobblestone = createPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class, "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null);
pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe", pipeWaterproof, pipeItemsStone, null);
pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe", pipeWaterproof, pipeItemsIron, null);
pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe", pipeWaterproof, pipeItemsGold, null);
// diamond
// obsidian
pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone,
pipeItemsWood, null);
pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone, pipeItemsWood, null);
// cobblestone
pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Conductive Pipe",
Item.redstone, pipeItemsStone, null);
pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Conductive Pipe", Item.redstone, pipeItemsStone, null);
// iron
pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Conductive Pipe", Item.redstone,
pipeItemsGold, null);
pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Conductive Pipe", Item.redstone, pipeItemsGold, null);
// diamond
// obsidian
// Fix name and recipe (Structure pipe insteand of Signal?)
pipeStructureCobblestone = createPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class,
"Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone, null);
pipeStructureCobblestone = createPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, "Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone, null);
// 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));
//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));
pipeItemsVoid = createPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe",
new ItemStack(Item.dyePowder, 1, 0), Block.glass, Item.redstone);
pipeItemsVoid = createPipe(DefaultProps.PIPE_ITEMS_VOID_ID, PipeItemsVoid.class, "Void Transport Pipe", new ItemStack(Item.dyePowder, 1, 0), Block.glass, Item.redstone);
pipeLiquidsVoid = createPipe(DefaultProps.PIPE_LIQUIDS_VOID_ID, PipeLiquidsVoid.class, "Void Waterproof Pipe",
pipeWaterproof, pipeItemsVoid, null);
pipeLiquidsVoid = createPipe(DefaultProps.PIPE_LIQUIDS_VOID_ID, PipeLiquidsVoid.class, "Void Waterproof Pipe", pipeWaterproof, pipeItemsVoid, null);
pipeItemsSandstone = createPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe",
Block.sandStone, Block.glass, Block.sandStone);
pipeItemsSandstone = createPipe(DefaultProps.PIPE_ITEMS_SANDSTONE_ID, PipeItemsSandstone.class, "Sandstone Transport Pipe", Block.sandStone, Block.glass, Block.sandStone);
pipeLiquidsSandstone = createPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeLiquidsSandstone.class, "Sandstone Waterproof Pipe",
pipeWaterproof, pipeItemsSandstone, null);
pipeLiquidsSandstone = createPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeLiquidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof, pipeItemsSandstone, null);
}
finally
{
BuildCraftCore.mainConfiguration.save();
}
}
@Init
public void load(FMLInitializationEvent evt) {
// Register connection handler
//MinecraftForge.registerConnectionHandler(new ConnectionHandler());
// Register gui handler
//MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, new GuiHandler());
TransportProxy.proxy.registerTileEntities();
// dockingStationBlock = new
// BlockDockingStation(Integer.parseInt(dockingStationId.value));
@ -331,29 +311,31 @@ public class BuildCraftTransport {
// "net.minecraft.src.buildcraft.TileDockingStation");
for (int j = 0; j < 6; ++j)
{
diamondTextures[j] = 1 * 16 + 6 + j;
}
redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE).setIconIndex(4 * 16 + 0);
redPipeWire.setItemName("redPipeWire");
ProxyCore.proxy.addName(redPipeWire, "Red Pipe Wire");
LanguageRegistry.addName(redPipeWire, "Red Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8)));
bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE).setIconIndex(4 * 16 + 1);
bluePipeWire.setItemName("bluePipeWire");
ProxyCore.proxy.addName(bluePipeWire, "Blue Pipe Wire");
LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8)));
greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE).setIconIndex(4 * 16 + 2);
greenPipeWire.setItemName("greenPipeWire");
ProxyCore.proxy.addName(greenPipeWire, "Green Pipe Wire");
LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8)));
yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE).setIconIndex(4 * 16 + 3);
yellowPipeWire.setItemName("yellowPipeWire");
ProxyCore.proxy.addName(yellowPipeWire, "Yellow Pipe Wire");
LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11),
new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8)));
@ -367,11 +349,6 @@ public class BuildCraftTransport {
facadeItem.setItemName("pipeFacade");
ItemFacade.initialize();
alwaysConnectPipes = Boolean.parseBoolean(alwaysConnect.value);
usePipeLoss = Boolean.parseBoolean(PipeLoss.value);
BuildCraftCore.mainConfiguration.save();
new BptBlockPipe(genericPipeBlock.blockID);
BuildCraftCore.itemBptProps[pipeItemsWood.shiftedIndex] = new BptItemPipeWodden();
@ -383,42 +360,49 @@ public class BuildCraftTransport {
ActionManager.registerTriggerProvider(new PipeTriggerProvider());
if (BuildCraftCore.loadDefaultRecipes)
{
loadRecipes();
}
public static void loadRecipes() {
TransportProxy.proxy.registerRenderers();
NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
}
public void loadRecipes() {
// Add base recipe for pipe waterproof.
ProxyCore.proxy.addCraftingRecipe(new ItemStack(pipeWaterproof, 1), new Object[] { "W ", " ", Character.valueOf('W'),
new ItemStack(Item.dyePowder, 1, 2) });
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Item.dyePowder, 1, 2));
// Add pipe recipes
for (PipeRecipe pipe : pipeRecipes)
{
if (pipe.isShapeless)
ProxyCore.proxy.addShapelessRecipe(pipe.result, pipe.input);
{
GameRegistry.addShapelessRecipe(pipe.result, pipe.input);
}
else
ProxyCore.proxy.addCraftingRecipe(pipe.result, pipe.input);
{
GameRegistry.addRecipe(pipe.result, pipe.input);
}
}
}
private static Item createPipe(int defaultID, Class<? extends Pipe> clas, String descr, Object ingredient1,
Object ingredient2, Object ingredient3) {
private static Item createPipe(int defaultID, Class<? extends Pipe> clas, String descr, Object ingredient1, Object ingredient2, Object ingredient3) {
String name = Character.toLowerCase(clas.getSimpleName().charAt(0)) + clas.getSimpleName().substring(1);
Property prop = BuildCraftCore.mainConfiguration.getOrCreateIntProperty(name + ".id", Configuration.CATEGORY_ITEM,
defaultID);
Property prop = BuildCraftCore.mainConfiguration.getOrCreateIntProperty(name + ".id", Configuration.CATEGORY_ITEM, defaultID);
int id = Integer.parseInt(prop.value);
int id = prop.getInt(defaultID);
ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
res.setItemName(clas.getSimpleName());
ProxyCore.proxy.addName(res, descr);
LanguageRegistry.addName(res, descr);
// Add appropriate recipe to temporary list
PipeRecipe recipe = new PipeRecipe();
if (ingredient1 != null && ingredient2 != null && ingredient3 != null) {
recipe.result = new ItemStack(res, 8);
recipe.input = new Object[] { " ", "ABC", " ", Character.valueOf('A'), ingredient1, Character.valueOf('B'),
ingredient2, Character.valueOf('C'), ingredient3 };
recipe.input = new Object[] { " ", "ABC", " ", Character.valueOf('A'), ingredient1, Character.valueOf('B'), ingredient2, Character.valueOf('C'), ingredient3 };
pipeRecipes.add(recipe);
} else if (ingredient1 != null && ingredient2 != null) {
@ -431,11 +415,4 @@ public class BuildCraftTransport {
return res;
}
public static void initializeModel(mod_BuildCraftTransport mod) {
//pipeModel = ModLoader.getUniqueBlockModelID(mod, true);
pipeModel = RenderingRegistry.getNextAvailableRenderId();
}
}

View file

@ -11,15 +11,6 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
@ -29,6 +20,14 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
public class BlockArchitect extends BlockContainer {
@ -93,7 +92,7 @@ public class BlockArchitect extends BlockContainer {
} else {
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.ARCHITECT_TABLE, world, i, j, k);
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.ARCHITECT_TABLE, world, i, j, k);
return true;
}

View file

@ -11,11 +11,6 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
@ -23,6 +18,10 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
public class BlockBlueprintLibrary extends BlockContainer {
@ -49,7 +48,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
if (!tile.locked || entityplayer.username.equals(tile.owner))
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k);
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k);
return true;
}

View file

@ -11,15 +11,6 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
@ -28,6 +19,14 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
public class BlockBuilder extends BlockContainer {
@ -106,7 +105,7 @@ public class BlockBuilder extends BlockContainer {
} else {
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BUILDER, world, i, j, k);
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BUILDER, world, i, j, k);
return true;
}

View file

@ -11,13 +11,6 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IBlockAccess;
@ -25,6 +18,12 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
public class BlockFiller extends BlockContainer {
@ -52,7 +51,7 @@ public class BlockFiller extends BlockContainer {
return false;
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.FILLER, world, i, j, k);
entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.FILLER, world, i, j, k);
return true;
}

View file

@ -0,0 +1,13 @@
package buildcraft.builders;
import cpw.mods.fml.common.SidedProxy;
public class BuilderProxy {
@SidedProxy(clientSide = "buildcraft.builders.BuilderProxyClient", serverSide = "buildcraft.builders.BuilderProxy")
public static BuilderProxy proxy;
public void registerClientHook()
{
}
}

View file

@ -0,0 +1,10 @@
package buildcraft.builders;
import buildcraft.BuildCraftBuilders;
public class BuilderProxyClient extends BuilderProxy {
@Override
public void registerClientHook() {
BuildCraftBuilders.addHook(new ClientBuilderHook());
}
}

View file

@ -460,9 +460,9 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
}
@Override
public Packet getDescriptionPacket() {
public Packet getAuxillaryInfoPacket() {
if (origin.vectO.getMarker(worldObj) == this) {
return super.getDescriptionPacket();
return super.getAuxillaryInfoPacket();
} else {
return null;
}

View file

@ -0,0 +1,74 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.core;
import java.util.Date;
import java.util.EnumSet;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.IScheduledTickHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import buildcraft.BuildCraftCore;
import buildcraft.core.network.EntityIds;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.utils.Localization;
public class BuildCraftNetworkTicker implements IScheduledTickHandler {
long lastReport = 0;
public boolean tick() {
if (BuildCraftCore.trackNetworkUsage) {
Date d = new Date();
if (d.getTime() - lastReport > 10000) {
lastReport = d.getTime();
int bytes = ClassMapping.report();
System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second");
System.out.println();
}
}
return true;
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
tick();
}
@Override
public EnumSet<TickType> ticks() {
return BuildCraftCore.trackNetworkUsage ? EnumSet.of(TickType.WORLD) : EnumSet.noneOf(TickType.class);
}
@Override
public String getLabel() {
return "BuildCraftNetworkTickMonitor";
}
@Override
public int nextTickSpacing() {
return 200;
}
}

View file

@ -11,7 +11,10 @@ package buildcraft.core;
public class DefaultProps {
public static final String VERSION = "@VERSION@";
public static final String VERSION = "4";
public static final String DEPENDENCY_CORE = "required-after:BuildCraft|Core@"+VERSION;
public static final String DEPENDENCY_TRANSPORT = "required-after:BuildCraft|Transport@"+VERSION;
public static int WORLD_HEIGHT = 256;
public static final String NET_CHANNEL_NAME = "BC";

View file

@ -85,11 +85,6 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized
return new PacketTileUpdate(this).getPacket();
}
@Override
public Packet getDescriptionPacket() {
return new PacketTileUpdate(this).getPacket();
}
@Override
public PacketPayload getPacketPayload() {
return updatePacket.toPayload(this);

View file

@ -21,7 +21,7 @@ public interface ISynchronizedTile {
public Packet getUpdatePacket();
public Packet getDescriptionPacket();
public Packet getAuxillaryInfoPacket();
public PacketPayload getPacketPayload();
}

View file

@ -14,7 +14,6 @@ import net.minecraft.src.Tessellator;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
public static class EntityRenderIndex {
public EntityRenderIndex(Block block, int damage) {

View file

@ -12,14 +12,6 @@ package buildcraft.energy;
import java.util.List;
import java.util.Random;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftEnergy;
import buildcraft.api.core.Orientations;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
@ -28,6 +20,13 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.core.Orientations;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
public class BlockEngine extends BlockContainer {
@ -94,12 +93,12 @@ public class BlockEngine extends BlockContainer {
if (tile.engine instanceof EngineStone) {
if (!ProxyCore.proxy.isRemote(tile.worldObj))
entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_STONE, world, i, j, k);
entityplayer.openGui(BuildCraftEnergy.instance, GuiIds.ENGINE_STONE, world, i, j, k);
return true;
} else if (tile.engine instanceof EngineIron) {
if (!ProxyCore.proxy.isRemote(tile.worldObj))
entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_IRON, world, i, j, k);
entityplayer.openGui(BuildCraftEnergy.instance, GuiIds.ENGINE_IRON, world, i, j, k);
return true;
}

View file

@ -15,4 +15,7 @@ public class EnergyProxy {
public void registerTextureFX() {
}
public void registerBlockRenderers() {
}
}

View file

@ -1,5 +1,9 @@
package buildcraft.energy;
import buildcraft.BuildCraftEnergy;
import buildcraft.core.DefaultProps;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.energy.render.RenderEngine;
import buildcraft.energy.render.TextureFuelFX;
import buildcraft.energy.render.TextureOilFX;
@ -22,4 +26,14 @@ public class EnergyProxyClient extends EnergyProxy {
renderEngine.registerTextureFX(new TextureFuelFX());
renderEngine.registerTextureFX(new TextureOilFlowFX());
}
@Override
public void registerBlockRenderers() {
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 0),
new RenderEngine(DefaultProps.TEXTURE_PATH_BLOCKS + "/base_wood.png"));
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 1),
new RenderEngine(DefaultProps.TEXTURE_PATH_BLOCKS + "/base_stone.png"));
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 2),
new RenderEngine(DefaultProps.TEXTURE_PATH_BLOCKS + "/base_iron.png"));
}
}

View file

@ -321,10 +321,10 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
/* SMP UPDATING */
@Override
public Packet getDescriptionPacket() {
public Packet getAuxillaryInfoPacket() {
createEngineIfNeeded();
return super.getDescriptionPacket();
return super.getAuxillaryInfoPacket();
}
@Override

View file

@ -11,18 +11,17 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftFactory;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
public class BlockAutoWorkbench extends BlockBuildCraft {
@ -61,7 +60,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
}
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.AUTO_CRAFTING_TABLE, world, i, j, k);
entityplayer.openGui(BuildCraftFactory.instance, GuiIds.AUTO_CRAFTING_TABLE, world, i, j, k);
return true;
}

View file

@ -2,19 +2,18 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.ProxyCore;
public class BlockHopper extends BlockBuildCraft {
@ -64,7 +63,7 @@ public class BlockHopper extends BlockBuildCraft {
}
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z);
entityplayer.openGui(BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z);
return true;
}

View file

@ -11,17 +11,6 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.liquids.LiquidManager;
import buildcraft.api.liquids.LiquidStack;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
@ -30,6 +19,16 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.liquids.LiquidManager;
import buildcraft.api.liquids.LiquidStack;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
public class BlockRefinery extends BlockContainer {
@ -119,7 +118,7 @@ public class BlockRefinery extends BlockContainer {
}
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.REFINERY, world, i, j, k);
entityplayer.openGui(BuildCraftFactory.instance, GuiIds.REFINERY, world, i, j, k);
return true;
}

View file

@ -0,0 +1,16 @@
package buildcraft.factory;
import cpw.mods.fml.common.SidedProxy;
public class FactoryProxy {
@SidedProxy(clientSide = "buildcraft.factory.FactoryProxyClient", serverSide = "buildcraft.factory.FactoryProxy")
public static FactoryProxy proxy;
public void initializeTileEntities()
{
}
public void initializeEntityRenders() {
}
}

View file

@ -0,0 +1,32 @@
package buildcraft.factory;
import buildcraft.BuildCraftFactory;
import buildcraft.core.render.RenderVoid;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.factory.render.RenderHopper;
import buildcraft.factory.render.RenderRefinery;
import buildcraft.factory.render.RenderTank;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class FactoryProxyClient extends FactoryProxy {
@Override
public void initializeTileEntities() {
super.initializeTileEntities();
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
ClientRegistry.bindTileEntitySpecialRenderer(TileRefinery.class, new RenderRefinery());
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0), new RenderRefinery());
if(!BuildCraftFactory.hopperDisabled) {
ClientRegistry.bindTileEntitySpecialRenderer(TileHopper.class, new RenderHopper());
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper());
}
}
@Override
public void initializeEntityRenders() {
RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid());
}
}

View file

@ -144,7 +144,10 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
@Override
public void updateEntity() {
if (worldObj!=null && worldObj.isRemote)
{
return;
}
super.updateEntity();
if (inProcess && arm != null) {

View file

@ -1,63 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import buildcraft.BuildCraftBuilders;
import buildcraft.builders.ClientBuilderHook;
import buildcraft.core.DefaultProps;
import buildcraft.core.network.PacketHandler;
@Mod(name="BuildCraft Builders", version=DefaultProps.VERSION, useMetadata = false, modid = "BC|BUILDERS")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class mod_BuildCraftBuilders {
public static mod_BuildCraftBuilders instance;
public mod_BuildCraftBuilders() {
instance = this;
}
@Init
public void init(FMLInitializationEvent event) {
BuildCraftBuilders.load();
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
BuildCraftBuilders.addHook(new ClientBuilderHook());
BuildCraftBuilders.initialize();
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.FillerGUI));
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.TemplateGUI));
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.BuilderGUI));
}
/*
* @Override public GuiScreen handleGUI(int i) { switch
* (Utils.intToPacketId(i)) { case FillerGUI: return new GuiFiller(
* ModLoader.getMinecraftInstance().thePlayer.inventory, new TileFiller());
* case TemplateGUI: return new GuiTemplate(
* ModLoader.getMinecraftInstance().thePlayer.inventory, new
* TileArchitect()); case BuilderGUI: TileBuilder tile = new TileBuilder();
* tile.worldObj = ModLoader.getMinecraftInstance().theWorld; return new
* GuiBuilder( ModLoader.getMinecraftInstance().thePlayer.inventory, tile);
* default: return null; } }
*/
}

View file

@ -1,98 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import java.util.Date;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import buildcraft.BuildCraftCore;
import buildcraft.core.ClassMapping;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityLaser;
import buildcraft.core.EntityRobot;
import buildcraft.core.ProxyCore;
import buildcraft.core.network.EntityIds;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.utils.Localization;
@Mod(name="BuildCraft", version=DefaultProps.VERSION, useMetadata = false, modid = "BC|CORE")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class mod_BuildCraftCore {
public static mod_BuildCraftCore instance;
BuildCraftCore proxy = new BuildCraftCore();
public static boolean initialized = false;
public mod_BuildCraftCore() {
instance = this;
}
@Init
public void init(FMLInitializationEvent event) {
BuildCraftCore.load();
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
mod_BuildCraftCore.initialize();
// ModLoader.setInGameHook(this, true, true);
}
public static void initialize() {
BuildCraftCore.initialize();
if (!initialized) {
EntityRegistry.registerModEntity(EntityRobot.class, "bcRobot", EntityIds.ROBOT, instance, 50, 1, true);
EntityRegistry.registerModEntity(EntityLaser.class, "bcLaser", EntityIds.LASER, instance, 50, 1, true);
EntityRegistry.registerModEntity(EntityEnergyLaser.class, "bcEnergyLaser", EntityIds.ENERGY_LASER, instance, 50, 1, true);
// Init rendering if applicable
ProxyCore.proxy.initializeRendering();
ProxyCore.proxy.initializeEntityRendering();
//Initialize localization
Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE);
initialized = true;
}
}
long lastReport = 0;
//@Override
public boolean onTickInGame(float f, Minecraft minecraft) {
if (BuildCraftCore.trackNetworkUsage) {
Date d = new Date();
if (d.getTime() - lastReport > 10000) {
lastReport = d.getTime();
int bytes = ClassMapping.report();
System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second");
System.out.println();
}
}
return true;
}
}

View file

@ -1,80 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import buildcraft.BuildCraftEnergy;
import buildcraft.core.DefaultProps;
import buildcraft.core.ProxyCore;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.energy.EnergyProxy;
import buildcraft.energy.OilPopulate;
import buildcraft.energy.TileEngine;
import buildcraft.energy.render.RenderEngine;
import buildcraft.energy.render.TextureFuelFX;
import buildcraft.energy.render.TextureOilFX;
import buildcraft.energy.render.TextureOilFlowFX;
@Mod(name="BuildCraft Energy", version=DefaultProps.VERSION, useMetadata = false, modid = "BC|ENERGY")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class mod_BuildCraftEnergy {
public static mod_BuildCraftEnergy instance;
public mod_BuildCraftEnergy() {
instance = this;
}
@Init
public void init(FMLInitializationEvent event) {
BuildCraftEnergy.load();
GameRegistry.registerWorldGenerator(new OilPopulate());
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
BuildCraftEnergy.initialize();
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 0), new RenderEngine(
DefaultProps.TEXTURE_PATH_BLOCKS + "/base_wood.png"));
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 1), new RenderEngine(
DefaultProps.TEXTURE_PATH_BLOCKS + "/base_stone.png"));
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 2), new RenderEngine(
DefaultProps.TEXTURE_PATH_BLOCKS + "/base_iron.png"));
EnergyProxy.proxy.registerTileEntities();
EnergyProxy.proxy.registerTextureFX();
}
/*
* @Override public GuiScreen handleGUI(int i) { TileEngine tile = new
* TileEngine();
*
* switch (Utils.intToPacketId(i)) { case EngineSteamGUI: tile.engine = new
* EngineStone(tile); return new GuiSteamEngine(
* ModLoader.getMinecraftInstance().thePlayer.inventory, tile); case
* EngineCombustionGUI: tile.engine = new EngineIron(tile); return new
* GuiCombustionEngine(
* ModLoader.getMinecraftInstance().thePlayer.inventory, tile); default:
* return null; } }
*/
}

View file

@ -1,81 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import java.lang.reflect.Method;
import java.util.Map;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import buildcraft.BuildCraftFactory;
import buildcraft.core.DefaultProps;
import buildcraft.core.render.RenderVoid;
import buildcraft.factory.EntityMechanicalArm;
import buildcraft.factory.gui.GuiAutoCrafting;
import buildcraft.factory.network.PacketHandlerFactory;
@Mod(name="BuildCraft Factory", version=DefaultProps.VERSION, useMetadata = false, modid = "BC|FACTORY")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true)
public class mod_BuildCraftFactory {
public static mod_BuildCraftFactory instance;
public mod_BuildCraftFactory() {
instance = this;
}
@Init
public void init(FMLInitializationEvent event) {
BuildCraftFactory.load();
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
BuildCraftFactory.initialize();
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.AutoCraftingGUI));
// Detect the presence of NEI and add overlay for the Autocrafting Table
try {
Class<?> neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer");
Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class);
method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11);
BuildCraftCore.bcLog.fine("NEI detected, adding NEI overlay");
} catch (Exception e) {
BuildCraftCore.bcLog.fine("NEI not detected.");
}
// Direct call (for reference)
// DefaultOverlayRenderer.registerGuiOverlay(GuiAutoCrafting.class,
// "crafting", 5, 11);
}
//@Override
public void addRenderer(Map map) {
map.put(EntityMechanicalArm.class, new RenderVoid());
}
/*
* @Override public GuiScreen handleGUI(int i) { if (Utils.intToPacketId(i)
* == PacketIds.AutoCraftingGUI) { return new GuiAutoCrafting(
* ModLoader.getMinecraftInstance().thePlayer.inventory,
* ModLoader.getMinecraftInstance().theWorld, new TileAutoWorkbench()); }
* else { return null; } }
*/
}

View file

@ -1,110 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import buildcraft.BuildCraftTransport;
import buildcraft.core.DefaultProps;
import buildcraft.transport.GuiHandler;
import buildcraft.transport.IPipeRenderState;
import buildcraft.transport.network.PacketHandlerTransport;
import buildcraft.transport.render.FacadeItemRenderer;
import buildcraft.transport.render.PipeItemRenderer;
import buildcraft.transport.render.PipeWorldRenderer;
import buildcraft.transport.render.RenderPipe;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import net.minecraft.src.TileEntity;
import net.minecraftforge.client.MinecraftForgeClient;
@Mod(version = DefaultProps.VERSION, modid="BC|TRANSPORT", name = "Buildcraft Transport")
@NetworkMod(channels={DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerTransport.class)
public class mod_BuildCraftTransport {
public static mod_BuildCraftTransport instance;
public final static PipeItemRenderer pipeItemRenderer = new PipeItemRenderer();
public final static PipeWorldRenderer pipeWorldRenderer = new PipeWorldRenderer();
public final static FacadeItemRenderer facadeItemRenderer = new FacadeItemRenderer();
public mod_BuildCraftTransport() {
instance = this;
}
@Init
public void init(FMLInitializationEvent event) {
BuildCraftTransport.load();
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
BuildCraftTransport.initialize();
BuildCraftTransport.initializeModel(this);
NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsIron.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone.shiftedIndex, pipeItemRenderer);
//MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStipes.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsVoid.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsVoid.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsSandstone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsSandstone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.facadeItem.shiftedIndex, facadeItemRenderer);
RenderingRegistry.registerBlockHandler(pipeWorldRenderer);
}
//@Override
public boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID) {
//cpw.mods.fml.client.registry.RenderingRegistry.instance().registerBlockHandler(new isimpleblockrenderinghandler() {
if (modelID != BuildCraftTransport.pipeModel) return true;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile instanceof IPipeRenderState){
IPipeRenderState pipeTile = (IPipeRenderState) tile;
pipeWorldRenderer.renderPipe(renderer, world, block, pipeTile.getRenderState(), x, y, z);
}
// if (tile != null && tile instanceof IPipeTile && ((IPipeTile)tile).isInitialized()) {
// pipeWorldRenderer.renderPipe(renderer, world, tile, block);
// }
return true;
}
}

View file

@ -2,19 +2,18 @@ package buildcraft.silicon;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftSilicon;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import buildcraft.factory.TileAssemblyTable;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import buildcraft.BuildCraftSilicon;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.ProxyCore;
import buildcraft.core.Utils;
import buildcraft.factory.TileAssemblyTable;
public class BlockAssemblyTable extends BlockContainer {
@ -49,7 +48,7 @@ public class BlockAssemblyTable extends BlockContainer {
return false;
if (!ProxyCore.proxy.isRemote(world))
entityplayer.openGui(mod_BuildCraftSilicon.instance, GuiIds.ASSEMBLY_TABLE, world, i, j, k);
entityplayer.openGui(BuildCraftSilicon.instance, GuiIds.ASSEMBLY_TABLE, world, i, j, k);
return true;
}

View file

@ -31,7 +31,7 @@ public class BlockLaser extends BlockContainer {
@Override
public int getRenderType() {
return BuildCraftSilicon.laserBlockModel;
return SiliconProxyClient.laserBlockModel;
}
@Override

View file

@ -0,0 +1,14 @@
package buildcraft.silicon;
import cpw.mods.fml.common.SidedProxy;
public class SiliconProxy {
@SidedProxy(clientSide = "buildcraft.silicon.SiliconProxyClient", serverSide = "buildcraft.silicon.SiliconProxy")
public static SiliconProxy proxy;
public void registerRenderers() {
}
}

View file

@ -0,0 +1,13 @@
package buildcraft.silicon;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class SiliconProxyClient extends SiliconProxy {
public static int laserBlockModel;
@Override
public void registerRenderers() {
laserBlockModel = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new SiliconRenderBlock());
}
}

View file

@ -7,7 +7,7 @@
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
package buildcraft.silicon;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
@ -17,6 +17,7 @@ import net.minecraft.src.Tessellator;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
@ -29,37 +30,20 @@ import buildcraft.BuildCraftTransport;
import buildcraft.api.core.Orientations;
import buildcraft.core.DefaultProps;
import buildcraft.core.Utils;
import buildcraft.silicon.SiliconProxyClient;
import buildcraft.silicon.network.PacketHandlerSilicon;
@Mod(name="BuildCraft Silicon", version=DefaultProps.VERSION, useMetadata = false, modid = "BC|SILICON")
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerSilicon.class, clientSideRequired = true, serverSideRequired = true)
public class mod_BuildCraftSilicon {
public static mod_BuildCraftSilicon instance;
public mod_BuildCraftSilicon() {
instance = this;
public class SiliconRenderBlock implements ISimpleBlockRenderingHandler {
@Override
public int getRenderId() {
return SiliconProxyClient.laserBlockModel;
}
@Init
public void load(FMLInitializationEvent event) {
BuildCraftSilicon.load();
@Override
public boolean shouldRender3DInInventory() {
return true;
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
// CoreProxy.registerGUI(this,
// Utils.packetIdToInt(PacketIds.AssemblyTableGUI));
BuildCraftTransport.initialize();
BuildCraftSilicon.initialize();
BuildCraftSilicon.initializeModel();
}
//@Override
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) {
@Override
public boolean renderWorldBlock(IBlockAccess iblockaccess, int x, int y, int z, Block block, int l, RenderBlocks renderblocks) {
int meta = iblockaccess.getBlockMetadata(x, y, z);
@ -136,8 +120,8 @@ public class mod_BuildCraftSilicon {
}
//@Override
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
@Override
public void renderInventoryBlock(Block block, int i, int j, RenderBlocks renderblocks) {
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

View file

@ -46,7 +46,7 @@ public class BlockGenericPipe extends BlockContainer {
@Override
public int getRenderType() {
return BuildCraftTransport.pipeModel;
return TransportProxyClient.pipeModel;
}
@Override

View file

@ -3,7 +3,6 @@ package buildcraft.transport;
import java.util.LinkedList;
import buildcraft.BuildCraftTransport;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.api.gates.IAction;
import buildcraft.api.gates.ITrigger;
import buildcraft.api.power.IPowerReceptor;
@ -63,7 +62,7 @@ public class GateVanilla extends Gate {
@Override
public void openGui(EntityPlayer player) {
if (!ProxyCore.proxy.isRemote(player.worldObj))
player.openGui(mod_BuildCraftTransport.instance, GuiIds.GATES, pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord);
player.openGui(BuildCraftTransport.instance, GuiIds.GATES, pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord);
}
// / UPDATING

View file

@ -10,7 +10,7 @@
package buildcraft.transport;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.inventory.ISpecialInventory;
@ -44,8 +44,7 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
return false;
if (!ProxyCore.proxy.isRemote(container.worldObj))
entityplayer.openGui(mod_BuildCraftTransport.instance, GuiIds.PIPE_DIAMOND, container.worldObj, container.xCoord,
container.yCoord, container.zCoord);
entityplayer.openGui(BuildCraftTransport.instance, GuiIds.PIPE_DIAMOND, container.worldObj, container.xCoord, container.yCoord, container.zCoord);
return true;
}

View file

@ -1,6 +1,5 @@
package buildcraft.transport;
import buildcraft.mod_BuildCraftTransport;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.registry.GameRegistry;
@ -14,4 +13,7 @@ public class TransportProxy {
GameRegistry.registerTileEntity(TileGenericPipe.class, "net.minecraft.src.buildcraft.transport.GenericPipe");
}
public void registerRenderers() {
}
}

View file

@ -1,9 +1,21 @@
package buildcraft.transport;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import buildcraft.BuildCraftTransport;
import buildcraft.transport.render.FacadeItemRenderer;
import buildcraft.transport.render.PipeItemRenderer;
import buildcraft.transport.render.PipeWorldRenderer;
import buildcraft.transport.render.RenderPipe;
public class TransportProxyClient extends TransportProxy {
public final static PipeItemRenderer pipeItemRenderer = new PipeItemRenderer();
public final static PipeWorldRenderer pipeWorldRenderer = new PipeWorldRenderer();
public final static FacadeItemRenderer facadeItemRenderer = new FacadeItemRenderer();
public static int pipeModel;
@Override
public void registerTileEntities() {
super.registerTileEntities();
@ -12,4 +24,37 @@ public class TransportProxyClient extends TransportProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileDummyGenericPipe2.class, rp);
ClientRegistry.bindTileEntitySpecialRenderer(TileGenericPipe.class, rp);
}
@Override
public void registerRenderers() {
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsIron.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone.shiftedIndex, pipeItemRenderer);
//MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStipes.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsVoid.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsVoid.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsSandstone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsSandstone.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.facadeItem.shiftedIndex, facadeItemRenderer);
pipeModel = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(pipeWorldRenderer);
}
}

View file

@ -11,6 +11,7 @@ import buildcraft.core.DefaultProps;
import buildcraft.core.Utils;
import buildcraft.transport.IPipeRenderState;
import buildcraft.transport.PipeRenderState;
import buildcraft.transport.TransportProxyClient;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
@ -519,6 +520,6 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
@Override
public int getRenderId() {
return BuildCraftTransport.pipeModel;
return TransportProxyClient.pipeModel;
}
}