Move marker and path marker to Core, close #2834
This commit is contained in:
parent
1c73dd18c7
commit
0a88284e24
16 changed files with 64 additions and 98 deletions
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -67,14 +67,11 @@ import buildcraft.builders.BlockBuilder;
|
||||||
import buildcraft.builders.BlockConstructionMarker;
|
import buildcraft.builders.BlockConstructionMarker;
|
||||||
import buildcraft.builders.BlockFiller;
|
import buildcraft.builders.BlockFiller;
|
||||||
import buildcraft.builders.BlockFrame;
|
import buildcraft.builders.BlockFrame;
|
||||||
import buildcraft.builders.BlockMarker;
|
|
||||||
import buildcraft.builders.BlockPathMarker;
|
|
||||||
import buildcraft.builders.BlockQuarry;
|
import buildcraft.builders.BlockQuarry;
|
||||||
import buildcraft.builders.BlueprintServerDatabase;
|
import buildcraft.builders.BlueprintServerDatabase;
|
||||||
import buildcraft.builders.BuilderProxy;
|
import buildcraft.builders.BuilderProxy;
|
||||||
import buildcraft.builders.BuilderProxyClient;
|
import buildcraft.builders.BuilderProxyClient;
|
||||||
import buildcraft.builders.BuildersGuiHandler;
|
import buildcraft.builders.BuildersGuiHandler;
|
||||||
import buildcraft.builders.EventHandlerBuilders;
|
|
||||||
import buildcraft.builders.HeuristicBlockDetection;
|
import buildcraft.builders.HeuristicBlockDetection;
|
||||||
import buildcraft.builders.ItemBlueprintStandard;
|
import buildcraft.builders.ItemBlueprintStandard;
|
||||||
import buildcraft.builders.ItemBlueprintTemplate;
|
import buildcraft.builders.ItemBlueprintTemplate;
|
||||||
|
@ -87,8 +84,8 @@ import buildcraft.builders.TileBlueprintLibrary;
|
||||||
import buildcraft.builders.TileBuilder;
|
import buildcraft.builders.TileBuilder;
|
||||||
import buildcraft.builders.TileConstructionMarker;
|
import buildcraft.builders.TileConstructionMarker;
|
||||||
import buildcraft.builders.TileFiller;
|
import buildcraft.builders.TileFiller;
|
||||||
import buildcraft.builders.TileMarker;
|
import buildcraft.core.TileMarker;
|
||||||
import buildcraft.builders.TilePathMarker;
|
import buildcraft.core.TilePathMarker;
|
||||||
import buildcraft.builders.TileQuarry;
|
import buildcraft.builders.TileQuarry;
|
||||||
import buildcraft.builders.blueprints.RealBlueprintDeployer;
|
import buildcraft.builders.blueprints.RealBlueprintDeployer;
|
||||||
import buildcraft.builders.schematics.SchematicAir;
|
import buildcraft.builders.schematics.SchematicAir;
|
||||||
|
@ -146,8 +143,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
@Mod.Instance("BuildCraft|Builders")
|
@Mod.Instance("BuildCraft|Builders")
|
||||||
public static BuildCraftBuilders instance;
|
public static BuildCraftBuilders instance;
|
||||||
|
|
||||||
public static BlockMarker markerBlock;
|
|
||||||
public static BlockPathMarker pathMarkerBlock;
|
|
||||||
public static BlockConstructionMarker constructionMarkerBlock;
|
public static BlockConstructionMarker constructionMarkerBlock;
|
||||||
public static BlockFiller fillerBlock;
|
public static BlockFiller fillerBlock;
|
||||||
public static BlockBuilder builderBlock;
|
public static BlockBuilder builderBlock;
|
||||||
|
@ -350,12 +345,8 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void init(FMLInitializationEvent evt) {
|
public void init(FMLInitializationEvent evt) {
|
||||||
// Register gui handler
|
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new BuildersGuiHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new BuildersGuiHandler());
|
||||||
|
|
||||||
// Register save handler
|
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHandlerBuilders());
|
|
||||||
|
|
||||||
// Standard blocks
|
// Standard blocks
|
||||||
ISchematicRegistry schemes = BuilderAPI.schematicRegistry;
|
ISchematicRegistry schemes = BuilderAPI.schematicRegistry;
|
||||||
schemes.registerSchematicBlock(Blocks.air, SchematicAir.class);
|
schemes.registerSchematicBlock(Blocks.air, SchematicAir.class);
|
||||||
|
@ -503,9 +494,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
schemes.registerSchematicBlock(architectBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
|
schemes.registerSchematicBlock(architectBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
|
||||||
schemes.registerSchematicBlock(builderBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
|
schemes.registerSchematicBlock(builderBlock, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
|
||||||
|
|
||||||
// Landmarks are often caught incorrectly, making building them counter-productive.
|
|
||||||
schemes.registerSchematicBlock(markerBlock, SchematicIgnore.class);
|
|
||||||
schemes.registerSchematicBlock(pathMarkerBlock, SchematicIgnore.class);
|
|
||||||
schemes.registerSchematicBlock(constructionMarkerBlock, SchematicIgnore.class);
|
schemes.registerSchematicBlock(constructionMarkerBlock, SchematicIgnore.class);
|
||||||
schemes.registerSchematicBlock(frameBlock, SchematicFree.class);
|
schemes.registerSchematicBlock(frameBlock, SchematicFree.class);
|
||||||
|
|
||||||
|
@ -548,12 +536,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
quarryBlock = (BlockQuarry) CompatHooks.INSTANCE.getBlock(BlockQuarry.class);
|
quarryBlock = (BlockQuarry) CompatHooks.INSTANCE.getBlock(BlockQuarry.class);
|
||||||
CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
|
CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
|
||||||
|
|
||||||
markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);
|
|
||||||
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
|
|
||||||
|
|
||||||
pathMarkerBlock = (BlockPathMarker) CompatHooks.INSTANCE.getBlock(BlockPathMarker.class);
|
|
||||||
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
|
|
||||||
|
|
||||||
constructionMarkerBlock = (BlockConstructionMarker) CompatHooks.INSTANCE.getBlock(BlockConstructionMarker.class);
|
constructionMarkerBlock = (BlockConstructionMarker) CompatHooks.INSTANCE.getBlock(BlockConstructionMarker.class);
|
||||||
CoreProxy.proxy.registerBlock(constructionMarkerBlock.setBlockName("constructionMarkerBlock"),
|
CoreProxy.proxy.registerBlock(constructionMarkerBlock.setBlockName("constructionMarkerBlock"),
|
||||||
ItemConstructionMarker.class);
|
ItemConstructionMarker.class);
|
||||||
|
@ -618,25 +600,19 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), "ppp", "pip", "ppp", 'i',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), "ppp", "pip", "ppp", 'i',
|
||||||
new ItemStack(Items.dye, 1, 4), 'p', Items.paper);
|
new ItemStack(Items.dye, 1, 4), 'p', Items.paper);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), "l ", "r ", 'l',
|
|
||||||
new ItemStack(Items.dye, 1, 4), 'r', Blocks.redstone_torch);
|
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), "l ", "r ", 'l',
|
|
||||||
"dyeGreen", 'r', Blocks.redstone_torch);
|
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(constructionMarkerBlock, 1), "l ", "r ", 'l',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(constructionMarkerBlock, 1), "l ", "r ", 'l',
|
||||||
"gearGold", 'r', Blocks.redstone_torch);
|
"gearGold", 'r', Blocks.redstone_torch);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), "btb", "ycy", "gCg", 'b',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), "btb", "ycy", "gCg", 'b',
|
||||||
"dyeBlack", 't', markerBlock, 'y', "dyeYellow",
|
"dyeBlack", 't', BuildCraftCore.markerBlock, 'y', "dyeYellow",
|
||||||
'c', Blocks.crafting_table, 'g', "gearGold", 'C', Blocks.chest);
|
'c', Blocks.crafting_table, 'g', "gearGold", 'C', Blocks.chest);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), "btb", "ycy", "gCg", 'b',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), "btb", "ycy", "gCg", 'b',
|
||||||
"dyeBlack", 't', markerBlock, 'y', "dyeYellow",
|
"dyeBlack", 't', BuildCraftCore.markerBlock, 'y', "dyeYellow",
|
||||||
'c', Blocks.crafting_table, 'g', "gearDiamond", 'C', Blocks.chest);
|
'c', Blocks.crafting_table, 'g', "gearDiamond", 'C', Blocks.chest);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), "btb", "ycy", "gCg", 'b',
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), "btb", "ycy", "gCg", 'b',
|
||||||
"dyeBlack", 't', markerBlock, 'y', "dyeYellow",
|
"dyeBlack", 't', BuildCraftCore.markerBlock, 'y', "dyeYellow",
|
||||||
'c', Blocks.crafting_table, 'g', "gearDiamond", 'C',
|
'c', Blocks.crafting_table, 'g', "gearDiamond", 'C',
|
||||||
new ItemStack(blueprintItem, 1));
|
new ItemStack(blueprintItem, 1));
|
||||||
|
|
||||||
|
@ -668,16 +644,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void whiteListAppliedEnergetics(FMLInitializationEvent event) {
|
public void whiteListAppliedEnergetics(FMLInitializationEvent event) {
|
||||||
//FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
|
||||||
// TileMarker.class.getCanonicalName());
|
|
||||||
//FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
|
||||||
// TileFiller.class.getCanonicalName());
|
|
||||||
//FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
|
||||||
// TileBuilder.class.getCanonicalName());
|
|
||||||
//FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
|
||||||
// TileArchitect.class.getCanonicalName());
|
|
||||||
//FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
|
||||||
// TilePathMarker.class.getCanonicalName());
|
|
||||||
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
||||||
TileBlueprintLibrary.class.getCanonicalName());
|
TileBlueprintLibrary.class.getCanonicalName());
|
||||||
}
|
}
|
||||||
|
@ -692,6 +658,18 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
} else {
|
} else {
|
||||||
mapping.remap(BuildCraftCore.buildToolBlock);
|
mapping.remap(BuildCraftCore.buildToolBlock);
|
||||||
}
|
}
|
||||||
|
} else if (mapping.name.equals("BuildCraft|Builders:markerBlock")) {
|
||||||
|
if (mapping.type == GameRegistry.Type.ITEM) {
|
||||||
|
mapping.remap(Item.getItemFromBlock(BuildCraftCore.markerBlock));
|
||||||
|
} else {
|
||||||
|
mapping.remap(BuildCraftCore.markerBlock);
|
||||||
|
}
|
||||||
|
} else if (mapping.name.equals("BuildCraft|Builders:pathMarkerBlock")) {
|
||||||
|
if (mapping.type == GameRegistry.Type.ITEM) {
|
||||||
|
mapping.remap(Item.getItemFromBlock(BuildCraftCore.pathMarkerBlock));
|
||||||
|
} else {
|
||||||
|
mapping.remap(BuildCraftCore.pathMarkerBlock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@ import buildcraft.core.AchievementManager;
|
||||||
import buildcraft.core.BCCreativeTab;
|
import buildcraft.core.BCCreativeTab;
|
||||||
import buildcraft.core.BlockBuildTool;
|
import buildcraft.core.BlockBuildTool;
|
||||||
import buildcraft.core.BlockEngine;
|
import buildcraft.core.BlockEngine;
|
||||||
|
import buildcraft.core.BlockMarker;
|
||||||
|
import buildcraft.core.BlockPathMarker;
|
||||||
import buildcraft.core.BlockSpring;
|
import buildcraft.core.BlockSpring;
|
||||||
import buildcraft.core.CompatHooks;
|
import buildcraft.core.CompatHooks;
|
||||||
import buildcraft.core.CoreGuiHandler;
|
import buildcraft.core.CoreGuiHandler;
|
||||||
|
@ -93,6 +95,7 @@ import buildcraft.core.SchematicEngine;
|
||||||
import buildcraft.core.SpringPopulate;
|
import buildcraft.core.SpringPopulate;
|
||||||
import buildcraft.core.TickHandlerCore;
|
import buildcraft.core.TickHandlerCore;
|
||||||
import buildcraft.core.TileEngineWood;
|
import buildcraft.core.TileEngineWood;
|
||||||
|
import buildcraft.core.TilePathMarker;
|
||||||
import buildcraft.core.Version;
|
import buildcraft.core.Version;
|
||||||
import buildcraft.core.blueprints.SchematicRegistry;
|
import buildcraft.core.blueprints.SchematicRegistry;
|
||||||
import buildcraft.core.builders.patterns.FillerPattern;
|
import buildcraft.core.builders.patterns.FillerPattern;
|
||||||
|
@ -110,6 +113,7 @@ import buildcraft.core.builders.patterns.PatternParameterXZDir;
|
||||||
import buildcraft.core.builders.patterns.PatternParameterYDir;
|
import buildcraft.core.builders.patterns.PatternParameterYDir;
|
||||||
import buildcraft.core.builders.patterns.PatternPyramid;
|
import buildcraft.core.builders.patterns.PatternPyramid;
|
||||||
import buildcraft.core.builders.patterns.PatternStairs;
|
import buildcraft.core.builders.patterns.PatternStairs;
|
||||||
|
import buildcraft.core.builders.schematics.SchematicIgnore;
|
||||||
import buildcraft.core.command.SubCommandChangelog;
|
import buildcraft.core.command.SubCommandChangelog;
|
||||||
import buildcraft.core.command.SubCommandVersion;
|
import buildcraft.core.command.SubCommandVersion;
|
||||||
import buildcraft.core.config.BuildCraftConfiguration;
|
import buildcraft.core.config.BuildCraftConfiguration;
|
||||||
|
@ -193,6 +197,8 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
public static ConfigManager mainConfigManager;
|
public static ConfigManager mainConfigManager;
|
||||||
|
|
||||||
public static BlockEngine engineBlock;
|
public static BlockEngine engineBlock;
|
||||||
|
public static BlockMarker markerBlock;
|
||||||
|
public static BlockPathMarker pathMarkerBlock;
|
||||||
public static Block springBlock;
|
public static Block springBlock;
|
||||||
public static BlockBuildTool buildToolBlock;
|
public static BlockBuildTool buildToolBlock;
|
||||||
public static Item woodenGearItem;
|
public static Item woodenGearItem;
|
||||||
|
@ -365,6 +371,12 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), "tile.engineWood");
|
engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), "tile.engineWood");
|
||||||
CoreProxy.proxy.registerTileEntity(TileEngineWood.class, "net.minecraft.src.buildcraft.energy.TileEngineWood");
|
CoreProxy.proxy.registerTileEntity(TileEngineWood.class, "net.minecraft.src.buildcraft.energy.TileEngineWood");
|
||||||
|
|
||||||
|
markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);
|
||||||
|
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
|
||||||
|
|
||||||
|
pathMarkerBlock = (BlockPathMarker) CompatHooks.INSTANCE.getBlock(BlockPathMarker.class);
|
||||||
|
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
|
||||||
|
|
||||||
FMLCommonHandler.instance().bus().register(this);
|
FMLCommonHandler.instance().bus().register(this);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
MinecraftForge.EVENT_BUS.register(new BlockHighlightHandler());
|
MinecraftForge.EVENT_BUS.register(new BlockHighlightHandler());
|
||||||
|
@ -495,6 +507,10 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
BuildCraftAPI.registerWorldProperty("dirt", new WorldPropertyIsDirt());
|
BuildCraftAPI.registerWorldProperty("dirt", new WorldPropertyIsDirt());
|
||||||
BuildCraftAPI.registerWorldProperty("fluidSource", new WorldPropertyIsFluidSource());
|
BuildCraftAPI.registerWorldProperty("fluidSource", new WorldPropertyIsFluidSource());
|
||||||
|
|
||||||
|
// Landmarks are often caught incorrectly, making building them counter-productive.
|
||||||
|
SchematicRegistry.INSTANCE.registerSchematicBlock(markerBlock, SchematicIgnore.class);
|
||||||
|
SchematicRegistry.INSTANCE.registerSchematicBlock(pathMarkerBlock, SchematicIgnore.class);
|
||||||
|
|
||||||
ColorUtils.initialize();
|
ColorUtils.initialize();
|
||||||
|
|
||||||
actionControl = new IActionExternal[IControllable.Mode.values().length];
|
actionControl = new IActionExternal[IControllable.Mode.values().length];
|
||||||
|
@ -624,6 +640,12 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
"www", " g ", "GpG", 'w', "plankWood", 'g', "blockGlass", 'G',
|
"www", " g ", "GpG", 'w', "plankWood", 'g', "blockGlass", 'G',
|
||||||
"gearWood", 'p', Blocks.piston);
|
"gearWood", 'p', Blocks.piston);
|
||||||
|
|
||||||
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), "l ", "r ", 'l',
|
||||||
|
new ItemStack(Items.dye, 1, 4), 'r', Blocks.redstone_torch);
|
||||||
|
|
||||||
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), "l ", "r ", 'l',
|
||||||
|
"dyeGreen", 'r', Blocks.redstone_torch);
|
||||||
|
|
||||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(paintbrushItem), " iw", " gi", "s ",
|
CoreProxy.proxy.addCraftingRecipe(new ItemStack(paintbrushItem), " iw", " gi", "s ",
|
||||||
's', "stickWood", 'g', "gearWood", 'w', new ItemStack(Blocks.wool, 1, 0), 'i', Items.string);
|
's', "stickWood", 'g', "gearWood", 'w', new ItemStack(Blocks.wool, 1, 0), 'i', Items.string);
|
||||||
|
|
||||||
|
@ -705,9 +727,12 @@ public class BuildCraftCore extends BuildCraftMod {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void cleanRegistries(WorldEvent.Unload unload) {
|
public void cleanRegistries(WorldEvent.Unload event) {
|
||||||
for (IWorldProperty property : BuildCraftAPI.worldProperties.values()) {
|
for (IWorldProperty property : BuildCraftAPI.worldProperties.values()) {
|
||||||
property.clear();
|
property.clear();
|
||||||
}
|
}
|
||||||
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||||
|
TilePathMarker.clearAvailableMarkersList(event.world);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
|
|
||||||
import buildcraft.api.tools.IToolWrench;
|
import buildcraft.api.tools.IToolWrench;
|
||||||
|
import buildcraft.core.BlockMarker;
|
||||||
import buildcraft.core.lib.utils.BlockUtils;
|
import buildcraft.core.lib.utils.BlockUtils;
|
||||||
import buildcraft.core.lib.utils.Utils;
|
import buildcraft.core.lib.utils.Utils;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ public class BuilderProxyClient extends BuilderProxy {
|
||||||
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileUrbanist.class, new RenderBoxProvider());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileUrbanist.class, new RenderBoxProvider());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBuilder.class, new RenderBuilderTile());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileBuilder.class, new RenderBuilderTile());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePathMarker.class, new RenderPathMarker());
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionMarker.class, new RenderConstructionMarker());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionMarker.class, new RenderConstructionMarker());
|
||||||
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFiller.class, new RenderMultiTESR(new TileEntitySpecialRenderer[] {
|
ClientRegistry.bindTileEntitySpecialRenderer(TileFiller.class, new RenderMultiTESR(new TileEntitySpecialRenderer[] {
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.builders;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
|
||||||
|
|
||||||
public class EventHandlerBuilders {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void handleWorldLoad(WorldEvent.Load event) {
|
|
||||||
// Temporary solution
|
|
||||||
// Please remove the world Load event when world Unload event gets implimented
|
|
||||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
|
||||||
TilePathMarker.clearAvailableMarkersList(event.world);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void handleWorldUnload(WorldEvent.Unload event) {
|
|
||||||
// When a world unloads clean from the list of available markers the ones
|
|
||||||
// that were on the unloaded world
|
|
||||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
|
||||||
TilePathMarker.clearAvailableMarkersList(event.world);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -49,6 +49,7 @@ import buildcraft.builders.blueprints.RecursiveBlueprintBuilder;
|
||||||
import buildcraft.core.Box;
|
import buildcraft.core.Box;
|
||||||
import buildcraft.core.Box.Kind;
|
import buildcraft.core.Box.Kind;
|
||||||
import buildcraft.core.LaserData;
|
import buildcraft.core.LaserData;
|
||||||
|
import buildcraft.core.TilePathMarker;
|
||||||
import buildcraft.core.blueprints.Blueprint;
|
import buildcraft.core.blueprints.Blueprint;
|
||||||
import buildcraft.core.blueprints.BlueprintBase;
|
import buildcraft.core.blueprints.BlueprintBase;
|
||||||
import buildcraft.core.blueprints.BptBuilderBase;
|
import buildcraft.core.blueprints.BptBuilderBase;
|
||||||
|
@ -259,7 +260,7 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid
|
||||||
for (BlockIndex b : path) {
|
for (BlockIndex b : path) {
|
||||||
worldObj.setBlockToAir(b.x, b.y, b.z);
|
worldObj.setBlockToAir(b.x, b.y, b.z);
|
||||||
|
|
||||||
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(
|
BuildCraftCore.pathMarkerBlock.dropBlockAsItem(
|
||||||
worldObj, b.x, b.y, b.z,
|
worldObj, b.x, b.y, b.z,
|
||||||
0, 0);
|
0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import buildcraft.api.tiles.IControllable;
|
||||||
import buildcraft.api.tiles.IHasWork;
|
import buildcraft.api.tiles.IHasWork;
|
||||||
import buildcraft.core.Box;
|
import buildcraft.core.Box;
|
||||||
import buildcraft.core.Box.Kind;
|
import buildcraft.core.Box.Kind;
|
||||||
|
import buildcraft.core.TileMarker;
|
||||||
import buildcraft.core.blueprints.BptBuilderTemplate;
|
import buildcraft.core.blueprints.BptBuilderTemplate;
|
||||||
import buildcraft.core.blueprints.BptContext;
|
import buildcraft.core.blueprints.BptContext;
|
||||||
import buildcraft.core.builders.TileAbstractBuilder;
|
import buildcraft.core.builders.TileAbstractBuilder;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.core;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
@ -19,7 +19,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.api.items.IMapLocation;
|
import buildcraft.api.items.IMapLocation;
|
||||||
import buildcraft.core.BCCreativeTab;
|
|
||||||
import buildcraft.core.lib.block.BlockBuildCraft;
|
import buildcraft.core.lib.block.BlockBuildCraft;
|
||||||
|
|
||||||
public class BlockMarker extends BlockBuildCraft {
|
public class BlockMarker extends BlockBuildCraft {
|
|
@ -6,7 +6,7 @@
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.core;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
|
@ -6,7 +6,7 @@
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.core;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import buildcraft.core.EntityLaser;
|
|
||||||
import buildcraft.core.LaserData;
|
|
||||||
import buildcraft.core.render.RenderLaser;
|
import buildcraft.core.render.RenderLaser;
|
||||||
|
|
||||||
public class RenderPathMarker extends TileEntitySpecialRenderer {
|
public class RenderPathMarker extends TileEntitySpecialRenderer {
|
|
@ -6,7 +6,7 @@
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.core;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
@ -15,12 +15,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.api.core.ISerializable;
|
import buildcraft.api.core.ISerializable;
|
||||||
import buildcraft.api.core.Position;
|
import buildcraft.api.core.Position;
|
||||||
import buildcraft.api.tiles.ITileAreaProvider;
|
import buildcraft.api.tiles.ITileAreaProvider;
|
||||||
import buildcraft.core.DefaultProps;
|
|
||||||
import buildcraft.core.LaserKind;
|
|
||||||
import buildcraft.core.lib.EntityBlock;
|
import buildcraft.core.lib.EntityBlock;
|
||||||
import buildcraft.core.lib.block.TileBuildCraft;
|
import buildcraft.core.lib.block.TileBuildCraft;
|
||||||
import buildcraft.core.lib.utils.Utils;
|
import buildcraft.core.lib.utils.Utils;
|
||||||
|
@ -222,7 +220,7 @@ public class TileMarker extends TileBuildCraft implements ITileAreaProvider {
|
||||||
|
|
||||||
Block block = worldObj.getBlock(coords[0], coords[1], coords[2]);
|
Block block = worldObj.getBlock(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (block == BuildCraftBuilders.markerBlock) {
|
if (block == BuildCraftCore.markerBlock) {
|
||||||
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (linkTo(marker, n)) {
|
if (linkTo(marker, n)) {
|
||||||
|
@ -235,7 +233,7 @@ public class TileMarker extends TileBuildCraft implements ITileAreaProvider {
|
||||||
|
|
||||||
block = worldObj.getBlock(coords[0], coords[1], coords[2]);
|
block = worldObj.getBlock(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (block == BuildCraftBuilders.markerBlock) {
|
if (block == BuildCraftCore.markerBlock) {
|
||||||
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
TileMarker marker = (TileMarker) worldObj.getTileEntity(coords[0], coords[1], coords[2]);
|
||||||
|
|
||||||
if (linkTo(marker, n)) {
|
if (linkTo(marker, n)) {
|
||||||
|
@ -459,13 +457,13 @@ public class TileMarker extends TileBuildCraft implements ITileAreaProvider {
|
||||||
if (m.isSet()) {
|
if (m.isSet()) {
|
||||||
worldObj.setBlockToAir(m.x, m.y, m.z);
|
worldObj.setBlockToAir(m.x, m.y, m.z);
|
||||||
|
|
||||||
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, 0, 0);
|
BuildCraftCore.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
worldObj.setBlockToAir(o.vectO.x, o.vectO.y, o.vectO.z);
|
worldObj.setBlockToAir(o.vectO.x, o.vectO.y, o.vectO.z);
|
||||||
|
|
||||||
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, 0, 0);
|
BuildCraftCore.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -6,7 +6,7 @@
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
package buildcraft.builders;
|
package buildcraft.core;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -21,8 +21,6 @@ import net.minecraft.world.World;
|
||||||
import buildcraft.api.core.BlockIndex;
|
import buildcraft.api.core.BlockIndex;
|
||||||
import buildcraft.api.core.IPathProvider;
|
import buildcraft.api.core.IPathProvider;
|
||||||
import buildcraft.api.core.Position;
|
import buildcraft.api.core.Position;
|
||||||
import buildcraft.core.DefaultProps;
|
|
||||||
import buildcraft.core.LaserData;
|
|
||||||
|
|
||||||
public class TilePathMarker extends TileMarker implements IPathProvider {
|
public class TilePathMarker extends TileMarker implements IPathProvider {
|
||||||
// A list with the pathMarkers that aren't fully connected
|
// A list with the pathMarkers that aren't fully connected
|
||||||
|
@ -275,6 +273,7 @@ public class TilePathMarker extends TileMarker implements IPathProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChunkUnload() {
|
public void onChunkUnload() {
|
||||||
|
super.onChunkUnload();
|
||||||
availableMarkers.remove(this);
|
availableMarkers.remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +284,7 @@ public class TilePathMarker extends TileMarker implements IPathProvider {
|
||||||
public static void clearAvailableMarkersList(World w) {
|
public static void clearAvailableMarkersList(World w) {
|
||||||
for (Iterator<TilePathMarker> it = availableMarkers.iterator(); it.hasNext();) {
|
for (Iterator<TilePathMarker> it = availableMarkers.iterator(); it.hasNext();) {
|
||||||
TilePathMarker t = it.next();
|
TilePathMarker t = it.next();
|
||||||
if (t.getWorldObj().provider.dimensionId != w.provider.dimensionId) {
|
if (t.getWorldObj().provider.dimensionId == w.provider.dimensionId) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,6 +27,8 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.core.LaserKind;
|
import buildcraft.core.LaserKind;
|
||||||
|
import buildcraft.core.RenderPathMarker;
|
||||||
|
import buildcraft.core.TilePathMarker;
|
||||||
import buildcraft.core.lib.EntityBlock;
|
import buildcraft.core.lib.EntityBlock;
|
||||||
import buildcraft.core.lib.engines.RenderEngine;
|
import buildcraft.core.lib.engines.RenderEngine;
|
||||||
import buildcraft.core.lib.engines.TileEngineBase;
|
import buildcraft.core.lib.engines.TileEngineBase;
|
||||||
|
@ -89,6 +91,7 @@ public class CoreProxyClient extends CoreProxy {
|
||||||
RenderingRegistry.registerBlockHandler(BuildCraftCore.legacyPipeModel, new RenderingEntityBlocks());
|
RenderingRegistry.registerBlockHandler(BuildCraftCore.legacyPipeModel, new RenderingEntityBlocks());
|
||||||
RenderingRegistry.registerBlockHandler(new RenderingMarkers());
|
RenderingRegistry.registerBlockHandler(new RenderingMarkers());
|
||||||
RenderingRegistry.registerBlockHandler(BuildCraftCore.complexBlockModel, new RenderBlockComplex());
|
RenderingRegistry.registerBlockHandler(BuildCraftCore.complexBlockModel, new RenderBlockComplex());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TilePathMarker.class, new RenderPathMarker());
|
||||||
|
|
||||||
//TODO Update me to grab differing trunk textures
|
//TODO Update me to grab differing trunk textures
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine());
|
||||||
|
|
Loading…
Reference in a new issue