-
Notifications
You must be signed in to change notification settings - Fork 497
/
BuildCraftBuilders.java
435 lines (360 loc) · 22.4 KB
/
BuildCraftBuilders.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft;
import java.io.File;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecartChest;
import net.minecraft.entity.item.EntityMinecartEmpty;
import net.minecraft.entity.item.EntityMinecartFurnace;
import net.minecraft.entity.item.EntityMinecartHopper;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import buildcraft.api.blueprints.SchematicRegistry;
import buildcraft.api.filler.FillerManager;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.api.gates.ActionManager;
import buildcraft.builders.BlockArchitect;
import buildcraft.builders.BlockBlueprintLibrary;
import buildcraft.builders.BlockBuildTool;
import buildcraft.builders.BlockBuilder;
import buildcraft.builders.BlockFiller;
import buildcraft.builders.BlockMarker;
import buildcraft.builders.BlockPathMarker;
import buildcraft.builders.BuilderProxy;
import buildcraft.builders.EventHandlerBuilders;
import buildcraft.builders.GuiHandler;
import buildcraft.builders.ItemBlueprintStandard;
import buildcraft.builders.ItemBlueprintTemplate;
import buildcraft.builders.TileArchitect;
import buildcraft.builders.TileBlueprintLibrary;
import buildcraft.builders.TileBuilder;
import buildcraft.builders.TileFiller;
import buildcraft.builders.TileMarker;
import buildcraft.builders.TilePathMarker;
import buildcraft.builders.blueprints.BlueprintDatabase;
import buildcraft.builders.filler.FillerRegistry;
import buildcraft.builders.filler.pattern.FillerPattern;
import buildcraft.builders.filler.pattern.PatternBox;
import buildcraft.builders.filler.pattern.PatternClear;
import buildcraft.builders.filler.pattern.PatternCylinder;
import buildcraft.builders.filler.pattern.PatternFill;
import buildcraft.builders.filler.pattern.PatternFlatten;
import buildcraft.builders.filler.pattern.PatternFrame;
import buildcraft.builders.filler.pattern.PatternHorizon;
import buildcraft.builders.filler.pattern.PatternPyramid;
import buildcraft.builders.filler.pattern.PatternStairs;
import buildcraft.builders.schematics.SchematicBed;
import buildcraft.builders.schematics.SchematicCustomStack;
import buildcraft.builders.schematics.SchematicDirt;
import buildcraft.builders.schematics.SchematicDoor;
import buildcraft.builders.schematics.SchematicFarmland;
import buildcraft.builders.schematics.SchematicFire;
import buildcraft.builders.schematics.SchematicFluid;
import buildcraft.builders.schematics.SchematicGravel;
import buildcraft.builders.schematics.SchematicHanging;
import buildcraft.builders.schematics.SchematicIgnore;
import buildcraft.builders.schematics.SchematicIgnoreMeta;
import buildcraft.builders.schematics.SchematicLever;
import buildcraft.builders.schematics.SchematicMinecart;
import buildcraft.builders.schematics.SchematicPiston;
import buildcraft.builders.schematics.SchematicPortal;
import buildcraft.builders.schematics.SchematicPumpkin;
import buildcraft.builders.schematics.SchematicRail;
import buildcraft.builders.schematics.SchematicRedstoneDiode;
import buildcraft.builders.schematics.SchematicRotateMeta;
import buildcraft.builders.schematics.SchematicSeeds;
import buildcraft.builders.schematics.SchematicSign;
import buildcraft.builders.schematics.SchematicStairs;
import buildcraft.builders.schematics.SchematicStone;
import buildcraft.builders.schematics.SchematicWallSide;
import buildcraft.builders.triggers.ActionFiller;
import buildcraft.builders.triggers.BuildersActionProvider;
import buildcraft.builders.urbanism.BlockUrbanist;
import buildcraft.builders.urbanism.TileUrbanist;
import buildcraft.builders.urbanism.UrbanistToolsIconProvider;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BCLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft Builders", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
public class BuildCraftBuilders extends BuildCraftMod {
public static final char BPT_SEP_CHARACTER = '-';
public static final int LIBRARY_PAGE_SIZE = 12;
public static final int MAX_BLUEPRINTS_NAME_SIZE = 14;
public static BlockBuildTool buildToolBlock;
public static BlockMarker markerBlock;
public static BlockPathMarker pathMarkerBlock;
public static BlockFiller fillerBlock;
public static BlockBuilder builderBlock;
public static BlockArchitect architectBlock;
public static BlockBlueprintLibrary libraryBlock;
public static BlockUrbanist urbanistBlock;
public static ItemBlueprintTemplate templateItem;
public static ItemBlueprintStandard blueprintItem;
public static boolean fillerDestroy;
public static int fillerLifespanTough;
public static int fillerLifespanNormal;
public static ActionFiller[] fillerActions;
@Instance("BuildCraft|Builders")
public static BuildCraftBuilders instance;
public static BlueprintDatabase serverDB;
public static BlueprintDatabase clientDB;
@EventHandler
public void loadConfiguration(FMLPreInitializationEvent evt) {
File bptMainDir = new File(new File(evt.getModConfigurationDirectory(), "buildcraft"), "blueprints");
File serverDir = new File (bptMainDir, "server");
File clientDir = new File (bptMainDir, "client");
serverDB = new BlueprintDatabase();
clientDB = new BlueprintDatabase();
serverDB.init(serverDir);
clientDB.init(clientDir);
}
@EventHandler
public void init(FMLInitializationEvent evt) {
// Register gui handler
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
// Register save handler
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
// Standard blocks
SchematicRegistry.registerSchematicBlock(Blocks.snow, SchematicIgnore.class);
SchematicRegistry.registerSchematicBlock(Blocks.tallgrass, SchematicIgnore.class);
SchematicRegistry.registerSchematicBlock(Blocks.ice, SchematicIgnore.class);
SchematicRegistry.registerSchematicBlock(Blocks.piston_head, SchematicIgnore.class);
SchematicRegistry.registerSchematicBlock(Blocks.dirt, SchematicDirt.class);
SchematicRegistry.registerSchematicBlock(Blocks.grass, SchematicDirt.class);
SchematicRegistry.registerSchematicBlock(Blocks.farmland, SchematicFarmland.class);
SchematicRegistry.registerSchematicBlock(Blocks.wheat, SchematicSeeds.class, Items.wheat_seeds);
SchematicRegistry.registerSchematicBlock(Blocks.pumpkin_stem, SchematicSeeds.class, Items.pumpkin_seeds);
SchematicRegistry.registerSchematicBlock(Blocks.melon_stem, SchematicSeeds.class, Items.melon_seeds);
SchematicRegistry.registerSchematicBlock(Blocks.nether_wart, SchematicSeeds.class, Items.nether_wart);
SchematicRegistry.registerSchematicBlock(Blocks.torch, SchematicWallSide.class);
SchematicRegistry.registerSchematicBlock(Blocks.redstone_torch, SchematicWallSide.class);
SchematicRegistry.registerSchematicBlock(Blocks.unlit_redstone_torch, SchematicWallSide.class);
SchematicRegistry.registerSchematicBlock(Blocks.ladder, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.fence_gate, SchematicRotateMeta.class, new int[]{0, 1, 2, 3}, true);
SchematicRegistry.registerSchematicBlock(Blocks.log, SchematicRotateMeta.class, new int[]{8, 4, 8, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.log2, SchematicRotateMeta.class, new int[]{8, 4, 8, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.hay_block, SchematicRotateMeta.class, new int[]{8, 4, 8, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.quartz_block, SchematicRotateMeta.class, new int[]{4, 3, 4, 3}, true);
SchematicRegistry.registerSchematicBlock(Blocks.hopper, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.lit_furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.chest, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.dispenser, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(Blocks.vine, SchematicRotateMeta.class, new int[]{1, 4, 8, 2}, false);
SchematicRegistry.registerSchematicBlock(Blocks.trapdoor, SchematicRotateMeta.class, new int[]{0, 1, 2, 3}, false);
SchematicRegistry.registerSchematicBlock(Blocks.wooden_button, SchematicLever.class);
SchematicRegistry.registerSchematicBlock(Blocks.stone_button, SchematicLever.class);
SchematicRegistry.registerSchematicBlock(Blocks.lever, SchematicLever.class);
SchematicRegistry.registerSchematicBlock(Blocks.stone, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.gold_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.iron_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.coal_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.lapis_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.diamond_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.redstone_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.lit_redstone_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.emerald_ore, SchematicStone.class);
SchematicRegistry.registerSchematicBlock(Blocks.gravel, SchematicGravel.class);
SchematicRegistry.registerSchematicBlock(Blocks.redstone_wire, SchematicCustomStack.class, new ItemStack(Items.redstone));
SchematicRegistry.registerSchematicBlock(Blocks.cake, SchematicCustomStack.class, new ItemStack(Items.cake));
SchematicRegistry.registerSchematicBlock(Blocks.pumpkin_stem, SchematicCustomStack.class, new ItemStack(Items.pumpkin_seeds));
SchematicRegistry.registerSchematicBlock(Blocks.melon_stem, SchematicCustomStack.class, new ItemStack(Items.melon_seeds));
SchematicRegistry.registerSchematicBlock(Blocks.glowstone, SchematicCustomStack.class, new ItemStack(Blocks.glowstone));
SchematicRegistry.registerSchematicBlock(Blocks.powered_repeater, SchematicRedstoneDiode.class);
SchematicRegistry.registerSchematicBlock(Blocks.unpowered_repeater, SchematicRedstoneDiode.class);
SchematicRegistry.registerSchematicBlock(Blocks.powered_comparator, SchematicRedstoneDiode.class);
SchematicRegistry.registerSchematicBlock(Blocks.unpowered_comparator, SchematicRedstoneDiode.class);
SchematicRegistry.registerSchematicBlock(Blocks.water, SchematicFluid.class, new ItemStack(Items.water_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.flowing_water, SchematicFluid.class, new ItemStack(Items.water_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.lava, SchematicFluid.class, new ItemStack(Items.lava_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.flowing_lava, SchematicFluid.class, new ItemStack(Items.lava_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.rail, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.detector_rail, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.glass_pane, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.piston, SchematicPiston.class);
SchematicRegistry.registerSchematicBlock(Blocks.piston_extension, SchematicPiston.class);
SchematicRegistry.registerSchematicBlock(Blocks.sticky_piston, SchematicPiston.class);
SchematicRegistry.registerSchematicBlock(Blocks.lit_pumpkin, SchematicPumpkin.class);
SchematicRegistry.registerSchematicBlock(Blocks.oak_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.stone_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.brick_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.stone_brick_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.nether_brick_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.sandstone_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.spruce_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.birch_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.jungle_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.quartz_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.acacia_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.dark_oak_stairs, SchematicStairs.class);
SchematicRegistry.registerSchematicBlock(Blocks.wooden_door, SchematicDoor.class, new ItemStack(Items.wooden_door));
SchematicRegistry.registerSchematicBlock(Blocks.iron_door, SchematicDoor.class, new ItemStack(Items.iron_door));
SchematicRegistry.registerSchematicBlock(Blocks.bed, SchematicBed.class);
SchematicRegistry.registerSchematicBlock(Blocks.wall_sign, SchematicSign.class, true);
SchematicRegistry.registerSchematicBlock(Blocks.standing_sign, SchematicSign.class, false);
SchematicRegistry.registerSchematicBlock(Blocks.portal, SchematicPortal.class);
SchematicRegistry.registerSchematicBlock(Blocks.rail, SchematicRail.class);
SchematicRegistry.registerSchematicBlock(Blocks.activator_rail, SchematicRail.class);
SchematicRegistry.registerSchematicBlock(Blocks.detector_rail, SchematicRail.class);
SchematicRegistry.registerSchematicBlock(Blocks.golden_rail, SchematicRail.class);
SchematicRegistry.registerSchematicBlock(Blocks.fire, SchematicFire.class);
// Standard entities
SchematicRegistry.registerSchematicEntity(EntityMinecartEmpty.class, SchematicMinecart.class);
SchematicRegistry.registerSchematicEntity(EntityMinecartFurnace.class, SchematicMinecart.class);
SchematicRegistry.registerSchematicEntity(EntityMinecartTNT.class, SchematicMinecart.class);
SchematicRegistry.registerSchematicEntity(EntityMinecartChest.class, SchematicMinecart.class);
SchematicRegistry.registerSchematicEntity(EntityMinecartHopper.class, SchematicMinecart.class);
SchematicRegistry.registerSchematicEntity(EntityPainting.class, SchematicHanging.class);
SchematicRegistry.registerSchematicEntity(EntityItemFrame.class, SchematicHanging.class);
// BuildCraft blocks
SchematicRegistry.registerSchematicBlock(architectBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(builderBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
SchematicRegistry.registerSchematicBlock(markerBlock, SchematicWallSide.class);
SchematicRegistry.registerSchematicBlock(pathMarkerBlock, SchematicWallSide.class);
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
}
BuilderProxy.proxy.registerBlockRenderers();
}
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
Property fillerDestroyProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "filler.destroy", DefaultProps.FILLER_DESTROY);
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
Property fillerLifespanToughProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "filler.lifespan.tough", DefaultProps.FILLER_LIFESPAN_TOUGH);
fillerLifespanToughProp.comment = "Lifespan in ticks of items dropped by the filler from 'tough' blocks (those that can't be broken by hand)";
fillerLifespanTough = fillerLifespanToughProp.getInt(DefaultProps.FILLER_LIFESPAN_TOUGH);
Property fillerLifespanNormalProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "filler.lifespan.other", DefaultProps.FILLER_LIFESPAN_NORMAL);
fillerLifespanNormalProp.comment = "Lifespan in ticks of items dropped by the filler from non-tough blocks (those that can be broken by hand)";
fillerLifespanNormal = fillerLifespanNormalProp.getInt(DefaultProps.FILLER_LIFESPAN_NORMAL);
templateItem = new ItemBlueprintTemplate();
templateItem.setUnlocalizedName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
CoreProxy.proxy.registerItem(templateItem);
blueprintItem = new ItemBlueprintStandard();
blueprintItem.setUnlocalizedName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
CoreProxy.proxy.registerItem(blueprintItem);
buildToolBlock = new BlockBuildTool ();
CoreProxy.proxy.registerBlock(buildToolBlock);
markerBlock = new BlockMarker();
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
pathMarkerBlock = new BlockPathMarker();
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
fillerBlock = new BlockFiller();
CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
builderBlock = new BlockBuilder();
CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
architectBlock = new BlockArchitect();
CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
libraryBlock = new BlockBlueprintLibrary();
CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
if (!BuildCraftCore.NEXTGEN_PREALPHA) {
urbanistBlock = new BlockUrbanist ();
CoreProxy.proxy.registerBlock(urbanistBlock.setBlockName("urbanistBlock"));
CoreProxy.proxy.registerTileEntity(TileUrbanist.class, "net.minecraft.src.builders.TileUrbanist");
}
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");
if (BuildCraftCore.mainConfiguration.hasChanged()) {
BuildCraftCore.mainConfiguration.save();
}
MinecraftForge.EVENT_BUS.register(this);
// Create filler registry
try {
FillerManager.registry = new FillerRegistry();
// INIT FILLER PATTERNS
FillerManager.registry.addPattern(PatternFill.INSTANCE);
FillerManager.registry.addPattern(new PatternFlatten());
FillerManager.registry.addPattern(new PatternHorizon());
FillerManager.registry.addPattern(new PatternClear());
FillerManager.registry.addPattern(new PatternBox());
FillerManager.registry.addPattern(new PatternPyramid());
FillerManager.registry.addPattern(new PatternStairs());
FillerManager.registry.addPattern(new PatternCylinder());
FillerManager.registry.addPattern(new PatternFrame());
} catch (Error error) {
BCLog.logErrorAPI("Buildcraft", error, IFillerPattern.class);
throw error;
}
ActionManager.registerActionProvider(new BuildersActionProvider());
}
public static void loadRecipes() {
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), new Object[]{"ppp", "pip", "ppp", 'i',
// new ItemStack(Item.dyePowder, 1, 0), 'p', Item.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), new Object[]{"ppp", "pip", "ppp", 'i',
new ItemStack(Items.dye, 1, 4), 'p', Items.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", 'l',
new ItemStack(Items.dye, 1, 4), 'r', Blocks.redstone_torch});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", 'l',
// new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
new ItemStack(Items.dye, 1, 0), 't', markerBlock, 'y', new ItemStack(Items.dye, 1, 11),
'c', Blocks.crafting_table, 'g', BuildCraftCore.goldGearItem, 'C', Blocks.chest});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
// new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
// 'c', Block.workbench, 'g', BuildCraftCore.diamondGearItem, 'C', Block.chest});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
// new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
// 'c', Block.workbench, 'g', BuildCraftCore.diamondGearItem, 'C',
// new ItemStack(templateItem, 1)});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), new Object[]{"bbb", "bBb", "bbb", 'b',
new ItemStack(blueprintItem), 'B', Blocks.bookshelf});
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
@EventHandler
public void ServerStop(FMLServerStoppingEvent event) {
TilePathMarker.clearAvailableMarkersList();
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
if (evt.map.getTextureType() == 0) {
for (FillerPattern pattern : FillerPattern.patterns.values()) {
pattern.registerIcon(evt.map);
}
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
if (event.map.getTextureType() == 1) {
UrbanistToolsIconProvider.INSTANCE.registerIcons(event.map);
}
}
}