Chisel icon indicating copy to clipboard operation
Chisel copied to clipboard

Chisel carpets are not showing (1.12.2)

Open tgevrenos opened this issue 5 years ago • 10 comments

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.

tgevrenos avatar Apr 27 '20 15:04 tgevrenos

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

tterrag1098 avatar May 03 '20 21:05 tterrag1098

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..

tgevrenos avatar May 04 '20 15:05 tgevrenos

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.

KnightMiner avatar May 05 '20 15:05 KnightMiner

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

tterrag1098 avatar May 12 '20 01:05 tterrag1098

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

tgevrenos avatar May 12 '20 09:05 tgevrenos

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:

https://github.com/Chisel-Team/Chisel/blob/a0df1047a979bc55b3c81d5875e6890c21063bec/src/main/java/team/chisel/common/carving/GroupList.java#L263

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));
}

ChloeDawn avatar May 12 '20 14:05 ChloeDawn

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

DamienBrittan avatar Jun 10 '20 17:06 DamienBrittan

@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..

tgevrenos avatar Jun 16 '20 10:06 tgevrenos

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")

ChloeDawn avatar Jun 16 '20 12:06 ChloeDawn

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));
}

justinrusso avatar Jul 01 '20 16:07 justinrusso