Merge pull request #539 from Flow86/patch-gate
Make gates and wires available for other mods in "preInitialize" phase
This commit is contained in:
commit
a345329843
1 changed files with 46 additions and 45 deletions
|
@ -309,33 +309,6 @@ public class BuildCraftTransport {
|
||||||
|
|
||||||
pipeLiquidsSandstone = createPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeLiquidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof,
|
pipeLiquidsSandstone = createPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeLiquidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof,
|
||||||
pipeItemsSandstone, null);
|
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));
|
|
||||||
// ModLoader.registerBlock(dockingStationBlock);
|
|
||||||
// CoreProxy.addName(dockingStationBlock.setBlockName("dockingStation"),
|
|
||||||
// "Docking Station");
|
|
||||||
|
|
||||||
// ModLoader.RegisterTileEntity(TileDockingStation.class,
|
|
||||||
// "net.minecraft.src.buildcraft.TileDockingStation");
|
|
||||||
|
|
||||||
for (int j = 0; j < 6; ++j) {
|
|
||||||
diamondTextures[j] = 1 * 16 + 6 + j;
|
|
||||||
}
|
|
||||||
|
|
||||||
Property redPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "redPipeWire.id", DefaultProps.RED_PIPE_WIRE);
|
Property redPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "redPipeWire.id", DefaultProps.RED_PIPE_WIRE);
|
||||||
redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0).setCreativeTab(CreativeTabs.tabRedstone);
|
redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0).setCreativeTab(CreativeTabs.tabRedstone);
|
||||||
|
@ -369,8 +342,8 @@ public class BuildCraftTransport {
|
||||||
pipeGate = new ItemGate(Integer.parseInt(pipeGateId.value), 0).setIconIndex(2 * 16 + 3);
|
pipeGate = new ItemGate(Integer.parseInt(pipeGateId.value), 0).setIconIndex(2 * 16 + 3);
|
||||||
pipeGate.setItemName("pipeGate");
|
pipeGate.setItemName("pipeGate");
|
||||||
|
|
||||||
Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration
|
Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGateAutarchic.id",
|
||||||
.get(Configuration.CATEGORY_ITEM, "pipeGateAutarchic.id", DefaultProps.GATE_AUTARCHIC_ID);
|
DefaultProps.GATE_AUTARCHIC_ID);
|
||||||
pipeGateAutarchic = new ItemGate(Integer.parseInt(pipeGateAutarchicId.value), 1).setIconIndex(2 * 16 + 3);
|
pipeGateAutarchic = new ItemGate(Integer.parseInt(pipeGateAutarchicId.value), 1).setIconIndex(2 * 16 + 3);
|
||||||
pipeGateAutarchic.setItemName("pipeGateAutarchic");
|
pipeGateAutarchic.setItemName("pipeGateAutarchic");
|
||||||
|
|
||||||
|
@ -378,7 +351,33 @@ public class BuildCraftTransport {
|
||||||
facadeItem = new ItemFacade(Integer.parseInt(pipeFacadeId.value));
|
facadeItem = new ItemFacade(Integer.parseInt(pipeFacadeId.value));
|
||||||
facadeItem.setItemName("pipeFacade");
|
facadeItem.setItemName("pipeFacade");
|
||||||
|
|
||||||
|
} finally {
|
||||||
BuildCraftCore.mainConfiguration.save();
|
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));
|
||||||
|
// ModLoader.registerBlock(dockingStationBlock);
|
||||||
|
// CoreProxy.addName(dockingStationBlock.setBlockName("dockingStation"),
|
||||||
|
// "Docking Station");
|
||||||
|
|
||||||
|
// ModLoader.RegisterTileEntity(TileDockingStation.class,
|
||||||
|
// "net.minecraft.src.buildcraft.TileDockingStation");
|
||||||
|
|
||||||
|
for (int j = 0; j < 6; ++j) {
|
||||||
|
diamondTextures[j] = 1 * 16 + 6 + j;
|
||||||
|
}
|
||||||
|
|
||||||
new BptBlockPipe(genericPipeBlock.blockID);
|
new BptBlockPipe(genericPipeBlock.blockID);
|
||||||
|
|
||||||
|
@ -425,13 +424,15 @@ public class BuildCraftTransport {
|
||||||
if ("add-facade".equals(m.key)) {
|
if ("add-facade".equals(m.key)) {
|
||||||
String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class);
|
String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class);
|
||||||
if (array.length != 2) {
|
if (array.length != 2) {
|
||||||
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
|
Logger.getLogger("Buildcraft").log(Level.INFO,
|
||||||
|
String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Integer blId = Ints.tryParse(array[0]);
|
Integer blId = Ints.tryParse(array[0]);
|
||||||
Integer metaId = Ints.tryParse(array[1]);
|
Integer metaId = Ints.tryParse(array[1]);
|
||||||
if (blId == null || metaId == null) {
|
if (blId == null || metaId == null) {
|
||||||
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
|
Logger.getLogger("Buildcraft").log(Level.INFO,
|
||||||
|
String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ItemFacade.addFacade(new ItemStack(blId, 1, metaId));
|
ItemFacade.addFacade(new ItemStack(blId, 1, metaId));
|
||||||
|
|
Loading…
Add table
Reference in a new issue