Skip to content

Commit 805e4cd

Browse files
authored
Note Chisel Carving bug for registry replacement (#325)
* add warning about registry replacement * catch warning and note possible cause * expand carving warning, add inspirations note
1 parent f4cfe68 commit 805e4cd

File tree

2 files changed

+13
-2
lines changed
  • src/main

2 files changed

+13
-2
lines changed

src/main/java/com/cleanroommc/groovyscript/compat/mods/chisel/Carving.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121

2222
@RegistryDescription(
2323
category = RegistryDescription.Category.ENTRIES,
24-
admonition = @Admonition(value = "groovyscript.wiki.chisel.carving.note", type = Admonition.Type.DANGER, format = Admonition.Format.STANDARD),
24+
admonition = {
25+
@Admonition(value = "groovyscript.wiki.chisel.carving.note0", type = Admonition.Type.DANGER, format = Admonition.Format.STANDARD),
26+
@Admonition(value = "groovyscript.wiki.chisel.carving.note1", type = Admonition.Type.BUG, format = Admonition.Format.STANDARD)
27+
},
2528
isFullyDocumented = false // TODO fully document Chisel Carving
2629
)
2730
public class Carving extends VirtualizedRegistry<Pair<String, ItemStack>> {
@@ -95,6 +98,13 @@ public void removeVariation(String groupName, ItemStack item) {
9598
.add("instead, edit the oredict via `oredict.remove('{}', {})`", groupName, GroovyScriptCodeConverter.asGroovyCode(item, false, false))
9699
.error()
97100
.post();
101+
} catch (NullPointerException e) {
102+
var log = GroovyLog.msg("An exception occurred with Chisel Carving - likely due to some other mod doing registry replacement")
103+
.add("This is not a bug with GroovyScript! It is a bug between Chisel and whatever mod is doing registry replacement.")
104+
.exception(e)
105+
.error();
106+
if (ModSupport.INSPIRATIONS.isLoaded()) log.add("The Inspirations Fitted Carpets feature will cause this if enabled - you will need to disable it in 'config/inspirations.cfg'");
107+
log.post();
98108
}
99109
}
100110

src/main/resources/assets/groovyscript/lang/en_us.lang

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,8 @@ groovyscript.wiki.calculator.stone_separator.description=Converts an input items
11001100
# Chisel
11011101
groovyscript.wiki.chisel.carving.title=Carving
11021102
groovyscript.wiki.chisel.carving.description=Sets a group of items any item can be converted between freely, in world and in a GUI
1103-
groovyscript.wiki.chisel.carving.note=You cannot addVariation/removeVariation to chisel groups based on the oredict, you have to modify the oredict directly.
1103+
groovyscript.wiki.chisel.carving.note0=You cannot addVariation/removeVariation to chisel groups based on the oredict, you have to modify the oredict directly.
1104+
groovyscript.wiki.chisel.carving.note1=Some mods use "registry replacement" to change a preexisting entry in a registry. If this has been done to a block used by chisel, this will result in errors when manipulating *any* carving group and prevent the chiseling of that block. Of particular note is Inspirations, which can replace carpets and causes [this issue](https://github.com/Chisel-Team/Chisel/issues/828).
11041105
groovyscript.wiki.chisel.carving.setSound=Sets the sound of the Chisel Group
11051106
groovyscript.wiki.chisel.carving.addGroup=Adds a new Chisel Group with the given name
11061107
groovyscript.wiki.chisel.carving.addVariation=Adds a new Item Variation to the Chisel Group

0 commit comments

Comments
 (0)