Register cables in preinit, and switch cable items and storage blocks to jsons
This commit is contained in:
parent
14c2b540f2
commit
b3988e4c4f
14 changed files with 176 additions and 175 deletions
|
@ -61,6 +61,7 @@ public class Core {
|
||||||
public static TechRebornWorldGen worldGen;
|
public static TechRebornWorldGen worldGen;
|
||||||
public static File configDir;
|
public static File configDir;
|
||||||
public VersionChecker versionChecker;
|
public VersionChecker versionChecker;
|
||||||
|
|
||||||
public Core() {
|
public Core() {
|
||||||
//Forge says to call it here, so yeah
|
//Forge says to call it here, so yeah
|
||||||
FluidRegistry.enableUniversalBucket();
|
FluidRegistry.enableUniversalBucket();
|
||||||
|
@ -84,11 +85,6 @@ public class Core {
|
||||||
|
|
||||||
TechRebornAPI.subItemRetriever = new SubItemRetriever();
|
TechRebornAPI.subItemRetriever = new SubItemRetriever();
|
||||||
//Recheck here because things break at times
|
//Recheck here because things break at times
|
||||||
CompatManager.isIC2Loaded = Loader.isModLoaded("IC2");
|
|
||||||
|
|
||||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
|
||||||
compatModule.preInit(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register ModBlocks
|
// Register ModBlocks
|
||||||
ModBlocks.init();
|
ModBlocks.init();
|
||||||
|
@ -99,6 +95,12 @@ public class Core {
|
||||||
// Entitys
|
// Entitys
|
||||||
EntityRegistry.registerModEntity(new ResourceLocation("techreborn", "nuke"), EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
|
EntityRegistry.registerModEntity(new ResourceLocation("techreborn", "nuke"), EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
|
||||||
|
|
||||||
|
CompatManager.isIC2Loaded = Loader.isModLoaded("IC2");
|
||||||
|
|
||||||
|
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||||
|
compatModule.preInit(event);
|
||||||
|
}
|
||||||
|
|
||||||
//Ore Dictionary
|
//Ore Dictionary
|
||||||
OreDict.init();
|
OreDict.init();
|
||||||
proxy.preInit(event);
|
proxy.preInit(event);
|
||||||
|
|
|
@ -5,11 +5,16 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import techreborn.blocks.BlockOre;
|
import techreborn.blocks.BlockOre;
|
||||||
import techreborn.blocks.BlockOre2;
|
import techreborn.blocks.BlockOre2;
|
||||||
|
import techreborn.blocks.BlockStorage;
|
||||||
|
import techreborn.blocks.BlockStorage2;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.items.*;
|
import techreborn.items.*;
|
||||||
|
import techreborn.parts.TechRebornParts;
|
||||||
|
import techreborn.parts.powerCables.EnumCableType;
|
||||||
|
|
||||||
public class RegisterItemJsons {
|
public class RegisterItemJsons {
|
||||||
public static void registerModels() {
|
public static void registerModels() {
|
||||||
|
@ -44,37 +49,37 @@ public class RegisterItemJsons {
|
||||||
|
|
||||||
for (int i = 0; i < ItemIngots.types.length; ++i) {
|
for (int i = 0; i < ItemIngots.types.length; ++i) {
|
||||||
String[] name = ItemIngots.types.clone();
|
String[] name = ItemIngots.types.clone();
|
||||||
registerBlockstate(ModItems.ingots, i, name[i]);
|
registerBlockstate(ModItems.ingots, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemGems.types.length; ++i) {
|
for (int i = 0; i < ItemGems.types.length; ++i) {
|
||||||
String[] name = ItemGems.types.clone();
|
String[] name = ItemGems.types.clone();
|
||||||
registerBlockstate(ModItems.gems, i, name[i]);
|
registerBlockstate(ModItems.gems, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemPlates.types.length; ++i) {
|
for (int i = 0; i < ItemPlates.types.length; ++i) {
|
||||||
String[] name = ItemPlates.types.clone();
|
String[] name = ItemPlates.types.clone();
|
||||||
registerBlockstate(ModItems.plate, i, name[i]);
|
registerBlockstate(ModItems.plate, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemNuggets.types.length; ++i) {
|
for (int i = 0; i < ItemNuggets.types.length; ++i) {
|
||||||
String[] name = ItemNuggets.types.clone();
|
String[] name = ItemNuggets.types.clone();
|
||||||
registerBlockstate(ModItems.nuggets, i, name[i]);
|
registerBlockstate(ModItems.nuggets, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemDusts.types.length; ++i) {
|
for (int i = 0; i < ItemDusts.types.length; ++i) {
|
||||||
String[] name = ItemDusts.types.clone();
|
String[] name = ItemDusts.types.clone();
|
||||||
registerBlockstate(ModItems.dusts, i, name[i]);
|
registerBlockstate(ModItems.dusts, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemDustsSmall.types.length; ++i) {
|
for (int i = 0; i < ItemDustsSmall.types.length; ++i) {
|
||||||
String[] name = ItemDustsSmall.types.clone();
|
String[] name = ItemDustsSmall.types.clone();
|
||||||
registerBlockstate(ModItems.smallDusts, i, name[i]);
|
registerBlockstate(ModItems.smallDusts, i, name[i], "items/materials/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ItemUpgrades.types.length; ++i) {
|
for (int i = 0; i < ItemUpgrades.types.length; ++i) {
|
||||||
String[] name = ItemUpgrades.types.clone();
|
String[] name = ItemUpgrades.types.clone();
|
||||||
registerBlockstate(ModItems.upgrades, i, name[i]);
|
registerBlockstate(ModItems.upgrades, i, name[i], "items/misc/");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < BlockOre.ores.length; ++i) {
|
for (int i = 0; i < BlockOre.ores.length; ++i) {
|
||||||
|
@ -86,6 +91,22 @@ public class RegisterItemJsons {
|
||||||
String[] name = BlockOre2.ores.clone();
|
String[] name = BlockOre2.ores.clone();
|
||||||
registerBlockstate(ModBlocks.ore2, i, name[i]);
|
registerBlockstate(ModBlocks.ore2, i, name[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < BlockStorage.types.length; ++i) {
|
||||||
|
String[] name = BlockStorage.types.clone();
|
||||||
|
registerBlockstate(ModBlocks.storage, i, name[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < BlockStorage2.types.length; ++i) {
|
||||||
|
String[] name = BlockStorage2.types.clone();
|
||||||
|
registerBlockstate(ModBlocks.storage2, i, name[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("reborncore-mcmultipart"))
|
||||||
|
for (EnumCableType i : EnumCableType.values()) {
|
||||||
|
String name = i.getName();
|
||||||
|
registerBlockstate(TechRebornParts.cables, i.ordinal(), name, "items/misc/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerBlocks() {
|
private static void registerBlocks() {
|
||||||
|
@ -110,12 +131,19 @@ public class RegisterItemJsons {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerBlockstate(Item i, int meta, String variant) {
|
private static void registerBlockstate(Item i, int meta, String variant) {
|
||||||
ResourceLocation loc = i.getRegistryName();
|
registerBlockstate(i, meta, variant, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerBlockstate(Item i, int meta, String variant, String dir) {
|
||||||
|
ResourceLocation loc = new ResourceLocation("techreborn", dir + i.getRegistryName().getResourcePath());
|
||||||
ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "type=" + variant));
|
ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "type=" + variant));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerBlockstate(Block i, int meta, String variant) {
|
private static void registerBlockstate(Block i, int meta, String variant) {
|
||||||
ResourceLocation loc = i.getRegistryName();
|
registerBlockstate(i, meta, variant, "");
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(i), meta, new ModelResourceLocation(loc, "type=" + variant));
|
}
|
||||||
|
|
||||||
|
private static void registerBlockstate(Block i, int meta, String variant, String dir) {
|
||||||
|
registerBlockstate(Item.getItemFromBlock(i), meta, variant, dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,6 @@ public class TechRebornParts implements ICompatModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(FMLInitializationEvent event) {
|
|
||||||
for (EnumCableType cableType : EnumCableType.values()) {
|
for (EnumCableType cableType : EnumCableType.values()) {
|
||||||
multipartHashMap.put(cableType, cableType.cableClass);
|
multipartHashMap.put(cableType, cableType.cableClass);
|
||||||
MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name());
|
MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name());
|
||||||
|
@ -43,6 +38,11 @@ public class TechRebornParts implements ICompatModule {
|
||||||
cables = new ItemCables();
|
cables = new ItemCables();
|
||||||
cables.setRegistryName("cables");
|
cables.setRegistryName("cables");
|
||||||
GameRegistry.register(cables);
|
GameRegistry.register(cables);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
|
||||||
// MultipartRegistry.registerPart(EmptyFluidPipe.class, "techreborn:fluidpipe.empty");
|
// MultipartRegistry.registerPart(EmptyFluidPipe.class, "techreborn:fluidpipe.empty");
|
||||||
// MultipartRegistry.registerPart(InsertingFluidPipe.class, "techreborn:fluidpipe.inserting");
|
// MultipartRegistry.registerPart(InsertingFluidPipe.class, "techreborn:fluidpipe.inserting");
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"forge_marker": 1,
|
||||||
|
"defaults": {
|
||||||
|
"model": "builtin/generated",
|
||||||
|
"transform": "forge:default-item"
|
||||||
|
},
|
||||||
|
"variants": {
|
||||||
|
"type": {
|
||||||
|
"copper": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/copper"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"glassfiber": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/glassfiber"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gold": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/gold"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hv": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/hv"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"insulatedcopper": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/insulatedcopper"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"insulatedgold": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/insulatedgold"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"insulatedhv": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/insulatedhv"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tin": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "techreborn:items/cables/tin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,95 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"textures": {},
|
|
||||||
"transform": "forge:default-block",
|
|
||||||
"model": "cube_all"
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [
|
|
||||||
{}
|
|
||||||
],
|
|
||||||
"type": {
|
|
||||||
"galena": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreGalena"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iridium": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreIridium"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ruby": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreRuby"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sapphire": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreSapphire"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bauxite": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreBauxite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pyrite": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/orePyrite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"cinnabar": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreCinnabar"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sphalerite": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreSphalerite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tungston": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreTungston"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sheldonite": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreSheldonite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"peridot": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/orePeridot"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sodalite": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreSodalite"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lead": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreLead"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"silver": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreSilver"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"copper": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreCopper"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tin": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/ore/oreTin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -20,6 +20,11 @@
|
||||||
"all": "techreborn:blocks/storage/aluminum_block"
|
"all": "techreborn:blocks/storage/aluminum_block"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"iridium": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/iridium_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
"titanium": {
|
"titanium": {
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "techreborn:blocks/storage/titanium_block"
|
"all": "techreborn:blocks/storage/titanium_block"
|
||||||
|
@ -74,66 +79,6 @@
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "techreborn:blocks/storage/invar_block"
|
"all": "techreborn:blocks/storage/invar_block"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"iridium": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/iridium_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tungstensteel": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/tungstensteel_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iridium_reinforced_tungstensteel": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/iridium_reinforced_tungstensteel_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iridium_reinforced_stone": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/iridium_reinforced_stone_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ruby": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/ruby_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sapphire": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/sapphire_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"peridot": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/peridot_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"yellowGarnet": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/yellowGarnet_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"redGarnet": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/redGarnet_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"copper": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/copper_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tin": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/tin_block"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"refinedIron": {
|
|
||||||
"textures": {
|
|
||||||
"all": "techreborn:blocks/storage/refinedIron_block"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
"forge_marker": 1,
|
||||||
|
"defaults": {
|
||||||
|
"textures": {},
|
||||||
|
"transform": "forge:default-block",
|
||||||
|
"model": "cube_all"
|
||||||
|
},
|
||||||
|
"variants": {
|
||||||
|
"inventory": [
|
||||||
|
{}
|
||||||
|
],
|
||||||
|
"type": {
|
||||||
|
"tungstensteel": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/tungstensteel_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iridium_reinforced_tungstensteel": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/iridium_reinforced_tungstensteel_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iridium_reinforced_stone": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/iridium_reinforced_stone_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ruby": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/ruby_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sapphire": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/sapphire_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"peridot": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/peridot_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yellowgarnet": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/yellowgarnet_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"redgarnet": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/redgarnet_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"copper": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/copper_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tin": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/tin_block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"refinediron": {
|
||||||
|
"textures": {
|
||||||
|
"all": "techreborn:blocks/storage/refinediron_block"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue