diff --git a/build.gradle b/build.gradle index d541110..746ef43 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,10 @@ processResources { } } +fabricApi { + configureDataGeneration() +} + tasks.withType(JavaCompile).configureEach { it.options.release = 25 } diff --git a/src/main/java/de/jottyfan/minecraft/item/QuicklyItems.java b/src/main/java/de/jottyfan/minecraft/item/QuicklyItems.java index e6961f9..ae499c8 100644 --- a/src/main/java/de/jottyfan/minecraft/item/QuicklyItems.java +++ b/src/main/java/de/jottyfan/minecraft/item/QuicklyItems.java @@ -14,6 +14,7 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.world.item.Item; import net.minecraft.world.item.equipment.ArmorType; import net.minecraft.world.level.ItemLike; + /** * * @author jotty @@ -23,13 +24,13 @@ public class QuicklyItems { public static final Item STUB = registerItem(ID.STUB, Stub::new); public static final Item RAWTURQUOISE = registerItem(ID.RAWTURQUOISE); public static final Item TURQUOISEINGOT = registerItem(ID.TURQUOISEINGOT); - public static final Item COTTON = registerItem(ID.COTTON); + public static final Item COTTON = registerItem(ID.COTTON, ofCompostable(QIP.of(ID.COTTON))); public static final Item COTTONPLANT = registerItem(ID.COTTONPLANT); - public static final Item COTTONSEED = registerItem(ID.COTTONSEED, QIP.of(ID.BLOCKCOTTONPLANT), Plant::new); + public static final Item COTTONSEED = registerItem(ID.COTTONSEED, ofCompostable(QIP.of(ID.BLOCKCOTTONPLANT)), Plant::new); public static final Item PILLOW = registerItem(ID.PILLOW); - public static final Item CANOLA = registerItem(ID.CANOLA); + public static final Item CANOLA = registerItem(ID.CANOLA, ofCompostable(QIP.of(ID.CANOLA))); public static final Item CANOLAPLANT = registerItem(ID.CANOLAPLANT); - public static final Item CANOLASEED = registerItem(ID.CANOLASEED, QIP.of(ID.BLOCKCANOLAPLANT), Plant::new); + public static final Item CANOLASEED = registerItem(ID.CANOLASEED, ofCompostable(QIP.of(ID.BLOCKCANOLAPLANT)), Plant::new); public static final Item CANOLABOTTLE = registerItem(ID.CANOLABOTTLE); public static final Item CANOLABOTTLESTACK = registerItem(ID.CANOLABOTTLESTACK); public static final Item ROTTENFLESHSTRIPES = registerItem(ID.ROTTEN_FLESH_STRIPES); @@ -78,6 +79,10 @@ public class QuicklyItems { public static final Item ARMOR_TURQUOISE_LEGGINGS = registerItem(ID.TURQUOISE_LEGGINGS, ArmorType.LEGGINGS); public static final Item ARMOR_TURQUOISE_CHESTPLATE = registerItem(ID.TURQUOISE_CHESTPLATE, ArmorType.CHESTPLATE); + private static final QIP ofCompostable(QIP qip) { + return (QIP) qip.compostable(ResourceKey.create(Registries.NUMBER_PROVIDER, Identifier.withDefaultNamespace("compostable/medium_high"))); + } + private static final Item registerItem(Identifier identifier, ArmorType armorType) { return QuicklyItems.registerItem(identifier, new QIP().stacksTo(1).humanoidArmor(ModArmorMaterials.TURQUOISE_ARMOR_MATERIAL, armorType)); diff --git a/src/main/resources/data/quickly/items/quickiepowderaxe.json b/src/main/resources/data/quickly/item/quickiepowderaxe.json similarity index 100% rename from src/main/resources/data/quickly/items/quickiepowderaxe.json rename to src/main/resources/data/quickly/item/quickiepowderaxe.json diff --git a/src/main/resources/data/quickly/items/speedpowderaxe.json b/src/main/resources/data/quickly/item/speedpowderaxe.json similarity index 100% rename from src/main/resources/data/quickly/items/speedpowderaxe.json rename to src/main/resources/data/quickly/item/speedpowderaxe.json diff --git a/src/main/resources/data/quickly/items/canola.json b/src/main/resources/data/quickly/items/canola.json deleted file mode 100644 index 085979b..0000000 --- a/src/main/resources/data/quickly/items/canola.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "components": { - "minecraft:compostable": { - "layers": { - "value": 0.75 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/data/quickly/items/canolaseed.json b/src/main/resources/data/quickly/items/canolaseed.json deleted file mode 100644 index 29e494e..0000000 --- a/src/main/resources/data/quickly/items/canolaseed.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "components": { - "minecraft:compostable": { - "layers": { - "type": "minecraft:constant", - "value": 0.5 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/data/quickly/items/cotton.json b/src/main/resources/data/quickly/items/cotton.json deleted file mode 100644 index 4740a0d..0000000 --- a/src/main/resources/data/quickly/items/cotton.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "components": { - "minecraft:compostable": { - "layers": { - "type": "minecraft:constant", - "value": 0.75 - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/data/quickly/items/cottonseed.json b/src/main/resources/data/quickly/items/cottonseed.json deleted file mode 100644 index 29e494e..0000000 --- a/src/main/resources/data/quickly/items/cottonseed.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "components": { - "minecraft:compostable": { - "layers": { - "type": "minecraft:constant", - "value": 0.5 - } - } - } -} \ No newline at end of file