From ec15b0247a02e3f6f04d46b8e1492977e0545d9b Mon Sep 17 00:00:00 2001 From: asiekierka Date: Thu, 16 Apr 2015 15:08:33 +0200 Subject: [PATCH] move quarry to Builders module, clean up a few things --- .../textures/blocks/frameBlock/default.png | Bin .../textures/blocks/machineBlock/back.png | Bin .../textures/blocks/machineBlock/bottom.png | Bin .../textures/blocks/machineBlock/display.png | Bin .../textures/blocks/machineBlock/drill.png | Bin .../blocks/machineBlock/drill_head.png | Bin .../textures/blocks/machineBlock/front.png | Bin .../blocks/machineBlock/item_hatch.png | Bin .../blocks/machineBlock/led_green.png | Bin .../textures/blocks/machineBlock/led_red.png | Bin .../textures/blocks/machineBlock/side.png | Bin .../textures/blocks/machineBlock/top.png | Bin common/buildcraft/BuildCraftBuilders.java | 88 +++++++++++-- common/buildcraft/BuildCraftFactory.java | 116 +++++------------- common/buildcraft/BuildCraftTransport.java | 12 +- .../{factory => builders}/BlockFrame.java | 6 +- .../{factory => builders}/BlockQuarry.java | 11 +- common/buildcraft/builders/BuilderProxy.java | 12 ++ .../builders/BuilderProxyClient.java | 25 ++++ .../EntityMechanicalArm.java | 10 +- .../{factory => builders}/TileQuarry.java | 19 +-- .../{factory => core}/BlockLEDHatchBase.java | 2 +- .../builders/schematics/SchematicFree.java | 28 +++++ .../buildcraft/core/config/ConfigManager.java | 10 +- .../buildcraft/factory/BlockMiningWell.java | 1 + common/buildcraft/factory/FactoryProxy.java | 10 -- .../factory/FactoryProxyClient.java | 21 ---- 27 files changed, 212 insertions(+), 159 deletions(-) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/frameBlock/default.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/back.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/bottom.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/display.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/drill.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/drill_head.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/front.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/item_hatch.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/led_green.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/led_red.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/side.png (100%) rename buildcraft_resources/assets/{buildcraftfactory => buildcraftbuilders}/textures/blocks/machineBlock/top.png (100%) rename common/buildcraft/{factory => builders}/BlockFrame.java (97%) rename common/buildcraft/{factory => builders}/BlockQuarry.java (93%) rename common/buildcraft/{factory => builders}/EntityMechanicalArm.java (92%) rename common/buildcraft/{factory => builders}/TileQuarry.java (97%) rename common/buildcraft/{factory => core}/BlockLEDHatchBase.java (98%) create mode 100644 common/buildcraft/core/builders/schematics/SchematicFree.java diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/frameBlock/default.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/frameBlock/default.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/frameBlock/default.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/frameBlock/default.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/back.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/back.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/back.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/back.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/bottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/bottom.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/bottom.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/bottom.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/display.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/display.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/display.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/display.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/drill.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/drill.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill_head.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/drill_head.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill_head.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/drill_head.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/front.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/front.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/item_hatch.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/item_hatch.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/item_hatch.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/item_hatch.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_green.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/led_green.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_green.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/led_green.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_red.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/led_red.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_red.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/led_red.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/side.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/side.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/side.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/side.png diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/top.png similarity index 100% rename from buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png rename to buildcraft_resources/assets/buildcraftbuilders/textures/blocks/machineBlock/top.png diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index af8baa39..5c0c0715 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -12,6 +12,10 @@ import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import java.io.PrintWriter; +import java.util.List; +import com.google.common.collect.Lists; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.item.EntityMinecartChest; import net.minecraft.entity.item.EntityMinecartEmpty; @@ -25,6 +29,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.launchwrapper.Launch; import net.minecraft.stats.Achievement; +import net.minecraft.world.World; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; @@ -40,6 +45,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Property; import buildcraft.api.blueprints.BlueprintDeployer; @@ -60,10 +66,13 @@ import buildcraft.builders.BlockBlueprintLibrary; import buildcraft.builders.BlockBuilder; import buildcraft.builders.BlockConstructionMarker; import buildcraft.builders.BlockFiller; +import buildcraft.builders.BlockFrame; import buildcraft.builders.BlockMarker; import buildcraft.builders.BlockPathMarker; +import buildcraft.builders.BlockQuarry; import buildcraft.builders.BlueprintServerDatabase; import buildcraft.builders.BuilderProxy; +import buildcraft.builders.BuilderProxyClient; import buildcraft.builders.BuildersGuiHandler; import buildcraft.builders.EventHandlerBuilders; import buildcraft.builders.HeuristicBlockDetection; @@ -80,6 +89,7 @@ import buildcraft.builders.TileConstructionMarker; import buildcraft.builders.TileFiller; import buildcraft.builders.TileMarker; import buildcraft.builders.TilePathMarker; +import buildcraft.builders.TileQuarry; import buildcraft.builders.blueprints.RealBlueprintDeployer; import buildcraft.builders.schematics.SchematicAir; import buildcraft.builders.schematics.SchematicBed; @@ -93,6 +103,7 @@ import buildcraft.builders.schematics.SchematicFactoryEntity; import buildcraft.builders.schematics.SchematicFactoryMask; import buildcraft.builders.schematics.SchematicFarmland; import buildcraft.builders.schematics.SchematicFire; +import buildcraft.core.builders.schematics.SchematicFree; import buildcraft.builders.schematics.SchematicGlassPane; import buildcraft.builders.schematics.SchematicGravel; import buildcraft.builders.schematics.SchematicHanging; @@ -155,6 +166,8 @@ public class BuildCraftBuilders extends BuildCraftMod { public static BlockArchitect architectBlock; public static BlockBlueprintLibrary libraryBlock; public static BlockUrbanist urbanistBlock; + public static BlockQuarry quarryBlock; + public static BlockFrame frameBlock; public static ItemBlueprintTemplate templateItem; public static ItemBlueprintStandard blueprintItem; @@ -163,6 +176,7 @@ public class BuildCraftBuilders extends BuildCraftMod { public static Achievement blueprintAchievement; public static Achievement builderAchievement; public static Achievement templateAchievement; + public static Achievement chunkDestroyerAchievement; public static BlueprintServerDatabase serverDB; public static LibraryDatabase clientDB; @@ -170,8 +184,44 @@ public class BuildCraftBuilders extends BuildCraftMod { public static boolean debugPrintSchematicList = false; public static boolean dropBrokenBlocks = false; + public static boolean quarryLoadsChunks = true; + public static boolean quarryOneTimeUse = false; + private String blueprintServerDir, blueprintClientDir; + public class QuarryChunkloadCallback implements ForgeChunkManager.OrderedLoadingCallback { + @Override + public void ticketsLoaded(List tickets, World world) { + for (ForgeChunkManager.Ticket ticket : tickets) { + int quarryX = ticket.getModData().getInteger("quarryX"); + int quarryY = ticket.getModData().getInteger("quarryY"); + int quarryZ = ticket.getModData().getInteger("quarryZ"); + + Block block = world.getBlock(quarryX, quarryY, quarryZ); + if (block == quarryBlock) { + TileQuarry tq = (TileQuarry) world.getTileEntity(quarryX, quarryY, quarryZ); + tq.forceChunkLoading(ticket); + } + } + } + + @Override + public List ticketsLoaded(List tickets, World world, int maxTicketCount) { + List validTickets = Lists.newArrayList(); + for (ForgeChunkManager.Ticket ticket : tickets) { + int quarryX = ticket.getModData().getInteger("quarryX"); + int quarryY = ticket.getModData().getInteger("quarryY"); + int quarryZ = ticket.getModData().getInteger("quarryZ"); + + Block block = world.getBlock(quarryX, quarryY, quarryZ); + if (block == quarryBlock) { + validTickets.add(ticket); + } + } + return validTickets; + } + } + @Mod.EventHandler public void loadConfiguration(FMLPreInitializationEvent evt) { BuildCraftCore.mainConfigManager.register("blueprints.serverDatabaseDirectory", @@ -211,6 +261,9 @@ public class BuildCraftBuilders extends BuildCraftMod { reloadConfig(ConfigManager.RestartRequirement.NONE); } else { + quarryOneTimeUse = BuildCraftCore.mainConfigManager.get("general.quarry.oneTimeUse").getBoolean(); + quarryLoadsChunks = BuildCraftCore.mainConfigManager.get("general.quarry.doChunkLoading").getBoolean(); + blueprintClientDir = BuildCraftCore.mainConfigManager.get("blueprints.clientDatabaseDirectory").getString(); blueprintClientDir = JavaTools.stripSurroundingQuotes(replacePathVariables(blueprintClientDir)); clientDB.init(new String[] { @@ -281,6 +334,7 @@ public class BuildCraftBuilders extends BuildCraftMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent evt) { HeuristicBlockDetection.start(); + ForgeChunkManager.setForcedChunkLoadingCallback(instance, new QuarryChunkloadCallback()); if (debugPrintSchematicList) { try { @@ -456,6 +510,7 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(markerBlock, SchematicIgnore.class); schemes.registerSchematicBlock(pathMarkerBlock, SchematicIgnore.class); schemes.registerSchematicBlock(constructionMarkerBlock, SchematicIgnore.class); + schemes.registerSchematicBlock(frameBlock, SchematicFree.class); // Factories required to save entities in world @@ -474,6 +529,7 @@ public class BuildCraftBuilders extends BuildCraftMod { blueprintAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.blueprint", "blueprintAchievement", 11, 4, BuildCraftBuilders.blueprintItem, architectAchievement)); templateAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.template", "templateAchievement", 13, 4, BuildCraftBuilders.templateItem, blueprintAchievement)); libraryAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.blueprintLibrary", "blueprintLibraryAchievement", 15, 2, BuildCraftBuilders.libraryBlock, builderAchievement)); + chunkDestroyerAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.chunkDestroyer", "chunkDestroyerAchievement", 9, 2, quarryBlock, BuildCraftCore.diamondGearAchievement)); if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); @@ -492,6 +548,9 @@ public class BuildCraftBuilders extends BuildCraftMod { blueprintItem.setUnlocalizedName("blueprintItem"); CoreProxy.proxy.registerItem(blueprintItem); + quarryBlock = (BlockQuarry) CompatHooks.INSTANCE.getBlock(BlockQuarry.class); + CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock")); + markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class); CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock")); @@ -505,6 +564,9 @@ public class BuildCraftBuilders extends BuildCraftMod { fillerBlock = (BlockFiller) CompatHooks.INSTANCE.getBlock(BlockFiller.class); CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock")); + frameBlock = new BlockFrame(); + CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock")); + builderBlock = (BlockBuilder) CompatHooks.INSTANCE.getBlock(BlockBuilder.class); CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock")); @@ -520,6 +582,7 @@ public class BuildCraftBuilders extends BuildCraftMod { CoreProxy.proxy.registerTileEntity(TileUrbanist.class, "net.minecraft.src.builders.TileUrbanist"); } + CoreProxy.proxy.registerTileEntity(TileQuarry.class, "Machine"); CoreProxy.proxy.registerTileEntity(TileMarker.class, "Marker"); CoreProxy.proxy.registerTileEntity(TileFiller.class, "Filler"); CoreProxy.proxy.registerTileEntity(TileBuilder.class, "net.minecraft.src.builders.TileBuilder"); @@ -562,6 +625,17 @@ public class BuildCraftBuilders extends BuildCraftMod { } public static void loadRecipes() { + CoreProxy.proxy.addCraftingRecipe( + new ItemStack(quarryBlock), + "ipi", + "gig", + "dDd", + 'i', "gearIron", + 'p', "dustRedstone", + 'g', "gearGold", + 'd', "gearDiamond", + 'D', Items.diamond_pickaxe); + CoreProxy.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), "ppp", "pip", "ppp", 'i', "dyeBlack", 'p', Items.paper); @@ -591,7 +665,7 @@ public class BuildCraftBuilders extends BuildCraftMod { new ItemStack(blueprintItem, 1)); CoreProxy.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), "bbb", "bBb", "bbb", 'b', - new ItemStack(blueprintItem), 'B', Blocks.bookshelf); + new ItemStack(blueprintItem), 'B', Blocks.bookshelf); } @Mod.EventHandler @@ -611,14 +685,12 @@ public class BuildCraftBuilders extends BuildCraftMod { for (FillerPattern pattern : FillerPattern.patterns.values()) { pattern.registerIcons(evt.map); } - } - } - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void textureHook(TextureStitchEvent.Pre event) { - if (event.map.getTextureType() == 1) { - UrbanistToolsIconProvider.INSTANCE.registerIcons(event.map); + TextureMap terrainTextures = evt.map; + BuilderProxyClient.drillTexture = terrainTextures.registerIcon("buildcraftbuilders:machineBlock/drill"); + BuilderProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraftbuilders:machineBlock/drill_head"); + } else if (evt.map.getTextureType() == 1) { + UrbanistToolsIconProvider.INSTANCE.registerIcons(evt.map); } } diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index 36868035..6550bab1 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -8,29 +8,27 @@ */ package buildcraft; -import java.util.List; -import com.google.common.collect.Lists; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.world.World; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; 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.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.ForgeChunkManager; -import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.MinecraftForge; import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.blueprints.SchematicTile; @@ -38,19 +36,17 @@ import buildcraft.core.CompatHooks; import buildcraft.core.DefaultProps; import buildcraft.core.InterModComms; import buildcraft.core.Version; -import buildcraft.core.builders.schematics.SchematicIgnoreMeta; +import buildcraft.core.builders.schematics.SchematicFree; import buildcraft.core.config.ConfigManager; import buildcraft.core.lib.network.ChannelHandler; import buildcraft.core.lib.network.PacketHandler; import buildcraft.core.proxy.CoreProxy; import buildcraft.factory.BlockAutoWorkbench; import buildcraft.factory.BlockFloodGate; -import buildcraft.factory.BlockFrame; import buildcraft.factory.BlockHopper; import buildcraft.factory.BlockMiningWell; import buildcraft.factory.BlockPlainPipe; import buildcraft.factory.BlockPump; -import buildcraft.factory.BlockQuarry; import buildcraft.factory.BlockRefinery; import buildcraft.factory.BlockTank; import buildcraft.factory.FactoryGuiHandler; @@ -62,7 +58,6 @@ import buildcraft.factory.TileFloodGate; import buildcraft.factory.TileHopper; import buildcraft.factory.TileMiningWell; import buildcraft.factory.TilePump; -import buildcraft.factory.TileQuarry; import buildcraft.factory.TileRefinery; import buildcraft.factory.TileTank; import buildcraft.factory.schematics.SchematicAutoWorkbench; @@ -76,10 +71,8 @@ public class BuildCraftFactory extends BuildCraftMod { @Mod.Instance("BuildCraft|Factory") public static BuildCraftFactory instance; - public static BlockQuarry quarryBlock; public static BlockMiningWell miningWellBlock; public static BlockAutoWorkbench autoWorkbenchBlock; - public static BlockFrame frameBlock; public static BlockPlainPipe plainPipeBlock; public static BlockPump pumpBlock; public static BlockFloodGate floodGateBlock; @@ -89,61 +82,17 @@ public class BuildCraftFactory extends BuildCraftMod { public static Achievement aLotOfCraftingAchievement; public static Achievement straightDownAchievement; - public static Achievement chunkDestroyerAchievement; public static Achievement refineAndRedefineAchievement; - public static boolean quarryLoadsChunks = true; - public static boolean quarryOneTimeUse = false; public static int miningDepth = 256; public static PumpDimensionList pumpDimensionList; - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent evt) { - FactoryProxy.proxy.initializeNEIIntegration(); - ForgeChunkManager.setForcedChunkLoadingCallback(instance, new QuarryChunkloadCallback()); - } - - public class QuarryChunkloadCallback implements ForgeChunkManager.OrderedLoadingCallback { - - @Override - public void ticketsLoaded(List tickets, World world) { - for (Ticket ticket : tickets) { - int quarryX = ticket.getModData().getInteger("quarryX"); - int quarryY = ticket.getModData().getInteger("quarryY"); - int quarryZ = ticket.getModData().getInteger("quarryZ"); - - Block block = world.getBlock(quarryX, quarryY, quarryZ); - if (block == quarryBlock) { - TileQuarry tq = (TileQuarry) world.getTileEntity(quarryX, quarryY, quarryZ); - tq.forceChunkLoading(ticket); - } - } - } - - @Override - public List ticketsLoaded(List tickets, World world, int maxTicketCount) { - List validTickets = Lists.newArrayList(); - for (Ticket ticket : tickets) { - int quarryX = ticket.getModData().getInteger("quarryX"); - int quarryY = ticket.getModData().getInteger("quarryY"); - int quarryZ = ticket.getModData().getInteger("quarryZ"); - - Block block = world.getBlock(quarryX, quarryY, quarryZ); - if (block == quarryBlock) { - validTickets.add(ticket); - } - } - return validTickets; - } - } - @Mod.EventHandler public void load(FMLInitializationEvent evt) { NetworkRegistry.INSTANCE.registerGuiHandler(instance, new FactoryGuiHandler()); // EntityRegistry.registerModEntity(EntityMechanicalArm.class, "bcMechanicalArm", EntityIds.MECHANICAL_ARM, instance, 50, 1, true); - CoreProxy.proxy.registerTileEntity(TileQuarry.class, "Machine"); CoreProxy.proxy.registerTileEntity(TileMiningWell.class, "MiningWell"); CoreProxy.proxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench"); CoreProxy.proxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump"); @@ -156,16 +105,15 @@ public class BuildCraftFactory extends BuildCraftMod { BuilderAPI.schematicRegistry.registerSchematicBlock(refineryBlock, SchematicRefinery.class); BuilderAPI.schematicRegistry.registerSchematicBlock(tankBlock, SchematicTileIgnoreState.class); - BuilderAPI.schematicRegistry.registerSchematicBlock(frameBlock, SchematicIgnoreMeta.class); BuilderAPI.schematicRegistry.registerSchematicBlock(pumpBlock, SchematicPump.class); BuilderAPI.schematicRegistry.registerSchematicBlock(miningWellBlock, SchematicTileIgnoreState.class); BuilderAPI.schematicRegistry.registerSchematicBlock(floodGateBlock, SchematicTileIgnoreState.class); BuilderAPI.schematicRegistry.registerSchematicBlock(autoWorkbenchBlock, SchematicAutoWorkbench.class); BuilderAPI.schematicRegistry.registerSchematicBlock(hopperBlock, SchematicTile.class); + BuilderAPI.schematicRegistry.registerSchematicBlock(plainPipeBlock, SchematicFree.class); aLotOfCraftingAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.aLotOfCrafting", "aLotOfCraftingAchievement", 1, 2, autoWorkbenchBlock, BuildCraftCore.woodenGearAchievement)); straightDownAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.straightDown", "straightDownAchievement", 5, 2, miningWellBlock, BuildCraftCore.ironGearAchievement)); - chunkDestroyerAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.chunkDestroyer", "chunkDestroyerAchievement", 9, 2, quarryBlock, BuildCraftCore.diamondGearAchievement)); refineAndRedefineAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("achievement.refineAndRedefine", "refineAndRedefineAchievement", 10, 0, refineryBlock, BuildCraftCore.diamondGearAchievement)); if (BuildCraftCore.loadDefaultRecipes) { @@ -201,12 +149,6 @@ public class BuildCraftFactory extends BuildCraftMod { autoWorkbenchBlock = (BlockAutoWorkbench) CompatHooks.INSTANCE.getBlock(BlockAutoWorkbench.class); CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock")); - frameBlock = new BlockFrame(); - CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock")); - - quarryBlock = (BlockQuarry) CompatHooks.INSTANCE.getBlock(BlockQuarry.class); - CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock")); - tankBlock = (BlockTank) CompatHooks.INSTANCE.getBlock(BlockTank.class); CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock")); @@ -240,19 +182,6 @@ public class BuildCraftFactory extends BuildCraftMod { 'P', Items.iron_pickaxe); } - if (quarryBlock != null) { - CoreProxy.proxy.addCraftingRecipe( - new ItemStack(quarryBlock), - "ipi", - "gig", - "dDd", - 'i', "gearIron", - 'p', "dustRedstone", - 'g', "gearGold", - 'd', "gearDiamond", - 'D', Items.diamond_pickaxe); - } - if (pumpBlock != null) { CoreProxy.proxy.addCraftingRecipe( new ItemStack(pumpBlock), @@ -327,8 +256,6 @@ public class BuildCraftFactory extends BuildCraftMod { } else if (restartType == ConfigManager.RestartRequirement.WORLD) { reloadConfig(ConfigManager.RestartRequirement.NONE); } else { - quarryOneTimeUse = BuildCraftCore.mainConfigManager.get("general.quarry.oneTimeUse").getBoolean(); - quarryLoadsChunks = BuildCraftCore.mainConfigManager.get("general.quarry.doChunkLoading").getBoolean(); miningDepth = BuildCraftCore.mainConfigManager.get("general.miningDepth").getInt(); pumpDimensionList = new PumpDimensionList(BuildCraftCore.mainConfigManager.get("general.pumpDimensionControl").getString()); @@ -356,15 +283,11 @@ public class BuildCraftFactory extends BuildCraftMod { if (evt.map.getTextureType() == 0) { TextureMap terrainTextures = evt.map; FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraftfactory:pumpBlock/tube"); - FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraftfactory:machineBlock/drill"); - FactoryProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraftfactory:machineBlock/drill_head"); } } @Mod.EventHandler public void whiteListAppliedEnergetics(FMLInitializationEvent event) { - //FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", - // TileQuarry.class.getCanonicalName()); //FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", // TileMiningWell.class.getCanonicalName()); FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", @@ -380,4 +303,31 @@ public class BuildCraftFactory extends BuildCraftMod { FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", TileHopper.class.getCanonicalName()); } + + @Mod.EventHandler + public void remap(FMLMissingMappingsEvent event) { + for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) { + if (mapping.name.equals("BuildCraft|Factory:machineBlock")) { + if (Loader.isModLoaded("BuildCraft|Builders")) { + if (mapping.type == GameRegistry.Type.BLOCK) { + mapping.remap(Block.getBlockFromName("BuildCraft|Builders:machineBlock")); + } else if (mapping.type == GameRegistry.Type.ITEM) { + mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("BuildCraft|Builders:machineBlock"))); + } + } else { + mapping.warn(); + } + } else if (mapping.name.equals("BuildCraft|Factory:frameBlock")) { + if (Loader.isModLoaded("BuildCraft|Builders")) { + if (mapping.type == GameRegistry.Type.BLOCK) { + mapping.remap(Block.getBlockFromName("BuildCraft|Builders:frameBlock")); + } else if (mapping.type == GameRegistry.Type.ITEM) { + mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("BuildCraft|Builders:frameBlock"))); + } + } else { + mapping.ignore(); + } + } + } + } } diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 464848c3..17e29f45 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -313,17 +313,7 @@ public class BuildCraftTransport extends BuildCraftMod { Block.blockRegistry.getNameForObject(Blocks.redstone_lamp), Block.blockRegistry.getNameForObject(Blocks.double_stone_slab), Block.blockRegistry.getNameForObject(Blocks.double_wooden_slab), - Block.blockRegistry.getNameForObject(Blocks.sponge), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftBuilders.architectBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftBuilders.builderBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftBuilders.fillerBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftBuilders.libraryBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftFactory.autoWorkbenchBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftFactory.floodGateBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftFactory.miningWellBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftFactory.pumpBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftFactory.quarryBlock)), - JavaTools.surroundWithQuotes(Block.blockRegistry.getNameForObject(BuildCraftTransport.filteredBufferBlock)), + Block.blockRegistry.getNameForObject(Blocks.sponge) }, "What block types should be blacklisted from being a facade?", ConfigManager.RestartRequirement.GAME); BuildCraftCore.mainConfigManager.register("general.pipes.facadeBlacklistAsWhitelist", false, "Should the blacklist be treated as a whitelist instead?", ConfigManager.RestartRequirement.GAME); BuildCraftCore.mainConfigManager.register("general.pipes.facadeNoLaserRecipe", false, "Should non-laser (crafting table) facade recipes be forced?", ConfigManager.RestartRequirement.GAME); diff --git a/common/buildcraft/factory/BlockFrame.java b/common/buildcraft/builders/BlockFrame.java similarity index 97% rename from common/buildcraft/factory/BlockFrame.java rename to common/buildcraft/builders/BlockFrame.java index 80530d41..048121aa 100644 --- a/common/buildcraft/factory/BlockFrame.java +++ b/common/buildcraft/builders/BlockFrame.java @@ -6,7 +6,7 @@ * 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.factory; +package buildcraft.builders; import java.util.ArrayList; import java.util.List; @@ -45,7 +45,7 @@ public class BlockFrame extends Block implements IFramePipeConnection { removeNeighboringFrames(world, x, y, z); } - protected void removeNeighboringFrames(World world, int x, int y, int z) { + public void removeNeighboringFrames(World world, int x, int y, int z) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { Block nBlock = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); if (nBlock == this) { @@ -206,6 +206,6 @@ public class BlockFrame extends Block implements IFramePipeConnection { @Override public void registerBlockIcons(IIconRegister register) { - blockIcon = register.registerIcon("buildcraftfactory:frameBlock/default"); + blockIcon = register.registerIcon("buildcraftbuilders:frameBlock/default"); } } diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/builders/BlockQuarry.java similarity index 93% rename from common/buildcraft/factory/BlockQuarry.java rename to common/buildcraft/builders/BlockQuarry.java index 8fc0ccb7..663d679a 100644 --- a/common/buildcraft/factory/BlockQuarry.java +++ b/common/buildcraft/builders/BlockQuarry.java @@ -6,7 +6,7 @@ * 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.factory; +package buildcraft.builders; import java.util.ArrayList; import net.minecraft.block.Block; @@ -19,8 +19,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.BuildCraftFactory; +import buildcraft.BuildCraftBuilders; import buildcraft.api.tools.IToolWrench; +import buildcraft.core.BlockLEDHatchBase; public class BlockQuarry extends BlockLEDHatchBase { public BlockQuarry() { @@ -55,7 +56,7 @@ public class BlockQuarry extends BlockLEDHatchBase { Block block = world.getBlock(i, j, k); - if (block != BuildCraftFactory.frameBlock) { + if (block != BuildCraftBuilders.frameBlock) { return; } @@ -94,7 +95,7 @@ public class BlockQuarry extends BlockLEDHatchBase { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - if (BuildCraftFactory.quarryOneTimeUse) { + if (BuildCraftBuilders.quarryOneTimeUse) { return new ArrayList(); } return super.getDrops(world, x, y, z, metadata, fortune); @@ -106,7 +107,7 @@ public class BlockQuarry extends BlockLEDHatchBase { return; } - BuildCraftFactory.frameBlock.removeNeighboringFrames(world, i, j, k); + BuildCraftBuilders.frameBlock.removeNeighboringFrames(world, i, j, k); super.breakBlock(world, i, j, k, block, metadata); } diff --git a/common/buildcraft/builders/BuilderProxy.java b/common/buildcraft/builders/BuilderProxy.java index 0d3f7bb0..bdb8b50d 100644 --- a/common/buildcraft/builders/BuilderProxy.java +++ b/common/buildcraft/builders/BuilderProxy.java @@ -8,7 +8,9 @@ */ package buildcraft.builders; +import net.minecraft.world.World; import cpw.mods.fml.common.SidedProxy; +import buildcraft.core.lib.EntityBlock; public class BuilderProxy { @SidedProxy(clientSide = "buildcraft.builders.BuilderProxyClient", serverSide = "buildcraft.builders.BuilderProxy") @@ -21,4 +23,14 @@ public class BuilderProxy { public void registerBlockRenderers () { } + + public EntityBlock newDrill(World w, double i, double j, double k, + double l, double d, double e) { + return new EntityBlock(w, i, j, k, l, d, e); + } + + public EntityBlock newDrillHead(World w, double i, double j, double k, + double l, double d, double e) { + return new EntityBlock(w, i, j, k, l, d, e); + } } diff --git a/common/buildcraft/builders/BuilderProxyClient.java b/common/buildcraft/builders/BuilderProxyClient.java index f847453b..941f0ef5 100644 --- a/common/buildcraft/builders/BuilderProxyClient.java +++ b/common/buildcraft/builders/BuilderProxyClient.java @@ -8,12 +8,19 @@ */ package buildcraft.builders; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; import buildcraft.builders.urbanism.TileUrbanist; +import buildcraft.core.lib.EntityBlock; +import buildcraft.core.lib.render.RenderVoid; import buildcraft.core.render.RenderBoxProvider; import buildcraft.core.render.RenderBuilder; public class BuilderProxyClient extends BuilderProxy { + public static IIcon drillTexture; + public static IIcon drillHeadTexture; @Override public void registerClientHook() { @@ -24,11 +31,29 @@ public class BuilderProxyClient extends BuilderProxy { public void registerBlockRenderers() { super.registerBlockRenderers(); + ClientRegistry.bindTileEntitySpecialRenderer(TileQuarry.class, new RenderBuilder()); ClientRegistry.bindTileEntitySpecialRenderer(TileUrbanist.class, new RenderBoxProvider()); ClientRegistry.bindTileEntitySpecialRenderer(TileArchitect.class, new RenderArchitect()); ClientRegistry.bindTileEntitySpecialRenderer(TileFiller.class, new RenderBuilder()); ClientRegistry.bindTileEntitySpecialRenderer(TileBuilder.class, new RenderBuilder()); ClientRegistry.bindTileEntitySpecialRenderer(TilePathMarker.class, new RenderPathMarker()); ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionMarker.class, new RenderConstructionMarker()); + + RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid()); + } + + + @Override + public EntityBlock newDrill(World w, double i, double j, double k, double l, double d, double e) { + EntityBlock eb = super.newDrill(w, i, j, k, l, d, e); + eb.texture = drillTexture; + return eb; + } + + @Override + public EntityBlock newDrillHead(World w, double i, double j, double k, double l, double d, double e) { + EntityBlock eb = super.newDrillHead(w, i, j, k, l, d, e); + eb.texture = drillHeadTexture; + return eb; } } diff --git a/common/buildcraft/factory/EntityMechanicalArm.java b/common/buildcraft/builders/EntityMechanicalArm.java similarity index 92% rename from common/buildcraft/factory/EntityMechanicalArm.java rename to common/buildcraft/builders/EntityMechanicalArm.java index 055d6db2..6715df63 100644 --- a/common/buildcraft/factory/EntityMechanicalArm.java +++ b/common/buildcraft/builders/EntityMechanicalArm.java @@ -6,7 +6,7 @@ * 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.factory; +package buildcraft.builders; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; @@ -66,11 +66,11 @@ public class EntityMechanicalArm extends Entity { } private void makeParts(World world) { - xArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 1, 0.5, 0.5); - yArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 1, 0.5); - zArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 0.5, 1); + xArm = BuilderProxy.proxy.newDrill(world, 0, 0, 0, 1, 0.5, 0.5); + yArm = BuilderProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 1, 0.5); + zArm = BuilderProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 0.5, 1); - head = FactoryProxy.proxy.newDrillHead(world, 0, 0, 0, 0.2, 1, 0.2); + head = BuilderProxy.proxy.newDrillHead(world, 0, 0, 0, 0.2, 1, 0.2); head.shadowSize = 1.0F; world.spawnEntityInWorld(xArm); diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/builders/TileQuarry.java similarity index 97% rename from common/buildcraft/factory/TileQuarry.java rename to common/buildcraft/builders/TileQuarry.java index d1c3ac15..172e75c7 100644 --- a/common/buildcraft/factory/TileQuarry.java +++ b/common/buildcraft/builders/TileQuarry.java @@ -6,7 +6,7 @@ * 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.factory; +package buildcraft.builders; import java.util.LinkedList; import java.util.List; @@ -29,8 +29,9 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Type; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftBuilders; import buildcraft.BuildCraftCore; -import buildcraft.BuildCraftFactory; +import buildcraft.BuildCraftBuilders; import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.IAreaProvider; @@ -146,7 +147,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI } public boolean areChunksLoaded() { - if (BuildCraftFactory.quarryLoadsChunks) { + if (BuildCraftBuilders.quarryLoadsChunks) { // Small optimization return true; } @@ -333,7 +334,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI Integer[][] columnHeights = new Integer[builder.blueprint.sizeX - 2][builder.blueprint.sizeZ - 2]; boolean[][] blockedColumns = new boolean[builder.blueprint.sizeX - 2][builder.blueprint.sizeZ - 2]; - for (int searchY = yCoord + 3; searchY >= Math.max(yCoord - BuildCraftFactory.miningDepth, 0); --searchY) { + for (int searchY = yCoord + 3; searchY >= yCoord; --searchY) { int startX, endX, incX; if (searchY % 2 == 0) { @@ -517,8 +518,8 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI private void setBoundaries(boolean useDefaultI) { boolean useDefault = useDefaultI; - if (BuildCraftFactory.quarryLoadsChunks && chunkTicket == null) { - chunkTicket = ForgeChunkManager.requestTicket(BuildCraftFactory.instance, worldObj, Type.NORMAL); + if (BuildCraftBuilders.quarryLoadsChunks && chunkTicket == null) { + chunkTicket = ForgeChunkManager.requestTicket(BuildCraftBuilders.instance, worldObj, Type.NORMAL); } if (chunkTicket != null) { chunkTicket.getModData().setInteger("quarryX", xCoord); @@ -606,7 +607,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI private void initializeBlueprintBuilder() { Blueprint bpt = ((FillerPattern) FillerManager.registry.getPattern("buildcraft:frame")) - .getBlueprint(box, worldObj, new IStatementParameter[0], BuildCraftFactory.frameBlock, 0); + .getBlueprint(box, worldObj, new IStatementParameter[0], BuildCraftBuilders.frameBlock, 0); if (bpt != null) { builder = new BptBuilderBlueprint(bpt, worldObj, box.xMin, yCoord, box.zMin); @@ -697,7 +698,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI @Override public ItemStack getStackInSlot(int i) { if (frameProducer) { - return new ItemStack(BuildCraftFactory.frameBlock); + return new ItemStack(BuildCraftBuilders.frameBlock); } else { return null; } @@ -706,7 +707,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI @Override public ItemStack decrStackSize(int i, int j) { if (frameProducer) { - return new ItemStack(BuildCraftFactory.frameBlock, j); + return new ItemStack(BuildCraftBuilders.frameBlock, j); } else { return null; } diff --git a/common/buildcraft/factory/BlockLEDHatchBase.java b/common/buildcraft/core/BlockLEDHatchBase.java similarity index 98% rename from common/buildcraft/factory/BlockLEDHatchBase.java rename to common/buildcraft/core/BlockLEDHatchBase.java index fbc677ac..5906de93 100644 --- a/common/buildcraft/factory/BlockLEDHatchBase.java +++ b/common/buildcraft/core/BlockLEDHatchBase.java @@ -1,4 +1,4 @@ -package buildcraft.factory; +package buildcraft.core; import net.minecraft.block.Block; import net.minecraft.block.material.Material; diff --git a/common/buildcraft/core/builders/schematics/SchematicFree.java b/common/buildcraft/core/builders/schematics/SchematicFree.java new file mode 100644 index 00000000..a5d812b7 --- /dev/null +++ b/common/buildcraft/core/builders/schematics/SchematicFree.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2015, 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.core.builders.schematics; + +import java.util.LinkedList; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import buildcraft.api.blueprints.IBuilderContext; +import buildcraft.api.blueprints.SchematicBlock; + +public class SchematicFree extends SchematicBlock { + @Override + public void getRequirementsForPlacement(IBuilderContext context, LinkedList requirements) { + + } + + @Override + public void storeRequirements(IBuilderContext context, int x, int y, int z) { + // cancel requirements reading + } +} diff --git a/common/buildcraft/core/config/ConfigManager.java b/common/buildcraft/core/config/ConfigManager.java index 307505bc..e4dad954 100644 --- a/common/buildcraft/core/config/ConfigManager.java +++ b/common/buildcraft/core/config/ConfigManager.java @@ -75,9 +75,13 @@ public class ConfigManager implements IModGuiFactory { parent.setLanguageKey("config." + parent.getQualifiedName()); parent = parent.parent; } - - Property p = create(suffix, property); - c.put(suffix, p); + Property p; + if (c.get(suffix) != null) { + p = c.get(suffix); + } else { + p = create(suffix, property); + c.put(suffix, p); + } p.comment = comment; RestartRequirement r = restartRequirement; p.setLanguageKey("config." + name); diff --git a/common/buildcraft/factory/BlockMiningWell.java b/common/buildcraft/factory/BlockMiningWell.java index 9455251d..84142632 100644 --- a/common/buildcraft/factory/BlockMiningWell.java +++ b/common/buildcraft/factory/BlockMiningWell.java @@ -14,6 +14,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import buildcraft.BuildCraftFactory; +import buildcraft.core.BlockLEDHatchBase; public class BlockMiningWell extends BlockLEDHatchBase { public BlockMiningWell() { diff --git a/common/buildcraft/factory/FactoryProxy.java b/common/buildcraft/factory/FactoryProxy.java index 9df687e9..d8752ae4 100644 --- a/common/buildcraft/factory/FactoryProxy.java +++ b/common/buildcraft/factory/FactoryProxy.java @@ -28,14 +28,4 @@ public class FactoryProxy { public EntityBlock newPumpTube(World w) { return new EntityBlock(w); } - - public EntityBlock newDrill(World w, double i, double j, double k, - double l, double d, double e) { - return new EntityBlock(w, i, j, k, l, d, e); - } - - public EntityBlock newDrillHead(World w, double i, double j, double k, - double l, double d, double e) { - return new EntityBlock(w, i, j, k, l, d, e); - } } diff --git a/common/buildcraft/factory/FactoryProxyClient.java b/common/buildcraft/factory/FactoryProxyClient.java index bd46d830..729ca7a3 100644 --- a/common/buildcraft/factory/FactoryProxyClient.java +++ b/common/buildcraft/factory/FactoryProxyClient.java @@ -17,7 +17,6 @@ import buildcraft.BuildCraftFactory; import buildcraft.api.core.BCLog; import buildcraft.core.lib.EntityBlock; import buildcraft.core.lib.render.RenderVoid; -import buildcraft.core.render.RenderBuilder; import buildcraft.core.render.RenderingEntityBlocks; import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex; import buildcraft.factory.gui.GuiAutoCrafting; @@ -26,10 +25,7 @@ import buildcraft.factory.render.RenderRefinery; import buildcraft.factory.render.RenderTank; public class FactoryProxyClient extends FactoryProxy { - public static IIcon pumpTexture; - public static IIcon drillTexture; - public static IIcon drillHeadTexture; @Override public void initializeTileEntities() { @@ -48,13 +44,10 @@ public class FactoryProxyClient extends FactoryProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileHopper.class, new RenderHopper()); RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper()); } - - ClientRegistry.bindTileEntitySpecialRenderer(TileQuarry.class, new RenderBuilder()); } @Override public void initializeEntityRenders() { - RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid()); } @Override @@ -75,18 +68,4 @@ public class FactoryProxyClient extends FactoryProxy { eb.texture = pumpTexture; return eb; } - - @Override - public EntityBlock newDrill(World w, double i, double j, double k, double l, double d, double e) { - EntityBlock eb = super.newDrill(w, i, j, k, l, d, e); - eb.texture = drillTexture; - return eb; - } - - @Override - public EntityBlock newDrillHead(World w, double i, double j, double k, double l, double d, double e) { - EntityBlock eb = super.newDrillHead(w, i, j, k, l, d, e); - eb.texture = drillHeadTexture; - return eb; - } }