Skip to content

Commit

Permalink
Large number of misc changes:
Browse files Browse the repository at this point in the history
 - Move Tags into the BC_module_ classes
 - Fix NbtSquish* not being able to handle larger tag compounds
 - Work on the power flow impl. Not finished yet, this is the first test.
 - Fix a crashing bug related to the help system being used on the server.
 - Change MutableQuad to use "vertex_#" rather than "vertex[#]".
 - Add a few useful methods to MutableQuad and MutableVertex (less "for (MutableVertex v : q.verticies()) { doThing(v);}"
  • Loading branch information
AlexIIL committed Jan 15, 2017
1 parent 1a9e4c3 commit 3ff9c1e
Show file tree
Hide file tree
Showing 51 changed files with 1,717 additions and 769 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ run_server

#Custom code to inject the the dev environment
custom
test-results

#licnse_checker
# Not in git because it contains names + emails.
Expand Down
2 changes: 1 addition & 1 deletion buildcraft_resources/assets/buildcraft/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ itemGroup.buildcraft.boards=BuildCraft Robots
itemGroup.buildcraft.main=BuildCraft
itemGroup.buildcraft.pipes=BuildCraft Pipes
itemGroup.buildcraft.facades=BuildCraft Facades
itemGroup.buildcraft.gates=BuildCraft Gates
itemGroup.buildcraft.plugs=BuildCraft Pluggables

tile.architectBlock.name=Architect Table
tile.assemblyTableBlock.name=Assembly Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"#all":"buildcrafttransport:pipes/plug",
"particle":"#all"
},
"shade": true,
"elements": [
{
"from": [ 2, 4, 4 ],
"to": [ 4, 12, 12 ],
"shade": true,
"faces": {
"down": { "uv": [ 2, 4, 4, 12 ], "texture": "#all" },
"up": { "uv": [ 2, 4, 4, 12 ], "texture": "#all" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"#all":"buildcrafttransport:plugs/daylight_sensor",
"particle":"#all"
},
"shade": true,
"elements": [
{
"from": [ 2, 5, 5 ],
"to": [ 4, 11, 11 ],
"shade": true,
"faces": {
"down": { "uv": [ 5, 11, 11, 13 ], "texture": "#all" },
"up": { "uv": [ 5, 11, 11, 13 ], "texture": "#all" },
"north": { "uv": [ 5, 11, 11, 13 ], "texture": "#all" },
"south": { "uv": [ 5, 11, 11, 13 ], "texture": "#all" },
"down": { "uv": [ 3, 5, 5, 11 ], "texture": "#all" },
"up": { "uv": [ 3, 5, 5, 11 ], "texture": "#all" },
"north": { "uv": [ 3, 5, 5, 11 ], "texture": "#all" },
"south": { "uv": [ 3, 5, 5, 11 ], "texture": "#all" },
"west": { "uv": [ 5, 5, 11, 11 ], "texture": "#all" },
"east": { "uv": [ 5, 5, 11, 11 ], "texture": "#all" }
}
Expand Down
46 changes: 46 additions & 0 deletions common/buildcraft/builders/BCBuilders.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package buildcraft.builders;

import java.util.function.Consumer;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.network.NetworkRegistry;
Expand All @@ -12,6 +14,9 @@
import buildcraft.core.BCCore;
import buildcraft.lib.BCLib;
import buildcraft.lib.registry.RegistryHelper;
import buildcraft.lib.registry.TagManager;
import buildcraft.lib.registry.TagManager.EnumTagType;
import buildcraft.lib.registry.TagManager.TagEntry;

//@formatter:off
@Mod(modid = BCBuilders.MODID,
Expand Down Expand Up @@ -56,4 +61,45 @@ public static void onServerStarting(FMLServerStartingEvent event) {
public static void onServerStopping(FMLServerStoppingEvent event) {
PerSaveBptStorage.onServerStopping();
}

static {
startBatch();
// Items
registerTag("item.schematic.single").reg("schematic_single").locale("schematicSingle").model("schematic_single/");
registerTag("item.blueprint").reg("blueprint").locale("blueprintItem").model("blueprint/");
// Item Blocks
registerTag("item.block.architect").reg("architect").locale("architectBlock").model("architect");
registerTag("item.block.builder").reg("builder").locale("builderBlock").model("builder");
registerTag("item.block.filler").reg("filler").locale("fillerBlock").model("filler");
registerTag("item.block.library").reg("library").locale("libraryBlock").model("library");
registerTag("item.block.frame").reg("frame").locale("frameBlock").model("frame");
registerTag("item.block.quarry").reg("quarry").locale("quarryBlock").model("quarry");
// Blocks
registerTag("block.architect").reg("architect").locale("architectBlock").model("architect");
registerTag("block.builder").reg("builder").locale("builderBlock").model("builder");
registerTag("block.filler").reg("filler").locale("fillerBlock").model("filler");
registerTag("block.library").reg("library").locale("libraryBlock").model("library");
registerTag("block.frame").reg("frame").locale("frameBlock").model("frame");
registerTag("block.quarry").reg("quarry").locale("quarryBlock").model("quarry");
// Tiles
registerTag("tile.architect").reg("architect");
registerTag("tile.library").reg("library");
registerTag("tile.builder").reg("builder");
registerTag("tile.filler").reg("filler");
registerTag("tile.quarry").reg("quarry");

endBatch(TagManager.prependTags("buildcraftbuilders:", EnumTagType.REGISTRY_NAME, EnumTagType.MODEL_LOCATION).andThen(TagManager.setTab("buildcraft.main")));
}

private static TagEntry registerTag(String id) {
return TagManager.registerTag(id);
}

private static void startBatch() {
TagManager.startBatch();
}

private static void endBatch(Consumer<TagEntry> consumer) {
TagManager.endBatch(consumer);
}
}
69 changes: 62 additions & 7 deletions common/buildcraft/core/BCCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package buildcraft.core;

import java.io.File;
import java.util.function.Consumer;

import net.minecraft.init.Blocks;

Expand All @@ -24,14 +25,17 @@
import buildcraft.lib.marker.MarkerCache;
import buildcraft.lib.registry.CreativeTabManager;
import buildcraft.lib.registry.CreativeTabManager.CreativeTabBC;
import buildcraft.lib.registry.TagManager;
import buildcraft.lib.registry.TagManager.EnumTagType;
import buildcraft.lib.registry.TagManager.TagEntry;

@Mod(//
modid = BCCore.MODID,//
name = "BuildCraft Core",//
version = BCLib.VERSION,//
dependencies = "required-after:buildcraftlib@[" + BCLib.VERSION + "]",//
acceptedMinecraftVersions = "[1.11.2]",//
guiFactory = "buildcraft.core.client.ConfigGuiFactoryBC"//
modid = BCCore.MODID,//
name = "BuildCraft Core",//
version = BCLib.VERSION,//
dependencies = "required-after:buildcraftlib@[" + BCLib.VERSION + "]",//
acceptedMinecraftVersions = "[1.11.2]",//
guiFactory = "buildcraft.core.client.ConfigGuiFactoryBC"//
)
public class BCCore {
public static final String MODID = "buildcraftcore";
Expand All @@ -51,7 +55,7 @@ public static void preInit(FMLPreInitializationEvent event) {
BCCoreConfig.preInit(cfgFolder);
BCCoreProxy.getProxy().fmlPreInit();

CreativeTabBC tab= CreativeTabManager.createTab("buildcraft.main");
CreativeTabBC tab = CreativeTabManager.createTab("buildcraft.main");

BCCoreItems.preInit();
BCCoreBlocks.preInit();
Expand Down Expand Up @@ -82,4 +86,55 @@ public static void postInit(FMLPostInitializationEvent event) {
BCCoreProxy.getProxy().fmlPostInit();
BCCoreConfig.postInit();
}

static {
startBatch();
// Items
registerTag("item.wrench").reg("wrench").locale("wrenchItem").oldReg("wrenchItem").model("wrench");
registerTag("item.diamond.shard").reg("diamond_shard").locale("diamondShard").model("diamond_shard").tab("vanilla.materials");
registerTag("item.gear.wood").reg("gear_wood").locale("woodenGearItem").oreDict("gearWood").oldReg("woodenGearItem").model("gears/wood");
registerTag("item.gear.stone").reg("gear_stone").locale("stoneGearItem").oreDict("gearStone").oldReg("stoneGearItem").model("gears/stone");
registerTag("item.gear.iron").reg("gear_iron").locale("ironGearItem").oreDict("gearIron").oldReg("ironGearItem").model("gears/iron");
registerTag("item.gear.gold").reg("gear_gold").locale("goldGearItem").oreDict("gearGold").oldReg("goldGearItem").model("gears/gold");
registerTag("item.gear.diamond").reg("gear_diamond").locale("diamondGearItem").oreDict("gearDiamond").oldReg("diamondGearItem").model("gears/diamond");
registerTag("item.list").reg("list").locale("list").oldReg("listItem").model("list_");
registerTag("item.map_location").reg("map_location").locale("mapLocation").oldReg("mapLocation").model("map_location/");
registerTag("item.paintbrush").reg("paintbrush").locale("paintbrush").model("paintbrush/");
registerTag("item.marker_connector").reg("marker_connector").locale("markerConnector").model("marker_connector");
registerTag("item.volume_marker").reg("volume_marker").locale("volume_marker").model("volume_marker");
// Item Blocks
registerTag("item.block.marker.volume").reg("marker_volume").locale("markerBlock").oldReg("markerBlock").model("marker_volume");
registerTag("item.block.marker.path").reg("marker_path").locale("pathMarkerBlock").oldReg("pathMarkerBlock").model("marker_path");
registerTag("item.block.spring").reg("spring").locale("spring").model("spring");
registerTag("item.block.decorated").reg("decorated").locale("decorated").model("decorated/");
registerTag("item.block.engine.bc").reg("engine").locale("engineBlock").model("engine/");
// Blocks
registerTag("block.spring").reg("spring").locale("spring");
registerTag("block.decorated").reg("decorated").locale("decorated");
registerTag("block.engine.bc").reg("engine").locale("engineBlock").oldReg("engineBlock");
registerTag("block.engine.bc.wood").locale("engineBlockWood");
registerTag("block.engine.bc.stone").locale("engineBlockStone");
registerTag("block.engine.bc.iron").locale("engineBlockIron");
registerTag("block.engine.bc.creative").locale("engineBlockCreative");
registerTag("block.marker.volume").reg("marker_volume").locale("markerBlock").oldReg("markerBlock").model("marker_volume");
registerTag("block.marker.path").reg("marker_path").locale("pathMarkerBlock").oldReg("pathMarkerBlock").model("marker_path");
// Tiles
registerTag("tile.marker.volume").reg("marker.volume").oldReg("buildcraft.builders.Marker", "Marker");
registerTag("tile.marker.path").reg("marker.path");
registerTag("tile.engine.wood").reg("engine.wood");

endBatch(TagManager.prependTags("buildcraftcore:", EnumTagType.REGISTRY_NAME, EnumTagType.MODEL_LOCATION).andThen(TagManager.setTab("buildcraft.main")));
}

private static TagEntry registerTag(String id) {
return TagManager.registerTag(id);
}

private static void startBatch() {
TagManager.startBatch();
}

private static void endBatch(Consumer<TagEntry> consumer) {
TagManager.endBatch(consumer);
}
}
2 changes: 1 addition & 1 deletion common/buildcraft/core/item/ItemWrench_Neptune.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, Ray

@Override
public boolean doesSneakBypassUse(ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player) {
return true;
return false;
}

@Override
Expand Down
33 changes: 33 additions & 0 deletions common/buildcraft/energy/BCEnergy.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package buildcraft.energy;

import java.util.function.Consumer;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
Expand All @@ -20,6 +22,9 @@
import buildcraft.energy.generation.OilPopulate;
import buildcraft.lib.BCLib;
import buildcraft.lib.registry.RegistryHelper;
import buildcraft.lib.registry.TagManager;
import buildcraft.lib.registry.TagManager.EnumTagType;
import buildcraft.lib.registry.TagManager.TagEntry;

//@formatter:off
@Mod(modid = BCEnergy.MODID,
Expand Down Expand Up @@ -63,4 +68,32 @@ public void postInit(FMLPostInitializationEvent evt) {
MinecraftForge.EVENT_BUS.register(OilPopulate.INSTANCE);
BCEnergyProxy.getProxy().fmlPostInit();
}

static {
startBatch();
// Items
registerTag("item.glob.oil").reg("glob_oil").locale("globOil").model("glob_oil");

// Item Blocks

// Blocks

// Tiles
registerTag("tile.engine.stone").reg("engine.stone");
registerTag("tile.engine.iron").reg("engine.iron");

endBatch(TagManager.prependTags("buildcraftenergy:", EnumTagType.REGISTRY_NAME, EnumTagType.MODEL_LOCATION).andThen(TagManager.setTab("buildcraft.main")));
}

private static TagEntry registerTag(String id) {
return TagManager.registerTag(id);
}

private static void startBatch() {
TagManager.startBatch();
}

private static void endBatch(Consumer<TagEntry> consumer) {
TagManager.endBatch(consumer);
}
}
54 changes: 53 additions & 1 deletion common/buildcraft/factory/BCFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package buildcraft.factory;

import java.util.function.Consumer;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
Expand All @@ -14,6 +16,9 @@
import buildcraft.core.BCCore;
import buildcraft.lib.BCLib;
import buildcraft.lib.registry.RegistryHelper;
import buildcraft.lib.registry.TagManager;
import buildcraft.lib.registry.TagManager.EnumTagType;
import buildcraft.lib.registry.TagManager.TagEntry;

//@formatter:off
@Mod(modid = BCFactory.MODID,
Expand All @@ -35,7 +40,7 @@ public void preInit(FMLPreInitializationEvent evt) {
BCFactoryBlocks.preInit();

NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, BCFactoryProxy.getProxy());

MinecraftForge.EVENT_BUS.register(BCFactoryEventDist.INSTANCE);
}

Expand All @@ -49,4 +54,51 @@ public void init(FMLInitializationEvent evt) {
public void postInit(FMLPostInitializationEvent evt) {

}

static {

startBatch();// factory
// BC Factory Items
registerTag("item.plastic.sheet").reg("plastic_sheet").locale("plasticSheet").oldReg("plasticSheet").model("plastic_sheet");
registerTag("item.water_gel_spawn").reg("water_gel_spawn").locale("waterGel").model("water_gel");
registerTag("item.gel").reg("gel").locale("gel").model("gel");
// BC Factory Item Blocks
registerTag("item.block.plastic").reg("plastic_block").locale("plasticBlock").model("plastic_block/");
registerTag("item.block.autoworkbench.item").reg("autoworkbench_item").locale("autoWorkbenchBlock").model("autoworkbench_item");
registerTag("item.block.mining_well").reg("mining_well").locale("miningWellBlock").model("mining_well");
registerTag("item.block.pump").reg("pump").locale("pumpBlock").model("pump");
registerTag("item.block.flood_gate").reg("flood_gate").locale("floodGateBlock").model("flood_gate");
registerTag("item.block.tank").reg("tank").locale("tankBlock").model("tank");
registerTag("item.block.chute").reg("chute").locale("chuteBlock").model("chute");
// BC Factory Blocks
registerTag("block.plastic").reg("plastic").locale("plasticBlock").model("plastic");
registerTag("block.autoworkbench.item").reg("autoworkbench_item").oldReg("autoWorkbenchBlock").locale("autoWorkbenchBlock").model("autoworkbench_item");
registerTag("block.mining_well").reg("mining_well").oldReg("miningWellBlock").locale("miningWellBlock").model("mining_well");
registerTag("block.pump").reg("pump").oldReg("pumpBlock").locale("pumpBlock").model("pump");
registerTag("block.flood_gate").reg("flood_gate").oldReg("floodGateBlock").locale("floodGateBlock").model("flood_gate");
registerTag("block.tank").reg("tank").oldReg("tankBlock").locale("tankBlock").model("tank");
registerTag("block.chute").reg("chute").oldReg("chuteBlock").locale("chuteBlock").model("chute");
registerTag("block.water_gel").reg("water_gel").locale("waterGel").model("water_gel");
// BC Factory Tiles
registerTag("tile.autoworkbench.item").reg("autoworkbench_item");
registerTag("tile.mining_well").reg("mining_well");
registerTag("tile.pump").reg("pump");
registerTag("tile.flood_gate").reg("flood_gate");
registerTag("tile.tank").reg("tank");
registerTag("tile.chute").reg("chute");

endBatch(TagManager.prependTags("buildcraftfactory:", EnumTagType.REGISTRY_NAME, EnumTagType.MODEL_LOCATION).andThen(TagManager.setTab("buildcraft.main")));
}

private static TagEntry registerTag(String id) {
return TagManager.registerTag(id);
}

private static void startBatch() {
TagManager.startBatch();
}

private static void endBatch(Consumer<TagEntry> consumer) {
TagManager.endBatch(consumer);
}
}
Loading

0 comments on commit 3ff9c1e

Please sign in to comment.