Chisel Chipped Integration

Chisel Chipped Integration

1M Downloads

Chisel carpets are not showing (1.12.2)

tgevrenos opened this issue · 10 comments

commented

When I try to chisel any color of wool directly; I am fine.. but when i try to chisel a carpet... it does not show.. The mod is probably conflicting with another mod i'm using.. I'd appreciate if someone could guide me to the right direction here..

Screen Shot 2020-04-27 at 18 34 54

I am playing on 1.12.2 with the latest version of the mod, along with 98 mods. (the chiseled carpets do show on JEI btw.

commented

A couple mods come to mind allready, may be “inspirations”. I’ll try and let you know.

(05.05.2020) EDIT:
For anyone that may have the same issue;

"Inspirations" is the mot that causes the conflict. it does not in any way remove the carpets, only the recipes don't work. I just created custom recipes for the ones i use :)

Thanks @tterrag1098 for guiding me here..

how you did that ? can you teach me how to fix that , 'cuz i have the same issue you had :c

commented

@DamienBrittan There are many ways to do that using mods.

The easiest one I find is customnpc's mod.. (I'm sure some people may disagree..)

1 - In Creative mode, acquire the items you want to create recipes for.
2 - Create an npc and go to the final gui tab that says "Global", there you will find recipes.

You can easily add new recipes for anything you want. (this is a cheaty way really. If you look into it; you can find some guides using mods like crafttweaker etc. .. In my case, i don't mess with those :D) Hope it helps..

commented

I literally explained how to fix it with CraftTweaker/ModTweaker in the message above. Adding all of the carpets to a new chisel group (causing it to lookup the items again and fix them being "missing")

commented

Not sure if it's the way CraftTweaker's implementation of ketSet is or what, but the result is a mismatch of colors caused by the ordering being different than the original order.

I've updated the code to just use an array to map the colors instead.

#modloaded chisel inspirations modtweaker

import mods.chisel.Carving;
import crafttweaker.item.IItemDefinition;
import crafttweaker.item.IItemStack;

static minecraftCarpet as IItemDefinition = <minecraft:carpet>.definition;

static chiselCarpetColorDict as string[] = [
    "white",
    "orange",
    "magenta",
    "lightblue",
    "yellow",
    "lime",
    "pink",
    "gray",
    "lightgray",
    "cyan",
    "purple",
    "blue",
    "brown",
    "green",
    "red",
    "black"
];

for i, color in chiselCarpetColorDict {
    var group = "inspirations_carpet_" + color;
    var chiselCarpet = itemUtils.getItem("chisel:carpet_" + color).definition;
    Carving.addVariation(group, minecraftCarpet.makeStack(i));
    Carving.addVariation(group, chiselCarpet.makeStack(0));
    Carving.addVariation(group, chiselCarpet.makeStack(1));
}
commented

See if any mods are replacing carpets? No idea, it works fine with only chisel.

commented

A couple mods come to mind allready, may be “inspirations”. I’ll try and let you know.

(05.05.2020) EDIT:
For anyone that may have the same issue;

"Inspirations" is the mot that causes the conflict. it does not in any way remove the carpets, only the recipes don't work. I just created custom recipes for the ones i use :)

Thanks @tterrag1098 for guiding me here..

commented

Cross-linking KnightMiner/Inspirations#161. I perform block substitutions to make my carpet on stairs feature work. Essentially, I replace the block with a new version. This would normally work fine with mods, but you store an instance of the old carpet block as part of your recipes since you register your recipes during the block registration event.

To fix, delay adding carving variations until addRecipes, that way I've already made my block substitutions so you don't have a risk of fetching the unsubstituted block.

commented

This would probably be a significant refactor. I'll look into it but I can't promise a fix for 1.12.

commented

@tterrag1098 @KnightMiner you people are awesome just for trying😁

commented

A working solution for the end-user would be to add the variations to a new group, which indirectly causes Chisel to lookup the item references again. Unfortunately, it's not possible to remove and re-add the variations to the existing group, as it seems Chisel's API would require you to effectively use an invalid item as the key for the variation lookup (specifically, attempting to remove variations for a minecraft:carpet stack results in an NPE here:

if ((g == null || lookup.get(vw).getName().equals(g.getName())) && vw.equals(new VariationWrapper(variation))) {

Here is an implementation of the new-group solution (requires ModTweaker):

import mods.chisel.Carving;
import crafttweaker.item.IItemDefinition;
import crafttweaker.item.IItemStack;

#modloaded chisel inspirations modtweaker

static minecraftCarpet as IItemDefinition = <minecraft:carpet>.definition;

static chiselCarpets as IItemStack[string] = {
	white: <chisel:carpet_white>,
	orange: <chisel:carpet_orange>,
	magenta: <chisel:carpet_magenta>,
	light_blue: <chisel:carpet_lightblue>,
	yellow: <chisel:carpet_yellow>,
	lime: <chisel:carpet_lime>,
	pink: <chisel:carpet_pink>,
	gray: <chisel:carpet_gray>,
	light_gray: <chisel:carpet_lightgray>,
	cyan: <chisel:carpet_cyan>,
	purple: <chisel:carpet_purple>,
	blue: <chisel:carpet_blue>,
	brown: <chisel:carpet_brown>,
	green: <chisel:carpet_green>,
	red: <chisel:carpet_red>,
	black: <chisel:carpet_black>
} as IItemStack[string];

for i, color in chiselCarpets.keySet {
	var group = "inspirations_carpet_" + color;
	var chiselCarpet = chiselCarpets[color].definition;
	Carving.addVariation(group, minecraftCarpet.makeStack(i));
	Carving.addVariation(group, chiselCarpet.makeStack(0));
	Carving.addVariation(group, chiselCarpet.makeStack(1));
}