Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions src/main/java/gregtech/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
IForgeRegistry<Block> registry = event.getRegistry();

for (MTERegistry r : GregTechAPI.mteManager.getRegistries()) {
registry.register(r.getBlock());
if (!registry.getKeys().isEmpty()) {
registry.register(r.getBlock());
}
}

StoneType.init();
Expand Down Expand Up @@ -122,9 +124,21 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
}
}

for (BlockCable cable : CABLES.get(materialRegistry.getModid())) registry.register(cable);
for (BlockFluidPipe pipe : FLUID_PIPES.get(materialRegistry.getModid())) registry.register(pipe);
for (BlockItemPipe pipe : ITEM_PIPES.get(materialRegistry.getModid())) registry.register(pipe);
for (BlockCable cable : CABLES.get(materialRegistry.getModid())) {
if (!cable.getEnabledMaterials().isEmpty()) {
registry.register(cable);
}
}
for (BlockFluidPipe pipe : FLUID_PIPES.get(materialRegistry.getModid())) {
if (!pipe.getEnabledMaterials().isEmpty()) {
registry.register(pipe);
}
}
for (BlockItemPipe pipe : ITEM_PIPES.get(materialRegistry.getModid())) {
if (!pipe.getEnabledMaterials().isEmpty()) {
registry.register(pipe);
}
}
}
for (BlockOpticalPipe pipe : OPTICAL_PIPES) registry.register(pipe);
for (BlockLaserPipe pipe : LASER_PIPES) registry.register(pipe);
Expand Down Expand Up @@ -235,16 +249,27 @@ public static void registerItems(RegistryEvent.Register<Item> event) {
GTRecipeManager.preLoad();

for (MTERegistry r : GregTechAPI.mteManager.getRegistries()) {
registry.register(createItemBlock(r.getBlock(), MachineItemBlock::new));
if (!r.getKeys().isEmpty()) {
registry.register(createItemBlock(r.getBlock(), MachineItemBlock::new));
}
}

for (MaterialRegistry materialRegistry : GregTechAPI.materialManager.getRegistries()) {
for (BlockCable cable : CABLES.get(materialRegistry.getModid()))
registry.register(createItemBlock(cable, ItemBlockCable::new));
for (BlockFluidPipe pipe : FLUID_PIPES.get(materialRegistry.getModid()))
registry.register(createItemBlock(pipe, ItemBlockFluidPipe::new));
for (BlockItemPipe pipe : ITEM_PIPES.get(materialRegistry.getModid()))
registry.register(createItemBlock(pipe, ItemBlockItemPipe::new));
for (BlockCable cable : CABLES.get(materialRegistry.getModid())) {
if (!cable.getEnabledMaterials().isEmpty()) {
registry.register(createItemBlock(cable, ItemBlockCable::new));
}
}
for (BlockFluidPipe pipe : FLUID_PIPES.get(materialRegistry.getModid())) {
if (!pipe.getEnabledMaterials().isEmpty()) {
registry.register(createItemBlock(pipe, ItemBlockFluidPipe::new));
}
}
for (BlockItemPipe pipe : ITEM_PIPES.get(materialRegistry.getModid())) {
if (!pipe.getEnabledMaterials().isEmpty()) {
registry.register(createItemBlock(pipe, ItemBlockItemPipe::new));
}
}
}
for (BlockOpticalPipe pipe : OPTICAL_PIPES) registry.register(createItemBlock(pipe, ItemBlockOpticalPipe::new));
for (BlockLaserPipe pipe : LASER_PIPES) registry.register(createItemBlock(pipe, ItemBlockLaserPipe::new));
Expand Down
Loading