Cleanup of model registration
This commit is contained in:
parent
ec0724b15f
commit
4612ab334c
22 changed files with 35 additions and 86 deletions
|
@ -45,7 +45,7 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
|||
* @param inputSlots Slot IDs for input
|
||||
* @param outputSlots Slot IDs for output
|
||||
*/
|
||||
public ScrapboxRecipeCrafter(TileEntity parentTile, Inventory inventory, int[] inputSlots, int[] outputSlots) {
|
||||
public ScrapboxRecipeCrafter(TileEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(Reference.SCRAPBOX_RECIPE, parentTile, 1, 1, inventory, inputSlots, outputSlots);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,6 @@ public class BlockNuke extends BaseBlock {
|
|||
|
||||
public BlockNuke() {
|
||||
super(Material.TNT);
|
||||
setTranslationKey("techreborn.nuke");
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false));
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
|
||||
}
|
||||
|
|
|
@ -27,16 +27,13 @@ package techreborn.blocks;
|
|||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
import net.minecraft.block.material.Material;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class BlockRefinedIronFence extends BlockFence {
|
||||
|
||||
public BlockRefinedIronFence() {
|
||||
super(Material.IRON, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
setHardness(2.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
//RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@ public class BlockReinforcedGlass extends BlockGlass {
|
|||
|
||||
public BlockReinforcedGlass() {
|
||||
super(Material.GLASS, false);
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
setSoundType(SoundType.STONE);
|
||||
setHardness(4.0F);
|
||||
setResistance(60F);
|
||||
|
|
|
@ -49,7 +49,6 @@ public class BlockRubberLeaves extends BlockLeaves {
|
|||
|
||||
public BlockRubberLeaves() {
|
||||
super();
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, true)
|
||||
.withProperty(DECAYABLE, true));
|
||||
Blocks.FIRE.setFireInfo(this, 30, 60);
|
||||
|
|
|
@ -66,7 +66,6 @@ public class BlockRubberLog extends Block {
|
|||
|
||||
public BlockRubberLog() {
|
||||
super(Material.WOOD);
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
this.setHardness(2.0F);
|
||||
this.setDefaultState(
|
||||
this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false));
|
||||
|
|
|
@ -39,7 +39,6 @@ public class BlockRubberPlank extends Block {
|
|||
|
||||
public BlockRubberPlank() {
|
||||
super(Material.WOOD);
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
this.setHardness(2.0F);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
Blocks.FIRE.setFireInfo(this, 5, 20);
|
||||
|
|
|
@ -58,7 +58,6 @@ public abstract class BlockRubberPlankSlab extends BlockSlab {
|
|||
iblockstate = iblockstate.withProperty(HALF, EnumBlockHalf.BOTTOM);
|
||||
halfslab = this;
|
||||
}
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
setHarvestLevel("axe", 0);
|
||||
setHardness(2.0F);
|
||||
setResistance(15);
|
||||
|
|
|
@ -34,7 +34,6 @@ public class BlockRubberPlankStair extends BlockStairs {
|
|||
|
||||
public BlockRubberPlankStair(IBlockState modelState, String name) {
|
||||
super(modelState);
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
useNeighborBrightness = true;
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
|
||||
}
|
||||
|
|
|
@ -32,9 +32,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.world.RubberTreeGenerator;
|
||||
|
||||
import java.util.Random;
|
||||
|
@ -45,10 +42,8 @@ import java.util.Random;
|
|||
public class BlockRubberSapling extends BlockSapling {
|
||||
|
||||
public BlockRubberSapling() {
|
||||
setCreativeTab(TechReborn.TAB);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(STAGE, 0));
|
||||
setSoundType(SoundType.PLANT);
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,12 +35,12 @@ import techreborn.init.TRContent;
|
|||
public class ContainerDestructoPack extends RebornContainer {
|
||||
|
||||
private EntityPlayer player;
|
||||
private Inventory inv;
|
||||
private Inventory<?> inv;
|
||||
|
||||
public ContainerDestructoPack(EntityPlayer player) {
|
||||
super(null);
|
||||
this.player = player;
|
||||
inv = new Inventory(1, "destructopack", 64, null);
|
||||
inv = new Inventory<>(1, "destructopack", 64, null);
|
||||
buildContainer();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.util.Map;
|
|||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
|
@ -45,6 +44,7 @@ import net.minecraftforge.fml.common.Mod;
|
|||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.fluid.BlockFluidTechReborn;
|
||||
|
@ -83,48 +83,20 @@ public class ModelRegistryEventHandler {
|
|||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
register(TRContent.REFINED_IRON_FENCE, "iron_fence");
|
||||
register(TRContent.RUBBER_SAPLING, "misc/rubber_sapling");
|
||||
|
||||
ResourceLocation oresRL = new ResourceLocation(TechReborn.MOD_ID, "ore");
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, TRContent.REFINED_IRON_FENCE));
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, TRContent.RUBBER_SAPLING));
|
||||
|
||||
for (Ores value : Ores.values()) {
|
||||
registerBlockstateMultiItem(oresRL, Item.getItemFromBlock(value.block), value.name);
|
||||
|
||||
ModelLoader.setCustomStateMapper(value.block, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(oresRL, "type=" + value.name);
|
||||
}
|
||||
});
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, value.block).setFileName("ore").setInvVariant("type=" + value.name));
|
||||
}
|
||||
|
||||
ResourceLocation storageRL = new ResourceLocation(TechReborn.MOD_ID, "storage_block");
|
||||
for (StorageBlocks value : StorageBlocks.values()) {
|
||||
registerBlockstateMultiItem(storageRL, Item.getItemFromBlock(value.block), value.name);
|
||||
ModelLoader.setCustomStateMapper(value.block, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(storageRL, "type=" + value.name);
|
||||
}
|
||||
});
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, value.block).setFileName("storage_block").setInvVariant("type=" + value.name));
|
||||
}
|
||||
|
||||
ResourceLocation machineBlockRL = new ResourceLocation(TechReborn.MOD_ID, "machine_block");
|
||||
for (MachineBlocks value : MachineBlocks.values()) {
|
||||
registerBlockstateMultiItem(machineBlockRL, Item.getItemFromBlock(value.frame), value.name + "_machine_frame");
|
||||
ModelLoader.setCustomStateMapper(value.frame, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_frame");
|
||||
}
|
||||
});
|
||||
registerBlockstateMultiItem(machineBlockRL, Item.getItemFromBlock(value.casing), value.name + "_machine_casing");
|
||||
ModelLoader.setCustomStateMapper(value.casing, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_casing");
|
||||
}
|
||||
});
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, value.frame).setFileName("machine_block").setInvVariant("type=" + value.name + "_machine_frame"));
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, value.casing).setFileName("machine_block").setInvVariant("type=" + value.name + "_machine_casing"));
|
||||
}
|
||||
|
||||
ResourceLocation cableRL = new ResourceLocation(TechReborn.MOD_ID, "cable_inv");
|
||||
|
@ -306,10 +278,6 @@ public class ModelRegistryEventHandler {
|
|||
});
|
||||
}
|
||||
|
||||
private static void register(Block block, String modelPath) {
|
||||
RebornModelRegistry.registerItemModel(Item.getItemFromBlock(block), modelPath);
|
||||
}
|
||||
|
||||
private static void register(Item item, String modelPath) {
|
||||
RebornModelRegistry.registerItemModel(item, modelPath);
|
||||
}
|
||||
|
|
|
@ -113,13 +113,11 @@ public class RegistryEventHandler {
|
|||
RebornRegistry.registerBlock(TRContent.RUBBER_LEAVES = InitUtils.setup(new BlockRubberLeaves(), "rubber_leaves"));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LOG = InitUtils.setup(new BlockRubberLog(), "rubber_log"));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PLANKS = InitUtils.setup(new BlockRubberPlank(), "rubber_planks"));
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_SAPLING = InitUtils.setup(new BlockRubberSapling(), "rubber_sapling"),
|
||||
ItemBlockRubberSapling.class,
|
||||
"rubber_sapling");
|
||||
RebornRegistry.registerBlockNoItem(TRContent.RUBBER_LOG_SLAB_HALF = InitUtils.setup(new BlockRubberPlankSlab.BlockHalf("rubber_plank"), "rubber_plank_slab"));
|
||||
RebornRegistry.registerBlock(
|
||||
TRContent.RUBBER_SAPLING = InitUtils.setup(new BlockRubberSapling(), "rubber_sapling"),
|
||||
ItemBlockRubberSapling.class,
|
||||
"rubber_sapling");
|
||||
RebornRegistry.registerBlock(
|
||||
TRContent.RUBBER_LOG_SLAB_DOUBLE = InitUtils.setup(new BlockRubberPlankSlab.BlockDouble("rubber_plank", TRContent.RUBBER_LOG_SLAB_HALF), "rubber_plank_double_slab"),
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LOG_SLAB_DOUBLE = InitUtils.setup(new BlockRubberPlankSlab.BlockDouble("rubber_plank", TRContent.RUBBER_LOG_SLAB_HALF), "rubber_plank_double_slab"),
|
||||
new ItemSlab(TRContent.RUBBER_LOG_SLAB_HALF, (BlockSlab) TRContent.RUBBER_LOG_SLAB_HALF, (BlockSlab) TRContent.RUBBER_LOG_SLAB_DOUBLE),
|
||||
"rubber_plank_double_slab");
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_LOG_STAIR = InitUtils.setup(new BlockRubberPlankStair(TRContent.RUBBER_LOG.getDefaultState(), "rubber_plank"),
|
||||
|
|
|
@ -49,18 +49,17 @@ public class OreDict {
|
|||
// Blocks
|
||||
OreUtil.registerOre("fenceIron", TRContent.REFINED_IRON_FENCE);
|
||||
OreUtil.registerOre("woodRubber", TRContent.RUBBER_LOG);
|
||||
OreUtil.registerOre("logWood", TRContent.RUBBER_LOG);
|
||||
OreUtil.registerOre("logRubber", TRContent.RUBBER_LOG);
|
||||
OreUtil.registerOre("plankWood", TRContent.RUBBER_PLANKS);
|
||||
OreUtil.registerOre("plankRubber", TRContent.RUBBER_PLANKS);
|
||||
OreUtil.registerOre("glassReinforced", TRContent.REINFORCED_GLASS);
|
||||
OreUtil.registerOre("treeSapling", TRContent.RUBBER_SAPLING);
|
||||
OreUtil.registerOre("saplingRubber", TRContent.RUBBER_SAPLING);
|
||||
|
||||
// OreUtil.registerOre("logWood", new ItemStack(RUBBER_LOG, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("logRubber", new ItemStack(RUBBER_LOG, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("plankWood", new ItemStack(RUBBER_PLANKS, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("slabWood", new ItemStack(RUBBER_LOG_SLAB_HALF, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("stairWood", new ItemStack(RUBBER_LOG_STAIR, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("plankRubber", new ItemStack(RUBBER_PLANKS, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("treeLeaves", new ItemStack(RUBBER_LEAVES, 1, OreDictionary.WILDCARD_VALUE));
|
||||
// OreUtil.registerOre("leavesRubber", new ItemStack(RUBBER_LEAVES, 1, OreDictionary.WILDCARD_VALUE));
|
||||
OreUtil.registerOre("slabWood", TRContent.RUBBER_LOG_SLAB_HALF);
|
||||
OreUtil.registerOre("stairWood", TRContent.RUBBER_LOG_STAIR);
|
||||
OreUtil.registerOre("treeLeaves", TRContent.RUBBER_LEAVES);
|
||||
OreUtil.registerOre("leavesRubber", TRContent.RUBBER_LEAVES);
|
||||
|
||||
// Parts
|
||||
OreUtil.registerOre("circuitBasic", TRContent.Parts.ELECTRONIC_CIRCUIT.getStack());
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class TileGenericMachine extends TilePowerAcceptor
|
|||
public int maxEnergy;
|
||||
public Block toolDrop;
|
||||
public int energySlot;
|
||||
public Inventory inventory;
|
||||
public Inventory<?> inventory;
|
||||
public RecipeCrafter crafter;
|
||||
|
||||
/**
|
||||
|
@ -115,7 +115,7 @@ public abstract class TileGenericMachine extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
public Inventory<?> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
|
|||
private FluidGeneratorRecipe currentRecipe;
|
||||
private int ticksSinceLastChange;
|
||||
public final Tank tank;
|
||||
public final Inventory inventory;
|
||||
public final Inventory<?> inventory;
|
||||
protected long lastOutput = 0;
|
||||
|
||||
/*
|
||||
|
@ -168,7 +168,7 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
|
|||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
public Inventory<?> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"multipart": [
|
||||
{
|
||||
"apply": {
|
||||
"model": "techreborn:iron_fence_post"
|
||||
"model": "techreborn:refined_iron_fence_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
|||
"north": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "techreborn:iron_fence_side",
|
||||
"model": "techreborn:refined_iron_fence_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
|
@ -19,7 +19,7 @@
|
|||
"east": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "techreborn:iron_fence_side",
|
||||
"model": "techreborn:refined_iron_fence_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
|||
"south": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "techreborn:iron_fence_side",
|
||||
"model": "techreborn:refined_iron_fence_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
|||
"west": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "techreborn:iron_fence_side",
|
||||
"model": "techreborn:refined_iron_fence_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"parent": "techreborn:block/iron_fence_inventory"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "techreborn:block/refined_iron_fence_inventory"
|
||||
}
|
Loading…
Add table
Reference in a new issue