diff --git a/src/main/java/net/zepalesque/redux/Redux.java b/src/main/java/net/zepalesque/redux/Redux.java index a4fbbccfe..171916c4b 100644 --- a/src/main/java/net/zepalesque/redux/Redux.java +++ b/src/main/java/net/zepalesque/redux/Redux.java @@ -4,6 +4,7 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; @@ -50,4 +51,9 @@ private void dataSetup(GatherDataEvent event) { CompletableFuture lookupProvider = event.getLookupProvider(); PackOutput packOutput = generator.getPackOutput(); } + + public static ResourceLocation loc(String path) { + return new ResourceLocation(MODID, path); + } + } diff --git a/src/main/java/net/zepalesque/redux/block/natural/AetherShortGrassBlock.java b/src/main/java/net/zepalesque/redux/block/natural/AetherShortGrassBlock.java index 506a52f68..98ba9b9d4 100644 --- a/src/main/java/net/zepalesque/redux/block/natural/AetherShortGrassBlock.java +++ b/src/main/java/net/zepalesque/redux/block/natural/AetherShortGrassBlock.java @@ -20,6 +20,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; import net.zepalesque.redux.block.state.ReduxStates; import net.zepalesque.redux.block.state.enums.GrassSize; +import net.zepalesque.redux.data.tags.ReduxTags; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -40,7 +41,7 @@ public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, @Override public boolean canBeReplaced(BlockState pState, BlockPlaceContext pUseContext) { - return super.canBeReplaced(pState, pUseContext) && (pUseContext.getItemInHand().getItem() instanceof BlockItem blockItem && !blockItem.getBlock().builtInRegistryHolder().is(ReduxTags.Blocks.DO_NOT_REPLACE_AETHER_GRASS)); + return super.canBeReplaced(pState, pUseContext) && (pUseContext.getItemInHand().getItem() instanceof BlockItem blockItem && !blockItem.getBlock().builtInRegistryHolder().is(ReduxTags.Blocks.AETHER_GRASS_NONREPLACING)); } @Override diff --git a/src/main/java/net/zepalesque/redux/data/tags/ReduxTags.java b/src/main/java/net/zepalesque/redux/data/tags/ReduxTags.java new file mode 100644 index 000000000..934c72e0e --- /dev/null +++ b/src/main/java/net/zepalesque/redux/data/tags/ReduxTags.java @@ -0,0 +1,69 @@ +package net.zepalesque.redux.data.tags; + +import com.aetherteam.aether.api.AetherAdvancementSoundOverrides; +import com.aetherteam.aether.api.registers.AdvancementSoundOverride; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.tags.TagKey; +import net.minecraft.world.damagesource.DamageType; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.Block; +import net.zepalesque.redux.Redux; + +public class ReduxTags { + + + public static class Blocks { + + public static final TagKey AETHER_GRASS_NONREPLACING = tag("aether_grass_nonreplacing"); + + public static TagKey tag(String name) { + return TagKey.create(Registries.BLOCK, Redux.loc(name)); + } + } + + public static class Items { + + public static TagKey tag(String name) { + return TagKey.create(Registries.ITEM, Redux.loc(name)); + } + } + + public static class Entities { + + private static TagKey> tag(String name) { + return TagKey.create(Registries.ENTITY_TYPE, Redux.loc(name)); + } + } + + public static class Biomes { + + private static TagKey tag(String name) { + return TagKey.create(Registries.BIOME, Redux.loc(name)); + } + } + + public static class DmgTypes { + + private static TagKey tag(String name) { + return TagKey.create(Registries.DAMAGE_TYPE, Redux.loc(name)); + } + } + + public static class Sounds { + + private static TagKey tag(String name) { + return TagKey.create(Registries.SOUND_EVENT, Redux.loc(name)); + } + } + + public static class AdvancementSFX { + + private static TagKey tag(String name) { + return TagKey.create(AetherAdvancementSoundOverrides.ADVANCEMENT_SOUND_OVERRIDE_REGISTRY_KEY, Redux.loc(name)); + } + } +}