Jump to content

JigenEagle

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by JigenEagle

  1. I am indeed using Forge blockstates. I set up some basic debug blocks and items to test and ran into an error-less roadblock. I did not pass a tintIndex when registering, I got the following result: It shows up fine in my inventory, however the block in the real world is incorrect as shown. Is there something I am missing to correctly render the block in the world? Here are my JSONs, both named 'oreDebug' model { "parent": "block/block", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" } } } ] } blockstate { "forge_marker": 1, "defaults": { "uvlock": true }, "variants": { "normal": [{ "textures": { "base": "fenton:blocks/ore", "overlay": "fenton:blocks/ore_vein" }, "model": "fenton:oreDebug" }], "inventory": [{ "textures": { "base": "fenton:blocks/ore", "overlay": "fenton:blocks/ore_vein" }, "model": "fenton:oreDebug" }] } }
  2. In this case I will be opting with the tintIndex route. It seems like the easier of the two to first approach, and colors may have to change dynamically. And yes, the backdrop of the ore itself referenced in Step 2 is a static texture, no color need be applied. In saying that, would this be the correct way of setting up my JSON file for the ore block? 'ore' is just a stone backdrop and 'ore_vein' is the white vein to be tinted. (I am away from my testing environment and am just clearing roadblocks I foresee when I begin work.) { "parent": "block/block", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "fi:blocks/ore_vein", "tintindex": 0, "cullface": "east" } } } ] }
  3. Hello, I am currently trying to implement a custom 'Material' (as in Iron/Gold/etc) pipeline in my mod. To do so I am generating ores, ingots, etc. using a single base texture and a material's assigned color. I understand how to achieve desired results for coloring Items and single-layer blocks, but I am having trouble figuring out how the following can be done: I have two texture files, the stone, and the white ore vein overlay. The block would have the base layer of stone. The overlay layer would be the ore veins post-colored. Are there any classes currently in MC/MCForge that I can utilize to Color just one layer of a block's texture? How would I go about this, or at least how could I refine my search to find information on achieving this result? Once this is figured out will treating the block as any other, like creating an ItemBlock, retain the desired appearance in the player's inventory? Or will additional work be required?
  4. Thank You -- It did seem weird to think that Minecraft would just 'know' to call the functions for what I wanted to do. The example was very helpful.
  5. Hello, I am currently trying to color different Items using the same base texture and getColorFromItemStack. My items register fine but are not colored in my inventory or in the world when I drop them. Code for Item class package com.jigeneagle.fentonindustries.items; import com.jigeneagle.fentonindustries.Main; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class FIItem extends Item { protected String sharedName; protected boolean colored = false; protected int sharedHexColor; public FIItem(String registryName, CreativeTabs tab) { // Set Registry Data for Item this.sharedName = registryName; this.setRegistryName(sharedName); this.setUnlocalizedName(this.getRegistryName().toString()); this.setCreativeTab(tab); } public FIItem(String registryName, CreativeTabs tab, int hexColor) { // Set Registry Data for Colored Item this.sharedName = registryName; this.setRegistryName(sharedName); this.setUnlocalizedName(this.getRegistryName().toString()); this.setCreativeTab(tab); this.colored = true; this.sharedHexColor = hexColor; } public void registerItemModel() { Main.proxy.registerItemRenderer(this, 0, sharedName); } // "Lets just run the colors across the bottom of the screen while we get started." public boolean hasColor(ItemStack itemStack) { return colored; } @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack itemStack, int renderPass) { return sharedHexColor; } } Code for Items class package com.jigeneagle.fentonindustries.items; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class FIItems { public static FIItem dustCopper; public static void initItems() { dustCopper = register(new FIItem("dustCopper", CreativeTabs.BUILDING_BLOCKS, 0xB87333)); } private static <T extends Item> T register(T item) { GameRegistry.register(item); ((FIItem)item).registerItemModel(); return item; } } My plan is to simply pass a hexColor when I want to register an item with a color multiplier. If an item doesn't need a color multiplied over it, I simply leave off the hexColor. Is this an issue with how I am storing and passing the hexidecimal? I don't often use them. If I am heading down the wrong path, what is the correct way to implement items with a hexColor multiplied over them?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.