From 9f82ffbdc5e96b24d4769683534b119db1a27ca4 Mon Sep 17 00:00:00 2001 From: Unix Date: Wed, 27 Sep 2023 11:24:37 -0500 Subject: [PATCH] 1.19.2 --- build.gradle | 24 +++++++---- gradle.properties | 12 +++--- .../io/github/unix_supremacist/Alchemist.java | 10 ++--- .../unix_supremacist/AlchemistRegistry.java | 38 +++++++++++++++++ .../content/AlchemistBlocks.java | 6 +-- .../content/AlchemistItems.java | 24 +++++------ .../unix_supremacist/data/BlockTag.java | 32 ++++++-------- .../github/unix_supremacist/data/Datagen.java | 9 ++-- .../github/unix_supremacist/data/ItemTag.java | 21 +++++----- .../unix_supremacist/data/Language.java | 10 ++--- .../github/unix_supremacist/data/Recipe.java | 42 +++++++++---------- .../unix_supremacist/item/GaleItem.java | 4 +- .../item/PhilosophersStoneItem.java | 6 +-- src/main/resources/fabric.mod.json | 2 +- 14 files changed, 134 insertions(+), 106 deletions(-) create mode 100644 src/main/java/io/github/unix_supremacist/AlchemistRegistry.java diff --git a/build.gradle b/build.gradle index 466548f..4d84b15 100644 --- a/build.gradle +++ b/build.gradle @@ -74,6 +74,12 @@ sourceSets { } } +configurations.all { + resolutionStrategy { + force("net.fabricmc:fabric-loader:$loader_version") + } +} + dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" @@ -83,9 +89,9 @@ dependencies { } modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation "TechReborn:TechReborn-1.20:5.9.1" - include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4"))) - include modImplementation("net.feltmc:felt-splash-api:1.0.0-1.20.1"){ + //modImplementation "TechReborn:TechReborn-1.20:5.9.1" + //include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4"))) + include modImplementation("net.feltmc:felt-splash-api:1.0.0-1.19.2"){ exclude(group: "com.terraformersmc") } /*include modImplementation("net.feltmc:felt-tool-api:1.0.0-1.20.1"){ @@ -95,16 +101,16 @@ dependencies { exclude(group: "com.terraformersmc") }*/ modRuntimeOnly "maven.modrinth:modmenu:${project.modmenu_version}" - modImplementation "io.github.ladysnake:PlayerAbilityLib:1.9.0" + modImplementation "io.github.ladysnake:PlayerAbilityLib:1.6.0" //required for trinkets - modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0" - modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0" - modImplementation "dev.emi:trinkets:3.8.0" - modRuntimeOnly "maven.modrinth:jei:16.0.0.28" + modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.0.2" + modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.0.2" + modImplementation "dev.emi:trinkets:3.4.1" + //modRuntimeOnly "maven.modrinth:jei:11.6.0.1018" //modRuntimeOnly "maven.modrinth:architectury-api:10.0.7+fabric" //modRuntimeOnly "maven.modrinth:cloth-config:12.0.107+fabric" //modRuntimeOnly "maven.modrinth:rei:13.0.654+fabric" - modRuntimeOnly "maven.modrinth:modernfix:${project.modernfix_version}" + //modRuntimeOnly "maven.modrinth:modernfix:${project.modernfix_version}" //modRuntimeOnly "maven.modrinth:ferrite-core:6.0.0-fabric" compileOnly 'org.projectlombok:lombok:1.18.24' annotationProcessor 'org.projectlombok:lombok:1.18.24' diff --git a/gradle.properties b/gradle.properties index 58e7190..0aed068 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.20.2 -yarn_mappings=1.20.2+build.1 -loader_version=0.14.22 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.28 +loader_version=0.15.0 # Mod Properties mod_version=1.1.0 @@ -15,8 +15,8 @@ maven_group=com.example archives_base_name=alchemist # Dependencies -fabric_version=0.89.2+1.20.2 +fabric_version=0.77.0+1.19.2 #Env -modernfix_version = 5.7.3-beta.1+mc1.20.2-pre3 -modmenu_version = 8.0.0-beta.2 \ No newline at end of file +modernfix_version = 5.7.4+mc1.19.2 +modmenu_version = 4.2.0-beta.2 \ No newline at end of file diff --git a/src/main/java/io/github/unix_supremacist/Alchemist.java b/src/main/java/io/github/unix_supremacist/Alchemist.java index 1c3169a..f3c2640 100644 --- a/src/main/java/io/github/unix_supremacist/Alchemist.java +++ b/src/main/java/io/github/unix_supremacist/Alchemist.java @@ -6,11 +6,9 @@ import io.github.unix_supremacist.data.BlockTag; import io.github.unix_supremacist.item.AbstractEmpowerableItem; import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; @@ -21,16 +19,16 @@ public class Alchemist { public static final String MODID = "alchemist"; public static final Logger LOGGER = LoggerFactory.getLogger(MODID); public static final ResourceLocation empower_packet = new ResourceLocation(Alchemist.MODID, "empower_packet"); - public static final CreativeModeTab tab = FabricItemGroup.builder() + public static final CreativeModeTab tab = FabricItemGroupBuilder.create(new ResourceLocation(Alchemist.MODID, "tab")) .icon(() -> new ItemStack(AlchemistItems.philosophers_stone.getItem())) - .title(Component.translatable("itemGroup."+MODID)) .build(); public static void Init(){ LOGGER.info("Welcome to the World of Alchemy!"); - Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(MODID, "tab"), tab); + AlchemistRegistry.registerExchanges(); + AlchemistSplashes.init(); AlchemistBlocks.values(); //force the enum to load AlchemistItems.values(); //force the enum to load diff --git a/src/main/java/io/github/unix_supremacist/AlchemistRegistry.java b/src/main/java/io/github/unix_supremacist/AlchemistRegistry.java new file mode 100644 index 0000000..60e42f2 --- /dev/null +++ b/src/main/java/io/github/unix_supremacist/AlchemistRegistry.java @@ -0,0 +1,38 @@ +package io.github.unix_supremacist; + +import io.github.unix_supremacist.data.BlockTag; +import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents; +import net.minecraft.core.Registry; +import net.minecraft.world.level.block.Block; + +import java.util.ArrayList; +import java.util.HashSet; + +public class AlchemistRegistry { + public static HashSet> exchanges = new HashSet<>(); + public static ArrayList terra = new ArrayList<>(); + public static ArrayList wood = new ArrayList<>(); + public static ArrayList leave = new ArrayList<>(); + + public static void registerExchanges(){ + CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> { + Registry.BLOCK.getTagOrEmpty(BlockTag.terratag).iterator().forEachRemaining(t ->terra.add(t.value())); + Registry.BLOCK.getTagOrEmpty(BlockTag.woodtag).iterator().forEachRemaining(t ->wood.add(t.value())); + Registry.BLOCK.getTagOrEmpty(BlockTag.leavetag).iterator().forEachRemaining(t ->leave.add(t.value())); + exchanges.add(terra); + exchanges.add(wood); + exchanges.add(leave); + }); + } + + public static Block getBlockWithOffset(Block b, ArrayList exchange, int o){ + int id = exchange.indexOf(b); + int size = exchange.size(); + id += o; + if (id < 0) + id = size + id % size; + else + id %= size; + return exchange.get(id); + } +} diff --git a/src/main/java/io/github/unix_supremacist/content/AlchemistBlocks.java b/src/main/java/io/github/unix_supremacist/content/AlchemistBlocks.java index 25feda2..d029554 100644 --- a/src/main/java/io/github/unix_supremacist/content/AlchemistBlocks.java +++ b/src/main/java/io/github/unix_supremacist/content/AlchemistBlocks.java @@ -5,16 +5,16 @@ import lombok.Getter; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.material.Material; public enum AlchemistBlocks { - transmutation_circle(new TransmutionCircleBlock(FabricBlockSettings.create())); + transmutation_circle(new TransmutionCircleBlock(FabricBlockSettings.of(Material.AIR))); @Getter Block block; AlchemistBlocks(Block block){ this.block = block; - Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Alchemist.MODID, this.name()), block); + Registry.register(Registry.BLOCK, new ResourceLocation(Alchemist.MODID, this.name()), block); } } diff --git a/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java b/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java index 319bb28..bd14629 100644 --- a/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java +++ b/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java @@ -3,10 +3,8 @@ import io.github.unix_supremacist.Alchemist; import io.github.unix_supremacist.item.*; import lombok.Getter; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.registry.FuelRegistry; import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; @@ -18,8 +16,8 @@ public enum AlchemistItems { alchemical_coal(25600), aeternalis_fuel(1638400), //black_hole_band, - catalytic_lens(new DestructionItem(new Properties().stacksTo(1), 3, 10, 5)), - chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock(), new Properties().durability(64))), + catalytic_lens(new DestructionItem(new Properties().tab(Alchemist.tab).stacksTo(1), 3, 10, 5)), + chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock(), new Properties().tab(Alchemist.tab).durability(64))), coal_coke(3200), dark_matter, //dark_matter_pickaxe, @@ -28,18 +26,19 @@ public enum AlchemistItems { //dark_matter_sword, //dark_matter_axe, //dark_matter_shears, - dark_matter_hammer(new AlchemistHammerItem(Tiers.NETHERITE, 1, -2.8f, new Properties())), - destruction_catalyst(new DestructionItem(new Properties().stacksTo(1), 3, 5, 1)), - evertide_amulet(new AlchemistBlockItem(Blocks.WATER, new Properties().stacksTo(1))), + + dark_matter_hammer(new AlchemistHammerItem(Tiers.NETHERITE, 1, -2.8f, new Properties().tab(Alchemist.tab))), + destruction_catalyst(new DestructionItem(new Properties().tab(Alchemist.tab).stacksTo(1), 3, 5, 1)), + evertide_amulet(new AlchemistBlockItem(Blocks.WATER, new Properties().tab(Alchemist.tab).stacksTo(1))), //gem_of_eternal_density, //harvest_goddess_band, //hyperkinetic_lens, iron_band, mobius_fuel(204800), - philosophers_stone(new PhilosophersStoneItem(new Properties().stacksTo(1))), + philosophers_stone(new PhilosophersStoneItem(new Properties().tab(Alchemist.tab).stacksTo(1))), red_matter, swiftwolfs_rending_gale(new GaleItem(new Properties().stacksTo(1))), - volcanite_amulet(new AlchemistBlockItem(Blocks.LAVA, new Properties().durability(64))), + volcanite_amulet(new AlchemistBlockItem(Blocks.LAVA, new Properties().tab(Alchemist.tab).durability(64))), ; @Getter Item item; AlchemistItems(){ @@ -47,7 +46,7 @@ public enum AlchemistItems { } AlchemistItems(int burntime){ - this(new Properties(), burntime); + this(new Properties().tab(Alchemist.tab), burntime); } AlchemistItems(Properties properties){ @@ -65,9 +64,6 @@ public enum AlchemistItems { AlchemistItems(Item item, int burntime){ this.item = item; FuelRegistry.INSTANCE.add(item, burntime); - Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(Alchemist.MODID, this.name()), item); - ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Alchemist.MODID, "tab"))).register(content -> { - content.accept(item); - }); + Registry.register(Registry.ITEM, new ResourceLocation(Alchemist.MODID, this.name()), item); } } diff --git a/src/main/java/io/github/unix_supremacist/data/BlockTag.java b/src/main/java/io/github/unix_supremacist/data/BlockTag.java index dd1712b..6e945b3 100644 --- a/src/main/java/io/github/unix_supremacist/data/BlockTag.java +++ b/src/main/java/io/github/unix_supremacist/data/BlockTag.java @@ -1,10 +1,10 @@ package io.github.unix_supremacist.data; import io.github.unix_supremacist.Alchemist; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; import net.minecraft.core.HolderLookup; -import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; @@ -13,24 +13,22 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.concurrent.CompletableFuture; - -public class BlockTag extends FabricTagProvider.BlockTagProvider { +public class BlockTag extends FabricTagProvider { public static HashSet> exchanges = new HashSet<>(); - public static TagKey terratag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra")); - public static TagKey woodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "wood")); - public static TagKey netherwoodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood")); - public static TagKey leavetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave")); - public static TagKey stonetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stone")); - public static TagKey obsidiantag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "obsidian")); - public static TagKey stonebrickstag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stonebricks")); + public static TagKey terratag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra")); + public static TagKey woodtag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "wood")); + public static TagKey netherwoodtag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood")); + public static TagKey leavetag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave")); + public static TagKey stonetag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stone")); public static TagKey obsidiantag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "obsidian")); + public static TagKey stonebrickstag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stonebricks")); - public BlockTag(FabricDataOutput output, CompletableFuture completableFuture) { - super(output, completableFuture); + public BlockTag(FabricDataGenerator dataGenerator) { + super(dataGenerator, Registry.BLOCK); } protected static void addExchange(TagKey tag){ ArrayList arrayList = new ArrayList<>(); - BuiltInRegistries.BLOCK.getTagOrEmpty(tag).iterator().forEachRemaining(t ->arrayList.add(t.value())); + Registry.BLOCK.getTagOrEmpty(tag).iterator().forEachRemaining(t ->arrayList.add(t.value())); exchanges.add(arrayList); } @@ -45,7 +43,7 @@ public static void init(){ } @Override - protected void addTags(HolderLookup.Provider arg) { + protected void generateTags() { FabricTagBuilder terra = getOrCreateTagBuilder(terratag); terra.add(Blocks.GRASS_BLOCK); terra.add(Blocks.DIRT); @@ -63,7 +61,6 @@ protected void addTags(HolderLookup.Provider arg) { wood.add(Blocks.OAK_LOG); wood.add(Blocks.ACACIA_LOG); wood.add(Blocks.BIRCH_LOG); - wood.add(Blocks.CHERRY_LOG); wood.add(Blocks.JUNGLE_LOG); wood.add(Blocks.DARK_OAK_LOG); wood.add(Blocks.MANGROVE_LOG); @@ -71,7 +68,6 @@ protected void addTags(HolderLookup.Provider arg) { wood.add(Blocks.STRIPPED_OAK_LOG); wood.add(Blocks.STRIPPED_ACACIA_LOG); wood.add(Blocks.STRIPPED_BIRCH_LOG); - wood.add(Blocks.STRIPPED_CHERRY_LOG); wood.add(Blocks.STRIPPED_JUNGLE_LOG); wood.add(Blocks.STRIPPED_DARK_OAK_LOG); wood.add(Blocks.STRIPPED_MANGROVE_LOG); @@ -79,7 +75,6 @@ protected void addTags(HolderLookup.Provider arg) { wood.add(Blocks.OAK_WOOD); wood.add(Blocks.ACACIA_LOG); wood.add(Blocks.BIRCH_LOG); - wood.add(Blocks.CHERRY_LOG); wood.add(Blocks.JUNGLE_LOG); wood.add(Blocks.DARK_OAK_LOG); wood.add(Blocks.MANGROVE_LOG); @@ -95,7 +90,6 @@ protected void addTags(HolderLookup.Provider arg) { leave.add(Blocks.OAK_LEAVES); leave.add(Blocks.ACACIA_LEAVES); leave.add(Blocks.BIRCH_LEAVES); - leave.add(Blocks.CHERRY_LEAVES); leave.add(Blocks.JUNGLE_LEAVES); leave.add(Blocks.DARK_OAK_LEAVES); leave.add(Blocks.MANGROVE_LEAVES); diff --git a/src/main/java/io/github/unix_supremacist/data/Datagen.java b/src/main/java/io/github/unix_supremacist/data/Datagen.java index 16f8994..a84fea0 100644 --- a/src/main/java/io/github/unix_supremacist/data/Datagen.java +++ b/src/main/java/io/github/unix_supremacist/data/Datagen.java @@ -6,10 +6,9 @@ public class Datagen implements DataGeneratorEntrypoint { @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { - FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); - pack.addProvider(ItemTag::new); - pack.addProvider(BlockTag::new); - pack.addProvider(Recipe::new); - pack.addProvider(Language::new); + fabricDataGenerator.addProvider(ItemTag::new); + fabricDataGenerator.addProvider(BlockTag::new); + fabricDataGenerator.addProvider(Recipe::new); + fabricDataGenerator.addProvider(Language::new); } } diff --git a/src/main/java/io/github/unix_supremacist/data/ItemTag.java b/src/main/java/io/github/unix_supremacist/data/ItemTag.java index 448804a..e9d7d69 100644 --- a/src/main/java/io/github/unix_supremacist/data/ItemTag.java +++ b/src/main/java/io/github/unix_supremacist/data/ItemTag.java @@ -1,10 +1,9 @@ package io.github.unix_supremacist.data; import dev.emi.trinkets.TrinketsMain; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; @@ -13,19 +12,19 @@ import static io.github.unix_supremacist.content.AlchemistItems.*; -public class ItemTag extends FabricTagProvider.ItemTagProvider { +public class ItemTag extends FabricTagProvider { public static String common = "c"; - public static TagKey handring = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "hand/ring")); - public static TagKey offhandring = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "offhand/ring")); - public static TagKey water_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(common, "water_buckets")); - public static TagKey lava_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(common, "lava_buckets")); + public static TagKey handring = TagKey.create(Registry.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "hand/ring")); + public static TagKey offhandring = TagKey.create(Registry.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "offhand/ring")); + public static TagKey water_bucket = TagKey.create(Registry.ITEM.key(), new ResourceLocation(common, "water_buckets")); + public static TagKey lava_bucket = TagKey.create(Registry.ITEM.key(), new ResourceLocation(common, "lava_buckets")); - public ItemTag(FabricDataOutput output, CompletableFuture completableFuture) { - super(output, completableFuture); + public ItemTag(FabricDataGenerator dataGenerator) { + super(dataGenerator, Registry.ITEM); } @Override - protected void addTags(HolderLookup.Provider arg) { + protected void generateTags() { getOrCreateTagBuilder(handring).add(swiftwolfs_rending_gale.getItem()); getOrCreateTagBuilder(offhandring).add(swiftwolfs_rending_gale.getItem()); getOrCreateTagBuilder(water_bucket).add(evertide_amulet.getItem()); diff --git a/src/main/java/io/github/unix_supremacist/data/Language.java b/src/main/java/io/github/unix_supremacist/data/Language.java index 5c42989..e176b0b 100644 --- a/src/main/java/io/github/unix_supremacist/data/Language.java +++ b/src/main/java/io/github/unix_supremacist/data/Language.java @@ -3,17 +3,17 @@ import io.github.unix_supremacist.Alchemist; import io.github.unix_supremacist.content.AlchemistBlocks; import io.github.unix_supremacist.content.AlchemistItems; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import org.apache.commons.lang3.text.WordUtils; public class Language extends FabricLanguageProvider { - protected Language(FabricDataOutput dataOutput) { - super(dataOutput, "en_us"); + + protected Language(FabricDataGenerator dataGenerator) { + super(dataGenerator, "en_us"); } @Override @@ -24,8 +24,6 @@ public void generateTranslations(TranslationBuilder translationBuilder) { for (AlchemistBlocks block : AlchemistBlocks.values()) translationBuilder.add(block.getBlock(), WordUtils.capitalize(block.name().replace("_", " "))); - translationBuilder.add(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Alchemist.MODID, "tab")), WordUtils.capitalize(Alchemist.MODID.replace("_", " "))); - translationBuilder.add("key.categories.alchemist", WordUtils.capitalize(Alchemist.MODID.replace("_", " "))); translationBuilder.add("key.alchemist.empower", "Empower"); } diff --git a/src/main/java/io/github/unix_supremacist/data/Recipe.java b/src/main/java/io/github/unix_supremacist/data/Recipe.java index 3ba6769..32bfbd5 100644 --- a/src/main/java/io/github/unix_supremacist/data/Recipe.java +++ b/src/main/java/io/github/unix_supremacist/data/Recipe.java @@ -1,24 +1,24 @@ package io.github.unix_supremacist.data; import io.github.unix_supremacist.Alchemist; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.recipes.*; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; +import java.util.function.Consumer; import static io.github.unix_supremacist.content.AlchemistItems.*; public class Recipe extends FabricRecipeProvider { - public Recipe(FabricDataOutput generator) { - super(generator); + public Recipe(FabricDataGenerator dataGenerator) { + super(dataGenerator); } @Override - public void buildRecipes(RecipeOutput recipeoutput) { - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, swiftwolfs_rending_gale.getItem()) + public void generateRecipes(Consumer recipeoutput) { + /*ShapedRecipeBuilder.shaped(swiftwolfs_rending_gale.getItem()) .pattern("D") .pattern("B") .define('D', dark_matter.getItem()) @@ -26,7 +26,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(dark_matter.getItem()), RecipeProvider.has(dark_matter.getItem())) .unlockedBy(RecipeProvider.getHasName(iron_band.getItem()), RecipeProvider.has(iron_band.getItem())) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, iron_band.getItem()) + ShapedRecipeBuilder.shaped(iron_band.getItem()) .pattern("III") .pattern("ILI") .pattern("III") @@ -35,7 +35,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(Items.IRON_INGOT), RecipeProvider.has(Items.IRON_INGOT)) .unlockedBy(RecipeProvider.getHasName(Items.LAVA_BUCKET), RecipeProvider.has(Items.LAVA_BUCKET)) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, catalytic_lens.getItem()) + ShapedRecipeBuilder.shaped(catalytic_lens.getItem()) .pattern("DDD") .pattern("CDC") .pattern("DDD") @@ -44,7 +44,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(red_matter.getItem()), RecipeProvider.has(red_matter.getItem())) .unlockedBy(RecipeProvider.getHasName(destruction_catalyst.getItem()), RecipeProvider.has(destruction_catalyst.getItem())) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, destruction_catalyst.getItem()) + ShapedRecipeBuilder.shaped(destruction_catalyst.getItem()) .pattern("FRF") .pattern("ASA") .pattern("FRF") @@ -57,7 +57,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(philosophers_stone.getItem()), RecipeProvider.has(philosophers_stone.getItem())) .unlockedBy(RecipeProvider.getHasName(red_matter.getItem()), RecipeProvider.has(red_matter.getItem())) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, volcanite_amulet.getItem()) + ShapedRecipeBuilder.shaped(volcanite_amulet.getItem()) .pattern("LLL") .pattern("DDD") .pattern("LLL") @@ -66,7 +66,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(dark_matter.getItem()), RecipeProvider.has(dark_matter.getItem())) .unlockedBy(RecipeProvider.getHasName(Items.LAVA_BUCKET), RecipeProvider.has(Items.LAVA_BUCKET)) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, evertide_amulet.getItem()) + ShapedRecipeBuilder.shaped(evertide_amulet.getItem()) .pattern("WWW") .pattern("DDD") .pattern("WWW") @@ -75,7 +75,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(dark_matter.getItem()), RecipeProvider.has(dark_matter.getItem())) .unlockedBy(RecipeProvider.getHasName(Items.WATER_BUCKET), RecipeProvider.has(Items.WATER_BUCKET)) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, chalk.getItem()) + ShapedRecipeBuilder.shaped(chalk.getItem()) .pattern("CD") .pattern("D ") .define('D', Items.DIORITE) @@ -83,7 +83,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(Items.DIORITE), RecipeProvider.has(Items.DIORITE)) .unlockedBy(RecipeProvider.getHasName(Items.CLAY_BALL), RecipeProvider.has(Items.CLAY_BALL)) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.COBBLESTONE) + ShapedRecipeBuilder.shaped(Items.COBBLESTONE) .pattern("WPL") .define('W', ItemTag.water_bucket) .define('P', philosophers_stone.getItem()) @@ -92,7 +92,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(Items.WATER_BUCKET), RecipeProvider.has(Items.WATER_BUCKET)) .unlockedBy(RecipeProvider.getHasName(philosophers_stone.getItem()), RecipeProvider.has(philosophers_stone.getItem())) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.OBSIDIAN) + ShapedRecipeBuilder.shaped(Items.OBSIDIAN) .pattern("PWL") .define('W', ItemTag.water_bucket) .define('P', philosophers_stone.getItem()) @@ -101,7 +101,7 @@ public void buildRecipes(RecipeOutput recipeoutput) { .unlockedBy(RecipeProvider.getHasName(Items.WATER_BUCKET), RecipeProvider.has(Items.WATER_BUCKET)) .unlockedBy(RecipeProvider.getHasName(philosophers_stone.getItem()), RecipeProvider.has(philosophers_stone.getItem())) .save(recipeoutput); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.STONE) + ShapedRecipeBuilder.shaped(Items.STONE) .pattern("PLW") .define('W', ItemTag.water_bucket) .define('P', philosophers_stone.getItem()) @@ -170,23 +170,23 @@ public void buildRecipes(RecipeOutput recipeoutput) { twoWayPhilStoneRecipe(Items.GUNPOWDER, Items.EMERALD, 1, recipeoutput); twoWayPhilStoneRecipe(Items.BLAZE_ROD, Items.GUNPOWDER, 2, recipeoutput); twoWayPhilStoneRecipe(Items.ENDER_PEARL, Items.BLAZE_ROD, 2, recipeoutput); - + */ } - public void twoWayPhilStoneRecipe(Item first, Item second, int count, RecipeOutput recipeoutput){ + public void twoWayPhilStoneRecipe(Item first, Item second, int count, Consumer recipeoutput){ twoWayPhilStoneRecipe(first, 1, second, count, recipeoutput); } - public void twoWayPhilStoneRecipe(Item first, int firstcount, Item second, int secondcount, RecipeOutput recipeoutput){ + public void twoWayPhilStoneRecipe(Item first, int firstcount, Item second, int secondcount, Consumer recipeoutput){ philStoneRecipe(first, firstcount, second, secondcount, recipeoutput); philStoneRecipe(second, secondcount, first, firstcount, recipeoutput); } - public void philStoneRecipe(Item output, int outputcount, Item input, int inputcount, RecipeOutput recipeoutput){ - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, output, outputcount) + public void philStoneRecipe(Item output, int outputcount, Item input, int inputcount, Consumer recipeoutput){ + /*ShapelessRecipeBuilder.shapeless(output, outputcount) .requires(philosophers_stone.getItem()) .requires(input, inputcount) .unlockedBy(RecipeProvider.getHasName(philosophers_stone.getItem()), RecipeProvider.has(philosophers_stone.getItem())) - .save(recipeoutput, new ResourceLocation(Alchemist.MODID, output +"_to_"+input)); + .save(recipeoutput, new ResourceLocation(Alchemist.MODID, output +"_to_"+input));*/ } } \ No newline at end of file diff --git a/src/main/java/io/github/unix_supremacist/item/GaleItem.java b/src/main/java/io/github/unix_supremacist/item/GaleItem.java index 5981d51..10cf5a9 100644 --- a/src/main/java/io/github/unix_supremacist/item/GaleItem.java +++ b/src/main/java/io/github/unix_supremacist/item/GaleItem.java @@ -19,14 +19,14 @@ public GaleItem(Properties properties) { @Override public void onEquip(ItemStack stack, SlotReference slot, LivingEntity entity) { - if (!entity.level().isClientSide()) + if (!entity.level.isClientSide()) if (entity instanceof Player) gale_ability.grantTo((Player) entity, VanillaAbilities.ALLOW_FLYING); } @Override public void onUnequip(ItemStack stack, SlotReference slot, LivingEntity entity) { - if (!entity.level().isClientSide()) + if (!entity.level.isClientSide()) if (entity instanceof Player) gale_ability.revokeFrom((Player) entity, VanillaAbilities.ALLOW_FLYING); } diff --git a/src/main/java/io/github/unix_supremacist/item/PhilosophersStoneItem.java b/src/main/java/io/github/unix_supremacist/item/PhilosophersStoneItem.java index eb41815..68fa59c 100644 --- a/src/main/java/io/github/unix_supremacist/item/PhilosophersStoneItem.java +++ b/src/main/java/io/github/unix_supremacist/item/PhilosophersStoneItem.java @@ -51,11 +51,11 @@ public InteractionResult useOn(UseOnContext context) { } public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity entity, InteractionHand hand) { - return transmuteEntity(entity, player.level()); + return transmuteEntity(entity, player.level); } - @Override + /*@Override public ItemStack getRecipeRemainder(ItemStack stack) { return stack.copy(); - } + }*/ } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ba681e3..acd34c0 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ }, "depends": { "fabricloader": ">=0.15.0", - "minecraft": ">=1.20", + "minecraft": ">=1.19", "java": ">=17", "fabric-api": "*", "trinkets": "*",