Jump to content

IcedReaper

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

IcedReaper's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Thanks for the hint. As I'm not that experienced with the model definitions I had to look some up, but I got it to work. I now use the following model (if someone has the same problem) { "parent": "block/block", "textures": { "all": "icedresources:blocks/base_block" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 } } } ] } Just change the block Texture and you can use it as a template/parent in your flat blocks you want to tint. And your specific block.json files can then be as slim as: { "parent": "icedresources:block/base_block" }
  2. Hi, I'm trying to dynamically color blocks (Metal Blocks). It works fine for items (ingots, dust, etc) but it sadly doesn't work for blocks. I'm having these events: @SubscribeEvent public static void colorItems(final ColorHandlerEvent.Item e) { ItemColors colors = e.getItemColors(); ModuleCore.materials.forEach((materialName, materialDefinition) -> { materialDefinition.parts.forEach((part, item) -> { if(item instanceof BaseItem) { Item i = (Item) item; // This works as it's supposed to be. colors.register((stack, tintIndex) -> materialDefinition.color.getRGB(), i); } else if(item instanceof MaterialBlock) { Item i = ((MaterialBlock) item).item; // These two were tests to see if I had to color the Blocks items instead of the block. But it didn't do anything. colors.register((stack, tintIndex) -> materialDefinition.color.getRGB(), Item.getItemFromBlock((MaterialBlock) item)); colors.register((stack, tintIndex) -> materialDefinition.color.getRGB(), i); } }); }); } @SubscribeEvent public static void colorBlocks(final ColorHandlerEvent.Block e) { BlockColors colors = e.getBlockColors(); ModuleCore.materials.forEach((materialName, materialDefinition) -> { if(materialDefinition.parts.containsKey(Part.BLOCK)) { // The code is executed but the block isn't colored. colors.register((state, worldIn, pos, tintIndex) -> materialDefinition.color.getRGB(), (Block) materialDefinition.parts.get(Part.BLOCK)); } }); } When I add a Logger.info in the if-condition I can see that the method is called and executed for every material I have defined to have a Block. The coloring of the BaseItems works fine, but all tries to color the Block doesn't seem to work. I looked at the Documentation (which seems to be outdated), I found this forum thread I tried several other approaches, but all tries didn't seem to work. I tried to use an alpha of 0 instead of 255, but it didn't had any influence too. I can see in the Debugger that the colors are being a added (See attached screenshot of the Debugging Information) Does anyone know what am I doing wrong and what do I have to change? You can see the complete Code here (https://github.com/IcedReaper/IcedResources/blob/main/src/main/java/com/icedreaper/icedresources/handlers/ColorEventHandler.java) (I currently have the code to color the blocks commented out and instead implemented a way to create new colored images for the blocks, but this shouldn't be the way I'd imagine ;)) Thanks in Advance, IcedReaper
  3. Hi, I'm trying to make a mod and would like to setup the recipes for some of it's items based on some conditions (mainly if mods are present) and currently I'm failing. I tried to register the recipe outside of the runData task, but as I don't have the Generator it's not possible or I'm still doing it wrong, or at least I don't know how to. I can create the static recipes in the runData task, but then they're always available, regardless if they should be available or not. And registering the default recipes and then using CraftTweaker to disable the created recipes and register new recipes with the items/machines from the mod doesn't feel to be the correct and intended way. Is there a way I can dynamically register recipes in the server start up event for example? Or is there a way to add a condition to the generated json files, like: { "useWhenModIsLoaded": "mekanism" } or { "useWhenModIsNotLoaded": "mekanism" } ? Thanks in Advance, IcedReaper
×
×
  • Create New...

Important Information

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