From 932712098732e0607130f543d1f8e0e48b072005 Mon Sep 17 00:00:00 2001 From: Tobias Burger Date: Thu, 24 Nov 2022 11:32:26 -0300 Subject: [PATCH] fixed: Beacons its not working with our custom metals. --- README.md | 6 ++--- .../data/network/RemoveNuggetPacket.java | 1 - ...nnerTag.java => ModBannerTagProvider.java} | 4 +-- .../data/providers/ModBeaconTagProvider.java | 26 +++++++++++++++++++ .../metallics_arts/setup/DataGenerators.java | 3 ++- 5 files changed, 33 insertions(+), 7 deletions(-) rename src/main/java/net/rudahee/metallics_arts/data/providers/{BannerTag.java => ModBannerTagProvider.java} (84%) create mode 100644 src/main/java/net/rudahee/metallics_arts/data/providers/ModBeaconTagProvider.java diff --git a/README.md b/README.md index 54204c44..bc469a4b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Metallics Arts 1.19.2-1.3.3 +# Metallics Arts 1.19.2-1.3.4 ## Index 📋 @@ -92,8 +92,8 @@ CurseForge page: - ~~Vials GUI, its not drawing correctly how much metal you have.~~ [v1.3.1] - ~~Bug with ctrl+space steel flying, nuggets drops doesnt sinchronyze with server~~[v1.3.2] - ~~Bendalloy do weird things in server~~[v1.3.2] -- Bronze allomantic is not drawing lines in multiplayer. -- Beacons its not working with our custom metals. +- ~~Bronze allomantic is not drawing lines in multiplayer.~~ [v1.3.2] +- ~~Beacons its not working with our custom metals.~~ [v1.3.4] - Names consistency are bad. **Improvements** diff --git a/src/main/java/net/rudahee/metallics_arts/data/network/RemoveNuggetPacket.java b/src/main/java/net/rudahee/metallics_arts/data/network/RemoveNuggetPacket.java index 4da9975b..aafc830c 100644 --- a/src/main/java/net/rudahee/metallics_arts/data/network/RemoveNuggetPacket.java +++ b/src/main/java/net/rudahee/metallics_arts/data/network/RemoveNuggetPacket.java @@ -25,7 +25,6 @@ public class RemoveNuggetPacket { public RemoveNuggetPacket(int slot, Player player) { this.uuid = player.getUUID(); this.slot = slot; - } private RemoveNuggetPacket(UUID uuid, int slot) { diff --git a/src/main/java/net/rudahee/metallics_arts/data/providers/BannerTag.java b/src/main/java/net/rudahee/metallics_arts/data/providers/ModBannerTagProvider.java similarity index 84% rename from src/main/java/net/rudahee/metallics_arts/data/providers/BannerTag.java rename to src/main/java/net/rudahee/metallics_arts/data/providers/ModBannerTagProvider.java index 7d7cc15d..1affd75b 100644 --- a/src/main/java/net/rudahee/metallics_arts/data/providers/BannerTag.java +++ b/src/main/java/net/rudahee/metallics_arts/data/providers/ModBannerTagProvider.java @@ -8,9 +8,9 @@ import net.rudahee.metallics_arts.modules.items.banners.Banners; import net.rudahee.metallics_arts.setup.enums.extras.MetalsNBTData; -public class BannerTag extends TagsProvider { +public class ModBannerTagProvider extends TagsProvider { - public BannerTag(DataGenerator pGenerator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + public ModBannerTagProvider(DataGenerator pGenerator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { super(pGenerator, Registry.BANNER_PATTERN, MetallicsArts.MOD_ID, existingFileHelper); } diff --git a/src/main/java/net/rudahee/metallics_arts/data/providers/ModBeaconTagProvider.java b/src/main/java/net/rudahee/metallics_arts/data/providers/ModBeaconTagProvider.java new file mode 100644 index 00000000..12170d87 --- /dev/null +++ b/src/main/java/net/rudahee/metallics_arts/data/providers/ModBeaconTagProvider.java @@ -0,0 +1,26 @@ +package net.rudahee.metallics_arts.data.providers; + +import net.minecraft.core.Registry; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.tags.BlockTags; +import net.minecraft.world.level.block.Block; +import net.rudahee.metallics_arts.MetallicsArts; +import net.rudahee.metallics_arts.setup.registries.ModBlock; + +public class ModBeaconTagProvider extends TagsProvider { + public ModBeaconTagProvider(DataGenerator gen, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + super(gen,Registry.BLOCK,MetallicsArts.MOD_ID,existingFileHelper); + } + + @Override + protected void addTags() { + for (Block block: ModBlock.BLOCK_METAL_BLOCKS.values()) { + this.tag(BlockTags.BEACON_BASE_BLOCKS).add(block); + } + for (Block block: ModBlock.BLOCK_GEMS_BLOCKS.values()) { + this.tag(BlockTags.BEACON_BASE_BLOCKS).add(block); + } + + } +} diff --git a/src/main/java/net/rudahee/metallics_arts/setup/DataGenerators.java b/src/main/java/net/rudahee/metallics_arts/setup/DataGenerators.java index f579db40..a54ef1dc 100644 --- a/src/main/java/net/rudahee/metallics_arts/setup/DataGenerators.java +++ b/src/main/java/net/rudahee/metallics_arts/setup/DataGenerators.java @@ -22,6 +22,7 @@ public static void gatherData (GatherDataEvent event){ gen.addProvider(true, new ModBlockTagsProvider(gen, MetallicsArts.MOD_ID, event.getExistingFileHelper())); gen.addProvider(true, new ModLootTableProvider(gen)); gen.addProvider(true, new ModRecipeProvider(gen)); - gen.addProvider(event.includeServer(), new BannerTag(gen, event.getExistingFileHelper())); + gen.addProvider(event.includeServer(), new ModBannerTagProvider(gen, event.getExistingFileHelper())); + gen.addProvider(true,new ModBeaconTagProvider(gen,event.getExistingFileHelper())); } }