Bunch of item work, 96

This commit is contained in:
modmuss50 2019-02-22 15:02:41 +00:00
parent 91994e5a01
commit fd0fa8c66e
27 changed files with 123 additions and 191 deletions

View file

@ -29,12 +29,7 @@ import java.util.Map;
import com.google.common.collect.Maps;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@ -98,7 +93,9 @@ public class ModelRegistryEventHandler {
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");
for (Cables value : Cables.values()) {
registerBlockstateMultiItem(cableRL, Item.getItemFromBlock(value.block), value.name);
@ -113,9 +110,13 @@ public class ModelRegistryEventHandler {
}
});
}
*/
}
private static void registerFluidBlocks() {
/*
registerFluidBlockModel(ModFluids.BLOCK_BERYLLIUM);
registerFluidBlockModel(ModFluids.BLOCK_CALCIUM);
registerFluidBlockModel(ModFluids.BLOCK_CALCIUM_CARBONATE);
@ -150,7 +151,9 @@ public class ModelRegistryEventHandler {
registerFluidBlockModel(ModFluids.BLOCK_SULFURIC_ACID);
registerFluidBlockModel(ModFluids.BLOCK_COMPRESSED_AIR);
registerFluidBlockModel(ModFluids.BLOCK_ELECTROLYZED_WATER);
*/
}
private static void registerItems() {
// Armor
@ -257,6 +260,8 @@ public class ModelRegistryEventHandler {
}
/*
private static void registerFluidBlockModel(BlockFluidTechReborn block) {
String name = block.getTranslationKey().substring(5).toLowerCase();
Item item = Item.getItemFromBlock(block);
@ -277,13 +282,15 @@ public class ModelRegistryEventHandler {
}
});
}
*/
private static void register(Item item, String modelPath) {
RebornModelRegistry.registerItemModel(item, modelPath);
}
private static void registerBlockstateMultiItem(ResourceLocation RL, Item item, String variantName) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(RL, "type=" + variantName));
//ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(RL, "type=" + variantName));
}
}

View file

@ -117,10 +117,7 @@ public class RegistryEventHandler {
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_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.registerBlockNoItem(TRContent.RUBBER_LOG_SLAB = InitUtils.setup(new BlockRubberPlankSlab("rubber_plank"), "rubber_plank_slab"));
RebornRegistry.registerBlock(TRContent.RUBBER_LOG_STAIR = InitUtils.setup(new BlockRubberPlankStair(TRContent.RUBBER_LOG.getDefaultState(), "rubber_plank"),
"rubber_plank_stair"), new Item.Properties());
@ -233,10 +230,10 @@ public class RegistryEventHandler {
TechReborn.LOGGER.debug("TechReborns Items Loaded");
}
@SubscribeEvent(priority = EventPriority.LOW)//LOW is used as we want it to load as late as possible, but before crafttweaker
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
//Register ModRecipes
ModRecipes.init();
}
// @SubscribeEvent(priority = EventPriority.LOW)//LOW is used as we want it to load as late as possible, but before crafttweaker
// public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
// //Register ModRecipes
// ModRecipes.init();
// }
}