From d1ef760f7c13c68b7a4156a5c247df6e265e68ec Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Oct 2023 10:57:18 -0600 Subject: [PATCH 01/17] added config classes --- .../config/AllTheModiumClientConfigs.java | 15 +++++++++ .../config/AllTheModiumCommonConfigs.java | 32 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java create mode 100644 src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java new file mode 100644 index 00000000..84ebd302 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java @@ -0,0 +1,15 @@ +package com.thevortex.allthemodium.config; + +import net.minecraftforge.common.ForgeConfigSpec; + +public class AllTheModiumClientConfigs { + public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); + public static final ForgeConfigSpec SPEC; + + static { + BUILDER.push("AllTheModium Configs"); + + BUILDER.pop(); + SPEC = BUILDER.build(); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java new file mode 100644 index 00000000..364f5ae0 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.config; + +import java.util.List; + +import net.minecraftforge.common.ForgeConfigSpec; + +public class AllTheModiumCommonConfigs { + public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); + public static final ForgeConfigSpec SPEC; + + public static final ForgeConfigSpec.ConfigValue ALLTHEMODIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; + + //public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; + + static { + BUILDER.push("AllTheModium Configs"); + ALLTHEMODIUM_QUARRYABLE = BUILDER + .comment("Whether or not Allthemodium Ore should be quarryable or only player mineable") + .define("Allthemodium Quarryable", false); + UNOBTAINIUM_QUARRYABLE = BUILDER + .comment("Whether or not Unobtainium Ore should be quarryable or only player mineable") + .define("Unobtainium Quarryable", false); + VIBRANIUM_QUARRYABLE = BUILDER + .comment("Whether or not Vibranium Ore should be quarryable or only player mineable") + .define("Vibranium Quarryable", false); + + BUILDER.pop(); + SPEC = BUILDER.build(); + } +} From 8aa62be6a3d58eb8f8fa7f992d79f0c1bd610812 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Oct 2023 12:29:11 -0600 Subject: [PATCH 02/17] added config registration --- .../java/com/thevortex/allthemodium/AllTheModium.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index 80cdcbb5..3f5c8e0b 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -26,7 +26,9 @@ import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.config.ModConfig.Type; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @@ -39,6 +41,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import com.thevortex.allthemodium.config.AllthemodiumClientConfigs; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.crafting.ATMCraftingSetup; import com.thevortex.allthemodium.events.ArmorEvents; import com.thevortex.allthemodium.events.BlockBreak; @@ -96,6 +100,11 @@ public AllTheModium() { modEventBus.addListener(this::setup); GeckoLib.initialize(); + + // load configs + ModLoadingContext.get().registerConfig(Type.CLIENT, AllthemodiumClientConfigs.SPEC, "allthemodium-client.toml"); + ModLoadingContext.get().registerConfig(Type.COMMON, AllthemodiumCommonConfigs.SPEC, "allthemodium-common.toml"); + if(ModList.get().isLoaded("mekanism")) { ATMSlurries.SLURRIES.register(modEventBus); } From 8e238c0960e9e913bb46227a3d8bcd742c7e7d78 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Oct 2023 12:29:40 -0600 Subject: [PATCH 03/17] renamed configs --- .../allthemodium/config/AllTheModiumClientConfigs.java | 2 +- .../allthemodium/config/AllTheModiumCommonConfigs.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java index 84ebd302..a5d7bc77 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java @@ -2,7 +2,7 @@ import net.minecraftforge.common.ForgeConfigSpec; -public class AllTheModiumClientConfigs { +public class AllthemodiumClientConfigs { public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java index 364f5ae0..7539f43f 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.ForgeConfigSpec; -public class AllTheModiumCommonConfigs { +public class AllthemodiumCommonConfigs { public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; From f507e3b1009caecbceb3e01574db70e1d1047063 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Oct 2023 12:37:17 -0600 Subject: [PATCH 04/17] added ability to enable or disable quarryability --- .../allthemodium/blocks/Allthemodium_Ore.java | 10 ++++++++-- .../thevortex/allthemodium/blocks/Unobtainium_Ore.java | 8 ++++++-- .../thevortex/allthemodium/blocks/Vibranium_Ore.java | 7 +++++-- .../com/thevortex/allthemodium/events/BlockBreak.java | 7 ++++--- .../allthemodium/items/Allthemodium_Ore_Item.java | 4 +++- .../allthemodium/items/Unobtainium_Ore_Item.java | 4 +++- .../allthemodium/items/Vibranium_Ore_Item.java | 4 +++- 7 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java index ffb9836a..f0bcec7a 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java @@ -2,6 +2,7 @@ import java.util.Random; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -27,7 +28,7 @@ public class Allthemodium_Ore extends RedStoneOreBlock { // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; public Allthemodium_Ore() { //func_235861_h_ = setRequiresTool - super(BlockBehaviour.Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.ANCIENT_DEBRIS).lightLevel((state) -> { return 15;}).strength(-1.0f,1500.0f)); + super(BlockBehaviour.Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.ANCIENT_DEBRIS).lightLevel((state) -> { return 15;}).strength(80.0f,1500.0f)); } @Override @@ -35,6 +36,9 @@ public Allthemodium_Ore() { //func_235861_h_ = setRequiresTool public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { + if(AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 250 : 1500; return player.getDigSpeed(state, blockPos) / 2.0F / i; } @@ -44,7 +48,9 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.ALLTHEMODIUM_ORE.get())) { return false; } + if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.ALLTHEMODIUM_ORE.get())) { + return AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get(); + } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java index b98d82f7..97266cf5 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java @@ -1,5 +1,6 @@ package com.thevortex.allthemodium.blocks; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; @@ -17,13 +18,16 @@ public class Unobtainium_Ore extends DropExperienceBlock { public Unobtainium_Ore() {//func_235861_h_ = setRequiresTool - super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_GOLD_ORE).strength(-1.0f,5000f)); + super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_GOLD_ORE).strength(80.0f,5000f)); } @Override @SuppressWarnings("java:S1874") // deprecated method from super class public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { + if(AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 750 : 5500; return player.getDigSpeed(state, blockPos) / 2.0F / i; } @@ -31,7 +35,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get } @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.UNOBTAINIUM_ORE.get())) { return false; } + if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.UNOBTAINIUM_ORE.get())) { return AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get(); } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java index 5253d155..053d934d 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java @@ -1,5 +1,6 @@ package com.thevortex.allthemodium.blocks; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; @@ -17,13 +18,15 @@ public class Vibranium_Ore extends DropExperienceBlock { public Vibranium_Ore() {//func_235861_h_ = setRequiresTool - super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_ORE).strength(-1.0f,2500.0f)); + super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_ORE).strength(80.0f,2500.0f)); } @Override @SuppressWarnings("java:S1874") // deprecated method from super class public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { + if(AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 500 : 2500; return player.getDigSpeed(state, blockPos) / 2.0F / i; } @@ -31,7 +34,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get } @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.VIBRANIUM_ORE.get())) { return false; } + if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.VIBRANIUM_ORE.get())) { return AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get(); } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index e42cc34a..80e77cdb 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -2,6 +2,7 @@ import com.thevortex.allthemodium.AllTheModium; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.TagRegistry; import net.minecraft.core.Registry; @@ -25,18 +26,18 @@ public static void on(BlockEvent.BreakEvent event) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty()))) { + if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty()))) { + if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty()))) { + if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) { event.setCanceled(true); return; diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java index ef26489e..78579c9b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java @@ -1,5 +1,6 @@ package com.thevortex.allthemodium.items; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -23,7 +24,8 @@ public Allthemodium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); + if(!AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java index 61dbe3e4..22e42342 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.items; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -23,7 +24,8 @@ public Unobtainium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"unobtainium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); + if(!AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) + tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java index 139a9112..0ac451ce 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java @@ -1,5 +1,6 @@ package com.thevortex.allthemodium.items; +import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -22,7 +23,8 @@ public Vibranium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"vibranium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); + if(!AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) + tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } } From 8b8e43572ea28b2fff38d8daaf049a9dc92019da Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Sun, 15 Oct 2023 09:52:08 -0600 Subject: [PATCH 05/17] use tag registry for different allthemodium entity destroy variants --- .../com/thevortex/allthemodium/blocks/Allthemodium_Ore.java | 4 +++- .../com/thevortex/allthemodium/blocks/Unobtainium_Ore.java | 6 +++++- .../com/thevortex/allthemodium/blocks/Vibranium_Ore.java | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java index f0bcec7a..efd87016 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java @@ -4,6 +4,8 @@ import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; + import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; @@ -48,7 +50,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.ALLTHEMODIUM_ORE.get())) { + if((player instanceof FakePlayer) && (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { return AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get(); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java index 97266cf5..8246bc3a 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java @@ -2,6 +2,8 @@ import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; + import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; @@ -35,7 +37,9 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get } @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.UNOBTAINIUM_ORE.get())) { return AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get(); } + if((player instanceof FakePlayer) && state.is(TagRegistry.UNOBTAINIUM_ORE)) { + return AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get(); + } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java index 053d934d..517ef4af 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java @@ -2,6 +2,8 @@ import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; + import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; @@ -34,7 +36,9 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get } @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.getBlock() == ModRegistry.VIBRANIUM_ORE.get())) { return AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get(); } + if((player instanceof FakePlayer) && state.is(TagRegistry.VIBRANIUM_ORE)) { + return AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get(); + } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } From b8df90655534959fff28711b044f5a72e5af6c1c Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Sun, 15 Oct 2023 09:52:25 -0600 Subject: [PATCH 06/17] added intermediate booleans for easier readability --- .../allthemodium/events/BlockBreak.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 80e77cdb..3abf0516 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -5,7 +5,10 @@ import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.TagRegistry; + +import net.minecraft.client.Minecraft; import net.minecraft.core.Registry; +import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraftforge.common.util.FakePlayer; @@ -21,23 +24,26 @@ public class BlockBreak { public static void on(BlockEvent.BreakEvent event) { if(event.getPlayer().isCreative()) { return; } - if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null)) && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES)) { + boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null); + boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); + + if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES)) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty())) && !AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) { event.setCanceled(true); return; @@ -46,10 +52,5 @@ public static void on(BlockEvent.BreakEvent event) { return; } - - } - - - } From c59fb5a61fc91df1a437b272a944431a53ba158b Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Sun, 15 Oct 2023 10:07:13 -0600 Subject: [PATCH 07/17] added config for other protection --- .../config/AllTheModiumCommonConfigs.java | 11 ++++++++--- .../com/thevortex/allthemodium/events/BlockBreak.java | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java index 7539f43f..67a844b4 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java @@ -12,19 +12,24 @@ public class AllthemodiumCommonConfigs { public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; + //public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; static { BUILDER.push("AllTheModium Configs"); ALLTHEMODIUM_QUARRYABLE = BUILDER - .comment("Whether or not Allthemodium Ore should be quarryable or only player mineable") + .comment("Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)") .define("Allthemodium Quarryable", false); UNOBTAINIUM_QUARRYABLE = BUILDER - .comment("Whether or not Unobtainium Ore should be quarryable or only player mineable") + .comment("Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)") .define("Unobtainium Quarryable", false); VIBRANIUM_QUARRYABLE = BUILDER - .comment("Whether or not Vibranium Ore should be quarryable or only player mineable") + .comment("Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)") .define("Vibranium Quarryable", false); + OTHER_PROTECTION = BUILDER + .comment("Whether The Other is protected from quarries. (Default value: true)") + .define("Other Protection", true); BUILDER.pop(); SPEC = BUILDER.build(); diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 3abf0516..712a7293 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -27,7 +27,7 @@ public static void on(BlockEvent.BreakEvent event) { boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null); boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES)) { + if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES) && AllthemodiumCommonConfigs.OTHER_PROTECTION.get()) { event.setCanceled(true); return; From b66cd9fb505d138539057e2f31e91fd6a57e3714 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Sun, 29 Oct 2023 13:08:21 -0600 Subject: [PATCH 08/17] renamed to server config --- .../com/thevortex/allthemodium/AllTheModium.java | 6 ++---- .../allthemodium/blocks/Allthemodium_Ore.java | 6 +++--- .../allthemodium/blocks/Unobtainium_Ore.java | 6 +++--- .../allthemodium/blocks/Vibranium_Ore.java | 6 +++--- .../config/AllTheModiumClientConfigs.java | 15 --------------- ...onfigs.java => AllthemodiumServerConfigs.java} | 2 +- .../thevortex/allthemodium/events/BlockBreak.java | 10 +++++----- .../allthemodium/items/Allthemodium_Ore_Item.java | 4 ++-- .../allthemodium/items/Unobtainium_Ore_Item.java | 4 ++-- .../allthemodium/items/Vibranium_Ore_Item.java | 4 ++-- 10 files changed, 23 insertions(+), 40 deletions(-) delete mode 100644 src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java rename src/main/java/com/thevortex/allthemodium/config/{AllTheModiumCommonConfigs.java => AllthemodiumServerConfigs.java} (97%) diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index 3f5c8e0b..90be5ec6 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -41,8 +41,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.thevortex.allthemodium.config.AllthemodiumClientConfigs; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.crafting.ATMCraftingSetup; import com.thevortex.allthemodium.events.ArmorEvents; import com.thevortex.allthemodium.events.BlockBreak; @@ -102,8 +101,7 @@ public AllTheModium() { GeckoLib.initialize(); // load configs - ModLoadingContext.get().registerConfig(Type.CLIENT, AllthemodiumClientConfigs.SPEC, "allthemodium-client.toml"); - ModLoadingContext.get().registerConfig(Type.COMMON, AllthemodiumCommonConfigs.SPEC, "allthemodium-common.toml"); + ModLoadingContext.get().registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC, "allthemodium-server.toml"); if(ModList.get().isLoaded("mekanism")) { ATMSlurries.SLURRIES.register(modEventBus); diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java index efd87016..f1278fad 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java @@ -2,7 +2,7 @@ import java.util.Random; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.registry.TagRegistry; @@ -38,7 +38,7 @@ public Allthemodium_Ore() { //func_235861_h_ = setRequiresTool public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + if(AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) return super.getDestroyProgress(state, player, getter, blockPos); int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 250 : 1500; @@ -51,7 +51,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { if((player instanceof FakePlayer) && (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { - return AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get(); + return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java index 8246bc3a..e59b263a 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java @@ -1,6 +1,6 @@ package com.thevortex.allthemodium.blocks; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.registry.TagRegistry; @@ -27,7 +27,7 @@ public Unobtainium_Ore() {//func_235861_h_ = setRequiresTool public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) + if(AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) return super.getDestroyProgress(state, player, getter, blockPos); int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 750 : 5500; @@ -38,7 +38,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { if((player instanceof FakePlayer) && state.is(TagRegistry.UNOBTAINIUM_ORE)) { - return AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get(); + return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java index 517ef4af..8a25ed72 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java @@ -1,6 +1,6 @@ package com.thevortex.allthemodium.blocks; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.registry.TagRegistry; @@ -27,7 +27,7 @@ public Vibranium_Ore() {//func_235861_h_ = setRequiresTool public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { BlockEntity blockEntity = getter.getBlockEntity(blockPos); if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) + if(AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) return super.getDestroyProgress(state, player, getter, blockPos); int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 500 : 2500; return player.getDigSpeed(state, blockPos) / 2.0F / i; @@ -37,7 +37,7 @@ public float getDestroyProgress(BlockState state, Player player, BlockGetter get @Override public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { if((player instanceof FakePlayer) && state.is(TagRegistry.VIBRANIUM_ORE)) { - return AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get(); + return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); } return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); } diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java deleted file mode 100644 index a5d7bc77..00000000 --- a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumClientConfigs.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.thevortex.allthemodium.config; - -import net.minecraftforge.common.ForgeConfigSpec; - -public class AllthemodiumClientConfigs { - public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); - public static final ForgeConfigSpec SPEC; - - static { - BUILDER.push("AllTheModium Configs"); - - BUILDER.pop(); - SPEC = BUILDER.build(); - } -} diff --git a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java similarity index 97% rename from src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java rename to src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java index 67a844b4..54f0803e 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllTheModiumCommonConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.ForgeConfigSpec; -public class AllthemodiumCommonConfigs { +public class AllthemodiumServerConfigs { public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 712a7293..78182137 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -2,7 +2,7 @@ import com.thevortex.allthemodium.AllTheModium; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.TagRegistry; @@ -27,23 +27,23 @@ public static void on(BlockEvent.BreakEvent event) { boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null); boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES) && AllthemodiumCommonConfigs.OTHER_PROTECTION.get()) { + if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES) && AllthemodiumServerConfigs.OTHER_PROTECTION.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) { event.setCanceled(true); return; } - if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) { + if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) { event.setCanceled(true); return; diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java index 78579c9b..76751b27 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java @@ -1,6 +1,6 @@ package com.thevortex.allthemodium.items; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -24,7 +24,7 @@ public Allthemodium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumCommonConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + if(!AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java index 22e42342..4bbd6483 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java @@ -1,7 +1,7 @@ package com.thevortex.allthemodium.items; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -24,7 +24,7 @@ public Unobtainium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"unobtainium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumCommonConfigs.UNOBTAINIUM_QUARRYABLE.get()) + if(!AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java index 0ac451ce..ebb21ad2 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java @@ -1,6 +1,6 @@ package com.thevortex.allthemodium.items; -import com.thevortex.allthemodium.config.AllthemodiumCommonConfigs; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -23,7 +23,7 @@ public Vibranium_Ore_Item(Block block, Properties properties) { @Override public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ tooltip.add(TextComponentHelper.createComponentTranslation(null,"vibranium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumCommonConfigs.VIBRANIUM_QUARRYABLE.get()) + if(!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); super.appendHoverText(stack, worldIn, tooltip, flagIn); } From 34a2c2bb08c213701baceaeefbd1d82d7f8647ab Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Sun, 29 Oct 2023 14:57:22 -0600 Subject: [PATCH 09/17] removed server file name --- src/main/java/com/thevortex/allthemodium/AllTheModium.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index 90be5ec6..ab1e1cf4 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -101,7 +101,7 @@ public AllTheModium() { GeckoLib.initialize(); // load configs - ModLoadingContext.get().registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC, "allthemodium-server.toml"); + ModLoadingContext.get().registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); if(ModList.get().isLoaded("mekanism")) { ATMSlurries.SLURRIES.register(modEventBus); From a7bc9181084920953578893758a0d5eef999dd16 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:17:53 -0600 Subject: [PATCH 10/17] added vscode folder to .gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a99cdf5c..7242c5dd 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,7 @@ TCon/silent_data/unobtainium.json TCon/silent_data/vibranium.json # datagen -src/generated/resources/.cache \ No newline at end of file +src/generated/resources/.cache + +# vscode +.vscode \ No newline at end of file From 3fddf77b96d2c2b7ba13436b6e32d2d80199d07e Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:20:01 -0600 Subject: [PATCH 11/17] Added spotless for java linting --- build.gradle | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 79c4ad5a..1d367448 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,14 @@ buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } + maven { url = 'https://plugins.gradle.org/m2/' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - + classpath group: 'com.diffplug.spotless', name: 'spotless-plugin-gradle', version: '6.25.0' } } @@ -20,7 +21,6 @@ group = 'com.thevortex.allthemodium' // http://maven.apache.org/guides/mini/guid archivesBaseName = 'allthemodium' sourceSets.main.resources { srcDir 'src/generated/resources' } - // Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16. java.toolchain.languageVersion = JavaLanguageVersion.of(17) @@ -34,7 +34,7 @@ minecraft { // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'official', version: '1.19.2' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. - + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. @@ -42,7 +42,7 @@ minecraft { runs { client { workingDirectory project.file('run') - // Recommended logging data for a userdev environment + // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console @@ -107,7 +107,7 @@ dependencies { // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" - implementation fg.deobf("curse.maven:${tweaks}") + implementation fg.deobf("curse.maven:${tweaks}") implementation fg.deobf("curse.maven:${geckolib}") // runtimeOnly fg.deobf("curse.maven:top-245211:3927520") implementation fg.deobf("curse.maven:${ato}") @@ -173,4 +173,28 @@ publishing { url "file:///${project.projectDir}/mcmodsrepo" } } -} \ No newline at end of file +} + +apply plugin: 'com.diffplug.spotless' + +spotless { + format 'misc', { + // define the files to apply `misc` to + target '*.gradle', '*.md', '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + setEncoding('utf-8') + } + java { + prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0']) + .config(['parser': 'java', 'tabWidth': 4, 'plugins': ['prettier-plugin-java']]) + } + json { + target 'resources/**/*.json' + prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0']) + .config(['parser': 'json', 'tabWidth': 4, 'plugins': ['prettier-plugin-java']]) + } +} From 13fc42a4d1ff8f3170b29efb2795400527bda6e4 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:22:33 -0600 Subject: [PATCH 12/17] Linted java files --- README.md | 1 + .../thevortex/allthemodium/AllTheModium.java | 224 +- .../allthemodium/blocks/ACaveVines.java | 39 +- .../blocks/AllthemodiumBlock.java | 32 + .../allthemodium/blocks/AllthemodiumOre.java | 138 + .../blocks/Allthemodium_Block.java | 31 - .../allthemodium/blocks/Allthemodium_Ore.java | 106 - .../allthemodium/blocks/AncientBookShelf.java | 8 +- .../allthemodium/blocks/AncientCaveVines.java | 92 +- .../blocks/AncientCaveVinesPlant.java | 68 +- .../allthemodium/blocks/AncientDirt.java | 11 +- .../blocks/AncientFenceBlock.java | 201 +- .../allthemodium/blocks/AncientGrass.java | 46 + .../allthemodium/blocks/AncientHerb.java | 27 +- .../allthemodium/blocks/AncientLeaves.java | 169 +- .../blocks/AncientLeavesBottom.java | 163 +- .../allthemodium/blocks/AncientLog.java | 2 +- .../blocks/AncientSaplingBlock.java | 131 +- .../allthemodium/blocks/Ancient_Grass.java | 29 - .../allthemodium/blocks/DemonicLeaves.java | 196 +- .../blocks/DemonicLeavesBottom.java | 163 +- .../thevortex/allthemodium/blocks/RawATM.java | 3 + .../thevortex/allthemodium/blocks/RawUNO.java | 3 + .../thevortex/allthemodium/blocks/RawVIB.java | 3 + .../allthemodium/blocks/Raw_ATM.java | 5 - .../allthemodium/blocks/Raw_UNO.java | 5 - .../allthemodium/blocks/Raw_VIB.java | 5 - .../allthemodium/blocks/SoulLava.java | 330 +- .../allthemodium/blocks/SoulLeaves.java | 197 +- .../allthemodium/blocks/SoulLeavesBottom.java | 163 +- .../allthemodium/blocks/TeleportPad.java | 484 +- .../allthemodium/blocks/UAAlloyBlock.java | 32 + .../allthemodium/blocks/UAAlloy_Block.java | 30 - .../allthemodium/blocks/UVAlloyBlock.java | 32 + .../allthemodium/blocks/UVAlloy_Block.java | 30 - .../allthemodium/blocks/UnobtainiumBlock.java | 32 + .../allthemodium/blocks/UnobtainiumOre.java | 84 + .../blocks/Unobtainium_Block.java | 30 - .../allthemodium/blocks/Unobtainium_Ore.java | 55 - .../allthemodium/blocks/VAAlloyBlock.java | 32 + .../allthemodium/blocks/VAAlloy_Block.java | 30 - .../allthemodium/blocks/VibraniumBlock.java | 32 + .../allthemodium/blocks/VibraniumOre.java | 83 + .../allthemodium/blocks/Vibranium_Block.java | 28 - .../allthemodium/blocks/Vibranium_Ore.java | 54 - .../config/AllthemodiumServerConfigs.java | 56 +- .../crafting/ATMCraftingSetup.java | 32 +- .../crafting/ATMRecipeSerializer.java | 67 +- .../crafting/ATMShapedRecipe.java | 203 +- .../crafting/ATMShapelessRecipe.java | 165 +- .../ATMShapelessRecipeSerializer.java | 85 +- .../crafting/IATMShapedRecipe.java | 6 +- .../crafting/IATMShapelessRecipe.java | 6 +- .../allthemodium/datagen/DataGenerators.java | 35 +- .../allthemodium/datagen/RecipeException.java | 1 + .../datagen/builder/ShapedAncientStones.java | 229 +- .../datagen/builder/ShapedArmorBuilder.java | 79 +- .../datagen/builder/ShapedBlockBuilder.java | 130 +- .../datagen/builder/ShapedIngotBuilder.java | 55 +- .../datagen/client/BlockStates.java | 392 +- .../datagen/client/ItemModels.java | 427 +- .../datagen/client/package-info.java | 1 - .../allthemodium/datagen/package-info.java | 1 - .../datagen/server/BlastingRecipes.java | 112 +- .../datagen/server/BlockTags.java | 567 ++- .../datagen/server/CraftingRecipes.java | 479 +- .../datagen/server/FluidTags.java | 29 +- .../allthemodium/datagen/server/ItemTags.java | 255 +- .../datagen/server/LootTables.java | 185 +- .../datagen/server/ShapelessCrafting.java | 372 +- .../datagen/server/SmeltingRecipes.java | 112 +- .../datagen/server/package-info.java | 1 - .../allthemodium/entity/PiglichEntity.java | 403 +- .../allthemodium/entity/PiglichModel.java | 418 +- .../allthemodium/entity/PiglichModelOld.java | 198 +- .../allthemodium/entity/PiglichRenderer.java | 36 +- .../entity/shulkers/atm/ATMShulkerEntity.java | 15 +- .../entity/shulkers/atm/ATMShulkerModel.java | 72 +- .../shulkers/atm/ATMShulkerRenderer.java | 42 +- .../shulkers/unob/UNOBShulkerEntity.java | 15 +- .../shulkers/unob/UNOBShulkerModel.java | 69 +- .../shulkers/unob/UNOBShulkerRenderer.java | 45 +- .../entity/shulkers/vib/VIBShulkerEntity.java | 15 +- .../entity/shulkers/vib/VIBShulkerModel.java | 69 +- .../shulkers/vib/VIBShulkerRenderer.java | 42 +- .../allthemodium/events/ArmorEvents.java | 105 +- .../allthemodium/events/BlockBreak.java | 91 +- .../allthemodium/events/ClientEvents.java | 152 +- .../allthemodium/events/PlayerHarvest.java | 64 +- .../allthemodium/fluid/FluidATM.java | 244 +- .../allthemodium/fluid/FluidSoulLava.java | 245 +- .../allthemodium/fluid/FluidUNOB.java | 244 +- .../allthemodium/fluid/FluidVIB.java | 244 +- .../thevortex/allthemodium/init/ModFoods.java | 40 +- .../allthemodium/items/AlloyDust.java | 10 + .../allthemodium/items/AlloyIngot.java | 10 + .../allthemodium/items/Alloy_Dust.java | 12 - .../allthemodium/items/Alloy_Ingot.java | 12 - .../allthemodium/items/AllthemodiumApple.java | 68 + .../allthemodium/items/AllthemodiumBlock.java | 11 + .../items/AllthemodiumCarrot.java | 67 + .../items/AllthemodiumOreItem.java | 52 + .../items/Allthemodium_Apple.java | 42 - .../items/Allthemodium_Block.java | 14 - .../items/Allthemodium_Carrot.java | 38 - .../items/Allthemodium_Ore_Item.java | 32 - .../thevortex/allthemodium/items/Dust.java | 1 + .../thevortex/allthemodium/items/Gear.java | 1 + .../thevortex/allthemodium/items/Ingot.java | 1 + .../thevortex/allthemodium/items/Nugget.java | 1 + .../allthemodium/items/PiglichHeart.java | 1 + .../thevortex/allthemodium/items/Plate.java | 1 + .../thevortex/allthemodium/items/RawOre.java | 1 + .../com/thevortex/allthemodium/items/Rod.java | 1 + .../allthemodium/items/SoulBerries.java | 39 +- .../allthemodium/items/SoulBucket.java | 25 +- .../allthemodium/items/TeleportPad.java | 12 +- ...inium_Block.java => UnobtainiumBlock.java} | 12 +- .../items/UnobtainiumOreItem.java | 52 + .../items/Unobtainium_Ore_Item.java | 31 - ...branium_Block.java => VibraniumBlock.java} | 12 +- .../items/Vibranium_Ore_Item.java | 52 +- ...dium_Boots.java => AllthemodiumBoots.java} | 33 +- .../armor/AllthemodiumChestplate.java | 34 + .../toolitems/armor/AllthemodiumHelmet.java | 50 + .../toolitems/armor/AllthemodiumLeggings.java | 34 + .../armor/Allthemodium_Chestplate.java | 40 - .../toolitems/armor/Allthemodium_Helmet.java | 59 - .../armor/Allthemodium_Leggings.java | 35 - .../armor/models/AllthemodiumHelmetModel.java | 190 + .../armor/models/allthemodium_helmet.java | 80 - .../items/toolitems/tools/AlloyAxe.java | 57 +- .../items/toolitems/tools/AlloyPaxel.java | 351 +- .../items/toolitems/tools/AlloyPick.java | 64 +- .../items/toolitems/tools/AlloyShovel.java | 65 +- .../items/toolitems/tools/AlloySword.java | 39 +- .../allthemodium/material/AArmorMaterial.java | 137 +- .../allthemodium/material/ToolTiers.java | 57 +- .../allthemodium/reference/Reference.java | 150 +- .../allthemodium/registry/BlockRegistry.java | 71 +- .../registry/FluidInteractionsRegistry.java | 28 +- .../allthemodium/registry/FluidRegistry.java | 47 +- .../registry/FluidTypeRegistry.java | 138 +- .../allthemodium/registry/ItemRegistry.java | 137 +- .../allthemodium/registry/LevelRegistry.java | 17 +- .../allthemodium/registry/MekRegistry.java | 46 +- .../allthemodium/registry/ModRegistry.java | 3112 +++++++++--- .../allthemodium/registry/TagRegistry.java | 483 +- .../registry/client/OtherSky.java | 87 +- .../registry/client/SkyRegistry.java | 35 +- .../registry/resource/ATMResource.java | 102 +- .../registry/resource/ATMSlurries.java | 15 +- .../registry/resource/EnumFunc.java | 2 +- .../registry/resource/MoltenATMType.java | 145 +- .../registry/resource/MoltenUNOBType.java | 145 +- .../registry/resource/MoltenVIBType.java | 145 +- .../registry/resource/SoulLavaType.java | 142 +- .../worldgen/ATMConfiguredFeature.java | 494 +- .../worldgen/ATMPlacedFeature.java | 280 +- .../worldgen/ATOtherPlacedFeatures.java | 128 +- .../worldgen/MiningDimSource.java | 22 +- .../worldgen/TheOtherDimSource.java | 59 +- .../worldgen/biomes/ATMBiomes.java | 441 +- .../worldgen/features/AncientTreeGrower.java | 16 +- .../worldgen/features/DemonicTreeGrower.java | 15 +- .../worldgen/features/FastNoiseLite.java | 4297 +++++++++++++---- .../worldgen/features/SoulTreeGrower.java | 15 +- .../worldgen/features/Volcano.java | 93 +- .../worldgen/features/VolcanoConfig.java | 16 +- .../worldgen/structures/APStructure.java | 203 +- .../worldgen/structures/ATMStructures.java | 31 +- .../worldgen/structures/DungeonStructure.java | 200 +- .../worldgen/structures/PVStructure.java | 148 +- .../worldgen/structures/VillagePieces.java | 20 +- 174 files changed, 17052 insertions(+), 7018 deletions(-) create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Block.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Ancient_Grass.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/RawATM.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Raw_ATM.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Raw_UNO.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UAAlloy_Block.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UVAlloy_Block.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Block.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/VAAlloy_Block.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java create mode 100644 src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Block.java delete mode 100644 src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AlloyDust.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Alloy_Dust.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Alloy_Ingot.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Allthemodium_Apple.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Allthemodium_Block.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Allthemodium_Carrot.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java rename src/main/java/com/thevortex/allthemodium/items/{Unobtainium_Block.java => UnobtainiumBlock.java} (51%) create mode 100644 src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java rename src/main/java/com/thevortex/allthemodium/items/{Vibranium_Block.java => VibraniumBlock.java} (52%) rename src/main/java/com/thevortex/allthemodium/items/toolitems/armor/{Allthemodium_Boots.java => AllthemodiumBoots.java} (54%) create mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Chestplate.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Helmet.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Leggings.java create mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java delete mode 100644 src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/allthemodium_helmet.java diff --git a/README.md b/README.md index e69de29b..8b137891 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ + diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index b2098ec1..99b40326 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -1,30 +1,26 @@ package com.thevortex.allthemodium; +import static com.thevortex.allthemodium.reference.Reference.MOD_ID; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import com.thevortex.allthemodium.crafting.ATMCraftingSetup; +import com.thevortex.allthemodium.events.ArmorEvents; +import com.thevortex.allthemodium.events.BlockBreak; +import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.*; import com.thevortex.allthemodium.registry.resource.ATMSlurries; import com.thevortex.allthemodium.worldgen.MiningDimSource; import com.thevortex.allthemodium.worldgen.TheOtherDimSource; -import com.thevortex.allthemodium.worldgen.biomes.ATMBiomes; import com.thevortex.allthemodium.worldgen.structures.ATMStructures; import com.thevortex.allthetweaks.config.Configuration; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.BlockTags; import net.minecraft.world.item.AxeItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.dimension.DimensionType; -import net.minecraft.world.level.levelgen.carver.WorldCarver; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.ModLoadingContext; @@ -33,119 +29,145 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; - -import com.thevortex.allthemodium.reference.Reference; - -import static com.thevortex.allthemodium.reference.Reference.MOD_ID; - -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.crafting.ATMCraftingSetup; -import com.thevortex.allthemodium.events.ArmorEvents; -import com.thevortex.allthemodium.events.BlockBreak; import software.bernie.geckolib3.GeckoLib; -import java.util.Set; - // The value here should match an entry in the META-INF/mods.toml file @Mod("allthemodium") -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) -public class AllTheModium -{ - - public static final ResourceKey OverWorld = Level.OVERWORLD; - public static final ResourceKey Nether = Level.NETHER; - public static final ResourceKey The_End = Level.END; - public static final ResourceLocation MINING_DIM_ID = new ResourceLocation(MOD_ID,"mining"); - public static final ResourceLocation THE_OTHER_DIM_ID = new ResourceLocation(MOD_ID,"the_other"); - public static final ResourceKey THE_OTHER = ResourceKey.create(Registry.DIMENSION_REGISTRY, THE_OTHER_DIM_ID); - //public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); - //public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); - //public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); - public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - public static boolean ALLOW_TELEPORT_MINING = true; - public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { - public ItemStack makeIcon() { return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); } - }; +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + bus = Mod.EventBusSubscriber.Bus.MOD +) +public class AllTheModium { + + public static final ResourceKey OverWorld = Level.OVERWORLD; + public static final ResourceKey Nether = Level.NETHER; + public static final ResourceKey The_End = Level.END; + public static final ResourceLocation MINING_DIM_ID = new ResourceLocation( + MOD_ID, + "mining" + ); + public static final ResourceLocation THE_OTHER_DIM_ID = + new ResourceLocation(MOD_ID, "the_other"); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID + ); + // public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); + // public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); + // public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + public static boolean ALLOW_TELEPORT_MINING = true; + public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { + public ItemStack makeIcon() { + return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + } + }; public AllTheModium() { - // Register the setup method for modloading + // Register the setup method for mod loading + + IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); + FluidTypeRegistry.FLUID_TYPES.register(modEventBus); + FluidRegistry.FLUIDS.register(modEventBus); + BlockRegistry.BLOCKS.register(modEventBus); + ModRegistry.BLOCKS.register(modEventBus); + ModRegistry.SHAPED_BLOCKS.register(modEventBus); + ModRegistry.STAIR_BLOCKS.register(modEventBus); + ModRegistry.SLAB_BLOCKS.register(modEventBus); + ModRegistry.WALL_BLOCKS.register(modEventBus); + ModRegistry.PILLAR_BLOCKS.register(modEventBus); - FluidTypeRegistry.FLUID_TYPES.register(modEventBus); - FluidRegistry.FLUIDS.register(modEventBus); - BlockRegistry.BLOCKS.register(modEventBus); - ModRegistry.BLOCKS.register(modEventBus); - ModRegistry.SHAPED_BLOCKS.register(modEventBus); - ModRegistry.STAIRBLOCKS.register(modEventBus); - ModRegistry.SLABBLOCKS.register(modEventBus); - ModRegistry.WALLBLOCKS.register(modEventBus); - ModRegistry.PILLARBLOCKS.register(modEventBus); + ItemRegistry.ITEMS.register(modEventBus); + ModRegistry.ITEMS.register(modEventBus); + ModRegistry.ENTITIES.register(modEventBus); - ItemRegistry.ITEMS.register(modEventBus); - ModRegistry.ITEMS.register(modEventBus); - ModRegistry.ENTITIES.register(modEventBus); + ModRegistry.CARVERS.register(modEventBus); + ModRegistry.BIOMES.register(modEventBus); + ATMCraftingSetup.REGISTRY.register(modEventBus); + ATMStructures.STRUCTURES.register(modEventBus); + ModRegistry.FEATURES.register(modEventBus); - ModRegistry.CARVERS.register(modEventBus); - ModRegistry.BIOMES.register(modEventBus); - ATMCraftingSetup.REGISTRY.register(modEventBus); - ATMStructures.STRUCTURES.register(modEventBus); - ModRegistry.FEATURES.register(modEventBus); + modEventBus.register(ModRegistry.class); + modEventBus.addListener(this::setup); - modEventBus.register(ModRegistry.class); - modEventBus.addListener(this::setup); + GeckoLib.initialize(); - GeckoLib.initialize(); + // load configs + ModLoadingContext + .get() + .registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); - // load configs - ModLoadingContext.get().registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); + if (ModList.get().isLoaded("mekanism")) { + ATMSlurries.SLURRIES.register(modEventBus); + } - if(ModList.get().isLoaded("mekanism")) { - ATMSlurries.SLURRIES.register(modEventBus); - } + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); - //MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); - //MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); - //MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(BlockBreak.class); MinecraftForge.EVENT_BUS.register(ArmorEvents.class); - } - public void setup(final FMLCommonSetupEvent event) { - event.enqueueWork(() -> { - AxeItem.STRIPPABLES.put(ModRegistry.SOUL_LOG.get(),ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.SOUL_LOG_0.get(),ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.SOUL_LOG_1.get(),ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.SOUL_LOG_2.get(),ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.DEMONIC_LOG.get(),ModRegistry.DEMONIC_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.ANCIENT_LOG_0.get(),ModRegistry.ANCIENT_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.ANCIENT_LOG_1.get(),ModRegistry.ANCIENT_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put(ModRegistry.ANCIENT_LOG_2.get(),ModRegistry.ANCIENT_LOG_STRIPPED.get()); - //ATMConfiguredStructures.registerConfiguredStructures(); - Registry.register(Registry.CHUNK_GENERATOR, MINING_DIM_ID, MiningDimSource.CODEC); - Registry.register(Registry.CHUNK_GENERATOR, THE_OTHER_DIM_ID, TheOtherDimSource.CODEC); - if(ModList.get().isLoaded("allthetweaks")) { - if (5 == Configuration.COMMON.mainmode.get()) { - ALLOW_TELEPORT_MINING = false; - } - } - }); - - } - public void setupClient(final FMLClientSetupEvent event) - { - event.enqueueWork(() -> { - - }); - } - - + public void setup(final FMLCommonSetupEvent event) { + event.enqueueWork(() -> { + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG.get(), + ModRegistry.SOUL_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_0.get(), + ModRegistry.SOUL_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_1.get(), + ModRegistry.SOUL_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_2.get(), + ModRegistry.SOUL_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.DEMONIC_LOG.get(), + ModRegistry.DEMONIC_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_0.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_1.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get() + ); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_2.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get() + ); + // ATMConfiguredStructures.registerConfiguredStructures(); + Registry.register( + Registry.CHUNK_GENERATOR, + MINING_DIM_ID, + MiningDimSource.CODEC + ); + Registry.register( + Registry.CHUNK_GENERATOR, + THE_OTHER_DIM_ID, + TheOtherDimSource.CODEC + ); + if (ModList.get().isLoaded("allthetweaks")) { + if (5 == Configuration.COMMON.mainmode.get()) { + ALLOW_TELEPORT_MINING = false; + } + } + }); + } + public void setupClient(final FMLClientSetupEvent event) { + event.enqueueWork(() -> {}); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java index 766df7f5..a34d60ae 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.function.ToIntFunction; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -8,7 +9,6 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.CaveVines; @@ -17,20 +17,35 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.function.ToIntFunction; - public interface ACaveVines extends CaveVines { - VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); BooleanProperty BERRIES = BlockStateProperties.BERRIES; - - static InteractionResult use(BlockState p_152954_, Level p_152955_, BlockPos p_152956_) { + static InteractionResult use( + BlockState p_152954_, + Level p_152955_, + BlockPos p_152956_ + ) { if (p_152954_.getValue(BERRIES)) { - Block.popResource(p_152955_, p_152956_, new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1)); + Block.popResource( + p_152955_, + p_152956_, + new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1) + ); float f = Mth.randomBetween(p_152955_.random, 0.8F, 1.2F); - p_152955_.playSound((Player)null, p_152956_, SoundEvents.CAVE_VINES_PICK_BERRIES, SoundSource.BLOCKS, 1.0F, f); - p_152955_.setBlock(p_152956_, p_152954_.setValue(BERRIES, Boolean.valueOf(false)), 2); + p_152955_.playSound( + (Player) null, + p_152956_, + SoundEvents.CAVE_VINES_PICK_BERRIES, + SoundSource.BLOCKS, + 1.0F, + f + ); + p_152955_.setBlock( + p_152956_, + p_152954_.setValue(BERRIES, Boolean.valueOf(false)), + 2 + ); return InteractionResult.sidedSuccess(p_152955_.isClientSide); } else { return InteractionResult.PASS; @@ -42,8 +57,10 @@ static boolean hasGlowBerries(BlockState p_152952_) { } static ToIntFunction emission(int p_181218_) { - return (p_181216_) -> { - return p_181216_.getValue(BlockStateProperties.BERRIES) ? p_181218_ : 0; + return p_181216_ -> { + return p_181216_.getValue(BlockStateProperties.BERRIES) + ? p_181218_ + : 0; }; } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java new file mode 100644 index 00000000..247bdb1c --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class AllthemodiumBlock extends Block { + + public AllthemodiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java new file mode 100644 index 00000000..518beaf9 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java @@ -0,0 +1,138 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import com.thevortex.allthemodium.registry.TagRegistry; +import javax.annotation.Nonnull; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.RedStoneOreBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.PushReaction; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.util.FakePlayer; + +public class AllthemodiumOre extends RedStoneOreBlock { + + // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; + public AllthemodiumOre() { // func_235861_h_ = setRequiresTool + super( + BlockBehaviour.Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.ANCIENT_DEBRIS) + .lightLevel(state -> { + return 15; + }) + .strength(80.0f, 1500.0f) + ); + } + + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos + ) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if ( + AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() + ) return super.getDestroyProgress(state, player, getter, blockPos); + + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player + ) + ? 250 + : 1500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player + ) { + if ( + (player instanceof FakePlayer) && + (state.is(TagRegistry.ALLTHEMODIUM_ORE)) + ) { + return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); + } + + return ( + super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F) + ); + } + + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2) + ); + } + + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } + + @OnlyIn(Dist.CLIENT) + private static void activate( + BlockState p_196500_0_, + Level worldIn, + BlockPos p_196500_2_ + ) { + spawnParticles(worldIn, p_196500_2_); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { + spawnParticles(worldIn, pos); + } + + @SuppressWarnings("unused") // TODO Remove unused suppression + @OnlyIn(Dist.CLIENT) + private static void spawnParticles(Level world, BlockPos worldIn) { + RandomSource random = world.random; + + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if (!world.getBlockState(blockPos).isSolidRender(world, blockPos)) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + // TODO spawn particles + } + } + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Block.java deleted file mode 100644 index 2833f600..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Block.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import java.util.ArrayList; -import java.util.List; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -public class Allthemodium_Block extends Block { - - public Allthemodium_Block() { - super(Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); - return list; -} - - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java deleted file mode 100644 index f1278fad..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import java.util.Random; - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; -import com.thevortex.allthemodium.registry.TagRegistry; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.util.RandomSource; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.DropExperienceBlock; -import net.minecraft.world.level.block.RedStoneOreBlock; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.PushReaction; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.FakePlayer; - -public class Allthemodium_Ore extends RedStoneOreBlock { - // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; - public Allthemodium_Ore() { //func_235861_h_ = setRequiresTool - super(BlockBehaviour.Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.ANCIENT_DEBRIS).lightLevel((state) -> { return 15;}).strength(80.0f,1500.0f)); - } - - @Override - @SuppressWarnings("java:S1874") // deprecated method from super class - public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { - BlockEntity blockEntity = getter.getBlockEntity(blockPos); - if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); - - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 250 : 1500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } - - - @Override - public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { - return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); - } - - return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); - } - - private double distanceTo(BlockPos block,BlockPos player) { - return Math.sqrt(Math.pow(block.getX() - player.getX(), 2) + Math.pow(block.getY() - player.getY(), 2) + Math.pow(block.getZ() - player.getZ(), 2)); - } - - @Override - public PushReaction getPistonPushReaction(BlockState state) { - - return PushReaction.BLOCK; - } - - - - - @OnlyIn(Dist.CLIENT) - private static void activate(BlockState p_196500_0_, Level worldIn, BlockPos p_196500_2_) { - spawnParticles(worldIn, p_196500_2_); - - - } - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand) { - - spawnParticles(worldIn, pos); - - - } - @OnlyIn(Dist.CLIENT) - private static void spawnParticles(Level world, BlockPos worldIn) { - RandomSource random = world.random; - - for(Direction direction : Direction.values()) { - BlockPos blockpos = worldIn.offset(direction.getNormal()); - if (!world.getBlockState(blockpos).isSolidRender(world, blockpos)) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X ? 0.5D + 0.5625D * (double)direction.getStepX() : (double)random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y ? 0.5D + 0.5625D * (double)direction.getStepY() : (double)random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z ? 0.5D + 0.5625D * (double)direction.getStepZ() : (double)random.nextFloat(); - //todo spawn particles - } - } - - } - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java index dd9f31cb..8bbcb514 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java @@ -2,8 +2,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EnchantmentTableBlock; import net.minecraft.world.level.block.RotatedPillarBlock; import net.minecraft.world.level.block.state.BlockState; @@ -14,7 +12,11 @@ public AncientBookShelf(Properties p_49795_) { } @Override - public float getEnchantPowerBonus(BlockState state, LevelReader world, BlockPos pos) { + public float getEnchantPowerBonus( + BlockState state, + LevelReader world, + BlockPos pos + ) { return 2.0f; } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java index 6b01be44..dde5e207 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java @@ -1,14 +1,15 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; @@ -17,55 +18,110 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraft.util.RandomSource; +public class AncientCaveVines + extends GrowingPlantHeadBlock + implements ACaveVines { -public class AncientCaveVines extends GrowingPlantHeadBlock implements BonemealableBlock, ACaveVines { - private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; + // private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; - public AncientCaveVines(Properties p_53928_, Direction p_53929_, VoxelShape p_53930_, boolean p_53931_, double p_53932_) { + public AncientCaveVines( + Properties p_53928_, + Direction p_53929_, + VoxelShape p_53930_, + boolean p_53931_, + double p_53932_ + ) { super(p_53928_, Direction.DOWN, SHAPE, false, 0.1D); - this.registerDefaultState(this.stateDefinition.any().setValue(AGE, Integer.valueOf(0)).setValue(BERRIES, Boolean.valueOf(false))); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(AGE, Integer.valueOf(0)) + .setValue(BERRIES, Boolean.valueOf(false)) + ); } - protected int getBlocksToGrowWhenBonemealed(RandomSource p_152995_) { + + protected int getBlocksToGrowWhenBonemealed( + @Nonnull RandomSource p_152995_ + ) { return 1; } - protected boolean canGrowInto(BlockState p_152998_) { + protected boolean canGrowInto(@Nonnull BlockState p_152998_) { return p_152998_.isAir(); } - protected BlockState updateBodyAfterConvertedFromHead(BlockState p_152987_, BlockState p_152988_) { + protected BlockState updateBodyAfterConvertedFromHead( + @Nonnull BlockState p_152987_, + @Nonnull BlockState p_152988_ + ) { return p_152988_.setValue(BERRIES, Boolean.FALSE); } - protected BlockState getGrowIntoState(BlockState p_152990_, RandomSource p_152991_) { - return super.getGrowIntoState(p_152990_, p_152991_).setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); + protected BlockState getGrowIntoState( + @Nonnull BlockState p_152990_, + @Nonnull RandomSource p_152991_ + ) { + return super + .getGrowIntoState(p_152990_, p_152991_) + .setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); } - public ItemStack getCloneItemStack(BlockGetter p_152966_, BlockPos p_152967_, BlockState p_152968_) { + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_152966_, + @Nonnull BlockPos p_152967_, + @Nonnull BlockState p_152968_ + ) { return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_.get()); } - public InteractionResult use(BlockState p_152980_, Level p_152981_, BlockPos p_152982_, Player p_152983_, InteractionHand p_152984_, BlockHitResult p_152985_) { + public InteractionResult use( + @Nonnull BlockState p_152980_, + @Nonnull Level p_152981_, + @Nonnull BlockPos p_152982_, + @Nonnull Player p_152983_, + @Nonnull InteractionHand p_152984_, + @Nonnull BlockHitResult p_152985_ + ) { return ACaveVines.use(p_152980_, p_152981_, p_152982_); } - protected void createBlockStateDefinition(StateDefinition.Builder p_152993_) { + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_152993_ + ) { super.createBlockStateDefinition(p_152993_); p_152993_.add(BERRIES); } - public boolean isValidBonemealTarget(BlockGetter p_152970_, BlockPos p_152971_, BlockState p_152972_, boolean p_152973_) { + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_152970_, + @Nonnull BlockPos p_152971_, + @Nonnull BlockState p_152972_, + boolean p_152973_ + ) { return !p_152972_.getValue(BERRIES); } - public boolean isBonemealSuccess(Level p_152975_, RandomSource p_152976_, BlockPos p_152977_, BlockState p_152978_) { + public boolean isBonemealSuccess( + @Nonnull Level p_152975_, + @Nonnull RandomSource p_152976_, + @Nonnull BlockPos p_152977_, + @Nonnull BlockState p_152978_ + ) { return true; } - public void performBonemeal(ServerLevel p_152961_, RandomSource p_152962_, BlockPos p_152963_, BlockState p_152964_) { - p_152961_.setBlock(p_152963_, p_152964_.setValue(BERRIES, Boolean.valueOf(true)), 2); + public void performBonemeal( + @Nonnull ServerLevel p_152961_, + @Nonnull RandomSource p_152962_, + @Nonnull BlockPos p_152963_, + @Nonnull BlockState p_152964_ + ) { + p_152961_.setBlock( + p_152963_, + p_152964_.setValue(BERRIES, Boolean.valueOf(true)), + 2 + ); } + @Override protected GrowingPlantBodyBlock getBodyBlock() { return ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(); diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java index 02a4dd6d..01174492 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; @@ -9,7 +10,6 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; @@ -18,47 +18,89 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.VoxelShape; +public class AncientCaveVinesPlant + extends GrowingPlantBodyBlock + implements ACaveVines { -public class AncientCaveVinesPlant extends GrowingPlantBodyBlock implements BonemealableBlock, ACaveVines { - public AncientCaveVinesPlant(Properties p_53886_, Direction p_53887_, VoxelShape p_53888_, boolean p_53889_) { - super(p_53886_,Direction.DOWN, SHAPE, false); + public AncientCaveVinesPlant( + Properties p_53886_, + Direction p_53887_, + VoxelShape p_53888_, + boolean p_53889_ + ) { + super(p_53886_, Direction.DOWN, SHAPE, false); } @Override - protected BlockState updateHeadAfterConvertedFromBody(BlockState p_153028_, BlockState p_153029_) { - + protected BlockState updateHeadAfterConvertedFromBody( + @Nonnull BlockState p_153028_, + @Nonnull BlockState p_153029_ + ) { return p_153029_.setValue(BERRIES, Boolean.FALSE); } @Override - public ItemStack getCloneItemStack(BlockGetter p_153007_, BlockPos p_153008_, BlockState p_153009_) { + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_153007_, + @Nonnull BlockPos p_153008_, + @Nonnull BlockState p_153009_ + ) { return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); } @Override - public InteractionResult use(BlockState p_153021_, Level p_153022_, BlockPos p_153023_, Player p_153024_, InteractionHand p_153025_, BlockHitResult p_153026_) { + public InteractionResult use( + @Nonnull BlockState p_153021_, + @Nonnull Level p_153022_, + @Nonnull BlockPos p_153023_, + @Nonnull Player p_153024_, + @Nonnull InteractionHand p_153025_, + @Nonnull BlockHitResult p_153026_ + ) { return ACaveVines.use(p_153021_, p_153022_, p_153023_); } @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_153031_) { + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_153031_ + ) { p_153031_.add(BERRIES); } @Override - public boolean isValidBonemealTarget(BlockGetter p_153011_, BlockPos p_153012_, BlockState p_153013_, boolean p_153014_) { + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_153011_, + @Nonnull BlockPos p_153012_, + @Nonnull BlockState p_153013_, + boolean p_153014_ + ) { return !p_153013_.getValue(BERRIES); } @Override - public boolean isBonemealSuccess(Level p_153016_, RandomSource p_153017_, BlockPos p_153018_, BlockState p_153019_) { + public boolean isBonemealSuccess( + @Nonnull Level p_153016_, + @Nonnull RandomSource p_153017_, + @Nonnull BlockPos p_153018_, + @Nonnull BlockState p_153019_ + ) { return true; } @Override - public void performBonemeal(ServerLevel p_153002_, RandomSource p_153003_, BlockPos p_153004_, BlockState p_153005_) { - p_153002_.setBlock(p_153004_, p_153005_.setValue(BERRIES, Boolean.valueOf(true)), 2); + public void performBonemeal( + @Nonnull ServerLevel p_153002_, + @Nonnull RandomSource p_153003_, + @Nonnull BlockPos p_153004_, + @Nonnull BlockState p_153005_ + ) { + p_153002_.setBlock( + p_153004_, + p_153005_.setValue(BERRIES, Boolean.valueOf(true)), + 2 + ); } + @Override protected GrowingPlantHeadBlock getHeadBlock() { return ModRegistry.ANCIENT_CAVEVINES_.get(); diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java index c92d802e..86f6e7ad 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java @@ -4,18 +4,23 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.GrassBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.IPlantable; public class AncientDirt extends Block { + public AncientDirt(Properties p_49795_) { super(p_49795_); } - @Override - public boolean canSustainPlant(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable) { + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable + ) { return true; } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java index a77d0037..ffefa013 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java @@ -1,5 +1,6 @@ package com.thevortex.allthemodium.blocks; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.tags.BlockTags; @@ -16,7 +17,6 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.FenceBlock; import net.minecraft.world.level.block.FenceGateBlock; -import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.material.FluidState; @@ -27,70 +27,213 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class AncientFenceBlock extends FenceBlock { + private final VoxelShape[] occlusionByIndex; public AncientFenceBlock(Properties props) { super(props); - this.registerDefaultState(this.stateDefinition.any().setValue(NORTH, Boolean.valueOf(false)).setValue(EAST, Boolean.valueOf(false)).setValue(SOUTH, Boolean.valueOf(false)).setValue(WEST, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(NORTH, Boolean.valueOf(false)) + .setValue(EAST, Boolean.valueOf(false)) + .setValue(SOUTH, Boolean.valueOf(false)) + .setValue(WEST, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); this.occlusionByIndex = this.makeShapes(2.0F, 1.0F, 16.0F, 6.0F, 15.0F); } - public VoxelShape getOcclusionShape(BlockState p_53338_, BlockGetter p_53339_, BlockPos p_53340_) { + public VoxelShape getOcclusionShape( + @Nonnull BlockState p_53338_, + @Nonnull BlockGetter p_53339_, + @Nonnull BlockPos p_53340_ + ) { return this.occlusionByIndex[this.getAABBIndex(p_53338_)]; } - public VoxelShape getVisualShape(BlockState p_53311_, BlockGetter p_53312_, BlockPos p_53313_, CollisionContext p_53314_) { + public VoxelShape getVisualShape( + @Nonnull BlockState p_53311_, + @Nonnull BlockGetter p_53312_, + @Nonnull BlockPos p_53313_, + @Nonnull CollisionContext p_53314_ + ) { return this.getShape(p_53311_, p_53312_, p_53313_, p_53314_); } - public boolean isPathfindable(BlockState p_53306_, BlockGetter p_53307_, BlockPos p_53308_, PathComputationType p_53309_) { + public boolean isPathfindable( + @Nonnull BlockState p_53306_, + @Nonnull BlockGetter p_53307_, + @Nonnull BlockPos p_53308_, + @Nonnull PathComputationType p_53309_ + ) { return false; } - public boolean connectsTo(BlockState p_53330_, boolean p_53331_, Direction p_53332_) { + public boolean connectsTo( + @Nonnull BlockState p_53330_, + boolean p_53331_, + @Nonnull Direction p_53332_ + ) { Block block = p_53330_.getBlock(); boolean flag = this.isSameFence(p_53330_); - boolean flag1 = block instanceof FenceGateBlock && FenceGateBlock.connectsToDirection(p_53330_, p_53332_); - return !isExceptionForConnection(p_53330_) && p_53331_ || flag || flag1; + boolean flag1 = + block instanceof FenceGateBlock && + FenceGateBlock.connectsToDirection(p_53330_, p_53332_); + return ( + (!isExceptionForConnection(p_53330_) && p_53331_) || flag || flag1 + ); } private boolean isSameFence(BlockState p_153255_) { - return p_153255_.is(BlockTags.FENCES) && p_153255_.is(BlockTags.WOODEN_FENCES) == this.defaultBlockState().is(BlockTags.WOODEN_FENCES); + return ( + p_153255_.is(BlockTags.FENCES) && + p_153255_.is(BlockTags.WOODEN_FENCES) == + this.defaultBlockState().is(BlockTags.WOODEN_FENCES) + ); } - public InteractionResult use(BlockState p_53316_, Level p_53317_, BlockPos p_53318_, Player p_53319_, InteractionHand p_53320_, BlockHitResult p_53321_) { + public InteractionResult use( + @Nonnull BlockState p_53316_, + @Nonnull Level p_53317_, + @Nonnull BlockPos p_53318_, + @Nonnull Player p_53319_, + @Nonnull InteractionHand p_53320_, + @Nonnull BlockHitResult p_53321_ + ) { if (p_53317_.isClientSide) { - ItemStack itemstack = p_53319_.getItemInHand(p_53320_); - return itemstack.is(Items.LEAD) ? InteractionResult.SUCCESS : InteractionResult.PASS; + ItemStack itemStack = p_53319_.getItemInHand(p_53320_); + return itemStack.is(Items.LEAD) + ? InteractionResult.SUCCESS + : InteractionResult.PASS; } else { return LeadItem.bindPlayerMobs(p_53319_, p_53317_, p_53318_); } } - public BlockState getStateForPlacement(BlockPlaceContext p_53304_) { - BlockGetter blockgetter = p_53304_.getLevel(); - BlockPos blockpos = p_53304_.getClickedPos(); - FluidState fluidstate = p_53304_.getLevel().getFluidState(p_53304_.getClickedPos()); - BlockPos blockpos1 = blockpos.north(); - BlockPos blockpos2 = blockpos.east(); - BlockPos blockpos3 = blockpos.south(); - BlockPos blockpos4 = blockpos.west(); - BlockState blockstate = blockgetter.getBlockState(blockpos1); - BlockState blockstate1 = blockgetter.getBlockState(blockpos2); - BlockState blockstate2 = blockgetter.getBlockState(blockpos3); - BlockState blockstate3 = blockgetter.getBlockState(blockpos4); - return super.getStateForPlacement(p_53304_).setValue(NORTH, Boolean.valueOf(this.connectsTo(blockstate, blockstate.isFaceSturdy(blockgetter, blockpos1, Direction.SOUTH), Direction.SOUTH))).setValue(EAST, Boolean.valueOf(this.connectsTo(blockstate1, blockstate1.isFaceSturdy(blockgetter, blockpos2, Direction.WEST), Direction.WEST))).setValue(SOUTH, Boolean.valueOf(this.connectsTo(blockstate2, blockstate2.isFaceSturdy(blockgetter, blockpos3, Direction.NORTH), Direction.NORTH))).setValue(WEST, Boolean.valueOf(this.connectsTo(blockstate3, blockstate3.isFaceSturdy(blockgetter, blockpos4, Direction.EAST), Direction.EAST))).setValue(WATERLOGGED, Boolean.valueOf(fluidstate.getType() == Fluids.WATER)); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_53304_ + ) { + BlockGetter blockGetter = p_53304_.getLevel(); + BlockPos blockPos = p_53304_.getClickedPos(); + FluidState fluidState = p_53304_ + .getLevel() + .getFluidState(p_53304_.getClickedPos()); + BlockPos blockPos1 = blockPos.north(); + BlockPos blockPos2 = blockPos.east(); + BlockPos blockPos3 = blockPos.south(); + BlockPos blockPos4 = blockPos.west(); + BlockState blockState = blockGetter.getBlockState(blockPos1); + BlockState blockState1 = blockGetter.getBlockState(blockPos2); + BlockState blockState2 = blockGetter.getBlockState(blockPos3); + BlockState blockState3 = blockGetter.getBlockState(blockPos4); + return super + .getStateForPlacement(p_53304_) + .setValue( + NORTH, + Boolean.valueOf( + this.connectsTo( + blockState, + blockState.isFaceSturdy( + blockGetter, + blockPos1, + Direction.SOUTH + ), + Direction.SOUTH + ) + ) + ) + .setValue( + EAST, + Boolean.valueOf( + this.connectsTo( + blockState1, + blockState1.isFaceSturdy( + blockGetter, + blockPos2, + Direction.WEST + ), + Direction.WEST + ) + ) + ) + .setValue( + SOUTH, + Boolean.valueOf( + this.connectsTo( + blockState2, + blockState2.isFaceSturdy( + blockGetter, + blockPos3, + Direction.NORTH + ), + Direction.NORTH + ) + ) + ) + .setValue( + WEST, + Boolean.valueOf( + this.connectsTo( + blockState3, + blockState3.isFaceSturdy( + blockGetter, + blockPos4, + Direction.EAST + ), + Direction.EAST + ) + ) + ) + .setValue( + WATERLOGGED, + Boolean.valueOf(fluidState.getType() == Fluids.WATER) + ); } - public BlockState updateShape(BlockState p_53323_, Direction p_53324_, BlockState p_53325_, LevelAccessor p_53326_, BlockPos p_53327_, BlockPos p_53328_) { + public BlockState updateShape( + @Nonnull BlockState p_53323_, + @Nonnull Direction p_53324_, + @Nonnull BlockState p_53325_, + @Nonnull LevelAccessor p_53326_, + @Nonnull BlockPos p_53327_, + @Nonnull BlockPos p_53328_ + ) { if (p_53323_.getValue(WATERLOGGED)) { - p_53326_.scheduleTick(p_53327_, Fluids.WATER, Fluids.WATER.getTickDelay(p_53326_)); + p_53326_.scheduleTick( + p_53327_, + Fluids.WATER, + Fluids.WATER.getTickDelay(p_53326_) + ); } - return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL ? p_53323_.setValue(PROPERTY_BY_DIRECTION.get(p_53324_), Boolean.valueOf(this.connectsTo(p_53325_, p_53325_.isFaceSturdy(p_53326_, p_53328_, p_53324_.getOpposite()), p_53324_.getOpposite()))) : super.updateShape(p_53323_, p_53324_, p_53325_, p_53326_, p_53327_, p_53328_); + return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL + ? p_53323_.setValue( + PROPERTY_BY_DIRECTION.get(p_53324_), + Boolean.valueOf( + this.connectsTo( + p_53325_, + p_53325_.isFaceSturdy( + p_53326_, + p_53328_, + p_53324_.getOpposite() + ), + p_53324_.getOpposite() + ) + ) + ) + : super.updateShape( + p_53323_, + p_53324_, + p_53325_, + p_53326_, + p_53327_, + p_53328_ + ); } - protected void createBlockStateDefinition(StateDefinition.Builder p_53334_) { + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_53334_ + ) { p_53334_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java new file mode 100644 index 00000000..0cdf9fb1 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java @@ -0,0 +1,46 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.GrassBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.common.IPlantable; + +public class AncientGrass extends GrassBlock { + + public AncientGrass(Properties p_49795_) { + super(p_49795_); + } + + @Override + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable + ) { + return true; + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random + ) { + if (!level.getBlockState(pos.above()).isAir()) { + level.setBlock( + pos, + ModRegistry.ANCIENT_DIRT.get().defaultBlockState(), + 1 + ); + } + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java index cb7ab541..4c8d90e6 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.blocks; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Random; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.tags.BlockTags; @@ -8,24 +9,34 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import java.util.Random; - public class AncientHerb extends Block { + public AncientHerb(Properties props) { super(props); } - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random random) { - if(!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random random + ) { + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { dropResources(state, level, pos); level.removeBlock(pos, false); - } } + @SuppressWarnings("deprecation") @Override - public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) { + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { super.tick(state, level, pos, rand); - if(!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { dropResources(state, level, pos); level.removeBlock(pos, false); } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java index c85d74bf..a7e95625 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -12,9 +13,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LeavesBlock; -import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; @@ -23,65 +22,106 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class AncientLeaves extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; private static final int TICK_DELAY = 800; private static int TICK_COUNT; public AncientLeaves(Properties p_54422_) { super(p_54422_.randomTicks()); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - @Override - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } @Override - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } + @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) { - this.TICK_COUNT++; - if(this.TICK_COUNT>=this.TICK_DELAY) { + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } if (level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), 3); + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } } - } - public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource p_54429_) { - this.TICK_COUNT++; - if(this.TICK_COUNT>=this.TICK_DELAY) { + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_ + ) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { level.setBlock(pos, updateDistance(state, level, pos), 3); if (level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), 3); + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } - this.TICK_COUNT=0; + AncientLeaves.TICK_COUNT = 0; } } @Override - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } + @Override - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -90,13 +130,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -109,30 +161,61 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } + @Override - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, RandomSource p_54434_) { + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } + @Override - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java index 9731ee22..2366a503 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java @@ -1,6 +1,8 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Random; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -20,58 +22,96 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class AncientLeavesBottom extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; - private static final int TICK_DELAY = 1; + // private static final int TICK_DELAY = 1; public AncientLeavesBottom(Properties p_54422_) { super(p_54422_); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - - - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random rand) { + public void randomTick( + @Nonnull BlockState state, + ServerLevel level, + BlockPos pos, + Random rand + ) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } - if(level.getBlockState(pos.above()).is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - - } - public void tick(BlockState state, ServerLevel level, BlockPos pos, Random p_54429_) { + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_ + ) { level.setBlock(pos, updateDistance(state, level, pos), 3); - if(level.getBlockState(pos.above()).is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - } - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -80,13 +120,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -99,30 +151,59 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, Random p_54434_) { + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT,WATERLOGGED); + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java index c438e4f8..a44318c5 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java @@ -3,8 +3,8 @@ import net.minecraft.world.level.block.RotatedPillarBlock; public class AncientLog extends RotatedPillarBlock { + public AncientLog(Properties prop) { super(prop); } } - diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java index 75e5750d..2f324b93 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java @@ -1,7 +1,8 @@ package com.thevortex.allthemodium.blocks; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; @@ -19,71 +20,149 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -public class AncientSaplingBlock extends SaplingBlock implements BonemealableBlock { - +public class AncientSaplingBlock extends SaplingBlock { public static final IntegerProperty STAGE = BlockStateProperties.STAGE; protected static final float AABB_OFFSET = 6.0F; - protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); + protected static final VoxelShape SHAPE = Block.box( + 2.0D, + 0.0D, + 2.0D, + 14.0D, + 12.0D, + 14.0D + ); private final AbstractTreeGrower treeGrower; - public AncientSaplingBlock(AbstractTreeGrower p_55978_, BlockBehaviour.Properties p_55979_) { - super(p_55978_,p_55979_); + public AncientSaplingBlock( + AbstractTreeGrower p_55978_, + BlockBehaviour.Properties p_55979_ + ) { + super(p_55978_, p_55979_); this.treeGrower = p_55978_; - this.registerDefaultState(this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0))); + this.registerDefaultState( + this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0)) + ); } - public VoxelShape getShape(BlockState p_56008_, BlockGetter p_56009_, BlockPos p_56010_, CollisionContext p_56011_) { + public VoxelShape getShape( + @Nonnull BlockState p_56008_, + @Nonnull BlockGetter p_56009_, + @Nonnull BlockPos p_56010_, + @Nonnull CollisionContext p_56011_ + ) { return SHAPE; } @Override - protected boolean mayPlaceOn(BlockState state, BlockGetter p_51043_, BlockPos p_51044_) { - return (state.is(TagRegistry.ANCIENT_DIRT) || state.is(Blocks.WARPED_NYLIUM) || state.is(Blocks.CRIMSON_NYLIUM) || state.is(ModRegistry.ANCIENT_GRASS.get())); + protected boolean mayPlaceOn( + @Nonnull BlockState state, + @Nonnull BlockGetter p_51043_, + @Nonnull BlockPos p_51044_ + ) { + return ( + state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get()) + ); } @Override - public VoxelShape getBlockSupportShape(BlockState p_60581_, BlockGetter p_60582_, BlockPos p_60583_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_60581_, + @Nonnull BlockGetter p_60582_, + @Nonnull BlockPos p_60583_ + ) { return Shapes.empty(); } - @Override - public boolean canSurvive(BlockState state, LevelReader reader, BlockPos pos) { - return (state.is(TagRegistry.ANCIENT_DIRT) || state.is(Blocks.WARPED_NYLIUM) || state.is(Blocks.CRIMSON_NYLIUM) || state.is(ModRegistry.ANCIENT_GRASS.get())); + public boolean canSurvive( + @Nonnull BlockState state, + @Nonnull LevelReader reader, + @Nonnull BlockPos pos + ) { + return ( + state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get()) + ); } - public void randomTick(BlockState p_56003_, ServerLevel p_56004_, BlockPos p_56005_, RandomSource p_56006_) { - if (p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && p_56006_.nextInt(7) == 0) { + @SuppressWarnings("deprecation") + public void randomTick( + @Nonnull BlockState p_56003_, + @Nonnull ServerLevel p_56004_, + @Nonnull BlockPos p_56005_, + @Nonnull RandomSource p_56006_ + ) { + if ( + p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && + p_56006_.nextInt(7) == 0 + ) { if (!p_56004_.isAreaLoaded(p_56005_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light this.advanceTree(p_56004_, p_56005_, p_56003_, p_56006_); } - } - public void advanceTree(ServerLevel p_55981_, BlockPos p_55982_, BlockState p_55983_, RandomSource p_55984_) { + public void advanceTree( + @Nonnull ServerLevel p_55981_, + @Nonnull BlockPos p_55982_, + @Nonnull BlockState p_55983_, + @Nonnull RandomSource p_55984_ + ) { if (p_55983_.getValue(STAGE) == 0) { p_55981_.setBlock(p_55982_, p_55983_.cycle(STAGE), 4); } else { - if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_55981_, p_55984_, p_55982_)) return; - this.treeGrower.growTree(p_55981_, p_55981_.getChunkSource().getGenerator(), p_55982_, p_55983_, p_55984_); + if ( + !net.minecraftforge.event.ForgeEventFactory.saplingGrowTree( + p_55981_, + p_55984_, + p_55982_ + ) + ) return; + this.treeGrower.growTree( + p_55981_, + p_55981_.getChunkSource().getGenerator(), + p_55982_, + p_55983_, + p_55984_ + ); } - } - public boolean isValidBonemealTarget(BlockGetter p_55991_, BlockPos p_55992_, BlockState p_55993_, boolean p_55994_) { + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_55991_, + @Nonnull BlockPos p_55992_, + @Nonnull BlockState p_55993_, + boolean p_55994_ + ) { return true; } - public boolean isBonemealSuccess(Level p_55996_, RandomSource p_55997_, BlockPos p_55998_, BlockState p_55999_) { - return (double)p_55996_.random.nextFloat() < 0.45D; + public boolean isBonemealSuccess( + @Nonnull Level p_55996_, + @Nonnull RandomSource p_55997_, + @Nonnull BlockPos p_55998_, + @Nonnull BlockState p_55999_ + ) { + return (double) p_55996_.random.nextFloat() < 0.45D; } - public void performBonemeal(ServerLevel p_55986_, RandomSource p_55987_, BlockPos p_55988_, BlockState p_55989_) { + public void performBonemeal( + @Nonnull ServerLevel p_55986_, + @Nonnull RandomSource p_55987_, + @Nonnull BlockPos p_55988_, + @Nonnull BlockState p_55989_ + ) { this.advanceTree(p_55986_, p_55988_, p_55989_, p_55987_); } - protected void createBlockStateDefinition(StateDefinition.Builder p_56001_) { + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_56001_ + ) { p_56001_.add(STAGE); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Ancient_Grass.java b/src/main/java/com/thevortex/allthemodium/blocks/Ancient_Grass.java deleted file mode 100644 index 05d04d40..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Ancient_Grass.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.GrassBlock; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.IPlantable; - -public class Ancient_Grass extends GrassBlock { - public Ancient_Grass(Properties p_49795_) { - super(p_49795_); - } - @Override - public boolean canSustainPlant(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable) { - return true; - } - - @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { - if(!level.getBlockState(pos.above()).isAir()) { - level.setBlock(pos, ModRegistry.ANCIENT_DIRT.get().defaultBlockState(),1 ); - } - } -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java index 69dbd567..80fe9c50 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -24,68 +25,130 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class DemonicLeaves extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; private static final int TICK_DELAY = 80; private static int TICK_COUNT; public DemonicLeaves(Properties p_54422_) { super(p_54422_.randomTicks()); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - @Override - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } @Override - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } + @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) { + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } - if(level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } - - } @Override - public boolean onDestroyedByPlayer(BlockState state, Level world, BlockPos pos, Player player, boolean willHarvest, FluidState fluid) { - if(world.getBlockState(pos.below()).getBlock() instanceof DemonicLeavesBottom) { world.setBlockAndUpdate(pos.below(), Blocks.AIR.defaultBlockState()); } - return super.onDestroyedByPlayer(state, world, pos, player, willHarvest, fluid); + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid + ) { + if ( + world.getBlockState(pos.below()).getBlock() instanceof + DemonicLeavesBottom + ) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState() + ); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid + ); } - public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource p_54429_) { - this.TICK_COUNT++; - if(this.TICK_COUNT>=this.TICK_DELAY) { + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_ + ) { + DemonicLeaves.TICK_COUNT++; + if (DemonicLeaves.TICK_COUNT >= DemonicLeaves.TICK_DELAY) { level.setBlock(pos, updateDistance(state, level, pos), 3); if (level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), 3); + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } - this.TICK_COUNT=0; + DemonicLeaves.TICK_COUNT = 0; } } @Override - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } + @Override - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -94,13 +157,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -113,30 +188,61 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } + @Override - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, RandomSource p_54434_) { + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT,WATERLOGGED); + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } + @Override - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java index c0841e12..6a2631cb 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java @@ -1,6 +1,8 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Random; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -20,58 +22,96 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class DemonicLeavesBottom extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; - private static final int TICK_DELAY = 1; + // private static final int TICK_DELAY = 1; public DemonicLeavesBottom(Properties p_54422_) { super(p_54422_); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - - - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random rand) { + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand + ) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } - if(level.getBlockState(pos.above()).is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - - } - public void tick(BlockState state, ServerLevel level, BlockPos pos, Random p_54429_) { + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_ + ) { level.setBlock(pos, updateDistance(state, level, pos), 3); - if(level.getBlockState(pos.above()).is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - } - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -80,13 +120,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -99,30 +151,59 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, Random p_54434_) { + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT,WATERLOGGED); + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java new file mode 100644 index 00000000..640f7da5 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java @@ -0,0 +1,3 @@ +package com.thevortex.allthemodium.blocks; + +public class RawATM extends AllthemodiumOre {} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java b/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java new file mode 100644 index 00000000..d7e9059e --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java @@ -0,0 +1,3 @@ +package com.thevortex.allthemodium.blocks; + +public class RawUNO extends UnobtainiumOre {} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java b/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java new file mode 100644 index 00000000..3e8b6fbb --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java @@ -0,0 +1,3 @@ +package com.thevortex.allthemodium.blocks; + +public class RawVIB extends VibraniumOre {} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Raw_ATM.java b/src/main/java/com/thevortex/allthemodium/blocks/Raw_ATM.java deleted file mode 100644 index b9a60b9a..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Raw_ATM.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -public class Raw_ATM extends Allthemodium_Ore { - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Raw_UNO.java b/src/main/java/com/thevortex/allthemodium/blocks/Raw_UNO.java deleted file mode 100644 index 9f47d1f4..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Raw_UNO.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -public class Raw_UNO extends Unobtainium_Ore { - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java b/src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java deleted file mode 100644 index 48aa13bc..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -public class Raw_VIB extends Vibranium_Ore { - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java index 27c82bee..e55b955e 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java @@ -1,17 +1,14 @@ package com.thevortex.allthemodium.blocks; -import java.util.Random; -import java.util.function.Supplier; - import com.thevortex.allthemodium.registry.BlockRegistry; +import java.util.function.Supplier; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.tags.FluidTags; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.GameRules; @@ -20,129 +17,214 @@ import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FlowingFluid; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.ticks.ScheduledTick; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; - import net.minecraftforge.event.ForgeEventFactory; -import com.thevortex.allthemodium.registry.ModRegistry; -import org.lwjgl.system.CallbackI; - public class SoulLava extends LiquidBlock { - public int tickcount = 0; - protected FlowingFluid fluid; - public SoulLava(Supplier supplier, Properties p_i48368_1_) { - super(supplier, p_i48368_1_); - - } - - @Override - public boolean isBurning(BlockState state, BlockGetter world, BlockPos pos) { - return true; - } - - @Override - public boolean isFireSource(BlockState state, LevelReader world, BlockPos pos, Direction side) { - return true; - } - - - @Override - public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity entity) { - return false; - } - - @Override - public boolean canBeReplaced(BlockState state, BlockPlaceContext context) { - - return false; - } - @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { - if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { - int i = random.nextInt(10); - if (i > 0) { - BlockPos blockpos = pos; - - for (int j = 0; j < i; ++j) { - blockpos = blockpos.offset(random.nextInt(10) - 1, 1, random.nextInt(10) - 1); - if (!level.isEmptyBlock(blockpos)) { - return; - } - - BlockState blockstate = level.getBlockState(blockpos); - BlockState FIRE = SoulFireBlock.canSurviveOnBlock(blockstate) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - } - } else { - for (int k = 0; k < 10; ++k) { - BlockPos blockpos1 = pos.offset(random.nextInt(10) - 1, 0, random.nextInt(10) - 1); - BlockState FIRE = SoulFireBlock.canSurviveOnBlock(level.getBlockState(blockpos1)) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - - if (!level.isEmptyBlock(blockpos1)) { - return; - } - - level.setBlockAndUpdate(blockpos1.above(), ForgeEventFactory - .fireFluidPlaceBlockEvent(level, blockpos1.above(), pos, FIRE)); - - } - } - - } - } - /**/ - - - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand) { - this.tickcount++; - - if(stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && this.tickcount >= 40) { - spawnParticles(worldIn, pos); - this.tickcount = 0; - } - super.animateTick(stateIn, worldIn, pos, rand); - } - - private static void spawnParticles(Level world, BlockPos worldIn) { - double d0 = 0.5625D; - RandomSource random = world.random; - - if(world.getFluidState(worldIn).isSource() && (random.nextBoolean() == true)) { - for (Direction direction : Direction.values()) { - BlockPos blockpos = worldIn.offset(direction.getNormal()); - if (!world.getBlockState(blockpos).isSolidRender(world, blockpos)) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X ? 0.5D + 0.5625D * (double) direction.getStepX() : (double) random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y ? 0.5D + 0.5625D * (double) direction.getStepY() : (double) random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z ? 0.5D + 0.5625D * (double) direction.getStepZ() : (double) random.nextFloat(); - world.addParticle(ParticleTypes.SOUL_FIRE_FLAME, (double) worldIn.getX() + d1, (double) worldIn.getY() + d2, (double) worldIn.getZ() + d3, random.nextFloat(), random.nextFloat(), random.nextFloat()); - world.addParticle(ParticleTypes.SOUL_FIRE_FLAME, (double) worldIn.getX() + d1, (double) worldIn.getY() + d2, (double) worldIn.getZ() + d3, random.nextFloat(), -random.nextFloat(), -random.nextFloat()); - world.addParticle(ParticleTypes.SOUL_FIRE_FLAME, (double) worldIn.getX() + d1, (double) worldIn.getY() + d2, (double) worldIn.getZ() + d3, -random.nextFloat(), random.nextFloat(), -random.nextFloat()); - world.addParticle(ParticleTypes.SOUL_FIRE_FLAME, (double) worldIn.getX() + d1, (double) worldIn.getY() + d2, (double) worldIn.getZ() + d3, -random.nextFloat(), -random.nextFloat(), random.nextFloat()); - } - } - } - } - - @Override - public int getFireSpreadSpeed(BlockState state, BlockGetter world, BlockPos pos, Direction face) { - return 1000; - } - - - - - -/**/ - + public int tickCount = 0; + protected FlowingFluid fluid; + + public SoulLava( + Supplier supplier, + Properties p_i48368_1_ + ) { + super(supplier, p_i48368_1_); + } + + @Override + public boolean isBurning( + BlockState state, + BlockGetter world, + BlockPos pos + ) { + return true; + } + + @Override + public boolean isFireSource( + BlockState state, + LevelReader world, + BlockPos pos, + Direction side + ) { + return true; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity entity + ) { + return false; + } + + @Override + public boolean canBeReplaced( + @Nonnull BlockState state, + @Nonnull BlockPlaceContext context + ) { + return false; + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random + ) { + if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { + int i = random.nextInt(10); + if (i > 0) { + BlockPos blockPos = pos; + + for (int j = 0; j < i; ++j) { + blockPos = + blockPos.offset( + random.nextInt(10) - 1, + 1, + random.nextInt(10) - 1 + ); + if (!level.isEmptyBlock(blockPos)) { + return; + } + + BlockState blockState = level.getBlockState(blockPos); + @SuppressWarnings("unused") + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + blockState + ) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + } + } else { + for (int k = 0; k < 10; ++k) { + BlockPos blockPos1 = pos.offset( + random.nextInt(10) - 1, + 0, + random.nextInt(10) - 1 + ); + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + level.getBlockState(blockPos1) + ) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + + if (!level.isEmptyBlock(blockPos1)) { + return; + } + + level.setBlockAndUpdate( + blockPos1.above(), + ForgeEventFactory.fireFluidPlaceBlockEvent( + level, + blockPos1.above(), + pos, + FIRE + ) + ); + } + } + } + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { + this.tickCount++; + + if ( + stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && + this.tickCount >= 40 + ) { + spawnParticles(worldIn, pos); + this.tickCount = 0; + } + super.animateTick(stateIn, worldIn, pos, rand); + } + + private static void spawnParticles(Level world, BlockPos worldIn) { + // double d0 = 0.5625D; + RandomSource random = world.random; + + if ( + world.getFluidState(worldIn).isSource() && + (random.nextBoolean() == true) + ) { + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if ( + !world + .getBlockState(blockPos) + .isSolidRender(world, blockPos) + ) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + random.nextFloat(), + random.nextFloat() + ); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + -random.nextFloat(), + -random.nextFloat() + ); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + random.nextFloat(), + -random.nextFloat() + ); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + -random.nextFloat(), + random.nextFloat() + ); + } + } + } + } + + @Override + public int getFireSpreadSpeed( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction face + ) { + return 1000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java index c4a24da5..65d457e0 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java @@ -1,6 +1,8 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Random; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -24,69 +26,131 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class SoulLeaves extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; private static final int TICK_DELAY = 80; private static int TICK_COUNT; public SoulLeaves(Properties p_54422_) { super(p_54422_.randomTicks()); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - @Override - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } @Override - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } + @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) { + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand + ) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } - if(level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } - - } @Override - public boolean onDestroyedByPlayer(BlockState state, Level world, BlockPos pos, Player player, boolean willHarvest, FluidState fluid) { - if(world.getBlockState(pos.below()).getBlock() instanceof SoulLeavesBottom) { world.setBlockAndUpdate(pos.below(), Blocks.AIR.defaultBlockState()); } - return super.onDestroyedByPlayer(state, world, pos, player, willHarvest, fluid); + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid + ) { + if ( + world.getBlockState(pos.below()).getBlock() instanceof + SoulLeavesBottom + ) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState() + ); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid + ); } - public void tick(BlockState state, ServerLevel level, BlockPos pos, Random p_54429_) { - this.TICK_COUNT++; - if(this.TICK_COUNT>=this.TICK_DELAY) { + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_ + ) { + SoulLeaves.TICK_COUNT++; + if (SoulLeaves.TICK_COUNT >= SoulLeaves.TICK_DELAY) { level.setBlock(pos, updateDistance(state, level, pos), 3); if (level.getBlockState(pos.below()).isAir()) { - level.setBlock(pos.below(), ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), 3); + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3 + ); } - this.TICK_COUNT=0; + SoulLeaves.TICK_COUNT = 0; } } @Override - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } + @Override - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -95,13 +159,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -114,30 +190,61 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } + @Override - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, RandomSource p_54434_) { + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT,WATERLOGGED); + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } + @Override - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java index 97399e51..b0ab8fc0 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java @@ -1,6 +1,8 @@ package com.thevortex.allthemodium.blocks; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Random; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -20,58 +22,96 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.Random; - public class SoulLeavesBottom extends LeavesBlock { + public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final IntegerProperty DISTANCE = + BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = + BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = + BlockStateProperties.WATERLOGGED; - private static final int TICK_DELAY = 1; + // private static final int TICK_DELAY = 1; public SoulLeavesBottom(Properties p_54422_) { super(p_54422_); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, Integer.valueOf(7)).setValue(PERSISTENT, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); - + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false)) + ); } - - - public VoxelShape getBlockSupportShape(BlockState p_54456_, BlockGetter p_54457_, BlockPos p_54458_) { + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_ + ) { return Shapes.empty(); } - public boolean isRandomlyTicking(BlockState p_54449_) { - return p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT); + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return ( + p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) + ); } - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random rand) { + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand + ) { if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { dropResources(state, level, pos); level.removeBlock(pos, false); } - if(level.getBlockState(pos.above()).is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - - } - public void tick(BlockState state, ServerLevel level, BlockPos pos, Random p_54429_) { + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_ + ) { level.setBlock(pos, updateDistance(state, level, pos), 3); - if(level.getBlockState(pos.above()).is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || level.getBlockState(pos.above()).isAir()) { + if ( + level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir() + ) { level.removeBlock(pos, false); } - } - public int getLightBlock(BlockState p_54460_, BlockGetter p_54461_, BlockPos p_54462_) { + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_ + ) { return 1; } - public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockState p_54442_, LevelAccessor p_54443_, BlockPos p_54444_, BlockPos p_54445_) { + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_ + ) { int i = getDistanceAt(p_54442_) + 1; if (i != 1 || p_54440_.getValue(DISTANCE) != i) { p_54443_.scheduleTick(p_54444_, this, 1); @@ -80,13 +120,25 @@ public BlockState updateShape(BlockState p_54440_, Direction p_54441_, BlockStat return p_54440_; } - private static BlockState updateDistance(BlockState p_54436_, LevelAccessor p_54437_, BlockPos p_54438_) { + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_ + ) { int i = 7; - BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - - for(Direction direction : Direction.values()) { - blockpos$mutableblockpos.setWithOffset(p_54438_, direction); - i = Math.min(i, getDistanceAt(p_54437_.getBlockState(blockpos$mutableblockpos)) + 1); + BlockPos.MutableBlockPos blockPos$mutableBlockPos = + new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = + Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos) + ) + + 1 + ); if (i == 1) { break; } @@ -99,30 +151,59 @@ private static int getDistanceAt(BlockState p_54464_) { if (p_54464_.is(BlockTags.LOGS)) { return 0; } else { - return p_54464_.getBlock() instanceof LeavesBlock ? p_54464_.getValue(DISTANCE) : 7; + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; } } - public void animateTick(BlockState p_54431_, Level p_54432_, BlockPos p_54433_, Random p_54434_) { + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_ + ) { if (p_54432_.isRainingAt(p_54433_.above())) { if (p_54434_.nextInt(15) == 1) { - BlockPos blockpos = p_54433_.below(); - BlockState blockstate = p_54432_.getBlockState(blockpos); - if (!blockstate.canOcclude() || !blockstate.isFaceSturdy(p_54432_, blockpos, Direction.UP)) { - double d0 = (double)p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double)p_54433_.getY() - 0.05D; - double d2 = (double)p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle(ParticleTypes.DRIPPING_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D); + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if ( + !blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) + ) { + double d0 = + (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = + (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D + ); } } } } - protected void createBlockStateDefinition(StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT,WATERLOGGED); + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_ + ) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); } - public BlockState getStateForPlacement(BlockPlaceContext p_54424_) { - return updateDistance(this.defaultBlockState().setValue(PERSISTENT, Boolean.valueOf(true)), p_54424_.getLevel(), p_54424_.getClickedPos()); + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_ + ) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos() + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java index 699e8fe6..287a8d63 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java @@ -1,13 +1,12 @@ package com.thevortex.allthemodium.blocks; -import java.util.ArrayList; -import java.util.List; - import com.thevortex.allthemodium.AllTheModium; - import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.LevelRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; @@ -21,7 +20,6 @@ import net.minecraft.world.level.LevelHeightAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.phys.BlockHitResult; @@ -29,152 +27,332 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class TeleportPad extends Block { - protected static final VoxelShape TELEPORTPAD_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D); - - public TeleportPad(Properties properties) { - super(properties); - // TODO Auto-generated constructor stub - } - - @Override - public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { - return TELEPORTPAD_AABB; - } - - @Override - public PushReaction getPistonPushReaction(BlockState state) { - return PushReaction.BLOCK; - } - - - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter worldIn, BlockPos pos, - CollisionContext context) { - - return TELEPORTPAD_AABB; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, - InteractionHand handIn, BlockHitResult hit) { - if ((player instanceof ServerPlayer) && (player.isCrouching() == true)) { - - transferPlayer((ServerPlayer) player, pos); - worldIn.addAlwaysVisibleParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY() + 1, pos.getZ(), 0, 1, 0); - } - return super.use(state, worldIn, pos, player, handIn, hit); - } - - @Override - public boolean canHarvestBlock(BlockState state, BlockGetter world, BlockPos pos, Player player) { - if(player.level.dimension().registry().getNamespace().contains(Reference.MOD_ID)) { - return false; - } else { - return true; - } - } - - public void transferPlayer(ServerPlayer player, BlockPos pos) { - boolean config = AllTheModium.ALLOW_TELEPORT_MINING; - if (player.level.dimension().equals(LevelRegistry.Mining)) { - ServerLevel targetWorld = player.server.getLevel(AllTheModium.OverWorld); - int y = 256; - boolean located = false; - while (y >= 1) { - BlockPos posa = new BlockPos(Math.round(pos.getX()), y, Math.round(pos.getZ())); - Block potential = targetWorld.getBlockState(posa).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - - } else { - y--; - } - } - if (located) { - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY(), pos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, pos.getX() + 0.5D, y + 0.25D, pos.getZ() + 0.5D, player.rotA, - player.yya); - - return; - } else { - - if ((!targetWorld.getBlockState(pos).hasBlockEntity()) - && (targetWorld.getBlockState(pos).canEntityDestroy(targetWorld, pos, player))) { - //targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); - } - - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY(), pos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, pos.getX() + 0.5D, pos.getY() + 0.25D, pos.getZ() + 0.5D, player.rotA, - player.yya); - } - - } else if (player.level.dimension().equals(AllTheModium.Nether)) { - ServerLevel targetWorld = player.server.getLevel(LevelRegistry.THE_OTHER); - BlockPos targetPos = new BlockPos(Math.round(pos.getX()), Math.round(pos.getY()), Math.round(pos.getZ())); - - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - - LevelHeightAccessor accessor = targetWorld.getChunk(pos).getHeightAccessorForGeneration(); - int y = targetWorld.getChunkSource().getGenerator().getSpawnHeight(accessor); - targetWorld.setBlockAndUpdate(new BlockPos(targetPos.getX(),y,targetPos.getZ()), ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY(), pos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, targetPos.getX() + 0.5D, y + 0.25D, targetPos.getZ() + 0.5D, 0, 0); - - - } - } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { - ServerLevel targetWorld = player.server.getLevel(AllTheModium.Nether); - int y = 128; - boolean located = false; - while (y >= 1) { - BlockPos posa = new BlockPos(Math.round(pos.getX()), y, Math.round(pos.getZ())); - Block potential = targetWorld.getBlockState(posa).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - - } else { - y--; - } - } - if (located) { - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY(), pos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, pos.getX() + 0.5D, y + 0.25D, pos.getZ() + 0.5D, player.rotA, - player.yya); - - return; - } else { - BlockPos newpos = new BlockPos(pos.getX(), 90 , pos.getZ()); - if ((!targetWorld.getBlockState(newpos).hasBlockEntity()) - && (targetWorld.getBlockState(newpos).canEntityDestroy(targetWorld, newpos, player))) { - targetWorld.setBlockAndUpdate(newpos, ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - } - - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, newpos.getX(), newpos.getY(), newpos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, newpos.getX() + 0.5D, newpos.getY() + 0.25D, newpos.getZ() + 0.5D, player.rotA, - player.yya); - - } - } - - else if (player.level.dimension().equals(AllTheModium.OverWorld) && (config == true)) { - ServerLevel targetWorld = player.server.getLevel(LevelRegistry.Mining); - BlockPos targetPos = new BlockPos(Math.round(pos.getX()), 253, Math.round(pos.getZ())); - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - targetWorld.setBlockAndUpdate(targetPos, ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - targetWorld.addParticle(ParticleTypes.SOUL_FIRE_FLAME, pos.getX(), pos.getY(), pos.getZ(), 0, 1, 0); - player.teleportTo(targetWorld, targetPos.getX() + 0.5D, targetPos.getY() + 0.25D, targetPos.getZ() + 0.5D, 0, 0); - - } - } - - } - - @Override - public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - return list; - } + + protected static final VoxelShape TELEPORTPAD_AABB = Block.box( + 0.0D, + 0.0D, + 0.0D, + 16.0D, + 3.0D, + 16.0D + ); + + public TeleportPad(Properties properties) { + super(properties); + // TODO Auto-generated constructor stub + } + + @Override + public VoxelShape getShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context + ) { + return TELEPORTPAD_AABB; + } + + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } + + @Override + public VoxelShape getCollisionShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context + ) { + return TELEPORTPAD_AABB; + } + + @SuppressWarnings("deprecation") + @Override + public InteractionResult use( + @Nonnull BlockState state, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull Player player, + @Nonnull InteractionHand handIn, + @Nonnull BlockHitResult hit + ) { + if ( + (player instanceof ServerPlayer) && (player.isCrouching() == true) + ) { + transferPlayer((ServerPlayer) player, pos); + worldIn.addAlwaysVisibleParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY() + 1, + pos.getZ(), + 0, + 1, + 0 + ); + } + + return super.use(state, worldIn, pos, player, handIn, hit); + } + + @Override + public boolean canHarvestBlock( + BlockState state, + BlockGetter world, + BlockPos pos, + Player player + ) { + if ( + player.level + .dimension() + .registry() + .getNamespace() + .contains(Reference.MOD_ID) + ) { + return false; + } else { + return true; + } + } + + public void transferPlayer(ServerPlayer player, BlockPos pos) { + boolean config = AllTheModium.ALLOW_TELEPORT_MINING; + if (player.level.dimension().equals(LevelRegistry.Mining)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.OverWorld + ); + + if (targetWorld == null) return; + + int y = 256; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ()) + ); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya + ); + + return; + } else { + if ( + (!targetWorld.getBlockState(pos).hasBlockEntity()) && + (targetWorld + .getBlockState(pos) + .canEntityDestroy(targetWorld, pos, player)) + ) { + // targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); + } + + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + pos.getY() + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya + ); + } + } else if (player.level.dimension().equals(AllTheModium.Nether)) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.THE_OTHER + ); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + Math.round(pos.getY()), + Math.round(pos.getZ()) + ); + + if (targetWorld == null) return; + + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + LevelHeightAccessor accessor = targetWorld + .getChunk(pos) + .getHeightAccessorForGeneration(); + int y = targetWorld + .getChunkSource() + .getGenerator() + .getSpawnHeight(accessor); + targetWorld.setBlockAndUpdate( + new BlockPos(targetPos.getX(), y, targetPos.getZ()), + ModRegistry.TELEPORT_PAD.get().defaultBlockState() + ); + + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + y + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0 + ); + } + } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.Nether + ); + + if (targetWorld == null) return; + + int y = 128; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ()) + ); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya + ); + + return; + } else { + BlockPos newPos = new BlockPos(pos.getX(), 90, pos.getZ()); + if ( + (!targetWorld.getBlockState(newPos).hasBlockEntity()) && + (targetWorld + .getBlockState(newPos) + .canEntityDestroy(targetWorld, newPos, player)) + ) { + targetWorld.setBlockAndUpdate( + newPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState() + ); + } + + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + newPos.getX(), + newPos.getY(), + newPos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + newPos.getX() + 0.5D, + newPos.getY() + 0.25D, + newPos.getZ() + 0.5D, + player.rotA, + player.yya + ); + } + } else if ( + player.level.dimension().equals(AllTheModium.OverWorld) && + (config == true) + ) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.Mining + ); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + 253, + Math.round(pos.getZ()) + ); + + if (targetWorld == null) return; + + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + targetWorld.setBlockAndUpdate( + targetPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState() + ); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0 + ); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + targetPos.getY() + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0 + ); + } + } + } + + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java new file mode 100644 index 00000000..fb559cde --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class UAAlloyBlock extends Block { + + public UAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloy_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloy_Block.java deleted file mode 100644 index d5ec7eb2..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloy_Block.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -import java.util.ArrayList; -import java.util.List; - -public class UAAlloy_Block extends Block { - - public UAAlloy_Block() { - super(Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); - return list; -} - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java new file mode 100644 index 00000000..2a4f2f5e --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class UVAlloyBlock extends Block { + + public UVAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloy_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloy_Block.java deleted file mode 100644 index a0e1e581..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloy_Block.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -import java.util.ArrayList; -import java.util.List; - -public class UVAlloy_Block extends Block { - - public UVAlloy_Block() { - super(Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); - return list; -} - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java new file mode 100644 index 00000000..0d8062ef --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class UnobtainiumBlock extends Block { + + public UnobtainiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java new file mode 100644 index 00000000..e15dcba8 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java @@ -0,0 +1,84 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import com.thevortex.allthemodium.registry.TagRegistry; +import javax.annotation.Nonnull; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.DropExperienceBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.PushReaction; +import net.minecraftforge.common.util.FakePlayer; + +public class UnobtainiumOre extends DropExperienceBlock { + + public UnobtainiumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_GOLD_ORE) + .strength(80.0f, 5000f) + ); + } + + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos + ) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if ( + AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() + ) return super.getDestroyProgress(state, player, getter, blockPos); + + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player + ) + ? 750 + : 5500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player + ) { + if ( + (player instanceof FakePlayer) && + state.is(TagRegistry.UNOBTAINIUM_ORE) + ) { + return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); + } + return ( + super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F) + ); + } + + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2) + ); + } + + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Block.java deleted file mode 100644 index 5e705534..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Block.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import java.util.ArrayList; -import java.util.List; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -public class Unobtainium_Block extends Block { - - public Unobtainium_Block() { - super(Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); - return list; -} - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java deleted file mode 100644 index e59b263a..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; -import com.thevortex.allthemodium.registry.TagRegistry; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.block.DropExperienceBlock; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.PushReaction; - -import net.minecraftforge.common.util.FakePlayer; - -public class Unobtainium_Ore extends DropExperienceBlock { - - public Unobtainium_Ore() {//func_235861_h_ = setRequiresTool - super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_GOLD_ORE).strength(80.0f,5000f)); - } - @Override - @SuppressWarnings("java:S1874") // deprecated method from super class - public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { - BlockEntity blockEntity = getter.getBlockEntity(blockPos); - if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); - - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 750 : 5500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } - @Override - public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && state.is(TagRegistry.UNOBTAINIUM_ORE)) { - return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); - } - return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); - } - - private double distanceTo(BlockPos block,BlockPos player) { - return Math.sqrt(Math.pow(block.getX() - player.getX(), 2) + Math.pow(block.getY() - player.getY(), 2) + Math.pow(block.getZ() - player.getZ(), 2)); - } - @Override - public PushReaction getPistonPushReaction(BlockState state) { - - return PushReaction.BLOCK; - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java new file mode 100644 index 00000000..31067445 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class VAAlloyBlock extends Block { + + public VAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloy_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloy_Block.java deleted file mode 100644 index 8fe3c40b..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloy_Block.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -import java.util.ArrayList; -import java.util.List; - -public class VAAlloy_Block extends Block { - - public VAAlloy_Block() { - super(Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); - return list; -} - - - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java new file mode 100644 index 00000000..6a5f32c0 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java @@ -0,0 +1,32 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.storage.loot.LootContext; + +public class VibraniumBlock extends Block { + + public VibraniumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) + ); + } + + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder + ) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); + return list; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java new file mode 100644 index 00000000..d0832c9b --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java @@ -0,0 +1,83 @@ +package com.thevortex.allthemodium.blocks; + +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import com.thevortex.allthemodium.registry.TagRegistry; +import javax.annotation.Nonnull; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.DropExperienceBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.PushReaction; +import net.minecraftforge.common.util.FakePlayer; + +public class VibraniumOre extends DropExperienceBlock { + + public VibraniumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_ORE) + .strength(80.0f, 2500.0f) + ); + } + + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos + ) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if ( + AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get() + ) return super.getDestroyProgress(state, player, getter, blockPos); + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player + ) + ? 500 + : 2500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player + ) { + if ( + (player instanceof FakePlayer) && + state.is(TagRegistry.VIBRANIUM_ORE) + ) { + return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); + } + return ( + super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F) + ); + } + + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2) + ); + } + + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Block.java b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Block.java deleted file mode 100644 index 8052428c..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Block.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import java.util.ArrayList; -import java.util.List; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.storage.loot.LootContext; - -public class Vibranium_Block extends Block { - - public Vibranium_Block() { - super(Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } - -@Deprecated -@Override -public List getDrops(BlockState state, LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); - return list; -} - -} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java b/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java deleted file mode 100644 index 8a25ed72..00000000 --- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.thevortex.allthemodium.blocks; - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; -import com.thevortex.allthemodium.registry.TagRegistry; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.block.DropExperienceBlock; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.PushReaction; - -import net.minecraftforge.common.util.FakePlayer; - -public class Vibranium_Ore extends DropExperienceBlock { - - public Vibranium_Ore() {//func_235861_h_ = setRequiresTool - super(Properties.of(Material.STONE).requiresCorrectToolForDrops().sound(SoundType.NETHER_ORE).strength(80.0f,2500.0f)); - } - @Override - @SuppressWarnings("java:S1874") // deprecated method from super class - public float getDestroyProgress(BlockState state, Player player, BlockGetter getter, BlockPos blockPos) { - BlockEntity blockEntity = getter.getBlockEntity(blockPos); - if (canEntityDestroy(state,getter,blockPos, player)) { - if(AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(state, player) ? 500 : 2500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } - @Override - public boolean canEntityDestroy(BlockState state, BlockGetter world, BlockPos pos, Entity player) { - if((player instanceof FakePlayer) && state.is(TagRegistry.VIBRANIUM_ORE)) { - return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); - } - return super.canEntityDestroy(state,world,pos,player) && (distanceTo(pos,player.blockPosition) < 16.0F); - } - - private double distanceTo(BlockPos block,BlockPos player) { - return Math.sqrt(Math.pow(block.getX() - player.getX(), 2) + Math.pow(block.getY() - player.getY(), 2) + Math.pow(block.getZ() - player.getZ(), 2)); - } - @Override - public PushReaction getPistonPushReaction(BlockState state) { - - return PushReaction.BLOCK; - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java index 54f0803e..725e7bfa 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java @@ -1,35 +1,53 @@ package com.thevortex.allthemodium.config; -import java.util.List; - import net.minecraftforge.common.ForgeConfigSpec; public class AllthemodiumServerConfigs { - public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); + + public static final ForgeConfigSpec.Builder BUILDER = + new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; - public static final ForgeConfigSpec.ConfigValue ALLTHEMODIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue< + Boolean + > ALLTHEMODIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue< + Boolean + > UNOBTAINIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue< + Boolean + > VIBRANIUM_QUARRYABLE; public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; - //public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; + // public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; static { BUILDER.push("AllTheModium Configs"); - ALLTHEMODIUM_QUARRYABLE = BUILDER - .comment("Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Allthemodium Quarryable", false); - UNOBTAINIUM_QUARRYABLE = BUILDER - .comment("Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Unobtainium Quarryable", false); - VIBRANIUM_QUARRYABLE = BUILDER - .comment("Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Vibranium Quarryable", false); - OTHER_PROTECTION = BUILDER - .comment("Whether The Other is protected from quarries. (Default value: true)") - .define("Other Protection", true); + ALLTHEMODIUM_QUARRYABLE = + BUILDER + .comment( + "Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)" + ) + .define("Allthemodium Quarryable", false); + UNOBTAINIUM_QUARRYABLE = + BUILDER + .comment( + "Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)" + ) + .define("Unobtainium Quarryable", false); + VIBRANIUM_QUARRYABLE = + BUILDER + .comment( + "Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)" + ) + .define("Vibranium Quarryable", false); + OTHER_PROTECTION = + BUILDER + .comment( + "Whether The Other is protected from quarries. (Default value: true)" + ) + .define("Other Protection", true); BUILDER.pop(); SPEC = BUILDER.build(); diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java index 111668da..677454ea 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java @@ -1,28 +1,26 @@ package com.thevortex.allthemodium.crafting; import com.thevortex.allthemodium.reference.Reference; - import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; - public class ATMCraftingSetup { - public static final RecipeSerializer SERIALIZER = new ATMRecipeSerializer(); - public static final RecipeSerializer SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); - - - - - public static final DeferredRegister> REGISTRY = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, Reference.MOD_ID); - public static final RegistryObject> ATM_DATA = REGISTRY.register("atmshaped_crafting", () -> SERIALIZER); - public static final RegistryObject> ATM_SHAPELESS_DATA = REGISTRY.register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); - - - - - - + public static final RecipeSerializer SERIALIZER = + new ATMRecipeSerializer(); + public static final RecipeSerializer< + ATMShapelessRecipe + > SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); + + public static final DeferredRegister> REGISTRY = + DeferredRegister.create( + ForgeRegistries.RECIPE_SERIALIZERS, + Reference.MOD_ID + ); + public static final RegistryObject> ATM_DATA = + REGISTRY.register("atmshaped_crafting", () -> SERIALIZER); + public static final RegistryObject> ATM_SHAPELESS_DATA = + REGISTRY.register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java index 800f6cb3..8ad6da4a 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java @@ -1,38 +1,49 @@ package com.thevortex.allthemodium.crafting; import com.google.gson.JsonObject; - +import javax.annotation.Nonnull; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; public class ATMRecipeSerializer implements RecipeSerializer { - @Override - public ATMShapedRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return new ATMShapedRecipe(RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json)); - } - - - - @Override - public ATMShapedRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - try { - return new ATMShapedRecipe(RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer)); - } catch (Exception e) { - throw e; - } - } - - @Override - public void toNetwork(FriendlyByteBuf buffer, ATMShapedRecipe recipe) { - try { - RecipeSerializer.SHAPED_RECIPE.toNetwork(buffer, recipe.getInternal()); - } catch (Exception e) { - throw e; - } - } + @Override + public ATMShapedRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json + ) { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json) + ); + } + + @Override + public ATMShapedRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer + ) { + try { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer) + ); + } catch (Exception e) { + throw e; + } + } + + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapedRecipe recipe + ) { + try { + RecipeSerializer.SHAPED_RECIPE.toNetwork( + buffer, + recipe.getInternal() + ); + } catch (Exception e) { + throw e; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java index 6145e13e..97a47d7b 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java @@ -1,13 +1,8 @@ package com.thevortex.allthemodium.crafting; -import java.io.DataOutput; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.Map; - -import com.thevortex.allthemodium.AllTheModium; +import javax.annotation.Nonnull; import net.minecraft.core.NonNullList; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; @@ -18,95 +13,113 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; -import org.codehaus.plexus.util.CachedMap; public class ATMShapedRecipe implements IATMShapedRecipe { - private final ShapedRecipe internal; - - public ATMShapedRecipe(ShapedRecipe internal) { - this.internal = internal; - } - - public ShapedRecipe getInternal() { - return internal; - } - - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_DATA.get(); - } - - @Override - public boolean matches(CraftingContainer inv, Level world) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return internal.matches(inv, world) && !assemble(inv).isEmpty(); - } - - @Override - public ItemStack assemble(CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); - Map enchant = new HashMap<>(); - - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = EnchantmentHelper.getEnchantments(stack); - for(Enchantment e : temp.keySet()) { - if(enchant.containsKey(e) && (enchant.get(e) == temp.get(e))) { enchant.put(e, temp.get(e) + 1); } - if(enchant.containsKey(e) && (enchant.get(e) < temp.get(e))) { enchant.put(e, temp.get(e)); } - if(enchant.containsKey(e) && (enchant.get(e) > temp.get(e))) { break; } - else { enchant.put(e,temp.get(e)); } - } - } - } - EnchantmentHelper.setEnchantments(enchant,toReturn); - return toReturn; - } - - @Override - public boolean canCraftInDimensions(int width, int height) { - return internal.canCraftInDimensions(width, height); - } - - @Override - public ItemStack getResultItem() { - return internal.getResultItem(); - } - - @Override - public NonNullList getRemainingItems(CraftingContainer inv) { - return internal.getRemainingItems(inv); - } - - @Override - public NonNullList getIngredients() { - return internal.getIngredients(); - } - - @Override - public boolean isSpecial() { - return internal.isSpecial(); - } - - @Override - public String getGroup() { - return internal.getGroup(); - } - - @Override - public ItemStack getToastSymbol() { - return internal.getToastSymbol(); - } - - @Override - public ResourceLocation getId() { - return internal.getId(); - } - -} \ No newline at end of file + private final ShapedRecipe internal; + + public ATMShapedRecipe(ShapedRecipe internal) { + this.internal = internal; + } + + public ShapedRecipe getInternal() { + return internal; + } + + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_DATA.get(); + } + + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world + ) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return internal.matches(inv, world) && !assemble(inv).isEmpty(); + } + + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); + Map enchant = new HashMap<>(); + + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = + EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if ( + enchant.containsKey(e) && + (enchant.get(e) == temp.get(e)) + ) { + enchant.put(e, temp.get(e) + 1); + } + if ( + enchant.containsKey(e) && (enchant.get(e) < temp.get(e)) + ) { + enchant.put(e, temp.get(e)); + } + if ( + enchant.containsKey(e) && (enchant.get(e) > temp.get(e)) + ) { + break; + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return internal.canCraftInDimensions(width, height); + } + + @Override + public ItemStack getResultItem() { + return internal.getResultItem(); + } + + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv + ) { + return internal.getRemainingItems(inv); + } + + @Override + public NonNullList getIngredients() { + return internal.getIngredients(); + } + + @Override + public boolean isSpecial() { + return internal.isSpecial(); + } + + @Override + public String getGroup() { + return internal.getGroup(); + } + + @Override + public ItemStack getToastSymbol() { + return internal.getToastSymbol(); + } + + @Override + public ResourceLocation getId() { + return internal.getId(); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java index 97415cc2..bc3fc28a 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java @@ -1,9 +1,7 @@ package com.thevortex.allthemodium.crafting; import java.util.*; -import java.util.Map.Entry; - - +import javax.annotation.Nonnull; import net.minecraft.core.NonNullList; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; @@ -14,79 +12,90 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.IShapedRecipe; - -public class ATMShapelessRecipe implements IATMShapelessRecipe { - - private final ShapelessRecipe recipe; - - public ATMShapelessRecipe(ShapelessRecipe recipe) { - this.recipe = recipe; - - } - - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); - } - - @Override - public boolean matches(CraftingContainer inv, Level world) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return recipe.matches(inv, world) && !assemble(inv).isEmpty(); - } - - @Override - public ItemStack assemble(CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); - - Map enchant = new HashMap<>(); - - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = EnchantmentHelper.getEnchantments(stack); - for(Enchantment e : temp.keySet()) { - if(enchant.containsKey(e) && (enchant.get(e) == temp.get(e))) { enchant.put(e, temp.get(e) + 1); } - else { enchant.put(e,temp.get(e)); } - } - } - } - EnchantmentHelper.setEnchantments(enchant,toReturn); - return toReturn; - } - - @Override - public NonNullList getRemainingItems(CraftingContainer inv) { - return recipe.getRemainingItems(inv); - } - - @Override - public ItemStack getToastSymbol() { return recipe.getToastSymbol(); } - - @Override - public NonNullList getIngredients() { - return recipe.getIngredients(); - } - - @Override - public boolean canCraftInDimensions(int width, int height) { - return recipe.canCraftInDimensions(width, height); - } - - @Override - public ItemStack getResultItem() { - return recipe.getResultItem(); - } - - @Override - public ResourceLocation getId() { - return recipe.getId(); - } -} \ No newline at end of file +public class ATMShapelessRecipe implements IATMShapelessRecipe { + + private final ShapelessRecipe recipe; + + public ATMShapelessRecipe(ShapelessRecipe recipe) { + this.recipe = recipe; + } + + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); + } + + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world + ) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return recipe.matches(inv, world) && !assemble(inv).isEmpty(); + } + + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); + + Map enchant = new HashMap<>(); + + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = + EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if ( + enchant.containsKey(e) && + (enchant.get(e) == temp.get(e)) + ) { + enchant.put(e, temp.get(e) + 1); + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } + + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv + ) { + return recipe.getRemainingItems(inv); + } + + @Override + public ItemStack getToastSymbol() { + return recipe.getToastSymbol(); + } + + @Override + public NonNullList getIngredients() { + return recipe.getIngredients(); + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return recipe.canCraftInDimensions(width, height); + } + + @Override + public ItemStack getResultItem() { + return recipe.getResultItem(); + } + + @Override + public ResourceLocation getId() { + return recipe.getId(); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java index 79e79534..cd8da6d3 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java @@ -1,43 +1,58 @@ package com.thevortex.allthemodium.crafting; import com.google.gson.JsonObject; - +import javax.annotation.Nonnull; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.ShapelessRecipe; -public class ATMShapelessRecipeSerializer implements RecipeSerializer { - - @Override - public ATMShapelessRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return new ATMShapelessRecipe(RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json)); - } - - @Override - public ATMShapelessRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - try { - return new ATMShapelessRecipe(RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer)); - } catch (Exception e) { - throw e; - } - } - - private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { - - try { - RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); - } catch (Exception e) { - throw e; - } - } - - @Override - public void toNetwork(FriendlyByteBuf buffer, ATMShapelessRecipe recipe) { - ShapelessRecipe recip = new ShapelessRecipe(recipe.getId(),recipe.getGroup(),recipe.getResultItem(),recipe.getIngredients()); - write(buffer,recip); - - } - - } - +public class ATMShapelessRecipeSerializer + implements RecipeSerializer { + + @Override + public ATMShapelessRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json + ) { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json) + ); + } + + @Override + public ATMShapelessRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer + ) { + try { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer) + ); + } catch (Exception e) { + throw e; + } + } + + private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { + try { + RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); + } catch (Exception e) { + throw e; + } + } + + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapelessRecipe recipe + ) { + ShapelessRecipe newRecipe = new ShapelessRecipe( + recipe.getId(), + recipe.getGroup(), + recipe.getResultItem(), + recipe.getIngredients() + ); + write(buffer, newRecipe); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java index 034068ed..e740383e 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java @@ -1,10 +1,12 @@ package com.thevortex.allthemodium.crafting; import com.thevortex.allthemodium.reference.Reference; - import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapedRecipe extends CraftingRecipe { -ResourceLocation RECIPE_TYPE = new ResourceLocation(Reference.MOD_ID,"atmshaped_crafting"); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshaped_crafting" + ); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java index c5d31837..dbee2d3b 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java @@ -1,10 +1,12 @@ package com.thevortex.allthemodium.crafting; import com.thevortex.allthemodium.reference.Reference; - import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapelessRecipe extends CraftingRecipe { -ResourceLocation RECIPE_TYPE = new ResourceLocation(Reference.MOD_ID,"atmshapeless_crafting"); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshapeless_crafting" + ); } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java index 89dbb3da..abd36866 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java @@ -4,6 +4,7 @@ import com.thevortex.allthemodium.datagen.client.ItemModels; import com.thevortex.allthemodium.datagen.server.*; import com.thevortex.allthemodium.reference.Reference; +import java.io.IOException; import net.minecraft.data.DataGenerator; import net.minecraft.data.tags.BlockTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; @@ -11,10 +12,9 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import java.io.IOException; - @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public final class DataGenerators { + private DataGenerators() {} @SubscribeEvent @@ -23,19 +23,28 @@ public static void gatherData(GatherDataEvent event) throws IOException { ExistingFileHelper fileHelper = event.getExistingFileHelper(); if (event.includeServer()) { - BlockTagsProvider blockTagsProvider = new BlockTags(generator, fileHelper); - generator.addProvider(true,new ItemTags(generator, blockTagsProvider, fileHelper)); - generator.addProvider(true,blockTagsProvider); - generator.addProvider(true,new FluidTags(generator, Reference.MOD_ID,fileHelper)); - generator.addProvider(true,new CraftingRecipes(generator)); - generator.addProvider(true,new ShapelessCrafting(generator)); - generator.addProvider(true,new BlastingRecipes(generator)); - generator.addProvider(true,new SmeltingRecipes(generator)); - generator.addProvider(true,new LootTables(generator)); + BlockTagsProvider blockTagsProvider = new BlockTags( + generator, + fileHelper + ); + generator.addProvider( + true, + new ItemTags(generator, blockTagsProvider, fileHelper) + ); + generator.addProvider(true, blockTagsProvider); + generator.addProvider( + true, + new FluidTags(generator, Reference.MOD_ID, fileHelper) + ); + generator.addProvider(true, new CraftingRecipes(generator)); + generator.addProvider(true, new ShapelessCrafting(generator)); + generator.addProvider(true, new BlastingRecipes(generator)); + generator.addProvider(true, new SmeltingRecipes(generator)); + generator.addProvider(true, new LootTables(generator)); } if (event.includeClient()) { - generator.addProvider(true,new BlockStates(generator, fileHelper)); - generator.addProvider(true,new ItemModels(generator, fileHelper)); + generator.addProvider(true, new BlockStates(generator, fileHelper)); + generator.addProvider(true, new ItemModels(generator, fileHelper)); } } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java index 1123fd28..d46120ef 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.datagen; public class RecipeException extends IllegalStateException { + public RecipeException(String id, String message) { super(String.format("recipe error: %s - %s", id, message)); } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java index 24619848..ba037ed7 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java @@ -3,6 +3,10 @@ import com.thevortex.allthemodium.datagen.RecipeException; import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.TagRegistry; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Optional; +import java.util.function.Consumer; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.data.recipes.FinishedRecipe; @@ -14,52 +18,67 @@ import net.minecraft.world.level.ItemLike; import net.minecraftforge.registries.RegistryObject; -import java.util.EnumMap; -import java.util.Locale; -import java.util.Optional; -import java.util.function.Consumer; - public class ShapedAncientStones { + public enum Slot { - BOOKSHELF, TRAPDOOR, BRICK, FENCE, FENCEGATE, STAIRS, WALL, SLAB, DOOR; + BOOKSHELF, + TRAPDOOR, + BRICK, + FENCE, + FENCEGATE, + STAIRS, + WALL, + SLAB, + DOOR; + public String lower() { return toString().toLowerCase(Locale.ROOT); } } + private final String criteriaName; private final InventoryChangeTrigger.TriggerInstance criterion; private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ancientstone; + private final TagKey ancientStone; - public ShapedAncientStones(TagKey ancientstone) { - this.ancientstone = ancientstone; + public ShapedAncientStones(TagKey ancientStone) { + this.ancientStone = ancientStone; - this.criteriaName = String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); + this.criteriaName = + String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); - ItemPredicate predicate = ItemPredicate.Builder.item().of(ancientstone).build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ancientStone) + .build(); + this.criterion = + InventoryChangeTrigger.TriggerInstance.hasItems(predicate); } - public static ShapedAncientStones builder(TagKey ancientstone) { - return new ShapedAncientStones(ancientstone); + public static ShapedAncientStones builder(TagKey ancientStone) { + return new ShapedAncientStones(ancientStone); } public ShapedAncientStones setBookShelf(RegistryObject object) { pieces.put(Slot.BOOKSHELF, object.get()); return this; } + public ShapedAncientStones setDoor(RegistryObject object) { pieces.put(Slot.DOOR, object.get()); return this; } + public ShapedAncientStones setTrapDoor(RegistryObject object) { pieces.put(Slot.TRAPDOOR, object.get()); return this; } + public ShapedAncientStones setBrick(RegistryObject object) { pieces.put(Slot.BRICK, object.get()); return this; } + public ShapedAncientStones setStairs(RegistryObject object) { pieces.put(Slot.STAIRS, object.get()); return this; @@ -85,144 +104,128 @@ public ShapedAncientStones setWall(RegistryObject object) { return this; } - protected void validate(ResourceLocation id) { if (pieces.isEmpty()) { - throw new RecipeException(id.toString(), "recipe must have at least 1 output"); + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output" + ); } } public void build(Consumer consumer) { - - Consumer register = builder -> builder.save(consumer); - Optional.ofNullable(pieces.get(Slot.BOOKSHELF)) - .map(this::bookshelf) - .map(this::addBookCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.TRAPDOOR)) - .map(this::trapdoor) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.WALL)) - .map(this::wall) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.BRICK)) - .map(this::brick) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.SLAB)) - .map(this::slab) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.DOOR)) - .map(this::door) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.STAIRS)) - .map(this::stairs) - .map(this::addCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.FENCE)) - .map(this::fence) - .map(this::addStickCriterion) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.FENCEGATE)) - .map(this::fencegate) - .map(this::addStickCriterion) - .ifPresent(register); - - + Consumer register = builder -> + builder.save(consumer); + Optional + .ofNullable(pieces.get(Slot.BOOKSHELF)) + .map(this::bookshelf) + .map(this::addBookCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.TRAPDOOR)) + .map(this::trapdoor) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.WALL)) + .map(this::wall) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.BRICK)) + .map(this::brick) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.SLAB)) + .map(this::slab) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.DOOR)) + .map(this::door) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.STAIRS)) + .map(this::stairs) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCE)) + .map(this::fence) + .map(this::addStickCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCEGATE)) + .map(this::fencegate) + .map(this::addStickCriterion) + .ifPresent(register); } + private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { - return ShapedRecipeBuilder.shaped(provider,integer) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder + .shaped(provider, integer) + .group(Reference.MOD_ID); } + private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); } private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { return builder - .define('a', ancientstone) - .unlockedBy(criteriaName, criterion); + .define('a', ancientStone) + .unlockedBy(criteriaName, criterion); } + private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) { return builder - .define('a', ancientstone) - .define('s', Items.STICK) - .unlockedBy(criteriaName, criterion); + .define('a', ancientStone) + .define('s', Items.STICK) + .unlockedBy(criteriaName, criterion); } + private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) { return builder - .define('a', ancientstone) - .define('b', Items.BOOK) - .unlockedBy(criteriaName, criterion); + .define('a', ancientStone) + .define('b', Items.BOOK) + .unlockedBy(criteriaName, criterion); } - private ShapedRecipeBuilder bookshelf(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("bbb") - .pattern("aaa"); + private ShapedRecipeBuilder bookshelf(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("bbb").pattern("aaa"); } private ShapedRecipeBuilder fence(ItemLike provider) { - return shaped(provider,3) - .pattern(" ") - .pattern("asa") - .pattern("asa"); - + return shaped(provider, 3).pattern(" ").pattern("asa").pattern("asa"); } - private ShapedRecipeBuilder trapdoor(ItemLike provider) { - return shaped(provider,2) - .pattern(" ") - .pattern("aaa") - .pattern("aaa"); + private ShapedRecipeBuilder trapdoor(ItemLike provider) { + return shaped(provider, 2).pattern(" ").pattern("aaa").pattern("aaa"); } - private ShapedRecipeBuilder door(ItemLike provider) { - return shaped(provider,3) - .pattern("aa ") - .pattern("aa ") - .pattern("aa "); + private ShapedRecipeBuilder door(ItemLike provider) { + return shaped(provider, 3).pattern("aa ").pattern("aa ").pattern("aa "); } - private ShapedRecipeBuilder brick(ItemLike provider) { - return shaped(provider,4) - .pattern(" ") - .pattern("aa ") - .pattern("aa "); + private ShapedRecipeBuilder brick(ItemLike provider) { + return shaped(provider, 4).pattern(" ").pattern("aa ").pattern("aa "); } - private ShapedRecipeBuilder fencegate(ItemLike provider) { - return shaped(provider) - .pattern(" ") - .pattern("sas") - .pattern("sas"); + private ShapedRecipeBuilder fencegate(ItemLike provider) { + return shaped(provider).pattern(" ").pattern("sas").pattern("sas"); } + private ShapedRecipeBuilder stairs(ItemLike provider) { - return shaped(provider,4) - .pattern("a ") - .pattern("aa ") - .pattern("aaa"); + return shaped(provider, 4).pattern("a ").pattern("aa ").pattern("aaa"); } private ShapedRecipeBuilder wall(ItemLike provider) { - return shaped(provider,6) - .pattern(" ") - .pattern("aaa") - .pattern("aaa"); - + return shaped(provider, 6).pattern(" ").pattern("aaa").pattern("aaa"); } - private ShapedRecipeBuilder slab(ItemLike provider) { - return shaped(provider,6) - .pattern(" ") - .pattern(" ") - .pattern("aaa"); + private ShapedRecipeBuilder slab(ItemLike provider) { + return shaped(provider, 6).pattern(" ").pattern(" ").pattern("aaa"); } - } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java index 7eecab1a..080c7132 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java @@ -2,11 +2,13 @@ import com.thevortex.allthemodium.datagen.RecipeException; import com.thevortex.allthemodium.reference.Reference; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Optional; +import java.util.function.Consumer; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.data.recipes.RecipeBuilder; -import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -15,16 +17,13 @@ import net.minecraft.world.level.ItemLike; import net.minecraftforge.registries.RegistryObject; -import java.util.EnumMap; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; - public class ShapedArmorBuilder { public enum Slot { - HELMET, CHESTPLATE, LEGGINGS, BOOTS; + HELMET, + CHESTPLATE, + LEGGINGS, + BOOTS; public String lower() { return toString().toLowerCase(Locale.ROOT); @@ -35,24 +34,24 @@ public String lower() { private final InventoryChangeTrigger.TriggerInstance criterion; private final EnumMap pieces = new EnumMap<>(Slot.class); private final TagKey ingot; - private Item core; - public ShapedArmorBuilder(TagKey ingot) { this.ingot = ingot; this.criteriaName = String.format("has_%s_ingot", ingot); - ItemPredicate predicate = ItemPredicate.Builder.item().of(ingot).build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = + InventoryChangeTrigger.TriggerInstance.hasItems(predicate); } public static ShapedArmorBuilder builder(TagKey ingot) { return new ShapedArmorBuilder(ingot); } - public ShapedArmorBuilder setHelmet(RegistryObject object) { pieces.put(Slot.HELMET, object.get()); return this; @@ -73,75 +72,65 @@ public ShapedArmorBuilder setBoots(RegistryObject object) { return this; } - protected void validate(ResourceLocation id) { if (pieces.isEmpty()) { - throw new RecipeException(id.toString(), "recipe must have at least 1 output"); + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output" + ); } } public void build(Consumer consumer) { + Consumer register = builder -> + builder.save(consumer); - Consumer register = builder -> builder.save(consumer); - - Optional.ofNullable(pieces.get(Slot.HELMET)) + Optional + .ofNullable(pieces.get(Slot.HELMET)) .map(this::helmet) .map(this::addCriterion) .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.CHESTPLATE)) + Optional + .ofNullable(pieces.get(Slot.CHESTPLATE)) .map(this::chestplate) .map(this::addCriterion) .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.LEGGINGS)) + Optional + .ofNullable(pieces.get(Slot.LEGGINGS)) .map(this::leggings) .map(this::addCriterion) .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.BOOTS)) + Optional + .ofNullable(pieces.get(Slot.BOOTS)) .map(this::boots) .map(this::addCriterion) .ifPresent(register); } private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); } private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ingot) - .unlockedBy(criteriaName, criterion); + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); } private ShapedRecipeBuilder helmet(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("a a") - .pattern(" "); - + return shaped(provider).pattern("aaa").pattern("a a").pattern(" "); } private ShapedRecipeBuilder chestplate(ItemLike provider) { - return shaped(provider) - .pattern("a a") - .pattern("aaa") - .pattern("aaa"); + return shaped(provider).pattern("a a").pattern("aaa").pattern("aaa"); } private ShapedRecipeBuilder leggings(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("a a") - .pattern("a a"); + return shaped(provider).pattern("aaa").pattern("a a").pattern("a a"); } private ShapedRecipeBuilder boots(ItemLike provider) { - return shaped(provider) - .pattern("a a") - .pattern("a a") - .pattern(" "); + return shaped(provider).pattern("a a").pattern("a a").pattern(" "); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java index 184f3633..207781d3 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java @@ -1,150 +1,140 @@ package com.thevortex.allthemodium.datagen.builder; - import com.thevortex.allthemodium.datagen.RecipeException; import com.thevortex.allthemodium.reference.Reference; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Optional; +import java.util.function.Consumer; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.level.ItemLike; import net.minecraftforge.registries.RegistryObject; -import java.util.EnumMap; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; - public class ShapedBlockBuilder { + public enum Slot { - BLOCK, GEAR, ROD, PLATE; + BLOCK, + GEAR, + ROD, + PLATE; + public String lower() { return toString().toLowerCase(Locale.ROOT); } } - private final String criteriaName; private final InventoryChangeTrigger.TriggerInstance criterion; private final EnumMap pieces = new EnumMap<>(Slot.class); private final TagKey ingot; - public ShapedBlockBuilder(TagKey ingot) { this.ingot = ingot; this.criteriaName = String.format("has_%s_ingot", ingot); - ItemPredicate predicate = ItemPredicate.Builder.item().of(ingot).build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = + InventoryChangeTrigger.TriggerInstance.hasItems(predicate); } public static ShapedBlockBuilder builder(TagKey ingot) { return new ShapedBlockBuilder(ingot); } - - public ShapedBlockBuilder setBlock(RegistryObject object) { pieces.put(Slot.BLOCK, object.get()); return this; } + public ShapedBlockBuilder setGear(RegistryObject object) { pieces.put(Slot.GEAR, object.get()); return this; } + public ShapedBlockBuilder setPlate(RegistryObject object) { pieces.put(Slot.PLATE, object.get()); return this; } + public ShapedBlockBuilder setRod(RegistryObject object) { pieces.put(Slot.ROD, object.get()); return this; } - protected void validate(ResourceLocation id) { if (pieces.isEmpty()) { - throw new RecipeException(id.toString(), "recipe must have at least 1 output"); + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output" + ); } } public void build(Consumer consumer) { - - Consumer register = builder -> builder.save(consumer); - - Optional.ofNullable(pieces.get(Slot.BLOCK)) - .map(this::block) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.GEAR)) - .map(this::gear) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.ROD)) - .map(this::rod) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional.ofNullable(pieces.get(Slot.PLATE)) - .map(this::plate) - .map(this::addCriterionIngot) - .ifPresent(register); - + Consumer register = builder -> + builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.BLOCK)) + .map(this::block) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.GEAR)) + .map(this::gear) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.ROD)) + .map(this::rod) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.PLATE)) + .map(this::plate) + .map(this::addCriterionIngot) + .ifPresent(register); } private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); } private ShapedRecipeBuilder addCriterionIngot(ShapedRecipeBuilder builder) { - return builder - .define('a', ingot) - .unlockedBy(criteriaName, criterion); + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); } - private ShapedRecipeBuilder block(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("aaa") - .pattern("aaa"); - + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); } - private ShapedRecipeBuilder ingot(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("aaa") - .pattern("aaa"); + // private ShapedRecipeBuilder ingot(ItemLike provider) { + // return shaped(provider) + // .pattern("aaa") + // .pattern("aaa") + // .pattern("aaa"); - } + // } private ShapedRecipeBuilder gear(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("a a") - .pattern("aaa"); - + return shaped(provider).pattern("aaa").pattern("a a").pattern("aaa"); } - private ShapedRecipeBuilder rod(ItemLike provider) { - return shaped(provider) - .pattern("a ") - .pattern("a ") - .pattern("a "); + private ShapedRecipeBuilder rod(ItemLike provider) { + return shaped(provider).pattern("a ").pattern("a ").pattern("a "); } - private ShapedRecipeBuilder plate(ItemLike provider) { - return shaped(provider) - .pattern("aa ") - .pattern("aa ") - .pattern(" "); + private ShapedRecipeBuilder plate(ItemLike provider) { + return shaped(provider).pattern("aa ").pattern("aa ").pattern(" "); } - } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java index 6438620a..a50c8ca7 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java @@ -2,91 +2,88 @@ import com.thevortex.allthemodium.datagen.RecipeException; import com.thevortex.allthemodium.reference.Reference; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Optional; +import java.util.function.Consumer; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.level.ItemLike; import net.minecraftforge.registries.RegistryObject; -import java.util.EnumMap; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; - public class ShapedIngotBuilder { + public enum Slot { INGOT; + public String lower() { return toString().toLowerCase(Locale.ROOT); } } - private final String criteriaName; private final InventoryChangeTrigger.TriggerInstance criterion; private final EnumMap pieces = new EnumMap<>(Slot.class); private final TagKey nugget; - public ShapedIngotBuilder(TagKey nugget) { this.nugget = nugget; this.criteriaName = String.format("has_%s_nugget", nugget); - ItemPredicate predicate = ItemPredicate.Builder.item().of(nugget).build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(nugget) + .build(); + this.criterion = + InventoryChangeTrigger.TriggerInstance.hasItems(predicate); } public static ShapedIngotBuilder builder(TagKey nugget) { return new ShapedIngotBuilder(nugget); } - - public ShapedIngotBuilder setIngot(RegistryObject object) { pieces.put(Slot.INGOT, object.get()); return this; } - protected void validate(ResourceLocation id) { if (pieces.isEmpty()) { - throw new RecipeException(id.toString(), "recipe must have at least 1 output"); + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output" + ); } } public void build(Consumer consumer) { + Consumer register = builder -> + builder.save(consumer); - Consumer register = builder -> builder.save(consumer); - - Optional.ofNullable(pieces.get(Slot.INGOT)) + Optional + .ofNullable(pieces.get(Slot.INGOT)) .map(this::ingot) .map(this::addCriterionNugget) .ifPresent(register); - } private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); } - private ShapedRecipeBuilder addCriterionNugget(ShapedRecipeBuilder builder) { - return builder - .define('a', nugget) - .unlockedBy(criteriaName, criterion); + private ShapedRecipeBuilder addCriterionNugget( + ShapedRecipeBuilder builder + ) { + return builder.define('a', nugget).unlockedBy(criteriaName, criterion); } private ShapedRecipeBuilder ingot(ItemLike provider) { - return shaped(provider) - .pattern("aaa") - .pattern("aaa") - .pattern("aaa"); + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java index f57790ae..4f64c747 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java @@ -1,128 +1,335 @@ package com.thevortex.allthemodium.datagen.client; -import com.thevortex.allthemodium.blocks.Ancient_Grass; -import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.reference.Reference; +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.List; +import java.util.stream.Collectors; import net.minecraft.data.DataGenerator; -import net.minecraft.data.models.model.ModelTemplates; -import net.minecraft.data.models.model.TextureMapping; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Items; import net.minecraft.world.level.block.*; import net.minecraftforge.client.model.generators.BlockModelBuilder; import net.minecraftforge.client.model.generators.BlockStateProvider; -import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - public class BlockStates extends BlockStateProvider { + public BlockStates(DataGenerator generator, ExistingFileHelper fileHelper) { super(generator, Reference.MOD_ID, fileHelper); } @Override protected void registerStatesAndModels() { - List entries = ModRegistry.BLOCKS.getEntries() - .stream().map(RegistryObject::get) + List entries = ModRegistry.BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) .filter(block -> !(block instanceof GrassBlock)) .filter(block -> !(block instanceof LiquidBlock)) .collect(Collectors.toList()); entries.forEach(this::simpleBlockAndItem); - logBlock((RotatedPillarBlock)ModRegistry.ANCIENT_LOG_0.get()); - logBlock((RotatedPillarBlock)ModRegistry.ANCIENT_LOG_1.get()); - logBlock((RotatedPillarBlock)ModRegistry.ANCIENT_LOG_2.get()); - logBlock((RotatedPillarBlock)ModRegistry.ANCIENT_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock)ModRegistry.ANCIENT_BOOKSHELF.get()); - - simpleBlockItem(ModRegistry.ANCIENT_LOG_0.get(),models().getBuilder("ancient_log_0")); - simpleBlockItem(ModRegistry.ANCIENT_LOG_1.get(),models().getBuilder("ancient_log_1")); - simpleBlockItem(ModRegistry.ANCIENT_LOG_2.get(),models().getBuilder("ancient_log_2")); - simpleBlockItem(ModRegistry.ANCIENT_LOG_STRIPPED.get(),models().getBuilder("stripped_ancient_log")); - //trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); - simpleBlockItem(ModRegistry.ANCIENT_BOOKSHELF.get(),models().getBuilder("ancient_bookshelf")); - // - stairsBlock(ModRegistry.ANCIENT_WOODEN_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - - logBlock((RotatedPillarBlock)ModRegistry.SOUL_LOG.get()); - logBlock((RotatedPillarBlock)ModRegistry.SOUL_LOG_0.get()); - logBlock((RotatedPillarBlock)ModRegistry.SOUL_LOG_1.get()); - logBlock((RotatedPillarBlock)ModRegistry.SOUL_LOG_2.get()); - logBlock((RotatedPillarBlock)ModRegistry.SOUL_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock)ModRegistry.SOUL_BOOKSHELF.get()); - - simpleBlockItem(ModRegistry.SOUL_LOG.get(),models().getBuilder("soul_log")); - simpleBlockItem(ModRegistry.SOUL_LOG_0.get(),models().getBuilder("soul_log_0")); - simpleBlockItem(ModRegistry.SOUL_LOG_1.get(),models().getBuilder("soul_log_1")); - simpleBlockItem(ModRegistry.SOUL_LOG_2.get(),models().getBuilder("soul_log_2")); - simpleBlockItem(ModRegistry.SOUL_LOG_STRIPPED.get(),models().getBuilder("stripped_soul_log")); - simpleBlockItem(ModRegistry.SOUL_BOOKSHELF.get(),models().getBuilder("soul_bookshelf")); - stairsBlock(ModRegistry.SOUL_WOODEN_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - - logBlock((RotatedPillarBlock)ModRegistry.DEMONIC_LOG.get()); - logBlock((RotatedPillarBlock)ModRegistry.DEMONIC_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock)ModRegistry.DEMONIC_BOOKSHELF.get()); - - simpleBlockItem(ModRegistry.DEMONIC_LOG.get(),models().getBuilder("demonic_log")); - simpleBlockItem(ModRegistry.DEMONIC_LOG_STRIPPED.get(),models().getBuilder("stripped_demonic_log")); - simpleBlockItem(ModRegistry.DEMONIC_BOOKSHELF.get(),models().getBuilder("demonic_bookshelf")); - stairsBlock(ModRegistry.DEMONIC_WOODEN_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - - - stairsBlock(ModRegistry.ANCIENT_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - stairsBlock(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - stairsBlock(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - stairsBlock(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - stairsBlock(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - stairsBlock(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - stairsBlock(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - - fenceBlock(ModRegistry.ANCIENT_WOOD_FENCE.get(),"ancient_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - fenceGateBlock(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(),"ancient_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - fenceBlock(ModRegistry.DEMONIC_WOOD_FENCE.get(),"demonic_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - fenceGateBlock(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(),"demonic_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - fenceBlock(ModRegistry.SOUL_WOOD_FENCE.get(),"soul_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - fenceGateBlock(ModRegistry.SOUL_WOOD_FENCE_GATE.get(),"soul_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - - wallBlock(ModRegistry.ANCIENT_STONE_WALL.get(),"ancient_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - wallBlock(ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(),"ancient_smooth_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - wallBlock(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(),"ancient_polished_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - wallBlock(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(),"ancient_mossy_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - wallBlock(ModRegistry.ANCIENT_STONE_BRICK_WALL.get(),"ancient_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - wallBlock(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(),"ancient_chiseled_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - wallBlock(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(),"ancient_cracked_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - - slabBlock(ModRegistry.ANCIENT_WOODEN_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_planks"), new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - slabBlock(ModRegistry.DEMONIC_WOODEN_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/demonic_planks"), new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - slabBlock(ModRegistry.SOUL_WOODEN_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/soul_planks"), new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - slabBlock(ModRegistry.ANCIENT_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone"), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - slabBlock(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone"), new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - slabBlock(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks"), new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - slabBlock(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone"), new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - slabBlock(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks"), new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - slabBlock(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks"), new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - slabBlock(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone"), new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - - doorBlock(ModRegistry.ANCIENT_DOOR_.get(),new ResourceLocation(Reference.MOD_ID,"block/ancient_door_bottom"),new ResourceLocation(Reference.MOD_ID,"block/ancient_door_top")); - doorBlock(ModRegistry.DEMONIC_DOOR_.get(),new ResourceLocation(Reference.MOD_ID,"block/demonic_door_bottom"),new ResourceLocation(Reference.MOD_ID,"block/demonic_door_top")); - doorBlock(ModRegistry.SOUL_DOOR_.get(),new ResourceLocation(Reference.MOD_ID,"block/soul_door_bottom"),new ResourceLocation(Reference.MOD_ID,"block/soul_door_top")); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_BOOKSHELF.get()); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_0.get(), + models().getBuilder("ancient_log_0") + ); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_1.get(), + models().getBuilder("ancient_log_1") + ); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_2.get(), + models().getBuilder("ancient_log_2") + ); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_STRIPPED.get(), + models().getBuilder("stripped_ancient_log") + ); + // trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); + simpleBlockItem( + ModRegistry.ANCIENT_BOOKSHELF.get(), + models().getBuilder("ancient_bookshelf") + ); + stairsBlock( + ModRegistry.ANCIENT_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_BOOKSHELF.get()); - } + simpleBlockItem( + ModRegistry.SOUL_LOG.get(), + models().getBuilder("soul_log") + ); + simpleBlockItem( + ModRegistry.SOUL_LOG_0.get(), + models().getBuilder("soul_log_0") + ); + simpleBlockItem( + ModRegistry.SOUL_LOG_1.get(), + models().getBuilder("soul_log_1") + ); + simpleBlockItem( + ModRegistry.SOUL_LOG_2.get(), + models().getBuilder("soul_log_2") + ); + simpleBlockItem( + ModRegistry.SOUL_LOG_STRIPPED.get(), + models().getBuilder("stripped_soul_log") + ); + simpleBlockItem( + ModRegistry.SOUL_BOOKSHELF.get(), + models().getBuilder("soul_bookshelf") + ); + stairsBlock( + ModRegistry.SOUL_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_BOOKSHELF.get()); + + simpleBlockItem( + ModRegistry.DEMONIC_LOG.get(), + models().getBuilder("demonic_log") + ); + simpleBlockItem( + ModRegistry.DEMONIC_LOG_STRIPPED.get(), + models().getBuilder("stripped_demonic_log") + ); + simpleBlockItem( + ModRegistry.DEMONIC_BOOKSHELF.get(), + models().getBuilder("demonic_bookshelf") + ); + stairsBlock( + ModRegistry.DEMONIC_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + + stairsBlock( + ModRegistry.ANCIENT_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + stairsBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + stairsBlock( + ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + stairsBlock( + ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + stairsBlock( + ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + stairsBlock( + ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + stairsBlock( + ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + fenceBlock( + ModRegistry.ANCIENT_WOOD_FENCE.get(), + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + fenceGateBlock( + ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(), + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + fenceBlock( + ModRegistry.DEMONIC_WOOD_FENCE.get(), + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + fenceGateBlock( + ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(), + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + fenceBlock( + ModRegistry.SOUL_WOOD_FENCE.get(), + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + fenceGateBlock( + ModRegistry.SOUL_WOOD_FENCE_GATE.get(), + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + wallBlock( + ModRegistry.ANCIENT_STONE_WALL.get(), + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + wallBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(), + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + wallBlock( + ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(), + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + wallBlock( + ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(), + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + wallBlock( + ModRegistry.ANCIENT_STONE_BRICK_WALL.get(), + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + wallBlock( + ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + wallBlock( + ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + slabBlock( + ModRegistry.ANCIENT_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + slabBlock( + ModRegistry.DEMONIC_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + slabBlock( + ModRegistry.SOUL_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + slabBlock( + ModRegistry.ANCIENT_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + slabBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + slabBlock( + ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + slabBlock( + ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + slabBlock( + ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + slabBlock( + ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + slabBlock( + ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + + doorBlock( + ModRegistry.ANCIENT_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_top") + ); + doorBlock( + ModRegistry.DEMONIC_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_top") + ); + doorBlock( + ModRegistry.SOUL_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_top") + ); + } /** - * Generates an item model and block model/blockstate for a simple block + * Generates an item model and block model/block state for a simple block + * * @param block the block */ private void simpleBlockAndItem(Block block) { @@ -131,5 +338,4 @@ private void simpleBlockAndItem(Block block) { BlockModelBuilder builder = models().getBuilder(blockName.toString()); simpleBlockItem(block, builder); } - } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java index 5da10d8d..d1ee63f6 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java @@ -1,8 +1,7 @@ package com.thevortex.allthemodium.datagen.client; -import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.reference.Reference; -import net.minecraft.client.model.Model; +import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.data.DataGenerator; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.*; @@ -22,8 +21,10 @@ private ResourceLocation res(String name) { @Override protected void registerModels() { ResourceLocation generated = new ResourceLocation("item/generated"); - ResourceLocation handheld = new ResourceLocation("item/handheld"); - ModRegistry.ITEMS.getEntries().stream() + // ResourceLocation handheld = new ResourceLocation("item/handheld"); + ModRegistry.ITEMS + .getEntries() + .stream() .filter(item -> !(item.get() instanceof BlockItem)) .filter(item -> !(item.get() instanceof SwordItem)) .filter(item -> !(item.get() instanceof PickaxeItem)) @@ -32,133 +33,295 @@ protected void registerModels() { .filter(item -> !(item.get() instanceof HoeItem)) .forEach(item -> { String name = item.getId().getPath(); - if(!name.contains("bucket")){ - withExistingParent(name, generated) - .texture("layer0", res(name)); - - }}); - - - stairs("ancient_wooden_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - - stairs("demonic_wooden_stairs", - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - - stairs("soul_wooden_stairs", - new ResourceLocation(Reference.MOD_ID,"block/soul_planks"), - new ResourceLocation(Reference.MOD_ID,"block/soul_planks"), - new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - - stairs("ancient_stone_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - - stairs("ancient_smooth_stone_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - - stairs("ancient_polished_stone_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - - stairs("ancient_mossy_stone_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - - stairs("ancient_stone_brick_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - - stairs("ancient_chiseled_stone_brick_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - - stairs("ancient_cracked_stone_brick_stairs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - - fenceInventory("ancient_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - fenceGate("ancient_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - - fenceInventory("demonic_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - fenceGate("demonic_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - - fenceInventory("soul_wooden_fence",new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - fenceGate("soul_wooden_fence_gate",new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - - - wallInventory("ancient_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - wallInventory("ancient_smooth_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - wallInventory("ancient_polished_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - wallInventory("ancient_mossy_stone_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - wallInventory("ancient_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - wallInventory("ancient_chiseled_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - wallInventory("ancient_cracked_stone_brick_wall",new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - - slab("ancient_wooden_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_planks")); - - slab("demonic_wooden_slabs", - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID,"block/demonic_planks")); - - slab("soul_wooden_slabs", - new ResourceLocation(Reference.MOD_ID,"block/soul_planks"), - new ResourceLocation(Reference.MOD_ID,"block/soul_planks"), - new ResourceLocation(Reference.MOD_ID,"block/soul_planks")); - - slab("ancient_stone_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone")); - - slab("ancient_smooth_stone_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_smooth_stone")); - - slab("ancient_polished_stone_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_polished_stone")); - - slab("ancient_mossy_stone_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_mossy_stone")); - - slab("ancient_stone_brick_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_stone_bricks")); - - slab("ancient_chiseled_stone_brick_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_chiseled_stone_bricks")); - - slab("ancient_cracked_stone_brick_slabs", - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks"), - new ResourceLocation(Reference.MOD_ID,"block/ancient_cracked_stone_bricks")); - - - - //trapdoorOrientableTop("ancient_trap_door",new ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); + if (!name.contains("bucket")) { + withExistingParent(name, generated) + .texture("layer0", res(name)); + } + }); + + stairs( + "ancient_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + + stairs( + "demonic_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + + stairs( + "soul_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + + stairs( + "ancient_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + + stairs( + "ancient_smooth_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + + stairs( + "ancient_polished_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + + stairs( + "ancient_mossy_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + + stairs( + "ancient_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + + stairs( + "ancient_chiseled_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + + stairs( + "ancient_cracked_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + + fenceInventory( + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + fenceGate( + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + + fenceInventory( + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + fenceGate( + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + + fenceInventory( + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + fenceGate( + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + + wallInventory( + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + wallInventory( + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + wallInventory( + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + wallInventory( + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + wallInventory( + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + wallInventory( + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + wallInventory( + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + + slab( + "ancient_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") + ); + + slab( + "demonic_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") + ); + + slab( + "soul_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks") + ); + + slab( + "ancient_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") + ); + + slab( + "ancient_smooth_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") + ); + + slab( + "ancient_polished_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone" + ) + ); + + slab( + "ancient_mossy_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") + ); + + slab( + "ancient_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks" + ), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") + ); + + slab( + "ancient_chiseled_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks" + ) + ); + + slab( + "ancient_cracked_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks" + ) + ); + // trapdoorOrientableTop("ancient_trap_door",new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/package-info.java b/src/main/java/com/thevortex/allthemodium/datagen/client/package-info.java index e5d2d5a8..117e2196 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/package-info.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/package-info.java @@ -1,5 +1,4 @@ @ParametersAreNonnullByDefault - package com.thevortex.allthemodium.datagen.client; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/com/thevortex/allthemodium/datagen/package-info.java b/src/main/java/com/thevortex/allthemodium/datagen/package-info.java index 21f4edeb..9c499c7b 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/package-info.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/package-info.java @@ -1,5 +1,4 @@ @ParametersAreNonnullByDefault package com.thevortex.allthemodium.datagen; - import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java index b64b17d9..57763501 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java @@ -2,6 +2,7 @@ import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.function.Consumer; import net.minecraft.data.DataGenerator; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeProvider; @@ -9,55 +10,112 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.Ingredient; -import java.util.function.Consumer; - public class BlastingRecipes extends RecipeProvider { + public BlastingRecipes(DataGenerator generator) { super(generator); } + private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation(Reference.MOD_ID,typeIn + "_from_" + typeOut + "_blasting"); + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut + "_blasting" + ); } + @Override protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()),ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer,recipeDir("ancient_smooth_stone","ancient_stone")); + .blasting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()),ModRegistry.ALLTHEMODIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer,recipeDir("allthemodium_ingot","raw_blasting")); + .blasting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) + ) + .save(consumer, recipeDir("allthemodium_ingot", "raw_blasting")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()),ModRegistry.VIBRANIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer,recipeDir("vibranium_ingot","raw_blasting")); + .blasting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) + ) + .save(consumer, recipeDir("vibranium_ingot", "raw_blasting")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()),ModRegistry.UNOBTAINIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer,recipeDir("unobtainium_ingot","raw_blasting")); + .blasting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) + ) + .save(consumer, recipeDir("unobtainium_ingot", "raw_blasting")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()),ModRegistry.ALLTHEMODIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) - .save(consumer,recipeDir("allthemodium_ingot","dust_blasting")); + .blasting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get()) + ) + .save(consumer, recipeDir("allthemodium_ingot", "dust_blasting")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()),ModRegistry.VIBRANIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) - .save(consumer,recipeDir("vibranium_ingot","dust_blasting")); + .blasting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get()) + ) + .save(consumer, recipeDir("vibranium_ingot", "dust_blasting")); SimpleCookingRecipeBuilder - .blasting(Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()),ModRegistry.UNOBTAINIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) - .save(consumer,recipeDir("unobtainium_ingot","dust_blasting")); - - + .blasting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get()) + ) + .save(consumer, recipeDir("unobtainium_ingot", "dust_blasting")); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java index 9c48c7eb..226f5d95 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java @@ -1,29 +1,28 @@ package com.thevortex.allthemodium.datagen.server; +import static net.minecraftforge.common.Tags.Blocks.NEEDS_NETHERITE_TOOL; -import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.reference.Reference; +import com.thevortex.allthemodium.registry.ModRegistry; import com.thevortex.allthemodium.registry.TagRegistry; import net.allthemods.alltheores.blocks.BlockList; import net.minecraft.data.DataGenerator; import net.minecraft.data.tags.BlockTagsProvider; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.common.Tags; import net.minecraftforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; -import static net.minecraftforge.common.Tags.Blocks.NEEDS_NETHERITE_TOOL; - - public class BlockTags extends BlockTagsProvider { - public BlockTags(DataGenerator generator, @Nullable ExistingFileHelper existingFileHelper) { + public BlockTags( + DataGenerator generator, + @Nullable ExistingFileHelper existingFileHelper + ) { super(generator, Reference.MOD_ID, existingFileHelper); } @Override protected void addTags() { - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.FURNACE); tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BLAST_FURNACE); tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BREWING_STAND); @@ -32,195 +31,344 @@ protected void addTags() { tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CAMPFIRE); tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.SOUL_CAMPFIRE); - tag(TagRegistry.PAXEL_TARGETS).addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); - tag(TagRegistry.PAXEL_TARGETS).addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); - tag(TagRegistry.PAXEL_TARGETS).addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); - tag(TagRegistry.PAXEL_TARGETS).addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); - - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS).add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS).add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS).add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS).add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS).add(ModRegistry.ANCIENT_LOG_2.get()); - tag(TagRegistry.ANCIENT_WOODEN_PLANKS).add(ModRegistry.ANCIENT_PLANKS.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS).add(ModRegistry.DEMONIC_PLANKS.get()); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); + + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(TagRegistry.ANCIENT_WOODEN_PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); tag(TagRegistry.SOUL_WOODEN_PLANKS).add(ModRegistry.SOUL_PLANKS.get()); tag(TagRegistry.ANCIENT_STONE).add(ModRegistry.ANCIENT_STONE.get()); tag(TagRegistry.ANCIENT_DIRT).add(ModRegistry.ANCIENT_DIRT.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE).add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE).add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE).add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS).add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS).add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS).add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.PLANKS).add(ModRegistry.DEMONIC_PLANKS.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS).add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS).add(ModRegistry.ANCIENT_PLANKS.get()); - - tag(net.minecraft.tags.BlockTags.CLIMBABLE).add(ModRegistry.ANCIENT_CAVEVINES_.get()); - tag(net.minecraft.tags.BlockTags.CLIMBABLE).add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL).add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL).add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.ANCIENT_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_.get()); + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_ORE.get()); tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL).add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL).add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL).add(ModRegistry.UNOBTAINIUM_ORE.get()); - - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.DEMONIC_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE).add(ModRegistry.SOUL_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.NYLIUM).add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER).add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER).add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER).add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.BEE_GROWABLES).add(ModRegistry.ANCIENT_SAPLING.get()); - tag(net.minecraft.tags.BlockTags.DIRT).add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.DIRT).add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING.get()); - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES).add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES).add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES).add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES).add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES).add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES).add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); - - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS).add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS).add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS).add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS).add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS).add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); - - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES).add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS).add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS).add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS).add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS).add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); - - tag(net.minecraft.tags.BlockTags.LEAVES).add(ModRegistry.ANCIENT_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES).add(ModRegistry.SOUL_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES).add(ModRegistry.DEMONIC_LEAVES.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK).add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE).add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.NYLIUM) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.BEE_GROWABLES) + .add(ModRegistry.ANCIENT_SAPLING.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SAPLINGS) + .add(ModRegistry.ANCIENT_SAPLING.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); + + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); + + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.ANCIENT_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.SOUL_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.DEMONIC_LEAVES.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); tag(TagRegistry.VIBRANIUM_BLOCK).add(ModRegistry.VIBRANIUM_BLOCK.get()); tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK).add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(TagRegistry.VIBRANIUM_ORE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); tag(TagRegistry.UNOBTAINIUM_ORE).add(ModRegistry.UNOBTAINIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.UNOBTAINIUM_ORE.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.UV_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.UA_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.VA_ALLOY.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(ModRegistry.TELEPORT_PAD.get()); - - - ModRegistry.BLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); - ModRegistry.SHAPED_BLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); - ModRegistry.STAIRBLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); - ModRegistry.SLABBLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); - ModRegistry.WALLBLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); - ModRegistry.PILLARBLOCKS.getEntries().stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get()); - }); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UV_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UA_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VA_ALLOY.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.TELEPORT_PAD.get()); + + ModRegistry.BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SHAPED_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.CRIMSON_NYLIUM); @@ -230,49 +378,64 @@ protected void addTags() { tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SOIL); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DEEPSLATE); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ALUMINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_ALUMINUM_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COAL_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COPPER_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_DIAMOND_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_DIAMOND_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LEAD_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_NICKEL_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRIDIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_IRIDIUM_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LAPIS_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_PLATINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_PLATINUM_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_SILVER_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_OSMIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_URANIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_URANIUM_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ZINC_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_TIN_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRON_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_REDSTONE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_REDSTONE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_GOLD_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_QUARTZ_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_EMERALD_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_EMERALD_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ALUMINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.ALUMINUM_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.LEAD_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.NICKEL_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OSMIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.PLATINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.PLATINUM_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.SILVER_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.TIN_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.URANIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.URANIUM_SLATE_ORE.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ZINC_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.IRIDIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.IRIDIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ALUMINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_ALUMINUM_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_LEAD_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_NICKEL_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_OSMIUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_PLATINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_PLATINUM_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_SILVER_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_TIN_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_URANIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_URANIUM_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ZINC_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_IRIDIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_IRIDIUM_BLOCK.get()); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERITE_BLOCK); tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DIAMOND_BLOCK); @@ -281,7 +444,5 @@ protected void addTags() { tag(TagRegistry.OTHER_PROTECTION).add(Blocks.GOLD_BLOCK); tag(TagRegistry.OTHER_PROTECTION).addTag(TagRegistry.BLOCK_ORES); - } - } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java index 59d0e57f..0d80f6a4 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java @@ -2,10 +2,10 @@ import com.thevortex.allthemodium.datagen.builder.ShapedAncientStones; import com.thevortex.allthemodium.datagen.builder.ShapedIngotBuilder; - import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; +import java.util.function.Consumer; import net.allthemods.alltheores.datagen.builder.ShapedBlockBuilder; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; @@ -20,75 +20,109 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; -import java.util.function.Consumer; - public class CraftingRecipes extends RecipeProvider { + public CraftingRecipes(DataGenerator generatorIn) { super(generatorIn); } - private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { - return ShapedRecipeBuilder.shaped(provider,integer) - .group(Reference.MOD_ID); - } private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider) - .group(Reference.MOD_ID); + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); } - private static InventoryChangeTrigger.TriggerInstance hasTag(TagKey tagKey) { - return inventoryTrigger(ItemPredicate.Builder.item().of(tagKey).build()); + private static InventoryChangeTrigger.TriggerInstance hasTag( + TagKey tagKey + ) { + return inventoryTrigger( + ItemPredicate.Builder.item().of(tagKey).build() + ); } - @Override protected void buildCraftingRecipes(Consumer consumer) { - - ShapelessRecipeBuilder.shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) .group(Reference.MOD_ID) .requires(Ingredient.of(TagRegistry.RAW_ALLTHEMODIUM), 9) - .unlockedBy("has_raw_allthemodium", hasTag(TagRegistry.RAW_ALLTHEMODIUM)) + .unlockedBy( + "has_raw_allthemodium", + hasTag(TagRegistry.RAW_ALLTHEMODIUM) + ) .save(consumer); - ShapelessRecipeBuilder.shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) .group(Reference.MOD_ID) .requires(Ingredient.of(TagRegistry.RAW_VIBRANIUM), 9) .unlockedBy("has_raw_vibranium", hasTag(TagRegistry.RAW_VIBRANIUM)) .save(consumer); - ShapelessRecipeBuilder.shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) .group(Reference.MOD_ID) .requires(Ingredient.of(TagRegistry.RAW_UNOBTAINIUM), 9) - .unlockedBy("has_raw_unobtainium", hasTag(TagRegistry.RAW_UNOBTAINIUM)) + .unlockedBy( + "has_raw_unobtainium", + hasTag(TagRegistry.RAW_UNOBTAINIUM) + ) .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_APPLE.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.APPLE) - .unlockedBy("has_allthemodium_nugget", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_NUGGET).build())) - .save(consumer); + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.APPLE) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build() + ) + ) + .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_CARROT.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.CARROT) - .unlockedBy("has_allthemodium_nugget", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_NUGGET).build())) - .save(consumer); + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.CARROT) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build() + ) + ) + .save(consumer); shaped(ModRegistry.TELEPORT_PAD_ITEM.get()) - .pattern(" n ") - .pattern("nan") - .pattern(" n ") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.ENDER_PEARL) - .unlockedBy("has_allthemodium_nugget", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_NUGGET).build())) - .unlockedBy("has_ender_pearl", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build())) - .save(consumer); + .pattern(" n ") + .pattern("nan") + .pattern(" n ") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.ENDER_PEARL) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build() + ) + ) + .unlockedBy( + "has_ender_pearl", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build() + ) + ) + .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_PICKAXE.get()) .pattern("ara") @@ -96,173 +130,220 @@ protected void buildCraftingRecipes(Consumer consumer) { .pattern(" r ") .define('r', TagRegistry.ALLTHEMODIUM_ROD) .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy("has_allthemodium_rod", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_ROD).build())) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build() + ) + ) .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_AXE.get()) - .pattern("aa ") - .pattern("ar ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy("has_allthemodium_rod", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_ROD).build())) - .save(consumer); - - - + .pattern("aa ") + .pattern("ar ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build() + ) + ) + .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_SHOVEL.get()) - .pattern(" a ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy("has_allthemodium_rod", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_ROD).build())) - .save(consumer); - - + .pattern(" a ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build() + ) + ) + .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_HOE.get()) - .pattern("aa ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy("has_allthemodium_rod", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_ROD).build())) - .save(consumer); - - - + .pattern("aa ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build() + ) + ) + .save(consumer); shaped(ModRegistry.ALLTHEMODIUM_SWORD.get()) - .pattern(" a ") - .pattern(" a ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy("has_allthemodium_rod", RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ALLTHEMODIUM_ROD).build())) - .save(consumer); - - - final String hasCondition = "has_item"; - - ShapedAncientStones.builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) - .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) - .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) - .setDoor(ModRegistry.SOUL_DOOR_ITEM) - .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) - .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) - .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) - .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_STONE_ITEM) - .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones.builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .setGear(ModRegistry.ATM_GEAR) - .setPlate(ModRegistry.ATM_PLATE) - .setRod(ModRegistry.ATM_ROD) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.VIBRANIUM_INGOT) - .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) - .setGear(ModRegistry.VIB_GEAR) - .setPlate(ModRegistry.VIB_PLATE) - .setRod(ModRegistry.VIB_ROD) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.UNOBTAINIUM_INGOT) - .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) - .setGear(ModRegistry.ONOB_GEAR) - .setPlate(ModRegistry.ONOB_PLATE) - .setRod(ModRegistry.ONOB_ROD) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.UA_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) - .setBlock(ModRegistry.UV_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder.builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.VA_ALLOY_ITEM) - .build(consumer); - - ShapedIngotBuilder.builder(TagRegistry.ALLTHEMODIUM_NUGGET) - .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) - .build(consumer); - ShapedIngotBuilder.builder(TagRegistry.VIBRANIUM_NUGGET) - .setIngot(ModRegistry.VIBRANIUM_INGOT) - .build(consumer); - ShapedIngotBuilder.builder(TagRegistry.UNOBTAINIUM_NUGGET) - .setIngot(ModRegistry.UNOBTAINIUM_INGOT) - .build(consumer); + .pattern(" a ") + .pattern(" a ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build() + ) + ) + .save(consumer); + // final String hasCondition = "has_item"; + + ShapedAncientStones + .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) + .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) + .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) + .setDoor(ModRegistry.SOUL_DOOR_ITEM) + .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) + .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) + .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) + .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_ITEM) + .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .setGear(ModRegistry.ATM_GEAR) + .setPlate(ModRegistry.ATM_PLATE) + .setRod(ModRegistry.ATM_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_INGOT) + .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) + .setGear(ModRegistry.VIB_GEAR) + .setPlate(ModRegistry.VIB_PLATE) + .setRod(ModRegistry.VIB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_INGOT) + .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) + .setGear(ModRegistry.UNOB_GEAR) + .setPlate(ModRegistry.UNOB_PLATE) + .setRod(ModRegistry.UNOB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.UA_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .setBlock(ModRegistry.UV_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.VA_ALLOY_ITEM) + .build(consumer); + + ShapedIngotBuilder + .builder(TagRegistry.ALLTHEMODIUM_NUGGET) + .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.VIBRANIUM_NUGGET) + .setIngot(ModRegistry.VIBRANIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.UNOBTAINIUM_NUGGET) + .setIngot(ModRegistry.UNOBTAINIUM_INGOT) + .build(consumer); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java index a083361d..cb48365d 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java @@ -1,27 +1,32 @@ package com.thevortex.allthemodium.datagen.server; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.FluidRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; import net.minecraft.data.DataGenerator; import net.minecraft.data.tags.FluidTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; public class FluidTags extends FluidTagsProvider { - public FluidTags(DataGenerator p_126523_, String modId, @Nullable ExistingFileHelper existingFileHelper) { + + public FluidTags( + DataGenerator p_126523_, + String modId, + @Nullable ExistingFileHelper existingFileHelper + ) { super(p_126523_, modId, existingFileHelper); } + @Override protected void addTags() { - - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA).add(FluidRegistry.SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); - - // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); - // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); - // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.FLOWING_SOULLAVA.get()); + // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); + // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); + // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); } - } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java index 7b631e51..baa49a93 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java @@ -1,10 +1,9 @@ package com.thevortex.allthemodium.datagen.server; - import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ItemRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; import net.minecraft.data.DataGenerator; import net.minecraft.data.tags.BlockTagsProvider; import net.minecraft.data.tags.ItemTagsProvider; @@ -13,48 +12,68 @@ public class ItemTags extends ItemTagsProvider { - - public ItemTags(DataGenerator generator, BlockTagsProvider blockTagsProvider, ExistingFileHelper existingFileHelper) { - super(generator, blockTagsProvider, Reference.MOD_ID, existingFileHelper); + public ItemTags( + DataGenerator generator, + BlockTagsProvider blockTagsProvider, + ExistingFileHelper existingFileHelper + ) { + super( + generator, + blockTagsProvider, + Reference.MOD_ID, + existingFileHelper + ); } @Override protected void addTags() { - - tag(net.minecraft.tags.ItemTags.PLANKS).add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS).add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.DEMONIC_LOG_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS).add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.SOUL_LOG_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.SOUL_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.SOUL_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS).add(ModRegistry.SOUL_LOG_2_ITEM.get()); - + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.DEMONIC_LOG_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_2_ITEM.get()); tag(TagRegistry.SAPLINGS).add(ModRegistry.SOUL_SAPLING_ITEM.get()); tag(TagRegistry.SAPLINGS).add(ModRegistry.DEMONIC_SAPLING_ITEM.get()); tag(TagRegistry.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING_ITEM.get()); - tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS).add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS).add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(TagRegistry.FORGE_PICKAXES).add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + tag(TagRegistry.FORGE_PICKAXES) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); tag(TagRegistry.FORGE_AXES).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - tag(TagRegistry.FORGE_SHOVELS).add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + tag(TagRegistry.FORGE_SHOVELS) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); tag(TagRegistry.FORGE_HOES).add(ModRegistry.ALLTHEMODIUM_HOE.get()); tag(TagRegistry.FORGE_SWORDS).add(ModRegistry.ALLTHEMODIUM_SWORD.get()); tag(TagRegistry.FORGE_SWORDS).add(ItemRegistry.ATM_ALLOY_SWORD.get()); - tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PICK.get()); tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); @@ -69,31 +88,47 @@ protected void addTags() { tag(TagRegistry.FORGE_HOES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HOE.get()); tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_BOOTS.get()); - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HELMET.get()); - - tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM).add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM).add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM).add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_ITEM).add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM).add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM).add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM).add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM).add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM).add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM).add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM).add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_HELMET.get()); + + tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_ITEM) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); tag(TagRegistry.RAW_VIBRANIUM).add(ModRegistry.RAW_VIBRANIUM.get()); tag(TagRegistry.RAW_UNOBTAINIUM).add(ModRegistry.RAW_UNOBTAINIUM.get()); @@ -101,25 +136,38 @@ protected void addTags() { tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_VIBRANIUM.get()); tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_UNOBTAINIUM.get()); - tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE).add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_VIBRANIUM_FORGE).add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_FORGE).add(ModRegistry.RAW_UNOBTAINIUM.get()); + tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_VIBRANIUM_FORGE) + .add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_FORGE) + .add(ModRegistry.RAW_UNOBTAINIUM.get()); - tag(TagRegistry.ALLTHEMODIUM_INGOT).add(ModRegistry.ALLTHEMODIUM_INGOT.get()); + tag(TagRegistry.ALLTHEMODIUM_INGOT) + .add(ModRegistry.ALLTHEMODIUM_INGOT.get()); tag(TagRegistry.VIBRANIUM_INGOT).add(ModRegistry.VIBRANIUM_INGOT.get()); - tag(TagRegistry.UNOBTAINIUM_INGOT).add(ModRegistry.UNOBTAINIUM_INGOT.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT).add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT).add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT).add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK).add(ModRegistry.VA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK).add(ModRegistry.UA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK).add(ModRegistry.UV_ALLOY_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_DUST).add(ModRegistry.ALLTHEMODIUM_DUST.get()); + tag(TagRegistry.UNOBTAINIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_INGOT.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.VA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.UA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .add(ModRegistry.UV_ALLOY_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_DUST) + .add(ModRegistry.ALLTHEMODIUM_DUST.get()); tag(TagRegistry.VIBRANIUM_DUST).add(ModRegistry.VIBRANIUM_DUST.get()); - tag(TagRegistry.UNOBTAINIUM_DUST).add(ModRegistry.UNOBTAINIUM_DUST.get()); + tag(TagRegistry.UNOBTAINIUM_DUST) + .add(ModRegistry.UNOBTAINIUM_DUST.get()); tag(TagRegistry.DUSTS).add(ModRegistry.ALLTHEMODIUM_DUST.get()); tag(TagRegistry.DUSTS).add(ModRegistry.VIBRANIUM_DUST.get()); @@ -129,74 +177,91 @@ protected void addTags() { tag(TagRegistry.INGOTS).add(ModRegistry.VIBRANIUM_INGOT.get()); tag(TagRegistry.INGOTS).add(ModRegistry.UNOBTAINIUM_INGOT.get()); - tag(TagRegistry.ALLTHEMODIUM_NUGGET).add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); - tag(TagRegistry.VIBRANIUM_NUGGET).add(ModRegistry.VIBRANIUM_NUGGET.get()); - tag(TagRegistry.UNOBTAINIUM_NUGGET).add(ModRegistry.UNOBTAINIUM_NUGGET.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM).add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.VIBRANIUM_BLOCK_ITEM).add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM).add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK).add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_VIBRANIUM_BLOCK).add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK).add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); - - - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ORE_ITEM).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); + tag(TagRegistry.ALLTHEMODIUM_NUGGET) + .add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); + tag(TagRegistry.VIBRANIUM_NUGGET) + .add(ModRegistry.VIBRANIUM_NUGGET.get()); + tag(TagRegistry.UNOBTAINIUM_NUGGET) + .add(ModRegistry.UNOBTAINIUM_NUGGET.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_VIBRANIUM_BLOCK) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ORE_ITEM) + .add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.ORES) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); tag(TagRegistry.ORES).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); tag(TagRegistry.ORES).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); tag(TagRegistry.ORES).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); tag(TagRegistry.ALLTHEMODIUM_GEAR).add(ModRegistry.ATM_GEAR.get()); tag(TagRegistry.VIBRANIUM_GEAR).add(ModRegistry.VIB_GEAR.get()); - tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.ONOB_GEAR.get()); + tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.UNOB_GEAR.get()); tag(TagRegistry.ALLTHEMODIUM_PLATE).add(ModRegistry.ATM_PLATE.get()); tag(TagRegistry.VIBRANIUM_PLATE).add(ModRegistry.VIB_PLATE.get()); - tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.ONOB_PLATE.get()); + tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.UNOB_PLATE.get()); tag(TagRegistry.ALLTHEMODIUM_ROD).add(ModRegistry.ATM_ROD.get()); tag(TagRegistry.VIBRANIUM_ROD).add(ModRegistry.VIB_ROD.get()); - tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.ONOB_ROD.get()); + tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.UNOB_ROD.get()); tag(TagRegistry.ALLTHEMODIUM_SHARD).add(ModRegistry.ATM_SHARD.get()); tag(TagRegistry.VIBRANIUM_SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.ONOB_SHARD.get()); + tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.UNOB_SHARD.get()); tag(TagRegistry.ALLTHEMODIUM_CLUMP).add(ModRegistry.ATM_CLUMP.get()); tag(TagRegistry.VIBRANIUM_CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.ONOB_CLUMP.get()); + tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.UNOB_CLUMP.get()); - tag(TagRegistry.ALLTHEMODIUM_CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); + tag(TagRegistry.ALLTHEMODIUM_CRYSTAL) + .add(ModRegistry.ATM_CRYSTAL.get()); tag(TagRegistry.VIBRANIUM_CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.UNOBTAINIUM_CRYSTAL).add(ModRegistry.ONOB_CRYSTAL.get()); + tag(TagRegistry.UNOBTAINIUM_CRYSTAL) + .add(ModRegistry.UNOB_CRYSTAL.get()); - tag(TagRegistry.ALLTHEMODIUM_DIRTYDUST).add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.VIBRANIUM_DIRTYDUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.UNOBTAINIUM_DIRTYDUST).add(ModRegistry.ONOB_DIRTY.get()); + tag(TagRegistry.ALLTHEMODIUM_DIRTY_DUST) + .add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.VIBRANIUM_DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.UNOBTAINIUM_DIRTY_DUST) + .add(ModRegistry.UNOB_DIRTY.get()); tag(TagRegistry.SHARD).add(ModRegistry.ATM_SHARD.get()); tag(TagRegistry.SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.SHARD).add(ModRegistry.ONOB_SHARD.get()); + tag(TagRegistry.SHARD).add(ModRegistry.UNOB_SHARD.get()); tag(TagRegistry.CLUMP).add(ModRegistry.ATM_CLUMP.get()); tag(TagRegistry.CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.CLUMP).add(ModRegistry.ONOB_CLUMP.get()); + tag(TagRegistry.CLUMP).add(ModRegistry.UNOB_CLUMP.get()); tag(TagRegistry.CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); tag(TagRegistry.CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.CRYSTAL).add(ModRegistry.ONOB_CRYSTAL.get()); - - tag(TagRegistry.DIRTYDUST).add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.DIRTYDUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.DIRTYDUST).add(ModRegistry.ONOB_DIRTY.get()); + tag(TagRegistry.CRYSTAL).add(ModRegistry.UNOB_CRYSTAL.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.UNOB_DIRTY.get()); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java index 549e0e50..ca2a6558 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java @@ -2,10 +2,18 @@ import com.google.common.collect.ImmutableList; import com.mojang.datafixers.util.Pair; -import com.thevortex.allthemodium.blocks.Allthemodium_Ore; -import com.thevortex.allthemodium.blocks.Unobtainium_Ore; -import com.thevortex.allthemodium.blocks.Vibranium_Ore; +import com.thevortex.allthemodium.blocks.AllthemodiumOre; +import com.thevortex.allthemodium.blocks.UnobtainiumOre; +import com.thevortex.allthemodium.blocks.VibraniumOre; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; import net.minecraft.data.DataGenerator; import net.minecraft.data.loot.BlockLoot; import net.minecraft.data.loot.LootTableProvider; @@ -16,19 +24,9 @@ import net.minecraft.world.level.storage.loot.ValidationContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraftforge.registries.RegistryObject; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.Stream; - public class LootTables extends LootTableProvider { public LootTables(DataGenerator generator) { @@ -36,9 +34,14 @@ public LootTables(DataGenerator generator) { } @Override - protected List>>, LootContextParamSet>> getTables() { + protected List< + Pair< + Supplier>>, + LootContextParamSet + > + > getTables() { return ImmutableList.of( - Pair.of(BlockLoots::new, LootContextParamSets.BLOCK) + Pair.of(BlockLoots::new, LootContextParamSets.BLOCK) ); } @@ -46,87 +49,125 @@ public static class BlockLoots extends BlockLoot { @Override public void addTables() { - getKnownBlocks().forEach(this::dropRaw); - - - } - private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[]{0.05F, 0.0625F, 0.083333336F, 0.1F}; + // private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[] { + // 0.05F, 0.0625F, 0.083333336F, 0.1F }; + private void dropRaw(Block block) { - if(block instanceof LiquidBlock) { + if (block instanceof LiquidBlock) { return; } - if(block.getName().getString().contains("ancient_bookshelf")) { - this.add(ModRegistry.ANCIENT_BOOKSHELF.get(), (p_124241_) -> { - return createSingleItemTableWithSilkTouch(p_124241_, Items.BOOK, ConstantValue.exactly(3.0F)); - }); - } - String oretype = block.getName().getString(); - - if (block instanceof Allthemodium_Ore) { - this.add(block, (block1) -> createOreDrop(block1, ModRegistry.RAW_ALLTHEMODIUM.get())); - } - else if (block instanceof Vibranium_Ore) { - this.add(block, (block1) -> createOreDrop(block1, ModRegistry.RAW_VIBRANIUM.get())); - } - else if (block instanceof Unobtainium_Ore) { - this.add(block, (block1) -> createOreDrop(block1, ModRegistry.RAW_UNOBTAINIUM.get())); + if (block.getName().getString().contains("ancient_bookshelf")) { + this.add( + ModRegistry.ANCIENT_BOOKSHELF.get(), + p_124241_ -> { + return createSingleItemTableWithSilkTouch( + p_124241_, + Items.BOOK, + ConstantValue.exactly(3.0F) + ); + } + ); } - else if (oretype.contains("raw_")) { + String oreType = block.getName().getString(); + + if (block instanceof AllthemodiumOre) { + this.add( + block, + block1 -> + createOreDrop( + block1, + ModRegistry.RAW_ALLTHEMODIUM.get() + ) + ); + } else if (block instanceof VibraniumOre) { + this.add( + block, + block1 -> + createOreDrop( + block1, + ModRegistry.RAW_VIBRANIUM.get() + ) + ); + } else if (block instanceof UnobtainiumOre) { + this.add( + block, + block1 -> + createOreDrop( + block1, + ModRegistry.RAW_UNOBTAINIUM.get() + ) + ); + } else if (oreType.contains("raw_")) { + this.dropSelf(block); + } else { this.dropSelf(block); } - else { this.dropSelf(block); } - } - @Override protected Iterable getKnownBlocks() { - return Stream.of(ModRegistry.BLOCKS.getEntries(), - ModRegistry.STAIRBLOCKS.getEntries(), - ModRegistry.SLABBLOCKS.getEntries(), - ModRegistry.WALLBLOCKS.getEntries(), - ModRegistry.PILLARBLOCKS.getEntries()) - .filter(block -> !(block instanceof LeavesBlock)) - .flatMap(Collection::stream) - .map(RegistryObject::get) - .collect(Collectors.toList()); - + return Stream + .of( + ModRegistry.BLOCKS.getEntries(), + ModRegistry.STAIR_BLOCKS.getEntries(), + ModRegistry.SLAB_BLOCKS.getEntries(), + ModRegistry.WALL_BLOCKS.getEntries(), + ModRegistry.PILLAR_BLOCKS.getEntries() + ) + .filter(block -> !(block instanceof LeavesBlock)) + .flatMap(Collection::stream) + .map(RegistryObject::get) + .collect(Collectors.toList()); } - protected Iterable getKnownStairs() { - return ModRegistry.STAIRBLOCKS.getEntries() - .stream().map(RegistryObject::get) - .collect(Collectors.toList()); + protected Iterable getKnownStairs() { + return ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); } - protected Iterable getKnownSlabs() { - return ModRegistry.SLABBLOCKS.getEntries() - .stream().map(RegistryObject::get) - .collect(Collectors.toList()); + protected Iterable getKnownSlabs() { + return ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); } protected Iterable getKnownWalls() { - return ModRegistry.WALLBLOCKS.getEntries() - .stream().map(RegistryObject::get) - .collect(Collectors.toList()); - + return ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); } - protected Iterable getunKnownBlocks() { - return ModRegistry.PILLARBLOCKS.getEntries() - .stream().map(RegistryObject::get) - .collect(Collectors.toList()); + protected Iterable getUnknownBlocks() { + return ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); } } - @Override - protected void validate(Map map, ValidationContext validationtracker) - { - map.forEach((name, table) -> net.minecraft.world.level.storage.loot.LootTables.validate(validationtracker, name, table)); - } - + @Override + protected void validate( + Map map, + ValidationContext validationTracker + ) { + map.forEach((name, table) -> + net.minecraft.world.level.storage.loot.LootTables.validate( + validationTracker, + name, + table + ) + ); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java index f069afb9..6c9d3b0c 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java @@ -1,8 +1,9 @@ package com.thevortex.allthemodium.datagen.server; import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; +import java.util.function.Consumer; import net.allthemods.alltheores.infos.ItemTagRegistry; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.data.*; @@ -10,198 +11,305 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; -import java.util.function.Consumer; - public class ShapelessCrafting extends RecipeProvider { -private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation(Reference.MOD_ID,typeIn + "_from_" + typeOut); -} + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut + ); + } + @Override protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; ShapelessRecipeBuilder - .shapeless(ModRegistry.DEMONIC_PLANKS.get(),4) - .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get())) - .save(consumer,recipeDir("demonic_planks","shapelesscrafting")); + .shapeless(ModRegistry.DEMONIC_PLANKS.get(), 4) + .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get()) + ) + .save(consumer, recipeDir("demonic_planks", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(),4) - .requires(ModRegistry.SOUL_LOG_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get())) - .save(consumer,recipeDir("soul_planks","shapelesscrafting")); + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get()) + ) + .save(consumer, recipeDir("soul_planks", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(),4) - .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get())) - .save(consumer,recipeDir("soul_planks_0","shapelesscrafting")); + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get()) + ) + .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(),4) - .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get())) - .save(consumer,recipeDir("soul_planks_1","shapelesscrafting")); + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get()) + ) + .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(),4) - .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get())) - .save(consumer,recipeDir("soul_planks_2","shapelesscrafting")); + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get()) + ) + .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4) - .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get())) - .save(consumer,recipeDir("ancient_planks","shapelesscrafting")); + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_planks", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4) - .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get())) - .save(consumer,recipeDir("ancient_planks_1","shapelesscrafting")); + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4) - .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get())) - .save(consumer,recipeDir("ancient_planks_2","shapelesscrafting")); + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4) - .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get())) - .save(consumer,recipeDir("ancient_planks_3","shapelesscrafting")); + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_planks_3", "shapelesscrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(),1) - .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) - .requires(Items.VINE) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer,recipeDir("ancient_mossy_stone","vinecrafting")); + .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) + .requires(Items.VINE) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_mossy_stone", "vinecrafting")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(),1) - .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) - .requires(Items.HONEYCOMB) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get())) - .save(consumer,recipeDir("ancient_polished_stone","waxing")); - + .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) + .requires(Items.HONEYCOMB) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_polished_stone", "waxing")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(),1) - .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy(hasCondition,RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM).build())) - .save(consumer,recipeDir("ancient_cracked_stone_bricks","crushing")); + .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .build() + ) + ) + .save( + consumer, + recipeDir("ancient_cracked_stone_bricks", "crushing") + ); ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(),1) - .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy(hasCondition,RecipeProvider.inventoryTrigger(ItemPredicate.Builder.item().of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM).build())) - .save(consumer,recipeDir("ancient_chiseled_stone_bricks","crushing")); + .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .build() + ) + ) + .save( + consumer, + recipeDir("ancient_chiseled_stone_bricks", "crushing") + ); ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(),2) - .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer,recipeDir("allthemodium_dust","ore_crushing")); + .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) + ) + .save(consumer, recipeDir("allthemodium_dust", "ore_crushing")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(),9) - .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("allthemodium_ingot","block")); + .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()) + ) + .save(consumer, recipeDir("allthemodium_ingot", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(),9) - .requires(TagRegistry.ALLTHEMODIUM_INGOT) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get())) - .save(consumer,recipeDir("allthemodium_nugget","ingot")); + .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get()) + ) + .save(consumer, recipeDir("allthemodium_nugget", "ingot")); ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_DUST.get(),2) - .requires(ModRegistry.RAW_VIBRANIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer,recipeDir("vibranium_dust","ore_crushing")); - + .shapeless(ModRegistry.VIBRANIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_VIBRANIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) + ) + .save(consumer, recipeDir("vibranium_dust", "ore_crushing")); ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(),2) - .requires(ModRegistry.RAW_UNOBTAINIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer,recipeDir("unobtainium_dust","ore_crushing")); + .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_UNOBTAINIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) + ) + .save(consumer, recipeDir("unobtainium_dust", "ore_crushing")); ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_INGOT.get(),9) - .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("vibranium_ingot","block")); + .shapeless(ModRegistry.VIBRANIUM_INGOT.get(), 9) + .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()) + ) + .save(consumer, recipeDir("vibranium_ingot", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(),9) - .requires(TagRegistry.VIBRANIUM_INGOT) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get())) - .save(consumer,recipeDir("vibranium_nugget","ingot")); + .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9) + .requires(TagRegistry.VIBRANIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get()) + ) + .save(consumer, recipeDir("vibranium_nugget", "ingot")); ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(),9) - .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("unobtainium_ingot","block")); + .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()) + ) + .save(consumer, recipeDir("unobtainium_ingot", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(),9) - .requires(TagRegistry.UNOBTAINIUM_INGOT) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get())) - .save(consumer,recipeDir("unobtainium_nugget","ingot")); + .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get()) + ) + .save(consumer, recipeDir("unobtainium_nugget", "ingot")); ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(),9) - .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("raw_allthemodium","block")); + .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(), 9) + .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has( + ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get() + ) + ) + .save(consumer, recipeDir("raw_allthemodium", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_VIBRANIUM.get(),9) - .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("raw_vibranium","block")); + .shapeless(ModRegistry.RAW_VIBRANIUM.get(), 9) + .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()) + ) + .save(consumer, recipeDir("raw_vibranium", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(),9) - .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get())) - .save(consumer,recipeDir("raw_unobtainium","block")); - + .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(), 9) + .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()) + ) + .save(consumer, recipeDir("raw_unobtainium", "block")); ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(),9) - .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get())) - .save(consumer,recipeDir("unobtainium_allthemodium_alloy_ingot","block")); + .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get()) + ) + .save( + consumer, + recipeDir("unobtainium_allthemodium_alloy_ingot", "block") + ); ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(),9) - .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get())) - .save(consumer,recipeDir("unobtainium_vibranium_alloy_ingot","block")); + .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get()) + ) + .save( + consumer, + recipeDir("unobtainium_vibranium_alloy_ingot", "block") + ); ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(),9) - .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get())) - .save(consumer,recipeDir("vibranium_allthemodium_alloy_ingot","block")); - - -} + .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get()) + ) + .save( + consumer, + recipeDir("vibranium_allthemodium_alloy_ingot", "block") + ); + } public ShapelessCrafting(DataGenerator generatorIn) { super(generatorIn); diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java index e1fd972a..2411ec86 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java @@ -1,8 +1,8 @@ package com.thevortex.allthemodium.datagen.server; - import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.function.Consumer; import net.minecraft.data.DataGenerator; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeProvider; @@ -10,54 +10,112 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.Ingredient; -import java.util.function.Consumer; - public class SmeltingRecipes extends RecipeProvider { + public SmeltingRecipes(DataGenerator generator) { super(generator); } + private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation(Reference.MOD_ID,typeIn + "_from_" + typeOut); + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut + ); } + @Override protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()),ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer,recipeDir("ancient_smooth_stone","ancient_stone")); + .smelting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) + ) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()),ModRegistry.ALLTHEMODIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer,recipeDir("allthemodium_ingot","raw")); + .smelting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) + ) + .save(consumer, recipeDir("allthemodium_ingot", "raw")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()),ModRegistry.VIBRANIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer,recipeDir("vibranium_ingot","raw")); + .smelting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) + ) + .save(consumer, recipeDir("vibranium_ingot", "raw")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()),ModRegistry.UNOBTAINIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer,recipeDir("unobtainium_ingot","raw")); + .smelting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) + ) + .save(consumer, recipeDir("unobtainium_ingot", "raw")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()),ModRegistry.ALLTHEMODIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) - .save(consumer,recipeDir("allthemodium_ingot","dust")); + .smelting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get()) + ) + .save(consumer, recipeDir("allthemodium_ingot", "dust")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()),ModRegistry.VIBRANIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) - .save(consumer,recipeDir("vibranium_ingot","dust")); + .smelting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get()) + ) + .save(consumer, recipeDir("vibranium_ingot", "dust")); SimpleCookingRecipeBuilder - .smelting(Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()),ModRegistry.UNOBTAINIUM_INGOT.get(),0.15f,200) - .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) - .save(consumer,recipeDir("unobtainium_ingot","dust")); - + .smelting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200 + ) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get()) + ) + .save(consumer, recipeDir("unobtainium_ingot", "dust")); } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/package-info.java b/src/main/java/com/thevortex/allthemodium/datagen/server/package-info.java index 37d4296b..97e137a3 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/package-info.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/package-info.java @@ -1,5 +1,4 @@ @ParametersAreNonnullByDefault package com.thevortex.allthemodium.datagen.server; - import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java index cb432326..ea4a1234 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java @@ -1,6 +1,9 @@ package com.thevortex.allthemodium.entity; import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.EnumSet; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; @@ -17,14 +20,11 @@ import net.minecraft.world.entity.monster.*; import net.minecraft.world.entity.monster.piglin.Piglin; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.projectile.LargeFireball; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.NaturalSpawner; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraft.world.phys.Vec3; -import org.jetbrains.annotations.Nullable; import software.bernie.geckolib3.core.IAnimatable; import software.bernie.geckolib3.core.PlayState; import software.bernie.geckolib3.core.builder.AnimationBuilder; @@ -33,116 +33,196 @@ import software.bernie.geckolib3.core.manager.AnimationData; import software.bernie.geckolib3.core.manager.AnimationFactory; -import java.util.EnumSet; - - public class PiglichEntity extends Piglin implements IAnimatable { + private final SimpleContainer inventory = new SimpleContainer(8); private AnimationFactory factory = new AnimationFactory(this); private boolean isSummoning = false; + public PiglichEntity(EntityType type, Level world) { - super(type, world); - this.setImmuneToZombification(true); - this.registerGoals(); - } + super(type, world); + this.setImmuneToZombification(true); + this.registerGoals(); + } @Override - public boolean canAttack(LivingEntity entity) { - if(entity instanceof Player) { - if(((Player)entity).isCreative()) { return false; } + public boolean canAttack(@Nonnull LivingEntity entity) { + if (entity instanceof Player) { + if (((Player) entity).isCreative()) { + return false; + } } return true; } - protected void populateDefaultEquipementSlots(DifficultyInstance diff) { - if (this.isAdult()) { - this.maybeWearArmor(EquipmentSlot.HEAD, new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get())); - this.maybeWearArmor(EquipmentSlot.CHEST, new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())); - this.maybeWearArmor(EquipmentSlot.LEGS, new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get())); - this.maybeWearArmor(EquipmentSlot.FEET, new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get())); - } - + protected void populateDefaultEquipmentSlots(DifficultyInstance diff) { + if (this.isAdult()) { + this.maybeWearArmor( + EquipmentSlot.HEAD, + new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get()) + ); + this.maybeWearArmor( + EquipmentSlot.CHEST, + new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()) + ); + this.maybeWearArmor( + EquipmentSlot.LEGS, + new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()) + ); + this.maybeWearArmor( + EquipmentSlot.FEET, + new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get()) + ); } + } + private void maybeWearArmor(EquipmentSlot slot, ItemStack stack) { if (this.level.random.nextFloat() < 0.5F) { this.setItemSlot(slot, stack); } - } + @Override - public void addAdditionalSaveData(CompoundTag tag) { + public void addAdditionalSaveData(@Nonnull CompoundTag tag) { super.addAdditionalSaveData(tag); tag.put("Inventory", this.inventory.createTag()); } + @Override - public void readAdditionalSaveData(CompoundTag tag) { + public void readAdditionalSaveData(@Nonnull CompoundTag tag) { super.readAdditionalSaveData(tag); this.inventory.fromTag(tag.getList("Inventory", 10)); } - @Override - protected void registerGoals() { - this.goalSelector.addGoal(3, new MeleeAttackGoal(this,3.0D,true)); - this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this,0.9D,32.0F)); - this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); - this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, Skeleton.class, true)); - this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, WitherSkeleton.class, true)); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); - this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Player.class, true)); - this.goalSelector.addGoal(4, new LookAtPlayerGoal(this, Player.class, 8.0F)); - this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); - this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); - - } + @Override + protected void registerGoals() { + this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 3.0D, true)); + this.goalSelector.addGoal( + 2, + new MoveTowardsTargetGoal(this, 0.9D, 32.0F) + ); + this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + Skeleton.class, + true + ) + ); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + WitherSkeleton.class, + true + ) + ); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); + this.targetSelector.addGoal( + 3, + new NearestAttackableTargetGoal( + this, + Player.class, + true + ) + ); + this.goalSelector.addGoal( + 4, + new LookAtPlayerGoal(this, Player.class, 8.0F) + ); + this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); + this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); + } - @Override - public MobType getMobType() { - return MobType.UNDEFINED; - } + @Override + public MobType getMobType() { + return MobType.UNDEFINED; + } private ItemStack createSpawnWeapon() { - return (double)this.random.nextFloat() < 0.4D ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) : new ItemStack(Items.NETHERITE_SWORD); + return (double) this.random.nextFloat() < 0.4D + ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) + : new ItemStack(Items.NETHERITE_SWORD); } @Override public void setImmuneToZombification(boolean p_34671_) { super.setImmuneToZombification(true); } + @Override - public SpawnGroupData finalizeSpawn(ServerLevelAccessor sla, DifficultyInstance difficultyInstance, MobSpawnType mobSpawnType, @Nullable SpawnGroupData spawnGroupData, @Nullable CompoundTag tag) { + public SpawnGroupData finalizeSpawn( + @Nonnull ServerLevelAccessor sla, + @Nonnull DifficultyInstance difficultyInstance, + @Nonnull MobSpawnType mobSpawnType, + @Nullable SpawnGroupData spawnGroupData, + @Nullable CompoundTag tag + ) { if (mobSpawnType != MobSpawnType.STRUCTURE) { - - this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); - + this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); } - this.populateDefaultEquipementSlots(difficultyInstance); - return super.finalizeSpawn(sla, difficultyInstance, mobSpawnType, spawnGroupData, tag); + this.populateDefaultEquipmentSlots(difficultyInstance); + return super.finalizeSpawn( + sla, + difficultyInstance, + mobSpawnType, + spawnGroupData, + tag + ); } public static AttributeSupplier.Builder createAttributes() { - return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED,0.21F).add(Attributes.ATTACK_DAMAGE,12).add(Attributes.ARMOR,24).add(Attributes.ARMOR_TOUGHNESS,24).add(Attributes.MAX_HEALTH,9999); + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 12) + .add(Attributes.ARMOR, 24) + .add(Attributes.ARMOR_TOUGHNESS, 24) + .add(Attributes.MAX_HEALTH, 9999); } - private PlayState predicate(AnimationEvent event) { - - if(event.isMoving()) { - event.getController().setAnimation(new AnimationBuilder().addAnimation("walk.piglich.nik", true)); + private PlayState predicate( + AnimationEvent event + ) { + if (event.isMoving()) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("walk.piglich.nik", true) + ); return PlayState.CONTINUE; } - if(this.isSummoning) { - event.getController().setAnimation(new AnimationBuilder().addAnimation("summon.piglich.nik", true)); + if (this.isSummoning) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("summon.piglich.nik", true) + ); return PlayState.CONTINUE; } - event.getController().setAnimation(new AnimationBuilder().addAnimation("idle.piglich.nik",true)); + event + .getController() + .setAnimation( + new AnimationBuilder().addAnimation("idle.piglich.nik", true) + ); return PlayState.CONTINUE; - - } + @Override public void registerControllers(AnimationData animationData) { - animationData.addAnimationController(new AnimationController(this,"controller",0,this::predicate)); + animationData.addAnimationController( + new AnimationController( + this, + "controller", + 0, + this::predicate + ) + ); } @Override @@ -151,20 +231,26 @@ public AnimationFactory getFactory() { } static class PigLichAttackGoal extends Goal { + private final PiglichEntity piglich; private int attackStep; private int attackTime; private int lastSeen; - public PigLichAttackGoal(PiglichEntity p_32247_) { this.piglich = p_32247_; - this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET)); + this.setFlags( + EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET) + ); } public boolean canUse() { - LivingEntity livingentity = this.piglich.getTarget(); - return livingentity != null && livingentity.isAlive() && this.piglich.canAttack(livingentity); + LivingEntity livingEntity = this.piglich.getTarget(); + return ( + livingEntity != null && + livingEntity.isAlive() && + this.piglich.canAttack(livingEntity) + ); } public void start() { @@ -179,18 +265,20 @@ public boolean requiresUpdateEveryTick() { return true; } + @SuppressWarnings("unused") public void tick() { --this.attackTime; - LivingEntity livingentity = this.piglich.getTarget(); - if (livingentity != null) { - boolean flag = this.piglich.getSensing().hasLineOfSight(livingentity); + LivingEntity livingEntity = this.piglich.getTarget(); + if (livingEntity != null) { + boolean flag = + this.piglich.getSensing().hasLineOfSight(livingEntity); if (flag) { this.lastSeen = 0; } else { ++this.lastSeen; } - double d0 = this.piglich.distanceToSqr(livingentity); + double d0 = this.piglich.distanceToSqr(livingEntity); if (d0 < 4.0D) { if (!flag) { return; @@ -198,48 +286,71 @@ public void tick() { if (this.attackTime <= 0) { this.attackTime = 20; - this.piglich.doHurtTarget(livingentity); + this.piglich.doHurtTarget(livingEntity); } - this.piglich.getMoveControl().setWantedPosition(livingentity.getX(), livingentity.getY(), livingentity.getZ(), 1.0D); - } else if (d0 < this.getFollowDistance() * this.getFollowDistance() && flag) { - double d1 = livingentity.getX() - this.piglich.getX(); - double d2 = livingentity.getY(0.5D) - this.piglich.getY(0.5D); - double d3 = livingentity.getZ() - this.piglich.getZ(); + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D + ); + } else if ( + d0 < this.getFollowDistance() * this.getFollowDistance() && + flag + ) { + double d1 = livingEntity.getX() - this.piglich.getX(); + double d2 = + livingEntity.getY(0.5D) - this.piglich.getY(0.5D); + double d3 = livingEntity.getZ() - this.piglich.getZ(); if (this.attackTime <= 0) { ++this.attackStep; if (this.attackStep == 1) { this.attackTime = 60; - } else if (this.attackStep <= 4) { this.attackTime = 6; } else { this.attackTime = 100; this.attackStep = 0; - } if (this.attackStep > 1) { double d4 = Math.sqrt(Math.sqrt(d0)) * 0.5D; if (!this.piglich.isSilent()) { - this.piglich.level.levelEvent((Player)null, 1018, this.piglich.blockPosition(), 0); + this.piglich.level.levelEvent( + (Player) null, + 1018, + this.piglich.blockPosition(), + 0 + ); } + // for (int i = 0; i < 3; ++i) { + // Vec3 vec3 = this.piglich.getViewVector(1.0F); + // this.piglich.isSummoning = true; + // LargeFireball largeFireball = new LargeFireball(this.piglich.level, this.piglich, d2, + // d3, d4, + // (int) this.piglich.getHealth()); + // largeFireball.setPos(this.piglich.getX() + + // vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, + // largeFireball.getZ() + vec3.z + // * 4.0D); + // this.piglich.level.addFreshEntity(largeFireball); + // } - /* for(int i = 0; i < 3; ++i) { - Vec3 vec3 = this.piglich.getViewVector(1.0F); - this.piglich.isSummoning = true; - LargeFireball largefireball = new LargeFireball(this.piglich.level, this.piglich, d2, d3, d4, (int)this.piglich.getHealth()); - largefireball.setPos(this.piglich.getX() + vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, largefireball.getZ() + vec3.z * 4.0D); - this.piglich.level.addFreshEntity(largefireball); - } - - */ } } - this.piglich.getLookControl().setLookAt(livingentity, 10.0F, 10.0F); + this.piglich.getLookControl() + .setLookAt(livingEntity, 10.0F, 10.0F); } else if (this.lastSeen < 5) { - this.piglich.getMoveControl().setWantedPosition(livingentity.getX(), livingentity.getY(), livingentity.getZ(), 1.0D); + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D + ); } super.tick(); @@ -252,19 +363,21 @@ private double getFollowDistance() { } @Override - public boolean hurt(DamageSource source, float damage) { + public boolean hurt(@Nonnull DamageSource source, float damage) { if (!super.hurt(source, damage)) { return false; } else if (!(this.level instanceof ServerLevel)) { return false; } else { - ServerLevel serverlevel = (ServerLevel)this.level; - LivingEntity livingentity = this.getTarget(); - if (livingentity == null && source.getEntity() instanceof LivingEntity) { - livingentity = (LivingEntity)source.getEntity(); + LivingEntity livingEntity = this.getTarget(); + if ( + livingEntity == null && + source.getEntity() instanceof LivingEntity + ) { + livingEntity = (LivingEntity) source.getEntity(); } - if (!(livingentity instanceof Player)) { + if (!(livingEntity instanceof Player)) { return false; } else { int i = Mth.floor(this.getX()); @@ -274,42 +387,93 @@ public boolean hurt(DamageSource source, float damage) { } } } - protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { - ServerLevel serverlevel = (ServerLevel)piglich.level; - LivingEntity livingentity = piglich.getTarget(); + protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { + ServerLevel serverLevel = (ServerLevel) piglich.level; + LivingEntity livingEntity = piglich.getTarget(); int mobType = Mth.nextInt(piglich.random, 1, 6); - Monster spawnmob = (Monster)EntityType.PIGLIN_BRUTE.create(piglich.level); - switch(mobType) { + Monster spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create( + piglich.level + ); + switch (mobType) { case 1: - spawnmob = (Monster)EntityType.PIGLIN_BRUTE.create(piglich.level); + spawnMob = + (Monster) EntityType.PIGLIN_BRUTE.create(piglich.level); case 2: - spawnmob = (Monster)EntityType.BLAZE.create(piglich.level); + spawnMob = (Monster) EntityType.BLAZE.create(piglich.level); case 3: - spawnmob = (Monster)EntityType.ENDERMAN.create(piglich.level); + spawnMob = (Monster) EntityType.ENDERMAN.create(piglich.level); case 4: - spawnmob = (Monster)EntityType.EVOKER.create(piglich.level); + spawnMob = (Monster) EntityType.EVOKER.create(piglich.level); case 5: - spawnmob = (Monster)EntityType.VINDICATOR.create(piglich.level); + spawnMob = + (Monster) EntityType.VINDICATOR.create(piglich.level); case 6: - spawnmob = (Monster)EntityType.WITCH.create(piglich.level); + spawnMob = (Monster) EntityType.WITCH.create(piglich.level); default: - for(int l = 0; l < 5; ++l) { - int i1 = i + Mth.nextInt(piglich.random, 7, 40) * Mth.nextInt(piglich.random, -1, 1); - int j1 = j + Mth.nextInt(piglich.random, 7, 40) * Mth.nextInt(piglich.random, -1, 1); - int k1 = k + Mth.nextInt(piglich.random, 7, 40) * Mth.nextInt(piglich.random, -1, 1); - BlockPos blockpos = new BlockPos(i1, j1, k1); - EntityType entitytype = spawnmob.getType(); - SpawnPlacements.Type spawnplacements$type = SpawnPlacements.getPlacementType(entitytype); - if (NaturalSpawner.isSpawnPositionOk(spawnplacements$type, piglich.level, blockpos, entitytype) && SpawnPlacements.checkSpawnRules(entitytype, serverlevel, MobSpawnType.REINFORCEMENT, blockpos, piglich.level.random)) { - spawnmob.setPos((double)i1, (double)j1, (double)k1); - if (!piglich.level.hasNearbyAlivePlayer((double)i1, (double)j1, (double)k1, 7.0D) && piglich.level.isUnobstructed(spawnmob) && piglich.level.noCollision(spawnmob) && !piglich.level.containsAnyLiquid(spawnmob.getBoundingBox())) { - if (livingentity != null) { - spawnmob.setTarget(livingentity); + for (int l = 0; l < 5; ++l) { + int i1 = + i + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int j1 = + j + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int k1 = + k + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + BlockPos blockPos = new BlockPos(i1, j1, k1); + + if (spawnMob == null) return false; + + EntityType entityType = spawnMob.getType(); + SpawnPlacements.Type spawnPlacements$type = + SpawnPlacements.getPlacementType(entityType); + if ( + NaturalSpawner.isSpawnPositionOk( + spawnPlacements$type, + piglich.level, + blockPos, + entityType + ) && + SpawnPlacements.checkSpawnRules( + entityType, + serverLevel, + MobSpawnType.REINFORCEMENT, + blockPos, + piglich.level.random + ) + ) { + spawnMob.setPos((double) i1, (double) j1, (double) k1); + if ( + !piglich.level.hasNearbyAlivePlayer( + (double) i1, + (double) j1, + (double) k1, + 7.0D + ) && + piglich.level.isUnobstructed(spawnMob) && + piglich.level.noCollision(spawnMob) && + !piglich.level.containsAnyLiquid( + spawnMob.getBoundingBox() + ) + ) { + if (livingEntity != null) { + spawnMob.setTarget(livingEntity); } - spawnmob.finalizeSpawn(serverlevel, piglich.level.getCurrentDifficultyAt(spawnmob.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData)null, (CompoundTag)null); - serverlevel.addFreshEntityWithPassengers(spawnmob); + spawnMob.finalizeSpawn( + serverLevel, + piglich.level.getCurrentDifficultyAt( + spawnMob.blockPosition() + ), + MobSpawnType.REINFORCEMENT, + (SpawnGroupData) null, + (CompoundTag) null + ); + serverLevel.addFreshEntityWithPassengers(spawnMob); } } } @@ -317,5 +481,4 @@ protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { return true; } } - } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java index ccc7a648..c19eabe8 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java @@ -1,96 +1,410 @@ package com.thevortex.allthemodium.entity; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; import com.thevortex.allthemodium.reference.Reference; -import net.minecraft.client.model.*; import net.minecraft.client.model.geom.ModelLayerLocation; -import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; -import net.minecraft.client.renderer.RenderType; import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.Mth; -import net.minecraft.world.entity.*; -import net.minecraft.world.entity.monster.piglin.AbstractPiglin; -import net.minecraft.world.entity.monster.piglin.Piglin; -import net.minecraft.world.entity.monster.piglin.PiglinArmPose; -import software.bernie.geckolib3.core.IAnimatable; import software.bernie.geckolib3.model.AnimatedGeoModel; -import java.util.Random; - public class PiglichModel extends AnimatedGeoModel { + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main" + ); - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "piglich"),"main"); - - public PiglichModel() { - } + public PiglichModel() {} + @SuppressWarnings("unused") public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); - PartDefinition head = partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(84, 0).addBox(-5.0F, -14.0F, -4.0F, 10.0F, 8.0F, 8.0F, new CubeDeformation(0.5F)) - .texOffs(48, 0).addBox(-5.1F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, new CubeDeformation(0.35F)) - .texOffs(0, 0).addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, new CubeDeformation(0.0F)) - .texOffs(29, 1).addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(2, 0).addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(2, 4).addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -4.0F, -3.0F)); + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(84, 0) + .addBox( + -5.0F, + -14.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.5F) + ) + .texOffs(48, 0) + .addBox( + -5.1F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.35F) + ) + .texOffs(0, 0) + .addBox( + -5.0F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F) + ) + .texOffs(29, 1) + .addBox( + -2.0F, + -4.0F, + -5.0F, + 4.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.0F) + ) + .texOffs(2, 0) + .addBox( + -3.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F) + ) + .texOffs(2, 4) + .addBox( + 2.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F) + ), + PartPose.offset(0.0F, -4.0F, -3.0F) + ); - PartDefinition righTear_r1 = head.addOrReplaceChild("righTear_r1", CubeListBuilder.create().texOffs(104, 18).addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F)); + PartDefinition rightEar_r1 = head.addOrReplaceChild( + "rightEar_r1", + CubeListBuilder + .create() + .texOffs(104, 18) + .addBox( + -1.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F) + ); - PartDefinition leftTear_r1 = head.addOrReplaceChild("leftTear_r1", CubeListBuilder.create().texOffs(115, 18).addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F)); + PartDefinition leftEar_r1 = head.addOrReplaceChild( + "leftEar_r1", + CubeListBuilder + .create() + .texOffs(115, 18) + .addBox( + 0.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F) + ); - PartDefinition leftHornTop_r1 = head.addOrReplaceChild("leftHornTop_r1", CubeListBuilder.create().texOffs(88, 0).addBox(0.0F, -4.0F, 0.0F, 1.0F, 4.0F, 1.0F, new CubeDeformation(0.3F)), PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F)); + PartDefinition leftHornTop_r1 = head.addOrReplaceChild( + "leftHornTop_r1", + CubeListBuilder + .create() + .texOffs(88, 0) + .addBox( + 0.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F) + ), + PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F) + ); - PartDefinition leftHorn_r1 = head.addOrReplaceChild("leftHorn_r1", CubeListBuilder.create().texOffs(76, 0).addBox(-1.0F, -4.0F, -1.0F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F)); + PartDefinition leftHorn_r1 = head.addOrReplaceChild( + "leftHorn_r1", + CubeListBuilder + .create() + .texOffs(76, 0) + .addBox( + -1.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F) + ); - PartDefinition rightHorn_r1 = head.addOrReplaceChild("rightHorn_r1", CubeListBuilder.create().texOffs(44, 0).addBox(-2.0F, -4.0F, -1.0F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F)); + PartDefinition rightHorn_r1 = head.addOrReplaceChild( + "rightHorn_r1", + CubeListBuilder + .create() + .texOffs(44, 0) + .addBox( + -2.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F) + ); - PartDefinition rightHornTop_r1 = head.addOrReplaceChild("rightHornTop_r1", CubeListBuilder.create().texOffs(40, 0).addBox(-1.0F, -4.0F, 0.0F, 1.0F, 4.0F, 1.0F, new CubeDeformation(0.3F)), PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F)); + PartDefinition rightHornTop_r1 = head.addOrReplaceChild( + "rightHornTop_r1", + CubeListBuilder + .create() + .texOffs(40, 0) + .addBox( + -1.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F) + ), + PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F) + ); - PartDefinition body = partdefinition.addOrReplaceChild("body", CubeListBuilder.create().texOffs(81, 38).addBox(-5.0F, -7.0F, -3.0F, 10.0F, 10.0F, 6.0F, new CubeDeformation(0.2F)) - .texOffs(33, 35).addBox(-3.0F, -7.0F, -2.0F, 6.0F, 7.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 10.0F, 2.0F)); + PartDefinition body = partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(81, 38) + .addBox( + -5.0F, + -7.0F, + -3.0F, + 10.0F, + 10.0F, + 6.0F, + new CubeDeformation(0.2F) + ) + .texOffs(33, 35) + .addBox( + -3.0F, + -7.0F, + -2.0F, + 6.0F, + 7.0F, + 5.0F, + new CubeDeformation(0.0F) + ), + PartPose.offset(0.0F, 10.0F, 2.0F) + ); - PartDefinition bodyTop = body.addOrReplaceChild("bodyTop", CubeListBuilder.create().texOffs(48, 46).addBox(-6.0F, -10.0F, -4.0F, 12.0F, 10.0F, 8.0F, new CubeDeformation(0.5F)) - .texOffs(0, 40).addBox(-6.0F, -10.0F, -4.0F, 12.0F, 10.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); + PartDefinition bodyTop = body.addOrReplaceChild( + "bodyTop", + CubeListBuilder + .create() + .texOffs(48, 46) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.5F) + ) + .texOffs(0, 40) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F) + ); - PartDefinition leftArm = bodyTop.addOrReplaceChild("leftArm", CubeListBuilder.create().texOffs(84, 16).addBox(-2.0F, -2.0F, -3.0F, 4.0F, 15.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); + PartDefinition leftArm = bodyTop.addOrReplaceChild( + "leftArm", + CubeListBuilder + .create() + .texOffs(84, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F) + ); - PartDefinition rightArm = bodyTop.addOrReplaceChild("rightArm", CubeListBuilder.create().texOffs(64, 16).addBox(-2.0F, -2.0F, -3.0F, 4.0F, 15.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); + PartDefinition rightArm = bodyTop.addOrReplaceChild( + "rightArm", + CubeListBuilder + .create() + .texOffs(64, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F) + ); - PartDefinition leftLeg = partdefinition.addOrReplaceChild("leftLeg", CubeListBuilder.create().texOffs(48, 16).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.5F)) - .texOffs(32, 16).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, 12.0F, 1.0F, -0.6109F, 0.6109F, 0.0F)); + PartDefinition leftLeg = partDefinition.addOrReplaceChild( + "leftLeg", + CubeListBuilder + .create() + .texOffs(48, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F) + ) + .texOffs(32, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation( + -2.0F, + 12.0F, + 1.0F, + -0.6109F, + 0.6109F, + 0.0F + ) + ); - PartDefinition leftLegDown = leftLeg.addOrReplaceChild("leftLegDown", CubeListBuilder.create().texOffs(16, 28).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(-0.1F)), PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); + PartDefinition leftLegDown = leftLeg.addOrReplaceChild( + "leftLegDown", + CubeListBuilder + .create() + .texOffs(16, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F) + ), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F) + ); - PartDefinition rightLeg = partdefinition.addOrReplaceChild("rightLeg", CubeListBuilder.create().texOffs(16, 16).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.5F)) - .texOffs(0, 16).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, 12.0F, 1.0F, -0.6109F, -0.6109F, 0.0F)); + PartDefinition rightLeg = partDefinition.addOrReplaceChild( + "rightLeg", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F) + ) + .texOffs(0, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation( + 2.0F, + 12.0F, + 1.0F, + -0.6109F, + -0.6109F, + 0.0F + ) + ); - PartDefinition rightLegDown = rightLeg.addOrReplaceChild("rightLegDown", CubeListBuilder.create().texOffs(0, 28).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 8.0F, 4.0F, new CubeDeformation(-0.1F)), PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); + PartDefinition rightLegDown = rightLeg.addOrReplaceChild( + "rightLegDown", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F) + ), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F) + ); - return LayerDefinition.create(meshdefinition, 128, 64); + return LayerDefinition.create(meshDefinition, 128, 64); } - - - - - @Override public ResourceLocation getModelResource(PiglichEntity piglichEntity) { - return new ResourceLocation(Reference.MOD_ID,"geo/piglich_anim.geo.json"); + return new ResourceLocation( + Reference.MOD_ID, + "geo/piglich_anim.geo.json" + ); } @Override public ResourceLocation getTextureResource(PiglichEntity piglichEntity) { - return new ResourceLocation(Reference.MOD_ID,"textures/entity/piglich.png"); + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png" + ); } @Override public ResourceLocation getAnimationResource(PiglichEntity piglichEntity) { - return new ResourceLocation(Reference.MOD_ID,"animations/piglich.animation.json"); + return new ResourceLocation( + Reference.MOD_ID, + "animations/piglich.animation.json" + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java index 0afec18b..faa453e3 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelPart; @@ -15,39 +16,113 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.entity.Mob; -import java.util.Random; - +@SuppressWarnings("unused") // TODO: Determine if we will keep this model around public class PiglichModelOld extends PlayerModel { - public final ModelPart rightEar = this.head.getChild("right_ear"); + + private final ModelPart rightEar = this.head.getChild("right_ear"); private final ModelPart leftEar = this.head.getChild("left_ear"); private final PartPose bodyDefault = this.body.storePose(); private final PartPose headDefault = this.head.storePose(); private final PartPose leftArmDefault = this.leftArm.storePose(); private final PartPose rightArmDefault = this.rightArm.storePose(); - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "piglich"),"main"); + + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main" + ); public PiglichModelOld(ModelPart p_170821_, boolean p_170822_) { super(p_170821_, p_170822_); } - public static MeshDefinition createMesh() { - CubeDeformation cubeDeformation = CubeDeformation.NONE; - MeshDefinition meshdefinition = PlayerModel.createMesh(cubeDeformation,false); - PartDefinition partdefinition = meshdefinition.getRoot(); - partdefinition.addOrReplaceChild("body", CubeListBuilder.create().texOffs(16, 16).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), PartPose.ZERO); - PartDefinition partdefinition1 = partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation).texOffs(31, 1).addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation).texOffs(2, 4).addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation).texOffs(2, 0).addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), PartPose.ZERO); - partdefinition1.addOrReplaceChild("left_ear", CubeListBuilder.create().texOffs(51, 6).addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), PartPose.offsetAndRotation(4.5F, -6.0F, 0.0F, 0.0F, 0.0F, (-(float)Math.PI / 6F))); - partdefinition1.addOrReplaceChild("right_ear", CubeListBuilder.create().texOffs(39, 6).addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), PartPose.offsetAndRotation(-4.5F, -6.0F, 0.0F, 0.0F, 0.0F, ((float)Math.PI / 6F))); - - partdefinition1.addOrReplaceChild("hat", CubeListBuilder.create(), PartPose.ZERO); - partdefinition1.addOrReplaceChild("right_arm", CubeListBuilder.create(), PartPose.ZERO); - partdefinition1.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); - partdefinition1.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); - partdefinition1.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - - return meshdefinition; + MeshDefinition meshDefinition = PlayerModel.createMesh( + cubeDeformation, + false + ); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), + PartPose.ZERO + ); + PartDefinition partDefinition1 = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation) + .texOffs(31, 1) + .addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation) + .texOffs(2, 4) + .addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation) + .texOffs(2, 0) + .addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), + PartPose.ZERO + ); + partDefinition1.addOrReplaceChild( + "left_ear", + CubeListBuilder + .create() + .texOffs(51, 6) + .addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + 4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + (-(float) Math.PI / 6F) + ) + ); + partDefinition1.addOrReplaceChild( + "right_ear", + CubeListBuilder + .create() + .texOffs(39, 6) + .addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + -4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + ((float) Math.PI / 6F) + ) + ); + + partDefinition1.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition1.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition1.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition1.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition1.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO + ); + + return meshDefinition; } @Override @@ -56,12 +131,22 @@ protected Iterable bodyParts() { } @Override - public void renderEars(PoseStack stack, VertexConsumer consumer, int p_103404_, int p_103405_) { + public void renderEars( + @Nonnull PoseStack stack, + @Nonnull VertexConsumer consumer, + int p_103404_, + int p_103405_ + ) { super.renderEars(stack, consumer, p_103404_, p_103405_); } @Override - public void renderCloak(PoseStack p_103412_, VertexConsumer p_103413_, int p_103414_, int p_103415_) { + public void renderCloak( + @Nonnull PoseStack p_103412_, + @Nonnull VertexConsumer p_103413_, + int p_103414_, + int p_103415_ + ) { super.renderCloak(p_103412_, p_103413_, p_103414_, p_103415_); } @@ -71,37 +156,74 @@ public void setAllVisible(boolean p_103419_) { } @Override - public ModelPart getRandomModelPart(RandomSource p_103407_) { + public ModelPart getRandomModelPart(@Nonnull RandomSource p_103407_) { return super.getRandomModelPart(p_103407_); } - public void setupAnim(T p_103366_, float p_103367_, float p_103368_, float p_103369_, float p_103370_, float p_103371_) { - super.setupAnim(p_103366_, p_103367_, p_103368_, p_103369_, p_103370_, p_103371_); + public void setupAnim( + @Nonnull T p_103366_, + float p_103367_, + float p_103368_, + float p_103369_, + float p_103370_, + float p_103371_ + ) { + super.setupAnim( + p_103366_, + p_103367_, + p_103368_, + p_103369_, + p_103370_, + p_103371_ + ); } - protected void setupAttackAnimation(T p_103363_, float p_103364_) { - super.setupAttackAnimation(p_103363_, p_103364_); + protected void setupAttackAnimation(@Nonnull T p_103363_, float p_103364_) { + super.setupAttackAnimation(p_103363_, p_103364_); } @Override - public void prepareMobModel(T p_102861_, float p_102862_, float p_102863_, float p_102864_) { + public void prepareMobModel( + @Nonnull T p_102861_, + float p_102862_, + float p_102863_, + float p_102864_ + ) { super.prepareMobModel(p_102861_, p_102862_, p_102863_, p_102864_); setPartVisibility(); } + @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha + ) { setPartVisibility(); - super.renderToBuffer(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha + ); } private void setPartVisibility() { - head.visible = true; - hat.visible = true; - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; + head.visible = true; + hat.visible = true; + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; } - } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java index 71947336..210454f1 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java @@ -3,36 +3,50 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.thevortex.allthemodium.reference.Reference; -import net.minecraft.client.model.geom.ModelPart; +import javax.annotation.Nullable; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; -import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.monster.piglin.Piglin; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import org.jetbrains.annotations.Nullable; -import software.bernie.geckolib3.model.AnimatedGeoModel; import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer; @OnlyIn(Dist.CLIENT) public class PiglichRenderer extends GeoEntityRenderer { public PiglichRenderer(EntityRendererProvider.Context context) { - super(context,new PiglichModel()); + super(context, new PiglichModel()); this.shadowRadius = 0.3f; } @Override public ResourceLocation getTextureLocation(PiglichEntity instance) { - return new ResourceLocation(Reference.MOD_ID, "textures/entity/piglich.png"); + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png" + ); } @Override - public RenderType getRenderType(PiglichEntity animatable, float partialTicks, PoseStack stack, @Nullable MultiBufferSource renderTypeBuffer, @Nullable VertexConsumer vertexBuilder, int packedLightIn, ResourceLocation textureLocation) { - stack.scale(1.1f,1.1f,1.1f); - return super.getRenderType(animatable, partialTicks, stack, renderTypeBuffer, vertexBuilder, packedLightIn, textureLocation); + public RenderType getRenderType( + PiglichEntity animatable, + float partialTicks, + PoseStack stack, + @Nullable MultiBufferSource renderTypeBuffer, + @Nullable VertexConsumer vertexBuilder, + int packedLightIn, + ResourceLocation textureLocation + ) { + stack.scale(1.1f, 1.1f, 1.1f); + return super.getRenderType( + animatable, + partialTicks, + stack, + renderTypeBuffer, + vertexBuilder, + packedLightIn, + textureLocation + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java index 21c68b67..b42c85bd 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java @@ -8,10 +8,21 @@ import net.minecraft.world.level.Level; public class ATMShulkerEntity extends Shulker { - public ATMShulkerEntity(EntityType p_33404_, Level p_33405_) { + + public ATMShulkerEntity( + EntityType p_33404_, + Level p_33405_ + ) { super(p_33404_, p_33405_); } + public static AttributeSupplier.Builder createAttributes() { - return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED,0.21F).add(Attributes.ATTACK_DAMAGE,4).add(Attributes.ARMOR,18).add(Attributes.ARMOR_TOUGHNESS,12).add(Attributes.MAX_HEALTH,45); + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java index 80c43415..6b9e97ae 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.model.ListModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelPart; @@ -10,19 +11,24 @@ import net.minecraft.client.model.geom.builders.LayerDefinition; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.client.renderer.RenderType; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.monster.Shulker; -import net.minecraft.client.renderer.RenderType; - public class ATMShulkerModel extends ListModel { - private static final String LID = "lid"; - private static final String BASE = "base"; + + // private static final String LID = "lid"; + // private static final String BASE = "base"; private final ModelPart base; private final ModelPart lid; private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"),"main"); + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"), + "main" + ); + public ATMShulkerModel(ModelPart p_170922_, boolean bool) { super(RenderType::entityCutoutNoCullZOffset); this.lid = p_170922_.getChild("lid"); @@ -31,32 +37,62 @@ public ATMShulkerModel(ModelPart p_170922_, boolean bool) { } public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - partdefinition.addOrReplaceChild("lid", CubeListBuilder.create().texOffs(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("base", CubeListBuilder.create().texOffs(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshdefinition, 64, 64); + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F) + ); + return LayerDefinition.create(meshDefinition, 64, 64); } - public void setupAnim(T p_103735_, float p_103736_, float p_103737_, float p_103738_, float p_103739_, float p_103740_) { - float f = p_103738_ - (float)p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float)Math.PI; + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_ + ) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; float f2 = -1.0F + Mth.sin(f1); float f3 = 0.0F; - if (f1 > (float)Math.PI) { + if (f1 > (float) Math.PI) { f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; } this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F; + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; } else { this.lid.yRot = 0.0F; } - this.head.xRot = p_103740_ * ((float)Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * ((float)Math.PI / 180F); + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = + (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); } public Iterable parts() { diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java index 7f7c2315..69e9c5e7 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java @@ -2,24 +2,52 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -public class ATMShulkerRenderer extends MobRenderer> { +public class ATMShulkerRenderer + extends MobRenderer> { public ATMShulkerRenderer(EntityRendererProvider.Context context) { - super(context, new ATMShulkerModel<>(context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), true), 0.5F); + super( + context, + new ATMShulkerModel<>( + context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), + true + ), + 0.5F + ); } + @Override - public void render(ATMShulkerEntity p_114485_, float p_114486_, float p_114487_, PoseStack p_114488_, MultiBufferSource p_114489_, int p_114490_) { - super.render(p_114485_, p_114486_, p_114487_, p_114488_, p_114489_, p_114490_); + public void render( + @Nonnull ATMShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_ + ) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_ + ); } @Override - public ResourceLocation getTextureLocation(ATMShulkerEntity p_114482_) { - return new ResourceLocation(Reference.MOD_ID, "textures/entity/allthemodium_shulker.png"); - + public ResourceLocation getTextureLocation( + @Nonnull ATMShulkerEntity p_114482_ + ) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/allthemodium_shulker.png" + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java index 12012b8f..485992a2 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java @@ -8,10 +8,21 @@ import net.minecraft.world.level.Level; public class UNOBShulkerEntity extends Shulker { - public UNOBShulkerEntity(EntityType p_33404_, Level p_33405_) { + + public UNOBShulkerEntity( + EntityType p_33404_, + Level p_33405_ + ) { super(p_33404_, p_33405_); } + public static AttributeSupplier.Builder createAttributes() { - return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED,0.21F).add(Attributes.ATTACK_DAMAGE,4).add(Attributes.ARMOR,18).add(Attributes.ARMOR_TOUGHNESS,12).add(Attributes.MAX_HEALTH,45); + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java index d4cd6c7c..61b2d181 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.model.ListModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelPart; @@ -16,12 +17,18 @@ import net.minecraft.world.entity.monster.Shulker; public class UNOBShulkerModel extends ListModel { - private static final String LID = "lid"; - private static final String BASE = "base"; + + // private static final String LID = "lid"; + // private static final String BASE = "base"; private final ModelPart base; private final ModelPart lid; private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"),"main"); + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"), + "main" + ); + public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { super(RenderType::entityCutoutNoCullZOffset); this.lid = p_170922_.getChild("lid"); @@ -30,32 +37,62 @@ public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { } public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - partdefinition.addOrReplaceChild("lid", CubeListBuilder.create().texOffs(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("base", CubeListBuilder.create().texOffs(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshdefinition, 64, 64); + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F) + ); + return LayerDefinition.create(meshDefinition, 64, 64); } - public void setupAnim(T p_103735_, float p_103736_, float p_103737_, float p_103738_, float p_103739_, float p_103740_) { - float f = p_103738_ - (float)p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float)Math.PI; + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_ + ) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; float f2 = -1.0F + Mth.sin(f1); float f3 = 0.0F; - if (f1 > (float)Math.PI) { + if (f1 > (float) Math.PI) { f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; } this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F; + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; } else { this.lid.yRot = 0.0F; } - this.head.xRot = p_103740_ * ((float)Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * ((float)Math.PI / 180F); + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = + (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); } public Iterable parts() { diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java index 1268e683..9030d8ad 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java @@ -2,24 +2,55 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -public class UNOBShulkerRenderer extends MobRenderer> { +public class UNOBShulkerRenderer + extends MobRenderer< + UNOBShulkerEntity, + UNOBShulkerModel + > { public UNOBShulkerRenderer(EntityRendererProvider.Context context) { - super(context, new UNOBShulkerModel<>(context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), true), 0.5F); + super( + context, + new UNOBShulkerModel<>( + context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), + true + ), + 0.5F + ); } + @Override - public void render(UNOBShulkerEntity p_114485_, float p_114486_, float p_114487_, PoseStack p_114488_, MultiBufferSource p_114489_, int p_114490_) { - super.render(p_114485_, p_114486_, p_114487_, p_114488_, p_114489_, p_114490_); + public void render( + @Nonnull UNOBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_ + ) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_ + ); } @Override - public ResourceLocation getTextureLocation(UNOBShulkerEntity p_114482_) { - return new ResourceLocation(Reference.MOD_ID, "textures/entity/unobtainium_shulker.png"); - + public ResourceLocation getTextureLocation( + @Nonnull UNOBShulkerEntity p_114482_ + ) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/unobtainium_shulker.png" + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java index c2ae1748..f5cdf822 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java @@ -8,10 +8,21 @@ import net.minecraft.world.level.Level; public class VIBShulkerEntity extends Shulker { - public VIBShulkerEntity(EntityType p_33404_, Level p_33405_) { + + public VIBShulkerEntity( + EntityType p_33404_, + Level p_33405_ + ) { super(p_33404_, p_33405_); } + public static AttributeSupplier.Builder createAttributes() { - return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED,0.21F).add(Attributes.ATTACK_DAMAGE,4).add(Attributes.ARMOR,18).add(Attributes.ARMOR_TOUGHNESS,12).add(Attributes.MAX_HEALTH,45); + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java index 69b7b426..cc2ec668 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.model.ListModel; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelPart; @@ -16,12 +17,18 @@ import net.minecraft.world.entity.monster.Shulker; public class VIBShulkerModel extends ListModel { - private static final String LID = "lid"; - private static final String BASE = "base"; + + // private static final String LID = "lid"; + // private static final String BASE = "base"; private final ModelPart base; private final ModelPart lid; private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"),"main"); + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"), + "main" + ); + public VIBShulkerModel(ModelPart p_170922_, boolean bool) { super(RenderType::entityCutoutNoCullZOffset); this.lid = p_170922_.getChild("lid"); @@ -30,32 +37,62 @@ public VIBShulkerModel(ModelPart p_170922_, boolean bool) { } public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - partdefinition.addOrReplaceChild("lid", CubeListBuilder.create().texOffs(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("base", CubeListBuilder.create().texOffs(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); - partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshdefinition, 64, 64); + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F) + ); + return LayerDefinition.create(meshDefinition, 64, 64); } - public void setupAnim(T p_103735_, float p_103736_, float p_103737_, float p_103738_, float p_103739_, float p_103740_) { - float f = p_103738_ - (float)p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float)Math.PI; + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_ + ) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; float f2 = -1.0F + Mth.sin(f1); float f3 = 0.0F; - if (f1 > (float)Math.PI) { + if (f1 > (float) Math.PI) { f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; } this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F; + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; } else { this.lid.yRot = 0.0F; } - this.head.xRot = p_103740_ * ((float)Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * ((float)Math.PI / 180F); + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = + (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); } public Iterable parts() { diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java index ff71eca0..29672e2b 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java @@ -2,24 +2,52 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -public class VIBShulkerRenderer extends MobRenderer> { +public class VIBShulkerRenderer + extends MobRenderer> { public VIBShulkerRenderer(EntityRendererProvider.Context context) { - super(context, new VIBShulkerModel<>(context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), true), 0.5F); + super( + context, + new VIBShulkerModel<>( + context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), + true + ), + 0.5F + ); } + @Override - public void render(VIBShulkerEntity p_114485_, float p_114486_, float p_114487_, PoseStack p_114488_, MultiBufferSource p_114489_, int p_114490_) { - super.render(p_114485_, p_114486_, p_114487_, p_114488_, p_114489_, p_114490_); + public void render( + @Nonnull VIBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_ + ) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_ + ); } @Override - public ResourceLocation getTextureLocation(VIBShulkerEntity p_114482_) { - return new ResourceLocation(Reference.MOD_ID, "textures/entity/vibranium_shulker.png"); - + public ResourceLocation getTextureLocation( + @Nonnull VIBShulkerEntity p_114482_ + ) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/vibranium_shulker.png" + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java index 0a6a7cf5..ca6e278b 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java @@ -1,68 +1,73 @@ package com.thevortex.allthemodium.events; -import java.util.Iterator; - import com.thevortex.allthemodium.entity.PiglichEntity; - import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Iterator; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import net.minecraftforge.event.entity.ProjectileImpactEvent; import net.minecraftforge.event.entity.living.*; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE) +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class ArmorEvents { - + @SubscribeEvent + public static void onPlayerFall(LivingFallEvent event) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { + event.setCanceled(true); + } + } + } - @SubscribeEvent - public static void onPlayerFall(LivingFallEvent event) { - Iterable armorlist = event.getEntity().getArmorSlots(); - Iterator iterator = armorlist.iterator(); - while(iterator.hasNext()) { - ItemStack armor = iterator.next(); - if((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { event.setCanceled(true);} - } - - } + @SubscribeEvent + public static void onEntityHurt(LivingAttackEvent event) { + LivingEntity entity = event.getEntity(); + if (entity instanceof PiglichEntity) {} + if (!entity.getCommandSenderWorld().isClientSide()) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ( + (armor.getItem() == + ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()) + ) { + if ( + (event.getSource() == DamageSource.HOT_FLOOR) || + (event.getSource() == DamageSource.IN_FIRE) || + (event.getSource() == DamageSource.LAVA) || + (event.getSource() == DamageSource.ON_FIRE) + ) { + event.getEntity().clearFire(); + event.setCanceled(true); + } + } + if ( + (armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) + ) { + if (event.getSource() == DamageSource.FLY_INTO_WALL) { + event.setCanceled(true); + } + if (event.getSource() == DamageSource.DROWN) { + event + .getEntity() + .setAirSupply(event.getEntity().getMaxAirSupply()); + event.setCanceled(true); + } + } + } + } + } - @SubscribeEvent - public static void onEntityHurt(LivingAttackEvent event) { - if(event.getEntity() instanceof PiglichEntity) { - - } - if (!event.getEntity().getCommandSenderWorld().isClientSide) { - Iterable armorlist = event.getEntity().getArmorSlots(); - Iterator iterator = armorlist.iterator(); - while (iterator.hasNext()) { - ItemStack armor = iterator.next(); - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())) { - if ((event.getSource() == DamageSource.HOT_FLOOR) || (event.getSource() == DamageSource.IN_FIRE) || (event.getSource() == DamageSource.LAVA) || (event.getSource() == DamageSource.ON_FIRE)) { - event.getEntity().clearFire(); - event.setCanceled(true); - } - } - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get())) { - if (event.getSource() == DamageSource.FLY_INTO_WALL) { - event.setCanceled(true); - } - if (event.getSource() == DamageSource.DROWN) { - event.getEntity().setAirSupply(event.getEntity().getMaxAirSupply()); - event.setCanceled(true); - } - } - } - - } - } - @SubscribeEvent - public static void onEntityCollide(ProjectileImpactEvent event) { - - } + @SubscribeEvent + public static void onEntityCollide(ProjectileImpactEvent event) {} } - diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 78182137..97ed3ec9 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -1,56 +1,65 @@ package com.thevortex.allthemodium.events; - -import com.thevortex.allthemodium.AllTheModium; import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.TagRegistry; - -import net.minecraft.client.Minecraft; -import net.minecraft.core.Registry; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.level.BlockEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE) +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class BlockBreak { + @SubscribeEvent + public static void on(BlockEvent.BreakEvent event) { + if (event.getPlayer().isCreative()) { + return; + } - @SubscribeEvent - public static void on(BlockEvent.BreakEvent event) { - if(event.getPlayer().isCreative()) { return; } - - boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null); - boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - - if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && fakePlayer && event.getLevel().getBiome(event.getPos()).is(TagRegistry.OTHER_BIOMES) && AllthemodiumServerConfigs.OTHER_PROTECTION.get()) { - - event.setCanceled(true); - return; - } - if((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { - - event.setCanceled(true); - return; - } + boolean fakePlayer = + (event.getPlayer() instanceof FakePlayer) || + (event.getPlayer() == null); + boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) { - - event.setCanceled(true); - return; - } - if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && (fakePlayer || emptyHand) && !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) { - - event.setCanceled(true); - return; - } - if(event.getPlayer() instanceof FakePlayer) { + if ( + (event.getState().is(TagRegistry.OTHER_PROTECTION)) && + fakePlayer && + event + .getLevel() + .getBiome(event.getPos()) + .is(TagRegistry.OTHER_BIOMES) && + AllthemodiumServerConfigs.OTHER_PROTECTION.get() + ) { + event.setCanceled(true); + return; + } + if ( + (event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() + ) { + event.setCanceled(true); + return; + } - return; - } - } + if ( + (event.getState().is(TagRegistry.VIBRANIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get() + ) { + event.setCanceled(true); + return; + } + if ( + (event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() + ) { + event.setCanceled(true); + return; + } + if (event.getPlayer() instanceof FakePlayer) { + return; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java index 0be10e6e..5d3517ec 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java @@ -3,7 +3,7 @@ import com.thevortex.allthemodium.entity.PiglichModel; import com.thevortex.allthemodium.entity.PiglichRenderer; import com.thevortex.allthemodium.entity.shulkers.atm.ATMShulkerModel; -import com.thevortex.allthemodium.items.toolitems.armor.models.allthemodium_helmet; +import com.thevortex.allthemodium.items.toolitems.armor.models.AllthemodiumHelmetModel; import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.ModRegistry; import net.minecraft.client.renderer.ItemBlockRenderTypes; @@ -14,53 +14,135 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + value = Dist.CLIENT, + bus = Mod.EventBusSubscriber.Bus.MOD +) public class ClientEvents { + @SubscribeEvent - public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { - event.registerEntityRenderer(ModRegistry.PIGLICH.get(), PiglichRenderer::new); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), UNOBShulkerRenderer::new); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), UNOBShulkerRenderer::new); + public static void registerRenderers( + EntityRenderersEvent.RegisterRenderers event + ) { + event.registerEntityRenderer( + ModRegistry.PIGLICH.get(), + PiglichRenderer::new + ); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); } + @SuppressWarnings("removal") // TODO: Alternative required for 1.20+ @SubscribeEvent - public static void registerTree(FMLClientSetupEvent event){ - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_HERB.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_SAPLING.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_LEAVES.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_TRAPDOOR.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_DOOR_.get(), RenderType.cutoutMipped()); - - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_HERB.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_SAPLING.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_LEAVES.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_TRAPDOOR.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.DEMONIC_DOOR_.get(), RenderType.cutoutMipped()); - - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_HERB.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_SAPLING.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_LEAVES.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_LEAVES_BOTTOM.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_TRAPDOOR.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.SOUL_DOOR_.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_CAVEVINES_.get(), RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), RenderType.cutoutMipped()); + public static void registerTree(FMLClientSetupEvent event) { + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_HERB.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_SAPLING.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_TRAPDOOR.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_DOOR_.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_HERB.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_SAPLING.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_TRAPDOOR.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_DOOR_.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_HERB.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_SAPLING.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES_BOTTOM.get(), + RenderType.cutout() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_TRAPDOOR.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_DOOR_.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_.get(), + RenderType.cutoutMipped() + ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), + RenderType.cutoutMipped() + ); } + @SubscribeEvent public static void registerMesh(EntityRenderersEvent.AddLayers event) { event.getEntityModels().bakeLayer(PiglichModel.LAYER_LOCATION); event.getEntityModels().bakeLayer(ATMShulkerModel.LAYER_LOCATION); } + @SubscribeEvent - public static void registerLayer(EntityRenderersEvent.RegisterLayerDefinitions event) - { - event.registerLayerDefinition(PiglichModel.LAYER_LOCATION, () -> PiglichModel.createBodyLayer()); - event.registerLayerDefinition(ATMShulkerModel.LAYER_LOCATION, () -> ATMShulkerModel.createBodyLayer()); - event.registerLayerDefinition(allthemodium_helmet.LAYER_LOCATION, allthemodium_helmet::createBodyLayer); + public static void registerLayer( + EntityRenderersEvent.RegisterLayerDefinitions event + ) { + event.registerLayerDefinition( + PiglichModel.LAYER_LOCATION, + () -> PiglichModel.createBodyLayer() + ); + event.registerLayerDefinition( + ATMShulkerModel.LAYER_LOCATION, + () -> ATMShulkerModel.createBodyLayer() + ); + event.registerLayerDefinition( + AllthemodiumHelmetModel.LAYER_LOCATION, + AllthemodiumHelmetModel::createBodyLayer + ); } - } diff --git a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java index f5cc41ad..b8725ab6 100644 --- a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java +++ b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java @@ -1,39 +1,37 @@ package com.thevortex.allthemodium.events; -import com.mojang.datafixers.TypeRewriteRule; -import com.thevortex.allthemodium.blocks.Allthemodium_Ore; -import com.thevortex.allthemodium.blocks.Unobtainium_Ore; -import com.thevortex.allthemodium.blocks.Vibranium_Ore; -import com.thevortex.allthemodium.material.ToolTiers; -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.*; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +// import com.mojang.datafixers.TypeRewriteRule; +// import com.thevortex.allthemodium.blocks.Allthemodium_Ore; +// import com.thevortex.allthemodium.blocks.Unobtainium_Ore; +// import com.thevortex.allthemodium.blocks.Vibranium_Ore; +// import com.thevortex.allthemodium.material.ToolTiers; +// import com.thevortex.allthemodium.registry.ModRegistry; +// import net.minecraft.world.entity.player.Player; +// import net.minecraft.world.item.*; +// import net.minecraft.world.level.block.Block; +// import net.minecraft.world.level.block.state.BlockState; +// import net.minecraftforge.event.entity.player.PlayerEvent; +// import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE) +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class PlayerHarvest { - - /* - @SubscribeEvent - public static void on(PlayerEvent.HarvestCheck event) { - Player player = event.getPlayer(); - BlockState blockstate = event.getTargetBlock(); - ItemStack heldItem = player.getMainHandItem(); - if (blockstate.getBlock() instanceof Allthemodium_Ore) { - boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player); - event.setCanHarvest(b); - } - if(blockstate.getBlock() instanceof Vibranium_Ore) { - event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - } - if(blockstate.getBlock() instanceof Unobtainium_Ore) { - event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - } - } - - */ + // TODO: Determine if this class should be kept + // @SubscribeEvent + // public static void on(PlayerEvent.HarvestCheck event) { + // Player player = event.getPlayer(); + // BlockState blockstate = event.getTargetBlock(); + // ItemStack heldItem = player.getMainHandItem(); + // if (blockstate.getBlock() instanceof Allthemodium_Ore) { + // boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, + // player); + // event.setCanHarvest(b); + // } + // if (blockstate.getBlock() instanceof Vibranium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // if (blockstate.getBlock() instanceof Unobtainium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java index fc87bc57..6a2eef23 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java @@ -4,6 +4,8 @@ import com.thevortex.allthemodium.registry.FluidRegistry; import com.thevortex.allthemodium.registry.FluidTypeRegistry; import com.thevortex.allthemodium.registry.ItemRegistry; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleOptions; @@ -26,131 +28,179 @@ import net.minecraft.world.level.material.FluidState; import net.minecraftforge.fluids.FluidType; -import javax.annotation.Nullable; - public class FluidATM extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); - } - @Override - public Fluid getSource() { - return FluidRegistry.ALLTHEMODIUM.get(); - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); + } - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_ATM_BUCKET.get(); - } + @Override + public Fluid getSource() { + return FluidRegistry.ALLTHEMODIUM.get(); + } - @Override - protected void animateTick(Level level, BlockPos blockPos, FluidState state, RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound((double)blockPos.getX() + 0.5D, (double)blockPos.getY() + 0.5D, (double)blockPos.getZ() + 0.5D, SoundEvents.WATER_AMBIENT, SoundSource.BLOCKS, randomSource.nextFloat() * 0.25F + 0.75F, randomSource.nextFloat() + 0.5F, false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle(ParticleTypes.UNDERWATER, (double)blockPos.getX() + randomSource.nextDouble(), (double)blockPos.getY() + randomSource.nextDouble(), (double)blockPos.getZ() + randomSource.nextDouble(), 0.0D, 0.0D, 0.0D); + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_ATM_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource + ) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false + ); } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D + ); } + } - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_HONEY; - } + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_HONEY; + } - @Override - protected boolean canConvertToSource() { - return false; - } + @Override + protected boolean canConvertToSource() { + return false; + } - @Override - protected void beforeDestroyingBlock(LevelAccessor worldIn, BlockPos pos, BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() ? worldIn.getBlockEntity(pos) : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state + ) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } - @Override - protected int getSlopeFindDistance(LevelReader p_76074_) { - return 4; - } + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } - @Override - protected BlockState createLegacyBlock(FluidState p_76136_) { - return BlockRegistry.MOLTEN_ATM_BLOCK.get().defaultBlockState().setValue(LiquidBlock.LEVEL, Integer.valueOf(getLegacyLevel(p_76136_))); - } + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_ATM_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_)) + ); + } - @Override - public boolean isSource(FluidState p_76140_) { - return false; - } + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } - @Override - public int getAmount(FluidState p_164509_) { - return 4; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } - @Override - public boolean isSame(Fluid fluidIn) { - return fluidIn == FluidRegistry.ALLTHEMODIUM.get() || fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get(); - } + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return ( + fluidIn == FluidRegistry.ALLTHEMODIUM.get() || + fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get() + ); + } - @Override - protected int getDropOff(LevelReader p_76087_) { - return 1; - } + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } - @Override - public int getTickDelay(LevelReader p_76120_) { - return 8; - } + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_ + ) { + return ( + p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.ATM.get() + ); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.ATM.get(); + } + + public static class Flowing extends FluidATM { @Override - protected boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) { - return p_76131_ == Direction.DOWN && p_76127_.getFluidType() != FluidTypeRegistry.ATM.get(); + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_ + ) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); } @Override - protected float getExplosionResistance() { - return 100.0F; + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); } @Override - public FluidType getFluidType() { - return FluidTypeRegistry.ATM.get(); + public boolean isSource(@Nonnull FluidState state) { + return false; } + } - public static class Flowing extends FluidATM { - @Override - protected void createFluidStateDefinition(StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } + public static class Source extends FluidATM { - @Override - public boolean isSource(FluidState state) { - return false; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; } - public static class Source extends FluidATM { - @Override - public int getAmount(FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(FluidState state) { - return true; - } + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; } } - +} diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java index a70d5f4a..18c272b2 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java @@ -2,6 +2,8 @@ import com.thevortex.allthemodium.blocks.SoulLava; import com.thevortex.allthemodium.registry.*; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleOptions; @@ -15,7 +17,6 @@ import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -24,131 +25,179 @@ import net.minecraft.world.level.material.FluidState; import net.minecraftforge.fluids.FluidType; -import javax.annotation.Nullable; - public class FluidSoulLava extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_SOULLAVA.get(); - } - @Override - public Fluid getSource() { - return FluidRegistry.SOULLAVA.get(); - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_SOULLAVA.get(); + } - @Override - public Item getBucket() { - return ItemRegistry.SOUL_LAVA_BUCKET.get(); - } + @Override + public Fluid getSource() { + return FluidRegistry.SOULLAVA.get(); + } - @Override - protected void animateTick(Level level, BlockPos blockPos, FluidState state, RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound((double)blockPos.getX() + 0.5D, (double)blockPos.getY() + 0.5D, (double)blockPos.getZ() + 0.5D, SoundEvents.WATER_AMBIENT, SoundSource.BLOCKS, randomSource.nextFloat() * 0.25F + 0.75F, randomSource.nextFloat() + 0.5F, false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle(ParticleTypes.UNDERWATER, (double)blockPos.getX() + randomSource.nextDouble(), (double)blockPos.getY() + randomSource.nextDouble(), (double)blockPos.getZ() + randomSource.nextDouble(), 0.0D, 0.0D, 0.0D); + @Override + public Item getBucket() { + return ItemRegistry.SOUL_LAVA_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource + ) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false + ); } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D + ); } + } - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.SOUL_FIRE_FLAME; - } + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.SOUL_FIRE_FLAME; + } - @Override - protected boolean canConvertToSource() { - return false; - } + @Override + protected boolean canConvertToSource() { + return false; + } - @Override - protected void beforeDestroyingBlock(LevelAccessor worldIn, BlockPos pos, BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() ? worldIn.getBlockEntity(pos) : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state + ) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } - @Override - protected int getSlopeFindDistance(LevelReader p_76074_) { - return 4; - } + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } - @Override - protected BlockState createLegacyBlock(FluidState p_76136_) { - return BlockRegistry.SOULLAVA_BLOCK.get().defaultBlockState().setValue(SoulLava.LEVEL, Integer.valueOf(getLegacyLevel(p_76136_))); - } + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState() + .setValue( + SoulLava.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_)) + ); + } - @Override - public boolean isSource(FluidState p_76140_) { - return false; - } + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } - @Override - public int getAmount(FluidState p_164509_) { - return 4; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } - @Override - public boolean isSame(Fluid fluidIn) { - return fluidIn == FluidRegistry.SOULLAVA.get() || fluidIn == FluidRegistry.FLOWING_SOULLAVA.get(); - } + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return ( + fluidIn == FluidRegistry.SOULLAVA.get() || + fluidIn == FluidRegistry.FLOWING_SOULLAVA.get() + ); + } - @Override - protected int getDropOff(LevelReader p_76087_) { - return 1; - } + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } - @Override - public int getTickDelay(LevelReader p_76120_) { - return 8; - } + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_ + ) { + return ( + p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get() + ); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.SOULLAVA.get(); + } + + public static class Flowing extends FluidSoulLava { @Override - protected boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) { - return p_76131_ == Direction.DOWN && p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get(); + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_ + ) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); } @Override - protected float getExplosionResistance() { - return 100.0F; + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); } @Override - public FluidType getFluidType() { - return FluidTypeRegistry.SOULLAVA.get(); + public boolean isSource(@Nonnull FluidState state) { + return false; } + } - public static class Flowing extends FluidSoulLava { - @Override - protected void createFluidStateDefinition(StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } + public static class Source extends FluidSoulLava { - @Override - public boolean isSource(FluidState state) { - return false; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; } - public static class Source extends FluidSoulLava { - @Override - public int getAmount(FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(FluidState state) { - return true; - } + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; } } - +} diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java index 167a186a..a2b814f4 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java @@ -4,6 +4,8 @@ import com.thevortex.allthemodium.registry.FluidRegistry; import com.thevortex.allthemodium.registry.FluidTypeRegistry; import com.thevortex.allthemodium.registry.ItemRegistry; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleOptions; @@ -26,131 +28,179 @@ import net.minecraft.world.level.material.FluidState; import net.minecraftforge.fluids.FluidType; -import javax.annotation.Nullable; - public class FluidUNOB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_UNOBTAINIUM.get(); - } - @Override - public Fluid getSource() { - return FluidRegistry.UNOBTAINIUM.get(); - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_UNOBTAINIUM.get(); + } - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); - } + @Override + public Fluid getSource() { + return FluidRegistry.UNOBTAINIUM.get(); + } - @Override - protected void animateTick(Level level, BlockPos blockPos, FluidState state, RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound((double)blockPos.getX() + 0.5D, (double)blockPos.getY() + 0.5D, (double)blockPos.getZ() + 0.5D, SoundEvents.WATER_AMBIENT, SoundSource.BLOCKS, randomSource.nextFloat() * 0.25F + 0.75F, randomSource.nextFloat() + 0.5F, false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle(ParticleTypes.UNDERWATER, (double)blockPos.getX() + randomSource.nextDouble(), (double)blockPos.getY() + randomSource.nextDouble(), (double)blockPos.getZ() + randomSource.nextDouble(), 0.0D, 0.0D, 0.0D); + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource + ) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false + ); } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D + ); } + } - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; - } + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; + } - @Override - protected boolean canConvertToSource() { - return false; - } + @Override + protected boolean canConvertToSource() { + return false; + } - @Override - protected void beforeDestroyingBlock(LevelAccessor worldIn, BlockPos pos, BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() ? worldIn.getBlockEntity(pos) : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state + ) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } - @Override - protected int getSlopeFindDistance(LevelReader p_76074_) { - return 4; - } + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } - @Override - protected BlockState createLegacyBlock(FluidState p_76136_) { - return BlockRegistry.MOLTEN_UNOB_BLOCK.get().defaultBlockState().setValue(LiquidBlock.LEVEL, Integer.valueOf(getLegacyLevel(p_76136_))); - } + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_UNOB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_)) + ); + } - @Override - public boolean isSource(FluidState p_76140_) { - return false; - } + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } - @Override - public int getAmount(FluidState p_164509_) { - return 4; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } - @Override - public boolean isSame(Fluid fluidIn) { - return fluidIn == FluidRegistry.UNOBTAINIUM.get() || fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get(); - } + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return ( + fluidIn == FluidRegistry.UNOBTAINIUM.get() || + fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get() + ); + } - @Override - protected int getDropOff(LevelReader p_76087_) { - return 1; - } + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } - @Override - public int getTickDelay(LevelReader p_76120_) { - return 8; - } + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_ + ) { + return ( + p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get() + ); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.UNOB.get(); + } + + public static class Flowing extends FluidUNOB { @Override - protected boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) { - return p_76131_ == Direction.DOWN && p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get(); + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_ + ) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); } @Override - protected float getExplosionResistance() { - return 100.0F; + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); } @Override - public FluidType getFluidType() { - return FluidTypeRegistry.UNOB.get(); + public boolean isSource(@Nonnull FluidState state) { + return false; } + } - public static class Flowing extends FluidUNOB { - @Override - protected void createFluidStateDefinition(StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } + public static class Source extends FluidUNOB { - @Override - public boolean isSource(FluidState state) { - return false; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; } - public static class Source extends FluidUNOB { - @Override - public int getAmount(FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(FluidState state) { - return true; - } + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; } } - +} diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java index 4574c7cd..a120b19d 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java @@ -4,6 +4,8 @@ import com.thevortex.allthemodium.registry.FluidRegistry; import com.thevortex.allthemodium.registry.FluidTypeRegistry; import com.thevortex.allthemodium.registry.ItemRegistry; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleOptions; @@ -26,131 +28,179 @@ import net.minecraft.world.level.material.FluidState; import net.minecraftforge.fluids.FluidType; -import javax.annotation.Nullable; - public class FluidVIB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_VIBRANIUM.get(); - } - @Override - public Fluid getSource() { - return FluidRegistry.VIBRANIUM.get(); - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_VIBRANIUM.get(); + } - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_VIB_BUCKET.get(); - } + @Override + public Fluid getSource() { + return FluidRegistry.VIBRANIUM.get(); + } - @Override - protected void animateTick(Level level, BlockPos blockPos, FluidState state, RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound((double)blockPos.getX() + 0.5D, (double)blockPos.getY() + 0.5D, (double)blockPos.getZ() + 0.5D, SoundEvents.WATER_AMBIENT, SoundSource.BLOCKS, randomSource.nextFloat() * 0.25F + 0.75F, randomSource.nextFloat() + 0.5F, false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle(ParticleTypes.UNDERWATER, (double)blockPos.getX() + randomSource.nextDouble(), (double)blockPos.getY() + randomSource.nextDouble(), (double)blockPos.getZ() + randomSource.nextDouble(), 0.0D, 0.0D, 0.0D); + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_VIB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource + ) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false + ); } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D + ); } + } - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.ELECTRIC_SPARK; - } + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.ELECTRIC_SPARK; + } - @Override - protected boolean canConvertToSource() { - return false; - } + @Override + protected boolean canConvertToSource() { + return false; + } - @Override - protected void beforeDestroyingBlock(LevelAccessor worldIn, BlockPos pos, BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() ? worldIn.getBlockEntity(pos) : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state + ) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } - @Override - protected int getSlopeFindDistance(LevelReader p_76074_) { - return 4; - } + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } - @Override - protected BlockState createLegacyBlock(FluidState p_76136_) { - return BlockRegistry.MOLTEN_VIB_BLOCK.get().defaultBlockState().setValue(LiquidBlock.LEVEL, Integer.valueOf(getLegacyLevel(p_76136_))); - } + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_VIB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_)) + ); + } - @Override - public boolean isSource(FluidState p_76140_) { - return false; - } + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } - @Override - public int getAmount(FluidState p_164509_) { - return 4; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } - @Override - public boolean isSame(Fluid fluidIn) { - return fluidIn == FluidRegistry.VIBRANIUM.get() || fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get(); - } + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return ( + fluidIn == FluidRegistry.VIBRANIUM.get() || + fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get() + ); + } - @Override - protected int getDropOff(LevelReader p_76087_) { - return 1; - } + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } - @Override - public int getTickDelay(LevelReader p_76120_) { - return 8; - } + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_ + ) { + return ( + p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.VIB.get() + ); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.VIB.get(); + } + + public static class Flowing extends FluidVIB { @Override - protected boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) { - return p_76131_ == Direction.DOWN && p_76127_.getFluidType() != FluidTypeRegistry.VIB.get(); + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_ + ) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); } @Override - protected float getExplosionResistance() { - return 100.0F; + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); } @Override - public FluidType getFluidType() { - return FluidTypeRegistry.VIB.get(); + public boolean isSource(@Nonnull FluidState state) { + return false; } + } - public static class Flowing extends FluidVIB { - @Override - protected void createFluidStateDefinition(StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } + public static class Source extends FluidVIB { - @Override - public boolean isSource(FluidState state) { - return false; - } + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; } - public static class Source extends FluidVIB { - @Override - public int getAmount(FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(FluidState state) { - return true; - } + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; } } - +} diff --git a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java index 5cd73484..37edcda8 100644 --- a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java +++ b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java @@ -1,19 +1,35 @@ package com.thevortex.allthemodium.init; - -import net.minecraft.world.food.FoodData; import net.minecraft.world.food.FoodProperties; -import net.minecraft.world.food.Foods; -import net.minecraft.world.item.Item; public class ModFoods { - public static final FoodProperties ALLTHEMODIUM_APPLE; - public static final FoodProperties ALLTHEMODIUM_CARROT; - public static final FoodProperties SOUL_BERRIES; - static { - ALLTHEMODIUM_APPLE = new FoodProperties.Builder().nutrition(20).saturationMod(2.0F).alwaysEat().fast().build(); - ALLTHEMODIUM_CARROT = new FoodProperties.Builder().nutrition(40).saturationMod(4.0F).alwaysEat().fast().build(); - SOUL_BERRIES = new FoodProperties.Builder().nutrition(5).saturationMod(4.0F).alwaysEat().fast().build(); - } + public static final FoodProperties ALLTHEMODIUM_APPLE; + public static final FoodProperties ALLTHEMODIUM_CARROT; + + public static final FoodProperties SOUL_BERRIES; + + static { + ALLTHEMODIUM_APPLE = + new FoodProperties.Builder() + .nutrition(20) + .saturationMod(2.0F) + .alwaysEat() + .fast() + .build(); + ALLTHEMODIUM_CARROT = + new FoodProperties.Builder() + .nutrition(40) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + SOUL_BERRIES = + new FoodProperties.Builder() + .nutrition(5) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java new file mode 100644 index 00000000..f12889d3 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java @@ -0,0 +1,10 @@ +package com.thevortex.allthemodium.items; + +import net.minecraft.world.item.Item; + +public class AlloyDust extends Item { + + public AlloyDust(Properties properties) { + super(properties); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java new file mode 100644 index 00000000..dc112bd7 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java @@ -0,0 +1,10 @@ +package com.thevortex.allthemodium.items; + +import net.minecraft.world.item.Item; + +public class AlloyIngot extends Item { + + public AlloyIngot(Properties properties) { + super(properties); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/Alloy_Dust.java b/src/main/java/com/thevortex/allthemodium/items/Alloy_Dust.java deleted file mode 100644 index f4e45665..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Alloy_Dust.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.thevortex.allthemodium.items; - -import net.minecraft.world.item.Item; - -public class Alloy_Dust extends Item { - - public Alloy_Dust(Properties properties) { - super(properties); - - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/items/Alloy_Ingot.java b/src/main/java/com/thevortex/allthemodium/items/Alloy_Ingot.java deleted file mode 100644 index a6b4a6e2..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Alloy_Ingot.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.thevortex.allthemodium.items; - -import net.minecraft.world.item.Item; - -public class Alloy_Ingot extends Item { - - public Alloy_Ingot(Properties properties) { - super(properties); - - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java new file mode 100644 index 00000000..6b590de4 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java @@ -0,0 +1,68 @@ +package com.thevortex.allthemodium.items; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import net.minecraft.network.chat.Component; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +public class AllthemodiumApple extends Item { + + public AllthemodiumApple(Properties properties) { + super(properties); + } + + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving + ) { + if ( + (entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get()) + ) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 1, + false, + false + ) + ); + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 1, + false, + false + ) + ); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java new file mode 100644 index 00000000..db9e36b5 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java @@ -0,0 +1,11 @@ +package com.thevortex.allthemodium.items; + +import com.thevortex.allthemodium.registry.ModRegistry; +import net.minecraft.world.item.BlockItem; + +public class AllthemodiumBlock extends BlockItem { + + public AllthemodiumBlock(Properties properties) { + super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java new file mode 100644 index 00000000..8c40c58c --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java @@ -0,0 +1,67 @@ +package com.thevortex.allthemodium.items; + +import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +public class AllthemodiumCarrot extends Item { + + public AllthemodiumCarrot(Properties properties) { + super(properties); + } + + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving + ) { + if ( + (entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get()) + ) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 2, + false, + false + ) + ); + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 2, + false, + false + ) + ); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java new file mode 100644 index 00000000..62c6276e --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java @@ -0,0 +1,52 @@ +package com.thevortex.allthemodium.items; + +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraftforge.server.command.TextComponentHelper; + +public class AllthemodiumOreItem extends BlockItem { + + public AllthemodiumOreItem(Block block, Properties properties) { + super(block, properties); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.loc", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + if ( + !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() + ) tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Apple.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Apple.java deleted file mode 100644 index 1de7cd24..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Apple.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.thevortex.allthemodium.items; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.network.chat.Component; -import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; - -public class Allthemodium_Apple extends Item { - - public Allthemodium_Apple(Properties properties) { - super(properties); - - } - @Override - public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entityLiving) { - - if((entityLiving instanceof Player) && (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get())) { - Player player = (Player)entityLiving; - player.addEffect(new MobEffectInstance(MobEffects.REGENERATION,600,1,false,false)); - player.addEffect(new MobEffectInstance(MobEffects.ABSORPTION,600,1,false,false)); - - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - ; - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Block.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Block.java deleted file mode 100644 index 02d2233f..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Block.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.thevortex.allthemodium.items; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.item.BlockItem; - - -public class Allthemodium_Block extends BlockItem { - - public Allthemodium_Block(Properties properties) { - super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); - - } - -} diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Carrot.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Carrot.java deleted file mode 100644 index f89cded7..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Carrot.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.thevortex.allthemodium.items; - -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; - -public class Allthemodium_Carrot extends Item { - - public Allthemodium_Carrot(Properties properties) { - super(properties); - - } - @Override - public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entityLiving) { - - if((entityLiving instanceof Player) && (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get())) { - Player player = (Player)entityLiving; - player.addEffect(new MobEffectInstance(MobEffects.ABSORPTION,600,2,false,false)); - player.addEffect(new MobEffectInstance(MobEffects.REGENERATION,600,2,false,false)); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } -} diff --git a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java deleted file mode 100644 index 76751b27..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.thevortex.allthemodium.items; - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.server.command.TextComponentHelper; - -import java.util.List; - -public class Allthemodium_Ore_Item extends BlockItem { - - public Allthemodium_Ore_Item(Block block, Properties properties) { - super(block, properties); - } - - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - } diff --git a/src/main/java/com/thevortex/allthemodium/items/Dust.java b/src/main/java/com/thevortex/allthemodium/items/Dust.java index 6db0dbee..cbc0ae8a 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Dust.java +++ b/src/main/java/com/thevortex/allthemodium/items/Dust.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Dust extends Item { + public Dust(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Gear.java b/src/main/java/com/thevortex/allthemodium/items/Gear.java index cb1ad0dd..7759dc6d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Gear.java +++ b/src/main/java/com/thevortex/allthemodium/items/Gear.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Gear extends Item { + public Gear(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Ingot.java b/src/main/java/com/thevortex/allthemodium/items/Ingot.java index d2066a90..fb3c5695 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Ingot.java +++ b/src/main/java/com/thevortex/allthemodium/items/Ingot.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Ingot extends Item { + public Ingot(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Nugget.java b/src/main/java/com/thevortex/allthemodium/items/Nugget.java index 6a21c216..b1c0a74e 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Nugget.java +++ b/src/main/java/com/thevortex/allthemodium/items/Nugget.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Nugget extends Item { + public Nugget(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java index ef3446e9..43e5e2ae 100644 --- a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java +++ b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class PiglichHeart extends Item { + public PiglichHeart(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Plate.java b/src/main/java/com/thevortex/allthemodium/items/Plate.java index c1d29406..41f2083d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Plate.java +++ b/src/main/java/com/thevortex/allthemodium/items/Plate.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Plate extends Item { + public Plate(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/RawOre.java b/src/main/java/com/thevortex/allthemodium/items/RawOre.java index 54dc3000..681bd2eb 100644 --- a/src/main/java/com/thevortex/allthemodium/items/RawOre.java +++ b/src/main/java/com/thevortex/allthemodium/items/RawOre.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class RawOre extends Item { + public RawOre(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/Rod.java b/src/main/java/com/thevortex/allthemodium/items/Rod.java index 45c2f968..9a1e6914 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Rod.java +++ b/src/main/java/com/thevortex/allthemodium/items/Rod.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; public class Rod extends Item { + public Rod(Properties properties) { super(properties); } diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java index c139313e..b9b78021 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java @@ -1,36 +1,43 @@ package com.thevortex.allthemodium.items; import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; +import javax.annotation.Nonnull; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemNameBlockItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; public class SoulBerries extends ItemNameBlockItem { + public SoulBerries(Block block, Properties properties) { super(block, properties); } - @Override - public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entityLiving) { - - if((entityLiving instanceof Player) && (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get())) { - Player player = (Player)entityLiving; - player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION,1200,2,false,false)); + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving + ) { + if ( + (entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get()) + ) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.NIGHT_VISION, + 1200, + 2, + false, + false + ) + ); } return super.finishUsingItem(stack, worldIn, entityLiving); } - - } - +} diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java index 345ab28a..551a3744 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java @@ -1,33 +1,32 @@ package com.thevortex.allthemodium.items; import java.util.function.Supplier; - +import javax.annotation.Nonnull; import javax.annotation.Nullable; - import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.material.Fluid; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper; public class SoulBucket extends BucketItem { - - - public SoulBucket(Supplier supplier, Properties builder) { - super(supplier, builder); - } + public SoulBucket(Supplier supplier, Properties builder) { + super(supplier, builder); + } @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { + public ICapabilityProvider initCapabilities( + @Nonnull ItemStack stack, + @Nullable CompoundTag nbt + ) { return new FluidBucketWrapper(stack); } - @Override - public int getBurnTime(ItemStack itemStack, RecipeType provider) { - return 100000; - } + @Override + public int getBurnTime(ItemStack itemStack, RecipeType provider) { + return 100000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java index 53382cb8..ea663565 100644 --- a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java @@ -1,21 +1,11 @@ package com.thevortex.allthemodium.items; - -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; public class TeleportPad extends BlockItem { public TeleportPad(Block blockIn, Properties builder) { super(blockIn, builder); } - } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Block.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java similarity index 51% rename from src/main/java/com/thevortex/allthemodium/items/Unobtainium_Block.java rename to src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java index 10617ed6..7960f319 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Block.java +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java @@ -1,5 +1,5 @@ /** - * + * */ package com.thevortex.allthemodium.items; @@ -10,11 +10,9 @@ * @author thevortex * */ -public class Unobtainium_Block extends BlockItem { - - public Unobtainium_Block(Properties properties) { - super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); - - } +public class UnobtainiumBlock extends BlockItem { + public UnobtainiumBlock(Properties properties) { + super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java new file mode 100644 index 00000000..a1e0bddd --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java @@ -0,0 +1,52 @@ +package com.thevortex.allthemodium.items; + +import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraftforge.server.command.TextComponentHelper; + +public class UnobtainiumOreItem extends BlockItem { + + public UnobtainiumOreItem(Block block, Properties properties) { + super(block, properties); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "unobtainium.loc", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + if ( + !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() + ) tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java deleted file mode 100644 index 4bbd6483..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.thevortex.allthemodium.items; - - -import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.server.command.TextComponentHelper; - -import java.util.List; - -public class Unobtainium_Ore_Item extends BlockItem { - - public Unobtainium_Ore_Item(Block block, Properties properties) { - super(block, properties); - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"unobtainium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Block.java b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java similarity index 52% rename from src/main/java/com/thevortex/allthemodium/items/Vibranium_Block.java rename to src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java index b0a29773..906bb8ac 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Block.java +++ b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java @@ -1,5 +1,5 @@ /** - * + * */ package com.thevortex.allthemodium.items; @@ -10,11 +10,9 @@ * @author thevortex * */ -public class Vibranium_Block extends BlockItem { - - public Vibranium_Block(Properties properties) { - super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); - - } +public class VibraniumBlock extends BlockItem { + public VibraniumBlock(Properties properties) { + super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java index ebb21ad2..516b04d6 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java @@ -1,30 +1,50 @@ package com.thevortex.allthemodium.items; import com.thevortex.allthemodium.config.AllthemodiumServerConfigs; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.network.chat.Component; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.List; - public class Vibranium_Ore_Item extends BlockItem { - public Vibranium_Ore_Item(Block block, Properties properties) { - super(block, properties); - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"vibranium.loc" , new Object()).withStyle(ChatFormatting.GOLD)); - if(!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) - tooltip.add(TextComponentHelper.createComponentTranslation(null,"allthemodium.mine" , new Object()).withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - } + public Vibranium_Ore_Item(Block block, Properties properties) { + super(block, properties); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "vibranium.loc", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + if (!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Boots.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java similarity index 54% rename from src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Boots.java rename to src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java index d9d4bc6f..822a7c76 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Boots.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java @@ -1,43 +1,38 @@ package com.thevortex.allthemodium.items.toolitems.armor; import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; - +import javax.annotation.Nonnull; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.*; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; -public class Allthemodium_Boots extends ArmorItem { +public class AllthemodiumBoots extends ArmorItem { + public AllthemodiumBoots( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder + ) { + super(materialIn, slot, builder); + } - public Allthemodium_Boots(ArmorMaterial materialIn, EquipmentSlot slot, Properties builder) { - super(materialIn, slot, builder); - - } @Override - public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) - { + public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { return stack.is(ModRegistry.ALLTHEMODIUM_BOOTS.get()); } - @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) - { + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { return true; } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java new file mode 100644 index 00000000..01e2fd6b --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java @@ -0,0 +1,34 @@ +package com.thevortex.allthemodium.items.toolitems.armor; + +import javax.annotation.Nonnull; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ArmorMaterial; +import net.minecraft.world.item.ItemStack; + +public class AllthemodiumChestplate extends ArmorItem { + + public AllthemodiumChestplate( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder + ) { + super(materialIn, slot, builder); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java new file mode 100644 index 00000000..0d986a3b --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java @@ -0,0 +1,50 @@ +package com.thevortex.allthemodium.items.toolitems.armor; + +import com.thevortex.allthemodium.registry.ModRegistry; +import javax.annotation.Nonnull; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ArmorMaterial; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; + +public class AllthemodiumHelmet extends ArmorItem { + + public AllthemodiumHelmet( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder + ) { + super(materialIn, slot, builder); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } + + @Override + public void onArmorTick(ItemStack stack, Level world, Player player) { + if ( + (stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && + (!world.isClientSide) + ) { + if (player.isInWater() && player.isSwimming()) { + player.setAirSupply(300); + } + } + super.onArmorTick(stack, world, player); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java new file mode 100644 index 00000000..1ec526e4 --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java @@ -0,0 +1,34 @@ +package com.thevortex.allthemodium.items.toolitems.armor; + +import javax.annotation.Nonnull; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ArmorMaterial; +import net.minecraft.world.item.ItemStack; + +public class AllthemodiumLeggings extends ArmorItem { + + public AllthemodiumLeggings( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder + ) { + super(materialIn, slot, builder); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Chestplate.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Chestplate.java deleted file mode 100644 index 904edb1a..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Chestplate.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.thevortex.allthemodium.items.toolitems.armor; - -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ArmorItem; -import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; - -public class Allthemodium_Chestplate extends ArmorItem { - - - - public Allthemodium_Chestplate(ArmorMaterial materialIn, EquipmentSlot slot, Properties builder) { - super(materialIn, slot, builder); - - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) - { - return true; - } - - -} \ No newline at end of file diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Helmet.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Helmet.java deleted file mode 100644 index 6d777ace..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Helmet.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.thevortex.allthemodium.items.toolitems.armor; - -import com.thevortex.allthemodium.items.toolitems.armor.models.allthemodium_helmet; -import com.thevortex.allthemodium.registry.ModRegistry; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.HumanoidModel; -import net.minecraft.client.renderer.entity.ItemEntityRenderer; -import net.minecraft.client.renderer.entity.ItemRenderer; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ArmorItem; -import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.extensions.common.IClientItemExtensions; - -import java.util.List; -import java.util.function.Consumer; - -public class Allthemodium_Helmet extends ArmorItem { - - public Allthemodium_Helmet(ArmorMaterial materialIn, EquipmentSlot slot, Properties builder) { - super(materialIn, slot, builder); - - } - - - - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) - { - return true; - } - @Override - public void onArmorTick(ItemStack stack, Level world, Player player) { - if((stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && (!world.isClientSide)) { - - if(player.isInWater() && player.isSwimming()){ - - player.setAirSupply(300); - } - } - super.onArmorTick(stack, world, player); - } -} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Leggings.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Leggings.java deleted file mode 100644 index 36a32efe..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/Allthemodium_Leggings.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.thevortex.allthemodium.items.toolitems.armor; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ArmorItem; -import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -import java.util.List; - -public class Allthemodium_Leggings extends ArmorItem { - - public Allthemodium_Leggings(ArmorMaterial materialIn, EquipmentSlot slot, Properties builder) { - super(materialIn, slot, builder); - - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) - { - return true; - } - } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java new file mode 100644 index 00000000..824314db --- /dev/null +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java @@ -0,0 +1,190 @@ +package com.thevortex.allthemodium.items.toolitems.armor.models; + +// Made with Blockbench 4.0.0-beta.0 + +// Exported for Minecraft version 1.17 with Mojang mappings +// Paste this class into your mod and generate all required imports + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import com.thevortex.allthemodium.reference.Reference; +import javax.annotation.Nonnull; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; + +public class AllthemodiumHelmetModel + extends HumanoidModel { + + // This layer location should be baked with EntityRendererProvider.Context in + // the entity renderer and passed into this model's constructor + public static final ModelLayerLocation LAYER_LOCATION = + new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), + "main" + ); + protected final EquipmentSlot slot; + + public AllthemodiumHelmetModel(ModelPart root, EquipmentSlot slot) { + super(root); + this.slot = slot; + } + + @SuppressWarnings("unused") + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox( + -4.0F, + -8.5F, + -4.0F, + 8.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F) + ), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); + + PartDefinition horn_r_1_r1 = head.addOrReplaceChild( + "horn_r_1_r1", + CubeListBuilder + .create() + .texOffs(0, 2) + .addBox( + -1.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F) + ) + .texOffs(2, 2) + .addBox( + -1.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F) + ) + .texOffs(28, 2) + .addBox( + 8.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F) + ) + .texOffs(24, 2) + .addBox( + 8.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F) + ), + PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F) + ); + + partDefinition.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO + ); + partDefinition.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO + ); + + return LayerDefinition.create(meshDefinition, 64, 32); + } + + @Override + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha + ) { + setPartVisibility(slot); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha + ); + } + + private void setPartVisibility(EquipmentSlot slot) { + setAllVisible(false); + switch (slot) { + case HEAD: + head.visible = true; + hat.visible = true; + break; + case CHEST: + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + break; + case LEGS: + body.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + break; + case FEET: + rightLeg.visible = true; + leftLeg.visible = true; + case MAINHAND: + case OFFHAND: + break; + } + } +} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/allthemodium_helmet.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/allthemodium_helmet.java deleted file mode 100644 index 3b0ddea7..00000000 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/allthemodium_helmet.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.thevortex.allthemodium.items.toolitems.armor.models; -// Made with Blockbench 4.0.0-beta.0 -// Exported for Minecraft version 1.17 with Mojang mappings -// Paste this class into your mod and generate all required imports - - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import com.thevortex.allthemodium.reference.Reference; -import net.minecraft.client.model.HumanoidModel; -import net.minecraft.client.model.PlayerModel; -import net.minecraft.client.model.geom.ModelLayerLocation; -import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.client.model.geom.PartPose; -import net.minecraft.client.model.geom.builders.*; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; - -public class allthemodium_helmet extends HumanoidModel { - // This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), "main"); - protected final EquipmentSlot slot; - - public allthemodium_helmet(ModelPart root, EquipmentSlot slot) { - super(root); - this.slot = slot; - } - - public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - - PartDefinition head = partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - - PartDefinition horn_r_1_r1 = head.addOrReplaceChild("horn_r_1_r1", CubeListBuilder.create().texOffs(0, 2).addBox(-1.0F, -3.0F, 1.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(2, 2).addBox(-1.0F, -3.0F, -1.0F, 1.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(28, 2).addBox(8.0F, -3.0F, 1.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(24, 2).addBox(8.0F, -3.0F, -1.0F, 1.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F)); - - partdefinition.addOrReplaceChild("hat", CubeListBuilder.create(), PartPose.ZERO); - partdefinition.addOrReplaceChild("body", CubeListBuilder.create(), PartPose.ZERO); - partdefinition.addOrReplaceChild("right_arm", CubeListBuilder.create(), PartPose.ZERO); - partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); - partdefinition.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); - partdefinition.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - - - return LayerDefinition.create(meshdefinition, 64, 32); - } - - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - setPartVisibility(slot); - super.renderToBuffer(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); - } - - private void setPartVisibility(EquipmentSlot slot) { - setAllVisible(false); - switch (slot) { - case HEAD: - head.visible = true; - hat.visible = true; - break; - case CHEST: - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - break; - case LEGS: - body.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; - break; - case FEET: - rightLeg.visible = true; - leftLeg.visible = true; - } - } -} diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java index 3de9f66f..68ebf5e4 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java @@ -1,7 +1,11 @@ package com.thevortex.allthemodium.items.toolitems.tools; import com.thevortex.allthemodium.material.ToolTiers; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.tags.BlockTags; @@ -14,44 +18,69 @@ import net.minecraftforge.common.TierSortingRegistry; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.List; - public class AlloyAxe extends AxeItem { public AlloyAxe(Tier tier, int damage, float speed, Properties properties) { super(tier, damage, speed, properties); } + @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed; return super.getDestroySpeed(stack, state); } + @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); super.appendHoverText(stack, worldIn, tooltip, flagIn); } - protected TranslatableContents getTooltip(String key){ + + protected TranslatableContents getTooltip(String key) { return new TranslatableContents(key); } @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if ( + state.is(BlockTags.MINEABLE_WITH_AXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); return false; } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java index 481e28de..4a1a619a 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java @@ -1,10 +1,13 @@ package com.thevortex.allthemodium.items.toolitems.tools; -import com.google.common.collect.ImmutableMap; import com.thevortex.allthemodium.material.ToolTiers; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.commands.CommandSource; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; @@ -22,50 +25,93 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.GrowingPlantHeadBlock; -import net.minecraft.world.level.block.LevelEvent; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.gameevent.GameEvent; -import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.common.Tags; import net.minecraftforge.common.TierSortingRegistry; -import net.minecraftforge.common.ToolActions; import net.minecraftforge.server.command.TextComponentHelper; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.Map; -import java.util.Optional; public class AlloyPaxel extends DiggerItem { public static Map STRIPPABLES = AxeItem.STRIPPABLES; - public AlloyPaxel(float attack, float speed, Tier tier, TagKey effectiveBlocks, Properties properties) { + + public AlloyPaxel( + float attack, + float speed, + Tier tier, + TagKey effectiveBlocks, + Properties properties + ) { super(attack, speed, tier, effectiveBlocks, properties); } + @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed *1.4f; - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed*1.8f; - if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed*1.8f; - if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed*1.9f; - if (state.is(Tags.Blocks.GLASS)) return speed*3.0F; + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed * 1.4f; + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed * 1.9f; + if (state.is(Tags.Blocks.GLASS)) return speed * 3.0F; return super.getDestroySpeed(stack, state); } + @Override - public net.minecraft.world.InteractionResult interactLivingEntity(ItemStack stack, net.minecraft.world.entity.player.Player playerIn, LivingEntity entity, net.minecraft.world.InteractionHand hand) { - if (entity instanceof net.minecraftforge.common.IForgeShearable target) { - if (entity.level.isClientSide) return net.minecraft.world.InteractionResult.SUCCESS; - BlockPos pos = new BlockPos(entity.getX(), entity.getY(), entity.getZ()); + public net.minecraft.world.InteractionResult interactLivingEntity( + @Nonnull ItemStack stack, + @Nonnull net.minecraft.world.entity.player.Player playerIn, + @Nonnull LivingEntity entity, + @Nonnull net.minecraft.world.InteractionHand hand + ) { + if ( + entity instanceof net.minecraftforge.common.IForgeShearable target + ) { + if ( + entity.level.isClientSide + ) return net.minecraft.world.InteractionResult.SUCCESS; + BlockPos pos = new BlockPos( + entity.getX(), + entity.getY(), + entity.getZ() + ); if (target.isShearable(stack, entity.level, pos)) { - java.util.List drops = target.onSheared(playerIn, stack, entity.level, pos, - net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, stack)); + @SuppressWarnings("deprecation") + java.util.List drops = target.onSheared( + playerIn, + stack, + entity.level, + pos, + net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel( + net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, + stack + ) + ); java.util.Random rand = new java.util.Random(); drops.forEach(d -> { - net.minecraft.world.entity.item.ItemEntity ent = entity.spawnAtLocation(d, 1.0F); - ent.setDeltaMovement(ent.getDeltaMovement().add((double)((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double)(rand.nextFloat() * 0.05F), (double)((rand.nextFloat() - rand.nextFloat()) * 0.1F))); + net.minecraft.world.entity.item.ItemEntity dropEntity = + entity.spawnAtLocation(d, 1.0F); + if (dropEntity == null) return; + + dropEntity.setDeltaMovement( + dropEntity + .getDeltaMovement() + .add( + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F), + (double) (rand.nextFloat() * 0.05F), + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F) + ) + ); }); - stack.hurtAndBreak(1, playerIn, e -> e.broadcastBreakEvent(hand)); + stack.hurtAndBreak( + 1, + playerIn, + e -> e.broadcastBreakEvent(hand) + ); } return net.minecraft.world.InteractionResult.SUCCESS; } @@ -73,129 +119,238 @@ public net.minecraft.world.InteractionResult interactLivingEntity(ItemStack stac } @Override - public boolean canPerformAction(ItemStack stack, net.minecraftforge.common.ToolAction toolAction) { - return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains(toolAction); + public boolean canPerformAction( + ItemStack stack, + net.minecraftforge.common.ToolAction toolAction + ) { + return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains( + toolAction + ); } @Override - public boolean hurtEnemy(ItemStack stack, LivingEntity entity, LivingEntity player) { - //entity.setSecondsOnFire(30); + public boolean hurtEnemy( + @Nonnull ItemStack stack, + @Nonnull LivingEntity entity, + @Nonnull LivingEntity player + ) { + // entity.setSecondsOnFire(30); return super.hurtEnemy(stack, entity, player); } @Override - public InteractionResult useOn(UseOnContext context) { + public InteractionResult useOn(@Nonnull UseOnContext context) { Level world = context.getLevel(); - BlockPos blockpos = context.getClickedPos(); - BlockState blockstate = world.getBlockState(blockpos); - if (blockstate.getBlock() == Blocks.OBSIDIAN) { - BlockState bpos = Blocks.CRYING_OBSIDIAN.defaultBlockState(); - Player playerentity = context.getPlayer(); - world.playSound(playerentity, blockpos, SoundEvents.NETHER_ORE_BREAK, SoundSource.BLOCKS, 1.0F, 1.0F); + BlockPos blockPos = context.getClickedPos(); + BlockState blockState = world.getBlockState(blockPos); + if (blockState.getBlock() == Blocks.OBSIDIAN) { + BlockState defaultBlockState = + Blocks.CRYING_OBSIDIAN.defaultBlockState(); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.NETHER_ORE_BREAK, + SoundSource.BLOCKS, + 1.0F, + 1.0F + ); if (!world.isClientSide) { - world.setBlock(blockpos, bpos, 11); - if (playerentity != null) { - context.getItemInHand().hurtAndBreak(1, playerentity, (p_220040_1_) -> { - p_220040_1_.broadcastBreakEvent(context.getHand()); - }); + world.setBlock(blockPos, defaultBlockState, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand() + ); + } + ); } } return InteractionResult.sidedSuccess(world.isClientSide); } - if (blockstate.getBlock() instanceof GrowingPlantHeadBlock growingplantheadblock) { - if (!growingplantheadblock.isMaxAge(blockstate)) { + if ( + blockState.getBlock() instanceof + GrowingPlantHeadBlock growingPlantHeadBlock + ) { + if (!growingPlantHeadBlock.isMaxAge(blockState)) { Player player = context.getPlayer(); - assert player != null; - ItemStack itemstack = context.getItemInHand(); + + if (player == null) return InteractionResult.PASS; + + ItemStack itemStack = context.getItemInHand(); if (player instanceof ServerPlayer) { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer) player, blockpos, itemstack); + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger( + (ServerPlayer) player, + blockPos, + itemStack + ); } - world.playSound(player, blockpos, SoundEvents.GROWING_PLANT_CROP, SoundSource.BLOCKS, 1.0F, 1.0F); - world.setBlockAndUpdate(blockpos, growingplantheadblock.getMaxAgeState(blockstate)); - itemstack.hurtAndBreak(1, player, (p_186374_) -> { - p_186374_.broadcastBreakEvent(context.getHand()); - }); + world.playSound( + player, + blockPos, + SoundEvents.GROWING_PLANT_CROP, + SoundSource.BLOCKS, + 1.0F, + 1.0F + ); + world.setBlockAndUpdate( + blockPos, + growingPlantHeadBlock.getMaxAgeState(blockState) + ); + itemStack.hurtAndBreak( + 1, + player, + p_186374_ -> { + p_186374_.broadcastBreakEvent(context.getHand()); + } + ); return InteractionResult.sidedSuccess(world.isClientSide); } } - if ((blockstate.is(BlockTags.DIRT))) { - //tags dirt - boolean isSneaking = context.getPlayer().isCrouching(); - BlockState blockPath = isSneaking ? Blocks.FARMLAND.defaultBlockState() : Blocks.DIRT_PATH.defaultBlockState(); - Player playerentity = context.getPlayer(); - world.playSound(playerentity, blockpos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); + if ((blockState.is(BlockTags.DIRT))) { + Player player = context.getPlayer(); + if (player == null) return InteractionResult.PASS; + + // tags dirt + boolean isSneaking = player.isCrouching(); + BlockState blockPath = isSneaking + ? Blocks.FARMLAND.defaultBlockState() + : Blocks.DIRT_PATH.defaultBlockState(); + + world.playSound( + player, + blockPos, + SoundEvents.SHOVEL_FLATTEN, + SoundSource.BLOCKS, + 1.0F, + 1.0F + ); if (!world.isClientSide) { - world.setBlock(blockpos, blockPath, 11); - if (playerentity != null) { - context.getItemInHand().hurtAndBreak(1, playerentity, (p_220040_1_) -> { - p_220040_1_.broadcastBreakEvent(context.getHand()); - }); - } + world.setBlock(blockPos, blockPath, 11); + + context + .getItemInHand() + .hurtAndBreak( + 1, + player, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent(context.getHand()); + } + ); } return InteractionResult.sidedSuccess(world.isClientSide); } - if (blockstate.is(BlockTags.LOGS)) { - - //tags logs - Block check = STRIPPABLES.get(blockstate.getBlock()); + if (blockState.is(BlockTags.LOGS)) { + // tags logs + Block check = STRIPPABLES.get(blockState.getBlock()); if (check != null) { BlockState block = check.defaultBlockState(); - Player playerentity = context.getPlayer(); - world.playSound(playerentity, blockpos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.AXE_STRIP, + SoundSource.BLOCKS, + 1.0F, + 1.0F + ); if (!world.isClientSide) { - world.setBlock(blockpos, block, 11); - if (playerentity != null) { - context.getItemInHand().hurtAndBreak(1, playerentity, (p_220040_1_) -> { - p_220040_1_.broadcastBreakEvent(context.getHand()); - }); + world.setBlock(blockPos, block, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand() + ); + } + ); } } return InteractionResult.sidedSuccess(world.isClientSide); } - - - } return InteractionResult.PASS; } - - @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); super.appendHoverText(stack, worldIn, tooltip, flagIn); } - protected TranslatableContents getTooltip(String key){ + + protected TranslatableContents getTooltip(String key) { return new TranslatableContents(key); } @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if ( + state.is(BlockTags.MINEABLE_WITH_PICKAXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(BlockTags.MINEABLE_WITH_HOE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(BlockTags.MINEABLE_WITH_SHOVEL) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(BlockTags.MINEABLE_WITH_AXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); return false; } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java index dce38e5a..c98b6bc0 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java @@ -1,7 +1,11 @@ package com.thevortex.allthemodium.items.toolitems.tools; import com.thevortex.allthemodium.material.ToolTiers; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.tags.BlockTags; @@ -14,44 +18,74 @@ import net.minecraftforge.common.TierSortingRegistry; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.List; - public class AlloyPick extends PickaxeItem { - public AlloyPick(Tier tier, int damage, float speed, Properties properties) { + public AlloyPick( + Tier tier, + int damage, + float speed, + Properties properties + ) { super(tier, damage, speed, properties); } + @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed; return super.getDestroySpeed(stack, state); } + @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); super.appendHoverText(stack, worldIn, tooltip, flagIn); } - protected TranslatableContents getTooltip(String key){ + + protected TranslatableContents getTooltip(String key) { return new TranslatableContents(key); } @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if ( + state.is(BlockTags.MINEABLE_WITH_PICKAXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); return false; } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java index 0c3dddb5..b42277c8 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java @@ -1,7 +1,11 @@ package com.thevortex.allthemodium.items.toolitems.tools; import com.thevortex.allthemodium.material.ToolTiers; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.tags.BlockTags; @@ -14,43 +18,74 @@ import net.minecraftforge.common.TierSortingRegistry; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.List; - public class AlloyShovel extends ShovelItem { - public AlloyShovel(Tier tier, int damage, float speed, Properties properties) { + public AlloyShovel( + Tier tier, + int damage, + float speed, + Properties properties + ) { super(tier, damage, speed, properties); } + @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed; return super.getDestroySpeed(stack, state); } + @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); super.appendHoverText(stack, worldIn, tooltip, flagIn); } - protected TranslatableContents getTooltip(String key){ + + protected TranslatableContents getTooltip(String key) { return new TranslatableContents(key); } + @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state); + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if ( + state.is(BlockTags.MINEABLE_WITH_SHOVEL) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state + ); return false; } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java index 55c3e4f4..e59a1258 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java @@ -1,6 +1,10 @@ package com.thevortex.allthemodium.items.toolitems.tools; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.world.item.ItemStack; @@ -10,29 +14,48 @@ import net.minecraft.world.level.Level; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.List; - public class AlloySword extends SwordItem { - public AlloySword(Tier tier, int damage, float speed, Properties properties) { + public AlloySword( + Tier tier, + int damage, + float speed, + Properties properties + ) { super(tier, damage, speed, properties); } + @Override - public boolean isEnchantable(ItemStack stack) { + public boolean isEnchantable(@Nonnull ItemStack stack) { return true; } + @Override public boolean canBeDepleted() { return false; } + @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); super.appendHoverText(stack, worldIn, tooltip, flagIn); } - protected TranslatableContents getTooltip(String key){ + + protected TranslatableContents getTooltip(String key) { return new TranslatableContents(key); } - } diff --git a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java index afcf4dd9..0436b05d 100644 --- a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java +++ b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java @@ -1,8 +1,8 @@ package com.thevortex.allthemodium.material; -import java.util.function.Supplier; - import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.function.Supplier; +import javax.annotation.Nonnull; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.util.LazyLoadedValue; @@ -12,58 +12,91 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +@SuppressWarnings("deprecation") // TODO: Determine alternative to LazyLoadedValue public enum AArmorMaterial implements ArmorMaterial { - ALLTHEMODIUM("allthemodium", 42, new int[]{4, 7, 9, 4}, 85, SoundEvents.ARMOR_EQUIP_NETHERITE, 5.0F, 0.5f, () -> { - return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); - }); - + ALLTHEMODIUM( + "allthemodium", + 42, + new int[] { 4, 7, 9, 4 }, + 85, + SoundEvents.ARMOR_EQUIP_NETHERITE, + 5.0F, + 0.5f, + () -> { + return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); + } + ); + + private static final int[] MAX_DAMAGE_ARRAY = new int[] { 25, 45, 45, 25 }; + private final String name; + + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + private final SoundEvent soundEvent; + private final float toughness; + private final float knockback; + + private final LazyLoadedValue repairMaterial; + + AArmorMaterial( + String nameIn, + int maxDamageFactorIn, + int[] damageReductionAmountsIn, + int enchantabilityIn, + SoundEvent equipSoundIn, + float toughness, + float knockback, + Supplier repairMaterialSupplier + ) { + this.name = nameIn; + this.maxDamageFactor = maxDamageFactorIn; + this.damageReductionAmountArray = damageReductionAmountsIn; + this.enchantability = enchantabilityIn; + this.soundEvent = equipSoundIn; + this.toughness = toughness; + this.repairMaterial = + new LazyLoadedValue(repairMaterialSupplier); + this.knockback = knockback; + } + + @Override + public int getDurabilityForSlot(@Nonnull EquipmentSlot slotIn) { + return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; + } + + @Override + public int getDefenseForSlot(@Nonnull EquipmentSlot slotIn) { + return this.damageReductionAmountArray[slotIn.getIndex()]; + } + + @Override + public int getEnchantmentValue() { + return this.enchantability; + } + + @Override + public SoundEvent getEquipSound() { + return this.soundEvent; + } + + @Override + public Ingredient getRepairIngredient() { + return this.repairMaterial.get(); + } - private static final int[] MAX_DAMAGE_ARRAY = new int[]{25, 45, 45, 25}; - private final String name; - - private final int maxDamageFactor; - private final int[] damageReductionAmountArray; - private final int enchantability; - private final SoundEvent soundEvent; - private final float toughness; - private final float knockback; - private final LazyLoadedValue repairMaterial; + @OnlyIn(Dist.CLIENT) + public String getName() { + return this.name; + } - AArmorMaterial(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountsIn, int enchantabilityIn, SoundEvent equipSoundIn, float toughness, float knockback, Supplier repairMaterialSupplier) { - this.name = nameIn; - this.maxDamageFactor = maxDamageFactorIn; - this.damageReductionAmountArray = damageReductionAmountsIn; - this.enchantability = enchantabilityIn; - this.soundEvent = equipSoundIn; - this.toughness = toughness; - this.repairMaterial = new LazyLoadedValue(repairMaterialSupplier); - this.knockback = knockback; - } - @Override - public int getDurabilityForSlot(EquipmentSlot slotIn) { return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; } - @Override - public int getDefenseForSlot(EquipmentSlot slotIn) { return this.damageReductionAmountArray[slotIn.getIndex()]; } - @Override - public int getEnchantmentValue() { - return this.enchantability; - } - @Override - public SoundEvent getEquipSound() { - return this.soundEvent; - } - @Override - public Ingredient getRepairIngredient() { - return this.repairMaterial.get(); - } - @OnlyIn(Dist.CLIENT) - public String getName() { - return this.name; - } - @Override - public float getToughness() { - return this.toughness; - } - @Override - public float getKnockbackResistance() { return this.knockback; } + @Override + public float getToughness() { + return this.toughness; + } + @Override + public float getKnockbackResistance() { + return this.knockback; + } } diff --git a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java index 638c2e62..dc9e5efe 100644 --- a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java +++ b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java @@ -1,8 +1,9 @@ package com.thevortex.allthemodium.material; import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; +import java.util.List; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.tags.TagKey; @@ -13,25 +14,45 @@ import net.minecraftforge.common.ForgeTier; import net.minecraftforge.common.TierSortingRegistry; -import java.util.List; - public class ToolTiers { - - public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create(new ResourceLocation("mineable/pickaxe")); - - public static final TagKey ALLTHEMODIUM_TIER_TAG = TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; - public static final TagKey ALLOY_TIER_TAG = TagRegistry.NEEDS_ALLOY_TOOL; - - - public static final Tier ALLTHEMODIUM_TIER = TierSortingRegistry.registerTier( - new ForgeTier(5, 15000, 10, 11.0F, 85, ALLTHEMODIUM_TIER_TAG, () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), - new ResourceLocation(Reference.MOD_ID,"allthemodium"), - List.of(Tiers.NETHERITE), List.of()); + public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create( + new ResourceLocation("mineable/pickaxe") + ); + + public static final TagKey ALLTHEMODIUM_TIER_TAG = + TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; + public static final TagKey ALLOY_TIER_TAG = + TagRegistry.NEEDS_ALLOY_TOOL; + + public static final Tier ALLTHEMODIUM_TIER = + TierSortingRegistry.registerTier( + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLTHEMODIUM_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()) + ), + new ResourceLocation(Reference.MOD_ID, "allthemodium"), + List.of(Tiers.NETHERITE), + List.of() + ); public static final Tier ALLOY_TIER = TierSortingRegistry.registerTier( - new ForgeTier(5, 15000, 10, 11.0F, 85, ALLOY_TIER_TAG, () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), - new ResourceLocation(Reference.MOD_ID,"allthemodium_alloy"), - List.of(ToolTiers.ALLTHEMODIUM_TIER), List.of()); - + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLOY_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()) + ), + new ResourceLocation(Reference.MOD_ID, "allthemodium_alloy"), + List.of(ToolTiers.ALLTHEMODIUM_TIER), + List.of() + ); } diff --git a/src/main/java/com/thevortex/allthemodium/reference/Reference.java b/src/main/java/com/thevortex/allthemodium/reference/Reference.java index 0c8d5166..a4c50ff4 100644 --- a/src/main/java/com/thevortex/allthemodium/reference/Reference.java +++ b/src/main/java/com/thevortex/allthemodium/reference/Reference.java @@ -1,71 +1,93 @@ package com.thevortex.allthemodium.reference; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.Block; - public class Reference { - public static final ResourceLocation ORETYPE = location("forge:ores/allthemodium"); - public static final ResourceLocation ORETYPE2 = location("forge:ores/vibranium"); - public static final ResourceLocation ORETYPE3 = location("forge:ores/unobtainium"); - public static final String MOD_ID = "allthemodium"; - - public static ResourceLocation atm(String path) { - return new ResourceLocation(MOD_ID, path); - } - public static ResourceLocation mek(String path) { - return new ResourceLocation("mekanism", path); - } - public static ResourceLocation location(String pathIn) { - return new ResourceLocation(pathIn); - } - public static ResourceLocation forge(String path) { - return new ResourceLocation("forge", path); - } - public static ResourceLocation raw_ores(String path) { - return forge("raw_ores/" + path); - } - public static ResourceLocation material(String path) { - return forge("raw_materials/" + path); - } - public static ResourceLocation ingot(String path) { - return forge("ingots/" + path); - } - public static ResourceLocation dust(String path) { - return forge("dusts/" + path); - } - public static ResourceLocation dirty(String path) { - return mek("dirty_dusts/" + path); - } - public static ResourceLocation shard(String path) { - return mek("shards/" + path); - } - public static ResourceLocation clump(String path) { - return mek("clumps/" + path); - } - public static ResourceLocation crystal(String path) { - return mek("crystals/" + path); - } - public static ResourceLocation nugget(String path) { - return forge("nuggets/" + path); - } - public static ResourceLocation ore(String path) { - return forge("ores/" + path); - } - public static ResourceLocation rod(String path) { - return forge("rods/" + path); - } - public static ResourceLocation gear(String path) { - return forge("gears/" + path); - } - public static ResourceLocation plate(String path) { - return forge("plates/" + path); - } - public static ResourceLocation block(String path) { - return forge("storage_blocks/" + path); - } - public static ResourceLocation raw_block(String path) { - return forge("raw_blocks/" + path); - } + public static final ResourceLocation ORE_TYPE = location( + "forge:ores/allthemodium" + ); + public static final ResourceLocation ORE_TYPE2 = location( + "forge:ores/vibranium" + ); + public static final ResourceLocation ORE_TYPE3 = location( + "forge:ores/unobtainium" + ); + public static final String MOD_ID = "allthemodium"; + + public static ResourceLocation atm(String path) { + return new ResourceLocation(MOD_ID, path); + } + + public static ResourceLocation mek(String path) { + return new ResourceLocation("mekanism", path); + } + + public static ResourceLocation location(String pathIn) { + return new ResourceLocation(pathIn); + } + + public static ResourceLocation forge(String path) { + return new ResourceLocation("forge", path); + } + + public static ResourceLocation raw_ores(String path) { + return forge("raw_ores/" + path); + } + + public static ResourceLocation material(String path) { + return forge("raw_materials/" + path); + } + + public static ResourceLocation ingot(String path) { + return forge("ingots/" + path); + } + + public static ResourceLocation dust(String path) { + return forge("dusts/" + path); + } + + public static ResourceLocation dirty(String path) { + return mek("dirty_dusts/" + path); + } + + public static ResourceLocation shard(String path) { + return mek("shards/" + path); + } + + public static ResourceLocation clump(String path) { + return mek("clumps/" + path); + } + + public static ResourceLocation crystal(String path) { + return mek("crystals/" + path); + } + + public static ResourceLocation nugget(String path) { + return forge("nuggets/" + path); + } + + public static ResourceLocation ore(String path) { + return forge("ores/" + path); + } + + public static ResourceLocation rod(String path) { + return forge("rods/" + path); + } + + public static ResourceLocation gear(String path) { + return forge("gears/" + path); + } + + public static ResourceLocation plate(String path) { + return forge("plates/" + path); + } + + public static ResourceLocation block(String path) { + return forge("storage_blocks/" + path); + } + + public static ResourceLocation raw_block(String path) { + return forge("raw_blocks/" + path); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java index bfcd2296..eaf466a0 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java @@ -12,16 +12,67 @@ public class BlockRegistry { - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - - public static final RegistryObject SOULLAVA_BLOCK = BLOCKS.register("soul_lava",() -> new SoulLava(FluidRegistry.SOULLAVA, Block.Properties.of(Material.LAVA).noCollission().strength(100f).noOcclusion().jumpFactor(0.1F).speedFactor(0.01F).lightLevel((light) -> { - return 15; - }).color(MaterialColor.COLOR_BLUE).noLootTable())); - - public static final RegistryObject MOLTEN_ATM_BLOCK = BLOCKS.register("molten_allthemodium_block",() -> new LiquidBlock(FluidRegistry.ALLTHEMODIUM, Block.Properties.of(Material.LAVA).noCollission().strength(100f).noLootTable())); - public static final RegistryObject MOLTEN_VIB_BLOCK = BLOCKS.register("molten_vibranium_block",() -> new LiquidBlock(FluidRegistry.VIBRANIUM, Block.Properties.of(Material.LAVA).noCollission().strength(100f).noLootTable())); - public static final RegistryObject MOLTEN_UNOB_BLOCK = BLOCKS.register("molten_unobtainium_block",() -> new LiquidBlock(FluidRegistry.UNOBTAINIUM, Block.Properties.of(Material.LAVA).noCollission().strength(100f).noLootTable())); + public static final DeferredRegister BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final RegistryObject SOULLAVA_BLOCK = + BLOCKS.register( + "soul_lava", + () -> + new SoulLava( + FluidRegistry.SOULLAVA, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noOcclusion() + .jumpFactor(0.1F) + .speedFactor(0.01F) + .lightLevel(light -> { + return 15; + }) + .color(MaterialColor.COLOR_BLUE) + .noLootTable() + ) + ); + public static final RegistryObject MOLTEN_ATM_BLOCK = + BLOCKS.register( + "molten_allthemodium_block", + () -> + new LiquidBlock( + FluidRegistry.ALLTHEMODIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable() + ) + ); + public static final RegistryObject MOLTEN_VIB_BLOCK = + BLOCKS.register( + "molten_vibranium_block", + () -> + new LiquidBlock( + FluidRegistry.VIBRANIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable() + ) + ); + public static final RegistryObject MOLTEN_UNOB_BLOCK = + BLOCKS.register( + "molten_unobtainium_block", + () -> + new LiquidBlock( + FluidRegistry.UNOBTAINIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable() + ) + ); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java index 87d3ef4b..cdaf9f74 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java @@ -9,7 +9,10 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + bus = Mod.EventBusSubscriber.Bus.MOD +) public class FluidInteractionsRegistry { @SubscribeEvent @@ -21,8 +24,25 @@ public static void register(FMLCommonSetupEvent event) { // Lava + Water = Obsidian (Source Lava) / Cobblestone (Flowing Lava) private static void addInteraction(FluidType fluidType) { - FluidInteractionRegistry.addInteraction(ForgeMod.LAVA_TYPE.get(), new FluidInteractionRegistry.InteractionInformation(fluidType, fluidState -> fluidState.isSource() ? Blocks.GILDED_BLACKSTONE.defaultBlockState() : Blocks.BLACKSTONE.defaultBlockState())); - FluidInteractionRegistry.addInteraction(ForgeMod.WATER_TYPE.get(), new FluidInteractionRegistry.InteractionInformation(fluidType, fluidState -> fluidState.isSource() ? Blocks.CRYING_OBSIDIAN.defaultBlockState() : Blocks.OBSIDIAN.defaultBlockState())); - + FluidInteractionRegistry.addInteraction( + ForgeMod.LAVA_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> + fluidState.isSource() + ? Blocks.GILDED_BLACKSTONE.defaultBlockState() + : Blocks.BLACKSTONE.defaultBlockState() + ) + ); + FluidInteractionRegistry.addInteraction( + ForgeMod.WATER_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> + fluidState.isSource() + ? Blocks.CRYING_OBSIDIAN.defaultBlockState() + : Blocks.OBSIDIAN.defaultBlockState() + ) + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java index e0877ea3..4cec7c39 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java @@ -7,33 +7,34 @@ import com.thevortex.allthemodium.reference.Reference; import net.minecraft.world.level.material.FlowingFluid; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.fluids.ForgeFlowingFluid; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class FluidRegistry { - public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, Reference.MOD_ID); - - public static final RegistryObject SOULLAVA = FLUIDS.register("soul_lava", - FluidSoulLava.Source::new); - public static final RegistryObject FLOWING_SOULLAVA = FLUIDS.register("flowing_soul_lava", - FluidSoulLava.Flowing::new); - - - public static final RegistryObject ALLTHEMODIUM = FLUIDS.register("molten_allthemodium", - FluidATM.Source::new); - public static final RegistryObject FLOWING_ALLTHEMODIUM = FLUIDS.register("flowing_molten_allthemodium", - FluidATM.Flowing::new); - - public static final RegistryObject VIBRANIUM = FLUIDS.register("molten_vibranium", - FluidVIB.Source::new); - public static final RegistryObject FLOWING_VIBRANIUM = FLUIDS.register("flowing_molten_vibranium", - FluidVIB.Flowing::new); - - public static final RegistryObject UNOBTAINIUM = FLUIDS.register("molten_unobtainium", - FluidUNOB.Source::new); - public static final RegistryObject FLOWING_UNOBTAINIUM = FLUIDS.register("flowing_molten_unobtainium", - FluidUNOB.Flowing::new); + public static final DeferredRegister FLUIDS = + DeferredRegister.create(ForgeRegistries.FLUIDS, Reference.MOD_ID); + + public static final RegistryObject SOULLAVA = FLUIDS.register( + "soul_lava", + FluidSoulLava.Source::new + ); + public static final RegistryObject FLOWING_SOULLAVA = + FLUIDS.register("flowing_soul_lava", FluidSoulLava.Flowing::new); + + public static final RegistryObject ALLTHEMODIUM = + FLUIDS.register("molten_allthemodium", FluidATM.Source::new); + public static final RegistryObject FLOWING_ALLTHEMODIUM = + FLUIDS.register("flowing_molten_allthemodium", FluidATM.Flowing::new); + + public static final RegistryObject VIBRANIUM = + FLUIDS.register("molten_vibranium", FluidVIB.Source::new); + public static final RegistryObject FLOWING_VIBRANIUM = + FLUIDS.register("flowing_molten_vibranium", FluidVIB.Flowing::new); + + public static final RegistryObject UNOBTAINIUM = + FLUIDS.register("molten_unobtainium", FluidUNOB.Source::new); + public static final RegistryObject FLOWING_UNOBTAINIUM = + FLUIDS.register("flowing_molten_unobtainium", FluidUNOB.Flowing::new); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java index 56a02b24..8323f30f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java @@ -13,49 +13,105 @@ import net.minecraftforge.registries.RegistryObject; public class FluidTypeRegistry { - public static final DeferredRegister FLUID_TYPES = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, Reference.MOD_ID); - public static final RegistryObject SOULLAVA = FLUID_TYPES.register("soul_lava", () -> new SoulLavaType(FluidType.Properties.create() - .descriptionId("block." + Reference.MOD_ID + ".soul_lava") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false) - )); + public static final DeferredRegister FLUID_TYPES = + DeferredRegister.create( + ForgeRegistries.Keys.FLUID_TYPES, + Reference.MOD_ID + ); - public static final RegistryObject ATM = FLUID_TYPES.register("molten_atm", () -> new MoltenATMType(FluidType.Properties.create() - .descriptionId("block." + Reference.MOD_ID + ".molten_allthemodium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false) - )); + public static final RegistryObject SOULLAVA = + FLUID_TYPES.register( + "soul_lava", + () -> + new SoulLavaType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".soul_lava" + ) + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound( + SoundActions.BUCKET_FILL, + SoundEvents.BUCKET_FILL + ) + .sound( + SoundActions.BUCKET_EMPTY, + SoundEvents.BUCKET_EMPTY + ) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH + ) + .canHydrate(false) + ) + ); - public static final RegistryObject VIB = FLUID_TYPES.register("molten_vibranium", () -> new MoltenVIBType(FluidType.Properties.create() - .descriptionId("block." + Reference.MOD_ID + ".molten_vibranium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false) - )); + public static final RegistryObject ATM = FLUID_TYPES.register( + "molten_atm", + () -> + new MoltenATMType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_allthemodium" + ) + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH + ) + .canHydrate(false) + ) + ); - public static final RegistryObject UNOB = FLUID_TYPES.register("molten_unobtainium", () -> new MoltenUNOBType(FluidType.Properties.create() - .descriptionId("block." + Reference.MOD_ID + ".molten_unobtainium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false) - )); + public static final RegistryObject VIB = FLUID_TYPES.register( + "molten_vibranium", + () -> + new MoltenVIBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_vibranium" + ) + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH + ) + .canHydrate(false) + ) + ); + + public static final RegistryObject UNOB = FLUID_TYPES.register( + "molten_unobtainium", + () -> + new MoltenUNOBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_unobtainium" + ) + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH + ) + .canHydrate(false) + ) + ); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java index c282de6e..8863258e 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java @@ -11,17 +11,134 @@ public class ItemRegistry { - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Reference.MOD_ID); + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID + ); - public static final RegistryObject SOUL_LAVA_BUCKET = ITEMS.register("soul_lava_bucket", () -> new BucketItem(FluidRegistry.SOULLAVA, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1).tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LAVA_BUCKET = + ITEMS.register( + "soul_lava_bucket", + () -> + new BucketItem( + FluidRegistry.SOULLAVA, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP) + ) + ); - public static final RegistryObject MOLTEN_ATM_BUCKET = ITEMS.register("molten_allthemodium_bucket", () -> new BucketItem(FluidRegistry.ALLTHEMODIUM, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1).tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_VIB_BUCKET = ITEMS.register("molten_vibranium_bucket", () -> new BucketItem(FluidRegistry.VIBRANIUM, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1).tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_UNOB_BUCKET = ITEMS.register("molten_unobtainium_bucket", () -> new BucketItem(FluidRegistry.UNOBTAINIUM, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1).tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_ATM_BUCKET = + ITEMS.register( + "molten_allthemodium_bucket", + () -> + new BucketItem( + FluidRegistry.ALLTHEMODIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject MOLTEN_VIB_BUCKET = + ITEMS.register( + "molten_vibranium_bucket", + () -> + new BucketItem( + FluidRegistry.VIBRANIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject MOLTEN_UNOB_BUCKET = + ITEMS.register( + "molten_unobtainium_bucket", + () -> + new BucketItem( + FluidRegistry.UNOBTAINIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP) + ) + ); - public static final RegistryObject ATM_ALLOY_SWORD = ITEMS.register("alloy_sword", () -> new AlloySword(ToolTiers.ALLOY_TIER,35,5.0F,new Item.Properties().fireResistant().stacksTo(1).rarity(Rarity.EPIC).tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register("alloy_axe", () -> new AlloyAxe(ToolTiers.ALLOY_TIER,39,5.0F,new Item.Properties().fireResistant().stacksTo(1).rarity(Rarity.EPIC).tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_PICK = ITEMS.register("alloy_pick", () -> new AlloyPick(ToolTiers.ALLOY_TIER,15,5.0F,new Item.Properties().fireResistant().stacksTo(1).rarity(Rarity.EPIC).tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_SHOVEL = ITEMS.register("alloy_shovel", () -> new AlloyShovel(ToolTiers.ALLOY_TIER,13,5.0F,new Item.Properties().fireResistant().stacksTo(1).rarity(Rarity.EPIC).tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_PAXEL = ITEMS.register("alloy_paxel", () -> new AlloyPaxel(33,5.0F,ToolTiers.ALLOY_TIER, TagRegistry.PAXEL_TARGETS,new Item.Properties().fireResistant().stacksTo(1).rarity(Rarity.EPIC).tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_SWORD = + ITEMS.register( + "alloy_sword", + () -> + new AlloySword( + ToolTiers.ALLOY_TIER, + 35, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register( + "alloy_axe", + () -> + new AlloyAxe( + ToolTiers.ALLOY_TIER, + 39, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ATM_ALLOY_PICK = + ITEMS.register( + "alloy_pick", + () -> + new AlloyPick( + ToolTiers.ALLOY_TIER, + 15, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ATM_ALLOY_SHOVEL = + ITEMS.register( + "alloy_shovel", + () -> + new AlloyShovel( + ToolTiers.ALLOY_TIER, + 13, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ATM_ALLOY_PAXEL = + ITEMS.register( + "alloy_paxel", + () -> + new AlloyPaxel( + 33, + 5.0F, + ToolTiers.ALLOY_TIER, + TagRegistry.PAXEL_TARGETS, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP) + ) + ); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java index 89056014..788def86 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java @@ -1,16 +1,21 @@ package com.thevortex.allthemodium.registry; -import com.thevortex.allthemodium.AllTheModium; +import static com.thevortex.allthemodium.AllTheModium.MINING_DIM_ID; +import static com.thevortex.allthemodium.AllTheModium.THE_OTHER_DIM_ID; + import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.Level; -import static com.thevortex.allthemodium.AllTheModium.MINING_DIM_ID; -import static com.thevortex.allthemodium.AllTheModium.THE_OTHER_DIM_ID; - public class LevelRegistry { - public static final ResourceKey Mining = ResourceKey.create(Registry.DIMENSION_REGISTRY, MINING_DIM_ID); - public static final ResourceKey THE_OTHER = ResourceKey.create(Registry.DIMENSION_REGISTRY, THE_OTHER_DIM_ID); + public static final ResourceKey Mining = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + MINING_DIM_ID + ); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID + ); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java index a81043f1..4cf2e73e 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java @@ -1,30 +1,40 @@ package com.thevortex.allthemodium.registry; - import com.thevortex.allthemodium.registry.resource.ATMResource; +import java.util.function.UnaryOperator; import mekanism.api.MekanismAPI; import mekanism.api.chemical.slurry.Slurry; import mekanism.api.chemical.slurry.SlurryBuilder; import mekanism.common.registration.WrappedDeferredRegister; import mekanism.common.registration.impl.SlurryRegistryObject; -import java.util.function.UnaryOperator; - public class MekRegistry extends WrappedDeferredRegister { - -public MekRegistry(String modid) { + public MekRegistry(String modid) { super(modid, MekanismAPI.slurryRegistryName()); - } - -public SlurryRegistryObject register(ATMResource resource) { - return register(resource.getRegistrySuffix(), builder -> builder.color(resource.getTint()).ore(resource.getOreTag())); - } - -public SlurryRegistryObject register(String baseName, UnaryOperator builderModifier) { - return new SlurryRegistryObject<>(internal.register("dirty_" + baseName, () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty()))), - internal.register("clean_" + baseName, () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())))); - } - - - } + } + + public SlurryRegistryObject register(ATMResource resource) { + return register( + resource.getRegistrySuffix(), + builder -> + builder.color(resource.getTint()).ore(resource.getOreTag()) + ); + } + + public SlurryRegistryObject register( + String baseName, + UnaryOperator builderModifier + ) { + return new SlurryRegistryObject<>( + internal.register( + "dirty_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty())) + ), + internal.register( + "clean_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())) + ) + ); + } +} diff --git a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java index 2324bfd0..5b0e49fc 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java @@ -1,15 +1,14 @@ package com.thevortex.allthemodium.registry; -import com.google.common.base.Preconditions; import com.thevortex.allthemodium.AllTheModium; import com.thevortex.allthemodium.blocks.*; -import com.thevortex.allthemodium.blocks.Allthemodium_Block; -import com.thevortex.allthemodium.blocks.Allthemodium_Ore; +import com.thevortex.allthemodium.blocks.AllthemodiumBlock; +import com.thevortex.allthemodium.blocks.AllthemodiumOre; import com.thevortex.allthemodium.blocks.TeleportPad; -import com.thevortex.allthemodium.blocks.Unobtainium_Block; -import com.thevortex.allthemodium.blocks.Unobtainium_Ore; -import com.thevortex.allthemodium.blocks.Vibranium_Block; -import com.thevortex.allthemodium.blocks.Vibranium_Ore; +import com.thevortex.allthemodium.blocks.UnobtainiumBlock; +import com.thevortex.allthemodium.blocks.UnobtainiumOre; +import com.thevortex.allthemodium.blocks.VibraniumBlock; +import com.thevortex.allthemodium.blocks.VibraniumOre; import com.thevortex.allthemodium.entity.PiglichEntity; import com.thevortex.allthemodium.init.ModFoods; import com.thevortex.allthemodium.items.*; @@ -19,18 +18,18 @@ import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.worldgen.biomes.ATMBiomes; import com.thevortex.allthemodium.worldgen.features.*; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.ChatFormatting; +import net.minecraft.commands.CommandSource; import net.minecraft.core.Direction; -import net.minecraft.core.Registry; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.contents.TranslatableContents; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.MobCategory; -import net.minecraft.world.entity.animal.AbstractGolem; import net.minecraft.world.entity.monster.Monster; import net.minecraft.world.item.*; import net.minecraft.world.level.Level; @@ -39,605 +38,2524 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.carver.CanyonCarverConfiguration; -import net.minecraft.world.level.levelgen.carver.CaveCarverConfiguration; import net.minecraft.world.level.levelgen.carver.WorldCarver; import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Material; - import net.minecraft.world.level.material.MaterialColor; import net.minecraftforge.common.TierSortingRegistry; -import net.minecraftforge.common.extensions.IForgeFluidState; -import net.minecraftforge.common.world.BiomeModifier; import net.minecraftforge.event.entity.EntityAttributeCreationEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.ForgeFlowingFluid; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.ObjectHolder; import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.server.command.TextComponentHelper; -import java.util.ArrayList; -import java.util.List; - -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + bus = Mod.EventBusSubscriber.Bus.MOD +) public class ModRegistry { - - public static final DeferredRegister SHAPED_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister STAIRBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister WALLBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister SLABBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister PILLARBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, - Reference.MOD_ID); - - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Reference.MOD_ID); - - - - public static final DeferredRegister> ENTITY = DeferredRegister - .create(ForgeRegistries.BLOCK_ENTITY_TYPES, Reference.MOD_ID); - public static final DeferredRegister> CARVERS = DeferredRegister - .create(ForgeRegistries.WORLD_CARVERS, Reference.MOD_ID); - public static final DeferredRegister> ENTITIES = DeferredRegister - .create(ForgeRegistries.ENTITY_TYPES, Reference.MOD_ID); - - public static final DeferredRegister> FEATURES = - DeferredRegister.create(ForgeRegistries.FEATURES, Reference.MOD_ID); - - private static ArrayList SPAWN_EGGS = new ArrayList(); - - // BIOMES - - RegistryObject MINING = BIOMES.register("mining", () -> ATMBiomes.mining()); - RegistryObject THE_OTHER = BIOMES.register("the_other", () -> ATMBiomes.the_other()); - RegistryObject DESERT = BIOMES.register("desert", () -> ATMBiomes.desert()); - RegistryObject DESERT_HILLS = BIOMES.register("desert_hills", () -> ATMBiomes.desert_hills()); - RegistryObject SOULSAND = BIOMES.register("soul_sand_valley", () -> ATMBiomes.soul_sand_valley()); - RegistryObject WARPED_FOREST = BIOMES.register("warped_forest", () -> ATMBiomes.warped_forest()); - RegistryObject CRIMSON_FOREST = BIOMES.register("crimson_forest", () -> ATMBiomes.crimson_forest()); - RegistryObject BASALT_DELTAS = BIOMES.register("basalt_deltas", () -> ATMBiomes.basalt_deltas()); - - - - // FOOD - - public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register("allthemodium_apple", () -> new Allthemodium_Apple(new Item.Properties().tab(AllTheModium.GROUP).fireResistant().food(ModFoods.ALLTHEMODIUM_APPLE).rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register("allthemodium_carrot", () -> new Allthemodium_Carrot(new Item.Properties().tab(AllTheModium.GROUP).fireResistant().food(ModFoods.ALLTHEMODIUM_CARROT).rarity(Rarity.EPIC))); - - // ARMORS - - public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register("allthemodium_boots", () -> (ArmorItem) new Allthemodium_Boots(AArmorMaterial.ALLTHEMODIUM, EquipmentSlot.FEET, new Item.Properties().tab(AllTheModium.GROUP).stacksTo(1).fireResistant().rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_LEGGINGS = ITEMS.register("allthemodium_leggings", () -> (ArmorItem) new Allthemodium_Leggings(AArmorMaterial.ALLTHEMODIUM, EquipmentSlot.LEGS, new Item.Properties().tab(AllTheModium.GROUP).stacksTo(1).fireResistant().rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_CHESTPLATE = ITEMS.register("allthemodium_chestplate", () -> (ArmorItem) new Allthemodium_Chestplate(AArmorMaterial.ALLTHEMODIUM, EquipmentSlot.CHEST, new Item.Properties().tab(AllTheModium.GROUP).stacksTo(1).fireResistant().rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_HELMET = ITEMS.register("allthemodium_helmet", () -> (ArmorItem) new Allthemodium_Helmet(AArmorMaterial.ALLTHEMODIUM, EquipmentSlot.HEAD, new Item.Properties().tab(AllTheModium.GROUP).stacksTo(1).fireResistant().rarity(Rarity.EPIC))); - - - //Volcano - - public static Feature VOLCANO_F = new Volcano(VolcanoConfig.CODEC); - public static RegistryObject> VOLCANO = FEATURES.register("volcano", () -> VOLCANO_F); - - - public static final RegistryObject ANCIENT_CAVEVINES_ = PILLARBLOCKS.register("ancient_cavevines", () -> new AncientCaveVines(BlockBehaviour.Properties.of(Material.PLANT) - .randomTicks() - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES) - ,Direction.DOWN - ,ACaveVines.SHAPE - ,false - ,0.1D)); - - public static final RegistryObject ANCIENT_CAVEVINES_PLANT_ = PILLARBLOCKS.register("ancient_cavevines_plant", () -> new AncientCaveVinesPlant(BlockBehaviour.Properties.of(Material.PLANT) - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES) - ,Direction.DOWN - ,ACaveVines.SHAPE - , false)); - - public static final RegistryObject ANCIENT_HERB = PILLARBLOCKS.register("ancient_herb",() -> new AncientHerb(BlockBehaviour.Properties.of(Material.GRASS).sound(SoundType.WET_GRASS).instabreak().noCollission())); - - public static final RegistryObject ANCIENT_SMOOTH_STONE = BLOCKS.register("ancient_smooth_stone", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.STONE).strength(2.25f))); - public static final RegistryObject ANCIENT_STONE = BLOCKS.register("ancient_stone", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.STONE).strength(1.5f))); - public static final RegistryObject ANCIENT_DIRT = BLOCKS.register("ancient_dirt", () -> new AncientDirt(BlockBehaviour.Properties.of(Material.DIRT).sound(SoundType.WET_GRASS).strength(0.6f))); - public static final RegistryObject ANCIENT_GRASS = BLOCKS.register("ancient_grass", () -> new Ancient_Grass(BlockBehaviour.Properties.of(Material.DIRT).sound(SoundType.MOSS).strength(0.6f))); - public static final RegistryObject ANCIENT_MOSSY_STONE = BLOCKS.register("ancient_mossy_stone", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.MOSS_CARPET).strength(1.5f))); - public static final RegistryObject ANCIENT_STONE_BRICKS = BLOCKS.register("ancient_stone_bricks", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.NETHER_BRICKS).strength(3.5f))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = BLOCKS.register("ancient_chiseled_stone_bricks", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.NETHER_BRICKS).strength(3.0f))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = BLOCKS.register("ancient_cracked_stone_bricks", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.NETHER_BRICKS).strength(3.25f))); - public static final RegistryObject ANCIENT_POLISHED_STONE = BLOCKS.register("ancient_polished_stone", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.METAL).strength(2.5f))); - - public static final RegistryObject ANCIENT_LOG_0 = PILLARBLOCKS.register("ancient_log_0",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_1 = PILLARBLOCKS.register("ancient_log_1",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_2 = PILLARBLOCKS.register("ancient_log_2",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_STRIPPED = PILLARBLOCKS.register("stripped_ancient_log",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register("ancient_leaves", () -> new AncientLeaves(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noOcclusion().color(MaterialColor.COLOR_PURPLE))); - public static final RegistryObject ANCIENT_LEAVES_BOTTOM = PILLARBLOCKS.register("ancient_leaves_bottom", () -> new AncientLeavesBottom(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noCollission().noOcclusion().color(MaterialColor.COLOR_PURPLE))); - public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register("ancient_planks", () -> new Block(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_TRAPDOOR = PILLARBLOCKS.register("ancient_trap_door", () -> new TrapDoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.2F).randomTicks().sound(SoundType.WOOD).noOcclusion())); - public static final RegistryObject ANCIENT_WOOD_FENCE = PILLARBLOCKS.register("ancient_wooden_fence", () -> new FenceBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = PILLARBLOCKS.register("ancient_wooden_fence_gate", () -> new FenceGateBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_DOOR_ = PILLARBLOCKS.register("ancient_door", () -> new DoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(2.0F).sound(SoundType.WOOD))); - - public static final RegistryObject DEMONIC_HERB = PILLARBLOCKS.register("demonic_herb",() -> new AncientHerb(BlockBehaviour.Properties.of(Material.GRASS).sound(SoundType.WET_GRASS).instabreak().noCollission())); - public static final RegistryObject DEMONIC_LOG = PILLARBLOCKS.register("demonic_log",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject DEMONIC_LOG_STRIPPED = PILLARBLOCKS.register("stripped_demonic_log",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register("demonic_leaves", () -> new DemonicLeaves(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noOcclusion().color(MaterialColor.COLOR_RED))); - public static final RegistryObject DEMONIC_LEAVES_BOTTOM = PILLARBLOCKS.register("demonic_leaves_bottom", () -> new DemonicLeavesBottom(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noCollission().noOcclusion().color(MaterialColor.COLOR_RED))); - public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register("demonic_planks", () -> new Block(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_TRAPDOOR = PILLARBLOCKS.register("demonic_trap_door", () -> new TrapDoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.2F).randomTicks().sound(SoundType.WOOD).noOcclusion())); - public static final RegistryObject DEMONIC_WOOD_FENCE = PILLARBLOCKS.register("demonic_wooden_fence", () -> new FenceBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = PILLARBLOCKS.register("demonic_wooden_fence_gate", () -> new FenceGateBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_DOOR_ = PILLARBLOCKS.register("demonic_door", () -> new DoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(2.0F).sound(SoundType.WOOD))); - - public static final RegistryObject SOUL_HERB = PILLARBLOCKS.register("soul_herb",() -> new AncientHerb(BlockBehaviour.Properties.of(Material.GRASS).sound(SoundType.WET_GRASS).instabreak().noCollission())); - public static final RegistryObject SOUL_LOG = PILLARBLOCKS.register("soul_log",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_0 = PILLARBLOCKS.register("soul_log_0",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_1 = PILLARBLOCKS.register("soul_log_1",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_2 = PILLARBLOCKS.register("soul_log_2",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_STRIPPED = PILLARBLOCKS.register("stripped_soul_log",() -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LEAVES = BLOCKS.register("soul_leaves", () -> new SoulLeaves(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noOcclusion().color(MaterialColor.COLOR_BLUE))); - public static final RegistryObject SOUL_LEAVES_BOTTOM = PILLARBLOCKS.register("soul_leaves_bottom", () -> new SoulLeavesBottom(BlockBehaviour.Properties.of(Material.LEAVES).strength(0.2F).randomTicks().sound(SoundType.AZALEA_LEAVES).noCollission().noOcclusion().color(MaterialColor.COLOR_BLUE))); - public static final RegistryObject SOUL_PLANKS = BLOCKS.register("soul_planks", () -> new Block(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - public static final RegistryObject SOUL_TRAPDOOR = PILLARBLOCKS.register("soul_trap_door", () -> new TrapDoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.2F).randomTicks().sound(SoundType.WOOD).noOcclusion())); - public static final RegistryObject SOUL_WOOD_FENCE = PILLARBLOCKS.register("soul_wooden_fence", () -> new FenceBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject SOUL_WOOD_FENCE_GATE = PILLARBLOCKS.register("soul_wooden_fence_gate", () -> new FenceGateBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).dynamicShape().sound(SoundType.WOOD))); - public static final RegistryObject SOUL_DOOR_ = PILLARBLOCKS.register("soul_door", () -> new DoorBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(2.0F).sound(SoundType.WOOD))); - - - public static final RegistryObject ANCIENT_STONE_WALL = WALLBLOCKS.register("ancient_stone_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = WALLBLOCKS.register("ancient_smooth_stone_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = WALLBLOCKS.register("ancient_polished_stone_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL = WALLBLOCKS.register("ancient_stone_brick_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL = WALLBLOCKS.register("ancient_chiseled_stone_brick_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_CHISELED_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL = WALLBLOCKS.register("ancient_cracked_stone_brick_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_CRACKED_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = WALLBLOCKS.register("ancient_mossy_stone_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - - public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = ITEMS.register("ancient_cavevines_plant", () ->new BlockItem(ANCIENT_CAVEVINES_PLANT_.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register("ancient_soulberries",() -> new SoulBerries(ANCIENT_CAVEVINES_.get(),(new Item.Properties()).food(ModFoods.SOUL_BERRIES).tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = ITEMS.register("ancient_trap_door", () -> new BlockItem(ANCIENT_TRAPDOOR.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = ITEMS.register("demonic_trap_door", () -> new BlockItem(DEMONIC_TRAPDOOR.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_TRAP_DOOR_ITEM = ITEMS.register("soul_trap_door", () -> new BlockItem(SOUL_TRAPDOOR.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register("ancient_door", () -> new BlockItem(ANCIENT_DOOR_.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register("demonic_door", () -> new BlockItem(DEMONIC_DOOR_.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register("soul_door", () -> new BlockItem(SOUL_DOOR_.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - - public static final RegistryObject ANCIENT_STONE_WALL_ITEM = ITEMS.register("ancient_stone_wall", () -> new BlockItem(ANCIENT_STONE_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = ITEMS.register("ancient_smooth_stone_wall", () -> new BlockItem(ANCIENT_SMOOTH_STONE_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = ITEMS.register("ancient_polished_stone_wall", () -> new BlockItem(ANCIENT_POLISHED_STONE_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = ITEMS.register("ancient_stone_brick_wall", () -> new BlockItem(ANCIENT_STONE_BRICK_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register("ancient_chiseled_stone_brick_wall", () -> new BlockItem(ANCIENT_CHISELED_STONE_BRICK_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register("ancient_cracked_stone_brick_wall", () -> new BlockItem(ANCIENT_CRACKED_STONE_BRICK_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = ITEMS.register("ancient_mossy_stone_wall", () -> new BlockItem(ANCIENT_MOSSY_STONE_WALL.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_BOOKSHELF = PILLARBLOCKS.register("ancient_bookshelf", () -> new AncientBookShelf(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_BOOKSHELF = PILLARBLOCKS.register("demonic_bookshelf", () -> new AncientBookShelf(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - public static final RegistryObject SOUL_BOOKSHELF = PILLARBLOCKS.register("soul_bookshelf", () -> new AncientBookShelf(BlockBehaviour.Properties.of(Material.NETHER_WOOD).strength(0.8F).randomTicks().sound(SoundType.WOOD))); - - public static final RegistryObject ANCIENT_SAPLING = PILLARBLOCKS.register("ancient_sapling",() -> new SaplingBlock(new AncientTreeGrower(), BlockBehaviour.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().dynamicShape().sound(SoundType.GRASS))); - public static final RegistryObject DEMONIC_SAPLING = PILLARBLOCKS.register("demonic_sapling",() -> new SaplingBlock(new DemonicTreeGrower(), BlockBehaviour.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().dynamicShape().sound(SoundType.GRASS))); - public static final RegistryObject SOUL_SAPLING = PILLARBLOCKS.register("soul_sapling",() -> new SaplingBlock(new SoulTreeGrower(), BlockBehaviour.Properties.of(Material.PLANT).noCollission().randomTicks().instabreak().dynamicShape().sound(SoundType.GRASS))); - - public static final RegistryObject ANCIENT_WOODEN_STAIRS = STAIRBLOCKS.register("ancient_wooden_stairs", () -> new StairBlock(() -> ANCIENT_PLANKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); - public static final RegistryObject DEMONIC_WOODEN_STAIRS = STAIRBLOCKS.register("demonic_wooden_stairs", () -> new StairBlock(() -> DEMONIC_PLANKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); - public static final RegistryObject SOUL_WOODEN_STAIRS = STAIRBLOCKS.register("soul_wooden_stairs", () -> new StairBlock(() -> SOUL_PLANKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); - public static final RegistryObject ANCIENT_STONE_STAIRS = STAIRBLOCKS.register("ancient_stone_stairs", () -> new StairBlock(() -> ANCIENT_STONE.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = STAIRBLOCKS.register("ancient_smooth_stone_stairs", () -> new StairBlock(() -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = STAIRBLOCKS.register("ancient_stone_brick_stairs", () -> new StairBlock(() -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = STAIRBLOCKS.register("ancient_mossy_stone_stairs", () -> new StairBlock(() -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS = STAIRBLOCKS.register("ancient_chiseled_stone_brick_stairs", () -> new StairBlock(() -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS = STAIRBLOCKS.register("ancient_cracked_stone_brick_stairs", () -> new StairBlock(() -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS = STAIRBLOCKS.register("ancient_polished_stone_stairs", () -> new StairBlock(() -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - public static final RegistryObject ANCIENT_WOODEN_SLABS = SLABBLOCKS.register("ancient_wooden_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); - public static final RegistryObject DEMONIC_WOODEN_SLABS = SLABBLOCKS.register("demonic_wooden_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); - public static final RegistryObject SOUL_WOODEN_SLABS = SLABBLOCKS.register("soul_wooden_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); - public static final RegistryObject ANCIENT_STONE_SLABS = SLABBLOCKS.register("ancient_stone_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = SLABBLOCKS.register("ancient_smooth_stone_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = SLABBLOCKS.register("ancient_stone_brick_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = SLABBLOCKS.register("ancient_mossy_stone_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = SLABBLOCKS.register("ancient_chiseled_stone_brick_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = SLABBLOCKS.register("ancient_cracked_stone_brick_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = SLABBLOCKS.register("ancient_polished_stone_slabs", () -> new SlabBlock(BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = ITEMS.register("ancient_wooden_slabs", () -> new BlockItem(ANCIENT_WOODEN_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = ITEMS.register("demonic_wooden_slabs", () -> new BlockItem(DEMONIC_WOODEN_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = ITEMS.register("soul_wooden_slabs", () -> new BlockItem(SOUL_WOODEN_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = ITEMS.register("ancient_stone_slabs", () -> new BlockItem(ANCIENT_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = ITEMS.register("ancient_smooth_stone_slabs", () -> new BlockItem(ANCIENT_SMOOTH_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = ITEMS.register("ancient_stone_brick_slabs", () -> new BlockItem(ANCIENT_STONE_BRICK_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = ITEMS.register("ancient_mossy_stone_slabs", () -> new BlockItem(ANCIENT_MOSSY_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = ITEMS.register("ancient_chiseled_stone_brick_slabs", () -> new BlockItem(ANCIENT_CHISELED_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = ITEMS.register("ancient_cracked_stone_brick_slabs", () -> new BlockItem(ANCIENT_CRACKED_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = ITEMS.register("ancient_polished_stone_slabs", () -> new BlockItem(ANCIENT_POLISHED_STONE_SLABS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register("ancient_herb",() -> new BlockItem(ANCIENT_HERB.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register("demonic_herb",() -> new BlockItem(DEMONIC_HERB.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register("soul_herb",() -> new BlockItem(SOUL_HERB.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - - - public static final RegistryObject ANCIENT_LOG_0_ITEM = ITEMS.register("ancient_log_0",() -> new BlockItem(ANCIENT_LOG_0.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_1_ITEM = ITEMS.register("ancient_log_1",() -> new BlockItem(ANCIENT_LOG_1.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_2_ITEM = ITEMS.register("ancient_log_2",() -> new BlockItem(ANCIENT_LOG_2.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = ITEMS.register("stripped_ancient_log",() -> new BlockItem(ANCIENT_LOG_STRIPPED.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LEAVES_ITEM = ITEMS.register("ancient_leaves", () -> new BlockItem(ANCIENT_LEAVES.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_PLANKS_ITEM = ITEMS.register("ancient_planks", () -> new BlockItem(ANCIENT_PLANKS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = ITEMS.register("ancient_bookshelf", () -> new BlockItem(ANCIENT_BOOKSHELF.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SAPLING_ITEM = ITEMS.register("ancient_sapling", () -> new BlockItem(ANCIENT_SAPLING.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register("soul_log",() -> new BlockItem(SOUL_LOG.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register("soul_log_0",() -> new BlockItem(SOUL_LOG_0.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register("soul_log_1",() -> new BlockItem(SOUL_LOG_1.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register("soul_log_2",() -> new BlockItem(SOUL_LOG_2.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = ITEMS.register("stripped_soul_log",() -> new BlockItem(SOUL_LOG_STRIPPED.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register("soul_leaves", () -> new BlockItem(SOUL_LEAVES.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register("soul_planks", () -> new BlockItem(SOUL_PLANKS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_BOOKSHELF_ITEM = ITEMS.register("soul_bookshelf", () -> new BlockItem(SOUL_BOOKSHELF.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register("soul_sapling", () -> new BlockItem(SOUL_SAPLING.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register("demonic_log",() -> new BlockItem(DEMONIC_LOG.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = ITEMS.register("stripped_demonic_log",() -> new BlockItem(DEMONIC_LOG_STRIPPED.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_LEAVES_ITEM = ITEMS.register("demonic_leaves", () -> new BlockItem(DEMONIC_LEAVES.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_PLANKS_ITEM = ITEMS.register("demonic_planks", () -> new BlockItem(DEMONIC_PLANKS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = ITEMS.register("demonic_bookshelf", () -> new BlockItem(DEMONIC_BOOKSHELF.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_SAPLING_ITEM = ITEMS.register("demonic_sapling", () -> new BlockItem(DEMONIC_SAPLING.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - - public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = ITEMS.register("ancient_wooden_stairs", () -> new BlockItem(ANCIENT_WOODEN_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = ITEMS.register("demonic_wooden_stairs", () -> new BlockItem(DEMONIC_WOODEN_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = ITEMS.register("soul_wooden_stairs", () -> new BlockItem(SOUL_WOODEN_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = ITEMS.register("ancient_stone_stairs", () -> new BlockItem(ANCIENT_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = ITEMS.register("ancient_smooth_stone_stairs", () -> new BlockItem(ANCIENT_SMOOTH_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = ITEMS.register("ancient_stone_brick_stairs", () -> new BlockItem(ANCIENT_STONE_BRICK_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = ITEMS.register("ancient_mossy_stone_stairs", () -> new BlockItem(ANCIENT_MOSSY_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register("ancient_chiseled_stone_brick_stairs", () -> new BlockItem(ANCIENT_CHISELED_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = ITEMS.register("ancient_cracked_stone_brick_stairs", () -> new BlockItem(ANCIENT_CRACKED_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register("ancient_polished_stone_stairs", () -> new BlockItem(ANCIENT_POLISHED_STONE_STAIRS.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - - public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = ITEMS.register("ancient_wooden_fence", () -> new BlockItem(ANCIENT_WOOD_FENCE.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = ITEMS.register("ancient_wooden_fence_gate", () -> new BlockItem(ANCIENT_WOOD_FENCE_GATE.get(),new Item.Properties().tab(AllTheModium.GROUP)));; - public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = ITEMS.register("demonic_wooden_fence", () -> new BlockItem(DEMONIC_WOOD_FENCE.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = ITEMS.register("demonic_wooden_fence_gate", () -> new BlockItem(DEMONIC_WOOD_FENCE_GATE.get(),new Item.Properties().tab(AllTheModium.GROUP)));; - public static final RegistryObject SOUL_WOOD_FENCE_ITEM = ITEMS.register("soul_wooden_fence", () -> new BlockItem(SOUL_WOOD_FENCE.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = ITEMS.register("soul_wooden_fence_gate", () -> new BlockItem(SOUL_WOOD_FENCE_GATE.get(),new Item.Properties().tab(AllTheModium.GROUP)));; - - - public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = ITEMS.register("ancient_smooth_stone", () -> new BlockItem(ANCIENT_SMOOTH_STONE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_ITEM = ITEMS.register("ancient_stone", () -> new BlockItem(ANCIENT_STONE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register("ancient_dirt", () -> new BlockItem(ANCIENT_DIRT.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_GRASS_ITEM = ITEMS.register("ancient_grass", () -> new BlockItem(ANCIENT_GRASS.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = ITEMS.register("ancient_mossy_stone", () -> new BlockItem(ANCIENT_MOSSY_STONE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = ITEMS.register("ancient_stone_bricks", () -> new BlockItem(ANCIENT_STONE_BRICKS.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register("ancient_chiseled_stone_bricks", () -> new BlockItem(ANCIENT_CHISELED_STONE_BRICKS.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = ITEMS.register("ancient_cracked_stone_bricks", () -> new BlockItem(ANCIENT_CRACKED_STONE_BRICKS.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = ITEMS.register("ancient_polished_stone", () -> new BlockItem(ANCIENT_POLISHED_STONE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_ORE = BLOCKS.register("allthemodium_ore", Allthemodium_Ore::new); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = BLOCKS.register("allthemodium_slate_ore", Allthemodium_Ore::new); - - public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register("vibranium_ore", Vibranium_Ore::new); - public static final RegistryObject OTHER_VIBRANIUM_ORE = BLOCKS.register("other_vibranium_ore", Vibranium_Ore::new); - public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register("unobtainium_ore", Unobtainium_Ore::new); - - public static final RegistryObject ALLTHEMODIUM_BLOCK = BLOCKS.register("allthemodium_block", Allthemodium_Block::new); - public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register("vibranium_block", Vibranium_Block::new); - public static final RegistryObject UNOBTAINIUM_BLOCK = BLOCKS.register("unobtainium_block", Unobtainium_Block::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = BLOCKS.register("raw_allthemodium_block", Raw_ATM::new); - public static final RegistryObject RAW_VIBRANIUM_BLOCK = BLOCKS.register("raw_vibranium_block", Raw_VIB::new); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = BLOCKS.register("raw_unobtainium_block", Raw_UNO::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register("raw_allthemodium_block", () -> new BlockItem(RAW_ALLTHEMODIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = ITEMS.register("raw_vibranium_block", () -> new BlockItem(RAW_VIBRANIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = ITEMS.register("raw_unobtainium_block", () -> new BlockItem(RAW_UNOBTAINIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = ITEMS.register("allthemodium_ore", () -> new Allthemodium_Ore_Item(ALLTHEMODIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = ITEMS.register("allthemodium_slate_ore", () -> new Allthemodium_Ore_Item(ALLTHEMODIUM_SLATE_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject VIBRANIUM_ORE_ITEM = ITEMS.register("vibranium_ore", () -> new Vibranium_Ore_Item(VIBRANIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = ITEMS.register("other_vibranium_ore", () -> new Vibranium_Ore_Item(OTHER_VIBRANIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_ORE_ITEM = ITEMS.register("unobtainium_ore", () -> new Unobtainium_Ore_Item(UNOBTAINIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register("allthemodium_block", () -> new BlockItem(ALLTHEMODIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_BLOCK_ITEM = ITEMS.register("vibranium_block", () -> new BlockItem(VIBRANIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = ITEMS.register("unobtainium_block", () -> new BlockItem(UNOBTAINIUM_BLOCK.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register("raw_allthemodium", () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_VIBRANIUM = ITEMS.register("raw_vibranium", () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register("raw_unobtainium", () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_INGOT = ITEMS.register("allthemodium_ingot", () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register("vibranium_ingot", () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register("unobtainium_ingot", () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_PLATE = ITEMS.register("allthemodium_plate", () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_PLATE = ITEMS.register("vibranium_plate", () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_PLATE = ITEMS.register("unobtainium_plate", () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_GEAR = ITEMS.register("allthemodium_gear", () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_GEAR = ITEMS.register("vibranium_gear", () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_GEAR = ITEMS.register("unobtainium_gear", () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_ROD = ITEMS.register("allthemodium_rod", () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_ROD = ITEMS.register("vibranium_rod", () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_ROD = ITEMS.register("unobtainium_rod", () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_NUGGET = ITEMS.register("allthemodium_nugget", () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register("vibranium_nugget", () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_NUGGET = ITEMS.register("unobtainium_nugget", () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register("allthemodium_dust", () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_DUST = ITEMS.register("vibranium_dust", () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register("unobtainium_dust", () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_CLUMP = ITEMS.register("allthemodium_clump", () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_CLUMP = ITEMS.register("vibranium_clump", () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_CLUMP = ITEMS.register("unobtainium_clump", () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_SHARD = ITEMS.register("allthemodium_shard", () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_SHARD = ITEMS.register("vibranium_shard", () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_SHARD = ITEMS.register("unobtainium_shard", () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_DIRTY = ITEMS.register("dirty_allthemodium_dust", () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_DIRTY = ITEMS.register("dirty_vibranium_dust", () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_DIRTY = ITEMS.register("dirty_unobtainium_dust", () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_CRYSTAL = ITEMS.register("allthemodium_crystal", () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_CRYSTAL = ITEMS.register("vibranium_crystal", () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ONOB_CRYSTAL = ITEMS.register("unobtainium_crystal", () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = ITEMS.register("unobtainium_allthemodium_alloy_dust",() -> new Alloy_Dust(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = ITEMS.register("unobtainium_vibranium_alloy_dust" , () -> new Alloy_Dust(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = ITEMS.register("vibranium_allthemodium_alloy_dust", ()-> new Alloy_Dust(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = ITEMS.register("unobtainium_allthemodium_alloy_ingot", () -> new Alloy_Ingot(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = ITEMS.register("unobtainium_vibranium_alloy_ingot", () -> new Alloy_Ingot(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = ITEMS.register("vibranium_allthemodium_alloy_ingot", ()-> new Alloy_Ingot(new Item.Properties().tab(AllTheModium.GROUP).fireResistant())); - - - - public static final RegistryObject TELEPORT_PAD = SHAPED_BLOCKS.register("teleport_pad", () -> new TeleportPad(Block.Properties.of(Material.METAL).noLootTable().noOcclusion().strength(20.0F))); - public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register("teleport_pad", () -> new BlockItem(TELEPORT_PAD.get(), new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_SWORD = ITEMS.register("allthemodium_sword",() -> new SwordItem(ToolTiers.ALLTHEMODIUM_TIER,4,1.5f, new Item.Properties().fireResistant().tab(AllTheModium.GROUP).rarity(Rarity.EPIC)) { - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - protected TranslatableContents getTooltip(String key){ - return new TranslatableContents(key); - } - - }); - - public static final RegistryObject ALLTHEMODIUM_PICKAXE = ITEMS.register("allthemodium_pickaxe",() -> new PickaxeItem(ToolTiers.ALLTHEMODIUM_TIER,2,1.0f, new Item.Properties().fireResistant().tab(AllTheModium.GROUP).rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed; - return super.getDestroySpeed(stack, state); - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - protected TranslatableContents getTooltip(String key){ - return new TranslatableContents(key); - } - - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_AXE = ITEMS.register("allthemodium_axe",() -> new AxeItem(ToolTiers.ALLTHEMODIUM_TIER,6,1.0f, new Item.Properties().fireResistant().tab(AllTheModium.GROUP).rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed; - return super.getDestroySpeed(stack, state); - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - protected TranslatableContents getTooltip(String key){ - return new TranslatableContents(key); - } - - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_SHOVEL = ITEMS.register("allthemodium_shovel",() -> new ShovelItem(ToolTiers.ALLTHEMODIUM_TIER,1,1.5f, new Item.Properties().fireResistant().tab(AllTheModium.GROUP).rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed; - return super.getDestroySpeed(stack, state); - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - protected TranslatableContents getTooltip(String key){ - return new TranslatableContents(key); - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_HOE = ITEMS.register("allthemodium_hoe",() -> new HoeItem(ToolTiers.ALLTHEMODIUM_TIER,0,1.5f, new Item.Properties().fireResistant().tab(AllTheModium.GROUP).rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed; - return super.getDestroySpeed(stack, state); - } - @Override - public boolean isEnchantable(ItemStack stack) { - return true; - } - @Override - public boolean canBeDepleted() { - return false; - } - @Override - public void appendHoverText(ItemStack stack, Level worldIn, List tooltip, TooltipFlag flagIn){ - tooltip.add(TextComponentHelper.createComponentTranslation(null,"indestructible" , new Object()).withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - protected TranslatableContents getTooltip(String key){ - return new TranslatableContents(key); - } - - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) - { - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state); - return false; - } - }); - - public static final RegistryObject UA_ALLOY = BLOCKS.register("unobtainium_allthemodium_alloy_block", UAAlloy_Block::new); - public static final RegistryObject UV_ALLOY = BLOCKS.register("unobtainium_vibranium_alloy_block", UVAlloy_Block::new); - public static final RegistryObject VA_ALLOY = BLOCKS.register("vibranium_allthemodium_alloy_block", VAAlloy_Block::new); - - public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register("unobtainium_allthemodium_alloy_block", () -> new BlockItem(UA_ALLOY.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register("unobtainium_vibranium_alloy_block", () -> new BlockItem(UV_ALLOY.get(),new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register("vibranium_allthemodium_alloy_block", () -> new BlockItem(VA_ALLOY.get(),new Item.Properties().tab(AllTheModium.GROUP))); - - - public static final RegistryObject PIGLICH_HEART = ITEMS.register("piglich_heart", () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject> PIGLICH = createMonsterEntity("piglich",PiglichEntity::new,0.6F,3.0F,0x000000,0xebe834); - - - - - - - private static RegistryObject> createMonsterEntity(String name, EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { - ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); - - return ENTITIES.register(name, () ->EntityType.Builder.of(factory, MobCategory.MONSTER).sized(width, height).setTrackingRange(64).setUpdateInterval(1).build(location.toString())); - //EntityType entity = EntityType.Builder.of(factory, MobCategory.MONSTER).sized(width, height).setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - //Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, (new Item.Properties()).tab(AllTheModium.GROUP)); - //spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + "_spawn_egg")); - //SPAWN_EGGS.add(spawnEgg); - - //return ENTITIES.register(name, () -> entity); - } -/* - private static RegistryObject> createShulkerEntity(String name, EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { - ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); - EntityType entity = EntityType.Builder.of(factory, MobCategory.MONSTER).sized(width, height).setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, (new Item.Properties()).tab(AllTheModium.GROUP)); - spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + "_spawn_egg")); - SPAWN_EGGS.add(spawnEgg); - - return ENTITIES.register(name, () -> entity); - } - - */ - - @SubscribeEvent - public static void addEntityAttributes(EntityAttributeCreationEvent event) { - event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); - //event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); - } - private static RotatedPillarBlock log(MaterialColor color1, MaterialColor color2) { - return new RotatedPillarBlock(BlockBehaviour.Properties.of(Material.NETHER_WOOD, (woodLog) -> { - return woodLog.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? color1 : color2; - }).strength(2.0F).sound(SoundType.WOOD)); - } - - - - + public static final DeferredRegister SHAPED_BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister STAIR_BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister WALL_BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister SLAB_BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister PILLAR_BLOCKS = + DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister BIOMES = + DeferredRegister.create(ForgeRegistries.BIOMES, Reference.MOD_ID); + + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID + ); + + public static final DeferredRegister> ENTITY = + DeferredRegister.create( + ForgeRegistries.BLOCK_ENTITY_TYPES, + Reference.MOD_ID + ); + public static final DeferredRegister> CARVERS = + DeferredRegister.create( + ForgeRegistries.WORLD_CARVERS, + Reference.MOD_ID + ); + public static final DeferredRegister> ENTITIES = + DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, Reference.MOD_ID); + + public static final DeferredRegister> FEATURES = + DeferredRegister.create(ForgeRegistries.FEATURES, Reference.MOD_ID); + + // TODO: Add spawn eggs for mobs + // private static ArrayList SPAWN_EGGS = new ArrayList() + + // BIOMES + + RegistryObject MINING = BIOMES.register( + "mining", + () -> ATMBiomes.mining() + ); + RegistryObject THE_OTHER = BIOMES.register( + "the_other", + () -> ATMBiomes.the_other() + ); + RegistryObject DESERT = BIOMES.register( + "desert", + () -> ATMBiomes.desert() + ); + RegistryObject DESERT_HILLS = BIOMES.register( + "desert_hills", + () -> ATMBiomes.desert_hills() + ); + RegistryObject SOULSAND = BIOMES.register( + "soul_sand_valley", + () -> ATMBiomes.soul_sand_valley() + ); + RegistryObject WARPED_FOREST = BIOMES.register( + "warped_forest", + () -> ATMBiomes.warped_forest() + ); + RegistryObject CRIMSON_FOREST = BIOMES.register( + "crimson_forest", + () -> ATMBiomes.crimson_forest() + ); + RegistryObject BASALT_DELTAS = BIOMES.register( + "basalt_deltas", + () -> ATMBiomes.basalt_deltas() + ); + + // FOOD + + public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register( + "allthemodium_apple", + () -> + new AllthemodiumApple( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_APPLE) + .rarity(Rarity.EPIC) + ) + ); + public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register( + "allthemodium_carrot", + () -> + new AllthemodiumCarrot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_CARROT) + .rarity(Rarity.EPIC) + ) + ); + + // ARMORS + + public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register( + "allthemodium_boots", + () -> + (ArmorItem) new AllthemodiumBoots( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.FEET, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC) + ) + ); + public static RegistryObject ALLTHEMODIUM_LEGGINGS = + ITEMS.register( + "allthemodium_leggings", + () -> + (ArmorItem) new AllthemodiumLeggings( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.LEGS, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC) + ) + ); + public static RegistryObject ALLTHEMODIUM_CHESTPLATE = + ITEMS.register( + "allthemodium_chestplate", + () -> + (ArmorItem) new AllthemodiumChestplate( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.CHEST, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC) + ) + ); + public static RegistryObject ALLTHEMODIUM_HELMET = + ITEMS.register( + "allthemodium_helmet", + () -> + (ArmorItem) new AllthemodiumHelmet( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.HEAD, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC) + ) + ); + + // Volcano + + public static Feature VOLCANO_F = new Volcano( + VolcanoConfig.CODEC + ); + public static RegistryObject> VOLCANO = + FEATURES.register("volcano", () -> VOLCANO_F); + + public static final RegistryObject ANCIENT_CAVEVINES_ = + PILLAR_BLOCKS.register( + "ancient_cavevines", + () -> + new AncientCaveVines( + BlockBehaviour.Properties + .of(Material.PLANT) + .randomTicks() + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false, + 0.1D + ) + ); + + public static final RegistryObject< + AncientCaveVinesPlant + > ANCIENT_CAVEVINES_PLANT_ = PILLAR_BLOCKS.register( + "ancient_cavevines_plant", + () -> + new AncientCaveVinesPlant( + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false + ) + ); + + public static final RegistryObject ANCIENT_HERB = + PILLAR_BLOCKS.register( + "ancient_herb", + () -> + new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission() + ) + ); + + public static final RegistryObject ANCIENT_SMOOTH_STONE = + BLOCKS.register( + "ancient_smooth_stone", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(2.25f) + ) + ); + public static final RegistryObject ANCIENT_STONE = BLOCKS.register( + "ancient_stone", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(1.5f) + ) + ); + public static final RegistryObject ANCIENT_DIRT = BLOCKS.register( + "ancient_dirt", + () -> + new AncientDirt( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.WET_GRASS) + .strength(0.6f) + ) + ); + public static final RegistryObject ANCIENT_GRASS = BLOCKS.register( + "ancient_grass", + () -> + new AncientGrass( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.MOSS) + .strength(0.6f) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE = + BLOCKS.register( + "ancient_mossy_stone", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.MOSS_CARPET) + .strength(1.5f) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICKS = + BLOCKS.register( + "ancient_stone_bricks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.5f) + ) + ); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = + BLOCKS.register( + "ancient_chiseled_stone_bricks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.0f) + ) + ); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = + BLOCKS.register( + "ancient_cracked_stone_bricks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.25f) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE = + BLOCKS.register( + "ancient_polished_stone", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.METAL) + .strength(2.5f) + ) + ); + + public static final RegistryObject ANCIENT_LOG_0 = + PILLAR_BLOCKS.register( + "ancient_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject ANCIENT_LOG_1 = + PILLAR_BLOCKS.register( + "ancient_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject ANCIENT_LOG_2 = + PILLAR_BLOCKS.register( + "ancient_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject ANCIENT_LOG_STRIPPED = + PILLAR_BLOCKS.register( + "stripped_ancient_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register( + "ancient_leaves", + () -> + new AncientLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE) + ) + ); + public static final RegistryObject ANCIENT_LEAVES_BOTTOM = + PILLAR_BLOCKS.register( + "ancient_leaves_bottom", + () -> + new AncientLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE) + ) + ); + public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register( + "ancient_planks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject ANCIENT_TRAPDOOR = + PILLAR_BLOCKS.register( + "ancient_trap_door", + () -> + new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion() + ) + ); + public static final RegistryObject ANCIENT_WOOD_FENCE = + PILLAR_BLOCKS.register( + "ancient_wooden_fence", + () -> + new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = + PILLAR_BLOCKS.register( + "ancient_wooden_fence_gate", + () -> + new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject ANCIENT_DOOR_ = + PILLAR_BLOCKS.register( + "ancient_door", + () -> + new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD) + ) + ); + + public static final RegistryObject DEMONIC_HERB = + PILLAR_BLOCKS.register( + "demonic_herb", + () -> + new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission() + ) + ); + public static final RegistryObject DEMONIC_LOG = + PILLAR_BLOCKS.register( + "demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject DEMONIC_LOG_STRIPPED = + PILLAR_BLOCKS.register( + "stripped_demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register( + "demonic_leaves", + () -> + new DemonicLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_RED) + ) + ); + public static final RegistryObject DEMONIC_LEAVES_BOTTOM = + PILLAR_BLOCKS.register( + "demonic_leaves_bottom", + () -> + new DemonicLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_RED) + ) + ); + public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register( + "demonic_planks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject DEMONIC_TRAPDOOR = + PILLAR_BLOCKS.register( + "demonic_trap_door", + () -> + new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion() + ) + ); + public static final RegistryObject DEMONIC_WOOD_FENCE = + PILLAR_BLOCKS.register( + "demonic_wooden_fence", + () -> + new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = + PILLAR_BLOCKS.register( + "demonic_wooden_fence_gate", + () -> + new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject DEMONIC_DOOR_ = + PILLAR_BLOCKS.register( + "demonic_door", + () -> + new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD) + ) + ); + + public static final RegistryObject SOUL_HERB = + PILLAR_BLOCKS.register( + "soul_herb", + () -> + new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission() + ) + ); + public static final RegistryObject SOUL_LOG = PILLAR_BLOCKS.register( + "soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject SOUL_LOG_0 = + PILLAR_BLOCKS.register( + "soul_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject SOUL_LOG_1 = + PILLAR_BLOCKS.register( + "soul_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject SOUL_LOG_2 = + PILLAR_BLOCKS.register( + "soul_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject SOUL_LOG_STRIPPED = + PILLAR_BLOCKS.register( + "stripped_soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD) + ); + public static final RegistryObject SOUL_LEAVES = BLOCKS.register( + "soul_leaves", + () -> + new SoulLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_BLUE) + ) + ); + public static final RegistryObject SOUL_LEAVES_BOTTOM = + PILLAR_BLOCKS.register( + "soul_leaves_bottom", + () -> + new SoulLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_BLUE) + ) + ); + public static final RegistryObject SOUL_PLANKS = BLOCKS.register( + "soul_planks", + () -> + new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject SOUL_TRAPDOOR = + PILLAR_BLOCKS.register( + "soul_trap_door", + () -> + new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion() + ) + ); + public static final RegistryObject SOUL_WOOD_FENCE = + PILLAR_BLOCKS.register( + "soul_wooden_fence", + () -> + new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject SOUL_WOOD_FENCE_GATE = + PILLAR_BLOCKS.register( + "soul_wooden_fence_gate", + () -> + new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject SOUL_DOOR_ = + PILLAR_BLOCKS.register( + "soul_door", + () -> + new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD) + ) + ); + + public static final RegistryObject ANCIENT_STONE_WALL = + WALL_BLOCKS.register( + "ancient_stone_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = + WALL_BLOCKS.register( + "ancient_smooth_stone_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = + WALL_BLOCKS.register( + "ancient_polished_stone_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL = + WALL_BLOCKS.register( + "ancient_stone_brick_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()) + ) + ); + public static final RegistryObject< + WallBlock + > ANCIENT_CHISELED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_chiseled_stone_brick_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CHISELED_STONE_BRICKS.get() + ) + ) + ); + public static final RegistryObject< + WallBlock + > ANCIENT_CRACKED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_cracked_stone_brick_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CRACKED_STONE_BRICKS.get() + ) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = + WALL_BLOCKS.register( + "ancient_mossy_stone_wall", + () -> + new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + + public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = + ITEMS.register( + "ancient_cavevines_plant", + () -> + new BlockItem( + ANCIENT_CAVEVINES_PLANT_.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register( + "ancient_soulberries", + () -> + new SoulBerries( + ANCIENT_CAVEVINES_.get(), + (new Item.Properties()).food(ModFoods.SOUL_BERRIES) + .tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = + ITEMS.register( + "ancient_trap_door", + () -> + new BlockItem( + ANCIENT_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = + ITEMS.register( + "demonic_trap_door", + () -> + new BlockItem( + DEMONIC_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_TRAP_DOOR_ITEM = + ITEMS.register( + "soul_trap_door", + () -> + new BlockItem( + SOUL_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register( + "ancient_door", + () -> + new BlockItem( + ANCIENT_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register( + "demonic_door", + () -> + new BlockItem( + DEMONIC_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register( + "soul_door", + () -> + new BlockItem( + SOUL_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_STONE_WALL_ITEM = + ITEMS.register( + "ancient_stone_wall", + () -> + new BlockItem( + ANCIENT_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = + ITEMS.register( + "ancient_smooth_stone_wall", + () -> + new BlockItem( + ANCIENT_SMOOTH_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = + ITEMS.register( + "ancient_polished_stone_wall", + () -> + new BlockItem( + ANCIENT_POLISHED_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = + ITEMS.register( + "ancient_stone_brick_wall", + () -> + new BlockItem( + ANCIENT_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject< + Item + > ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_wall", + () -> + new BlockItem( + ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject< + Item + > ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_wall", + () -> + new BlockItem( + ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = + ITEMS.register( + "ancient_mossy_stone_wall", + () -> + new BlockItem( + ANCIENT_MOSSY_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_BOOKSHELF = + PILLAR_BLOCKS.register( + "ancient_bookshelf", + () -> + new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject DEMONIC_BOOKSHELF = + PILLAR_BLOCKS.register( + "demonic_bookshelf", + () -> + new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + public static final RegistryObject SOUL_BOOKSHELF = + PILLAR_BLOCKS.register( + "soul_bookshelf", + () -> + new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD) + ) + ); + + public static final RegistryObject ANCIENT_SAPLING = + PILLAR_BLOCKS.register( + "ancient_sapling", + () -> + new SaplingBlock( + new AncientTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS) + ) + ); + public static final RegistryObject DEMONIC_SAPLING = + PILLAR_BLOCKS.register( + "demonic_sapling", + () -> + new SaplingBlock( + new DemonicTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS) + ) + ); + public static final RegistryObject SOUL_SAPLING = + PILLAR_BLOCKS.register( + "soul_sapling", + () -> + new SaplingBlock( + new SoulTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS) + ) + ); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS = + STAIR_BLOCKS.register( + "ancient_wooden_stairs", + () -> + new StairBlock( + () -> ANCIENT_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()) + ) + ); + public static final RegistryObject DEMONIC_WOODEN_STAIRS = + STAIR_BLOCKS.register( + "demonic_wooden_stairs", + () -> + new StairBlock( + () -> DEMONIC_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()) + ) + ); + public static final RegistryObject SOUL_WOODEN_STAIRS = + STAIR_BLOCKS.register( + "soul_wooden_stairs", + () -> + new StairBlock( + () -> SOUL_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(SOUL_PLANKS.get()) + ) + ); + public static final RegistryObject ANCIENT_STONE_STAIRS = + STAIR_BLOCKS.register( + "ancient_stone_stairs", + () -> + new StairBlock( + () -> ANCIENT_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = + STAIR_BLOCKS.register( + "ancient_smooth_stone_stairs", + () -> + new StairBlock( + () -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = + STAIR_BLOCKS.register( + "ancient_stone_brick_stairs", + () -> + new StairBlock( + () -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) + ) + ); + + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = + STAIR_BLOCKS.register( + "ancient_mossy_stone_stairs", + () -> + new StairBlock( + () -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject< + StairBlock + > ANCIENT_CHISELED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_chiseled_stone_brick_stairs", + () -> + new StairBlock( + () -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject< + StairBlock + > ANCIENT_CRACKED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_cracked_stone_brick_stairs", + () -> + new StairBlock( + () -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject< + StairBlock + > ANCIENT_POLISHED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_polished_stone_stairs", + () -> + new StairBlock( + () -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + + public static final RegistryObject ANCIENT_WOODEN_SLABS = + SLAB_BLOCKS.register( + "ancient_wooden_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()) + ) + ); + public static final RegistryObject DEMONIC_WOODEN_SLABS = + SLAB_BLOCKS.register( + "demonic_wooden_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()) + ) + ); + public static final RegistryObject SOUL_WOODEN_SLABS = + SLAB_BLOCKS.register( + "soul_wooden_slabs", + () -> + new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get())) + ); + public static final RegistryObject ANCIENT_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_stone_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_smooth_stone_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = + SLAB_BLOCKS.register( + "ancient_stone_brick_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_mossy_stone_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_chiseled_stone_brick_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_cracked_stone_brick_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = + SLAB_BLOCKS.register( + "ancient_polished_stone_slabs", + () -> + new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) + ) + ); + + public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = + ITEMS.register( + "ancient_wooden_slabs", + () -> + new BlockItem( + ANCIENT_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = + ITEMS.register( + "demonic_wooden_slabs", + () -> + new BlockItem( + DEMONIC_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = + ITEMS.register( + "soul_wooden_slabs", + () -> + new BlockItem( + SOUL_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_stone_slabs", + () -> + new BlockItem( + ANCIENT_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_smooth_stone_slabs", + () -> + new BlockItem( + ANCIENT_SMOOTH_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = + ITEMS.register( + "ancient_stone_brick_slabs", + () -> + new BlockItem( + ANCIENT_STONE_BRICK_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_mossy_stone_slabs", + () -> + new BlockItem( + ANCIENT_MOSSY_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_chiseled_stone_brick_slabs", + () -> + new BlockItem( + ANCIENT_CHISELED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_cracked_stone_brick_slabs", + () -> + new BlockItem( + ANCIENT_CRACKED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = + ITEMS.register( + "ancient_polished_stone_slabs", + () -> + new BlockItem( + ANCIENT_POLISHED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register( + "ancient_herb", + () -> + new BlockItem( + ANCIENT_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register( + "demonic_herb", + () -> + new BlockItem( + DEMONIC_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register( + "soul_herb", + () -> + new BlockItem( + SOUL_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_LOG_0_ITEM = + ITEMS.register( + "ancient_log_0", + () -> + new BlockItem( + ANCIENT_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_LOG_1_ITEM = + ITEMS.register( + "ancient_log_1", + () -> + new BlockItem( + ANCIENT_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_LOG_2_ITEM = + ITEMS.register( + "ancient_log_2", + () -> + new BlockItem( + ANCIENT_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = + ITEMS.register( + "stripped_ancient_log", + () -> + new BlockItem( + ANCIENT_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_LEAVES_ITEM = + ITEMS.register( + "ancient_leaves", + () -> + new BlockItem( + ANCIENT_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_PLANKS_ITEM = + ITEMS.register( + "ancient_planks", + () -> + new BlockItem( + ANCIENT_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = + ITEMS.register( + "ancient_bookshelf", + () -> + new BlockItem( + ANCIENT_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_SAPLING_ITEM = + ITEMS.register( + "ancient_sapling", + () -> + new BlockItem( + ANCIENT_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register( + "soul_log", + () -> + new BlockItem( + SOUL_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register( + "soul_log_0", + () -> + new BlockItem( + SOUL_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register( + "soul_log_1", + () -> + new BlockItem( + SOUL_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register( + "soul_log_2", + () -> + new BlockItem( + SOUL_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = + ITEMS.register( + "stripped_soul_log", + () -> + new BlockItem( + SOUL_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register( + "soul_leaves", + () -> + new BlockItem( + SOUL_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register( + "soul_planks", + () -> + new BlockItem( + SOUL_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_BOOKSHELF_ITEM = + ITEMS.register( + "soul_bookshelf", + () -> + new BlockItem( + SOUL_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register( + "soul_sapling", + () -> + new BlockItem( + SOUL_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register( + "demonic_log", + () -> + new BlockItem( + DEMONIC_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = + ITEMS.register( + "stripped_demonic_log", + () -> + new BlockItem( + DEMONIC_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_LEAVES_ITEM = + ITEMS.register( + "demonic_leaves", + () -> + new BlockItem( + DEMONIC_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_PLANKS_ITEM = + ITEMS.register( + "demonic_planks", + () -> + new BlockItem( + DEMONIC_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = + ITEMS.register( + "demonic_bookshelf", + () -> + new BlockItem( + DEMONIC_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_SAPLING_ITEM = + ITEMS.register( + "demonic_sapling", + () -> + new BlockItem( + DEMONIC_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = + ITEMS.register( + "ancient_wooden_stairs", + () -> + new BlockItem( + ANCIENT_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = + ITEMS.register( + "demonic_wooden_stairs", + () -> + new BlockItem( + DEMONIC_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = + ITEMS.register( + "soul_wooden_stairs", + () -> + new BlockItem( + SOUL_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = + ITEMS.register( + "ancient_stone_stairs", + () -> + new BlockItem( + ANCIENT_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = + ITEMS.register( + "ancient_smooth_stone_stairs", + () -> + new BlockItem( + ANCIENT_SMOOTH_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = + ITEMS.register( + "ancient_stone_brick_stairs", + () -> + new BlockItem( + ANCIENT_STONE_BRICK_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = + ITEMS.register( + "ancient_mossy_stone_stairs", + () -> + new BlockItem( + ANCIENT_MOSSY_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject< + Item + > ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_stairs", + () -> + new BlockItem( + ANCIENT_CHISELED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = + ITEMS.register( + "ancient_cracked_stone_brick_stairs", + () -> + new BlockItem( + ANCIENT_CRACKED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject< + Item + > ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_polished_stone_stairs", + () -> + new BlockItem( + ANCIENT_POLISHED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = + ITEMS.register( + "ancient_wooden_fence", + () -> + new BlockItem( + ANCIENT_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = + ITEMS.register( + "ancient_wooden_fence_gate", + () -> + new BlockItem( + ANCIENT_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = + ITEMS.register( + "demonic_wooden_fence", + () -> + new BlockItem( + DEMONIC_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = + ITEMS.register( + "demonic_wooden_fence_gate", + () -> + new BlockItem( + DEMONIC_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_WOOD_FENCE_ITEM = + ITEMS.register( + "soul_wooden_fence", + () -> + new BlockItem( + SOUL_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = + ITEMS.register( + "soul_wooden_fence_gate", + () -> + new BlockItem( + SOUL_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = + ITEMS.register( + "ancient_smooth_stone", + () -> + new BlockItem( + ANCIENT_SMOOTH_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_ITEM = + ITEMS.register( + "ancient_stone", + () -> + new BlockItem( + ANCIENT_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register( + "ancient_dirt", + () -> + new BlockItem( + ANCIENT_DIRT.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_GRASS_ITEM = + ITEMS.register( + "ancient_grass", + () -> + new BlockItem( + ANCIENT_GRASS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = + ITEMS.register( + "ancient_mossy_stone", + () -> + new BlockItem( + ANCIENT_MOSSY_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = + ITEMS.register( + "ancient_stone_bricks", + () -> + new BlockItem( + ANCIENT_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject< + Item + > ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_chiseled_stone_bricks", + () -> + new BlockItem( + ANCIENT_CHISELED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = + ITEMS.register( + "ancient_cracked_stone_bricks", + () -> + new BlockItem( + ANCIENT_CRACKED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = + ITEMS.register( + "ancient_polished_stone", + () -> + new BlockItem( + ANCIENT_POLISHED_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ALLTHEMODIUM_ORE = + BLOCKS.register("allthemodium_ore", AllthemodiumOre::new); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = + BLOCKS.register("allthemodium_slate_ore", AllthemodiumOre::new); + + public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register( + "vibranium_ore", + VibraniumOre::new + ); + public static final RegistryObject OTHER_VIBRANIUM_ORE = + BLOCKS.register("other_vibranium_ore", VibraniumOre::new); + public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register( + "unobtainium_ore", + UnobtainiumOre::new + ); + + public static final RegistryObject ALLTHEMODIUM_BLOCK = + BLOCKS.register("allthemodium_block", AllthemodiumBlock::new); + public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register( + "vibranium_block", + VibraniumBlock::new + ); + public static final RegistryObject UNOBTAINIUM_BLOCK = + BLOCKS.register("unobtainium_block", UnobtainiumBlock::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = + BLOCKS.register("raw_allthemodium_block", RawATM::new); + public static final RegistryObject RAW_VIBRANIUM_BLOCK = + BLOCKS.register("raw_vibranium_block", RawVIB::new); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = + BLOCKS.register("raw_unobtainium_block", RawUNO::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = + ITEMS.register( + "raw_allthemodium_block", + () -> + new BlockItem( + RAW_ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = + ITEMS.register( + "raw_vibranium_block", + () -> + new BlockItem( + RAW_VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = + ITEMS.register( + "raw_unobtainium_block", + () -> + new BlockItem( + RAW_UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = + ITEMS.register( + "allthemodium_ore", + () -> + new AllthemodiumOreItem( + ALLTHEMODIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = + ITEMS.register( + "allthemodium_slate_ore", + () -> + new AllthemodiumOreItem( + ALLTHEMODIUM_SLATE_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject VIBRANIUM_ORE_ITEM = + ITEMS.register( + "vibranium_ore", + () -> + new Vibranium_Ore_Item( + VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = + ITEMS.register( + "other_vibranium_ore", + () -> + new Vibranium_Ore_Item( + OTHER_VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject UNOBTAINIUM_ORE_ITEM = + ITEMS.register( + "unobtainium_ore", + () -> + new UnobtainiumOreItem( + UNOBTAINIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = + ITEMS.register( + "allthemodium_block", + () -> + new BlockItem( + ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject VIBRANIUM_BLOCK_ITEM = + ITEMS.register( + "vibranium_block", + () -> + new BlockItem( + VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = + ITEMS.register( + "unobtainium_block", + () -> + new BlockItem( + UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register( + "raw_allthemodium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject RAW_VIBRANIUM = ITEMS.register( + "raw_vibranium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register( + "raw_unobtainium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ALLTHEMODIUM_INGOT = + ITEMS.register( + "allthemodium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register( + "vibranium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register( + "unobtainium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject ATM_PLATE = ITEMS.register( + "allthemodium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_PLATE = ITEMS.register( + "vibranium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_PLATE = ITEMS.register( + "unobtainium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_GEAR = ITEMS.register( + "allthemodium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_GEAR = ITEMS.register( + "vibranium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_GEAR = ITEMS.register( + "unobtainium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_ROD = ITEMS.register( + "allthemodium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_ROD = ITEMS.register( + "vibranium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_ROD = ITEMS.register( + "unobtainium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ALLTHEMODIUM_NUGGET = + ITEMS.register( + "allthemodium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register( + "vibranium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOBTAINIUM_NUGGET = + ITEMS.register( + "unobtainium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register( + "allthemodium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIBRANIUM_DUST = ITEMS.register( + "vibranium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register( + "unobtainium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_CLUMP = ITEMS.register( + "allthemodium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_CLUMP = ITEMS.register( + "vibranium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_CLUMP = ITEMS.register( + "unobtainium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_SHARD = ITEMS.register( + "allthemodium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_SHARD = ITEMS.register( + "vibranium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_SHARD = ITEMS.register( + "unobtainium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_DIRTY = ITEMS.register( + "dirty_allthemodium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_DIRTY = ITEMS.register( + "dirty_vibranium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_DIRTY = ITEMS.register( + "dirty_unobtainium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject ATM_CRYSTAL = ITEMS.register( + "allthemodium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject VIB_CRYSTAL = ITEMS.register( + "vibranium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject UNOB_CRYSTAL = ITEMS.register( + "unobtainium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) + ); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = + ITEMS.register( + "unobtainium_allthemodium_alloy_dust", + () -> + new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = + ITEMS.register( + "unobtainium_vibranium_alloy_dust", + () -> + new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = + ITEMS.register( + "vibranium_allthemodium_alloy_dust", + () -> + new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = + ITEMS.register( + "unobtainium_allthemodium_alloy_ingot", + () -> + new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = + ITEMS.register( + "unobtainium_vibranium_alloy_ingot", + () -> + new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = + ITEMS.register( + "vibranium_allthemodium_alloy_ingot", + () -> + new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + ) + ); + + public static final RegistryObject TELEPORT_PAD = + SHAPED_BLOCKS.register( + "teleport_pad", + () -> + new TeleportPad( + Block.Properties + .of(Material.METAL) + .noLootTable() + .noOcclusion() + .strength(20.0F) + ) + ); + public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register( + "teleport_pad", + () -> + new BlockItem( + TELEPORT_PAD.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject ALLTHEMODIUM_SWORD = + ITEMS.register( + "allthemodium_sword", + () -> + new SwordItem( + ToolTiers.ALLTHEMODIUM_TIER, + 4, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC) + ) { + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + } + ); + + public static final RegistryObject ALLTHEMODIUM_PICKAXE = + ITEMS.register( + "allthemodium_pickaxe", + () -> + new PickaxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 2, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC) + ) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_PICKAXE) + ) return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_PICKAXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + return false; + } + } + ); + + public static final RegistryObject ALLTHEMODIUM_AXE = + ITEMS.register( + "allthemodium_axe", + () -> + new AxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 6, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC) + ) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_AXE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + return false; + } + } + ); + + public static final RegistryObject ALLTHEMODIUM_SHOVEL = + ITEMS.register( + "allthemodium_shovel", + () -> + new ShovelItem( + ToolTiers.ALLTHEMODIUM_TIER, + 1, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC) + ) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_SHOVEL) + ) return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_SHOVEL) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + return false; + } + } + ); + + public static final RegistryObject ALLTHEMODIUM_HOE = + ITEMS.register( + "allthemodium_hoe", + () -> + new HoeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 0, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC) + ) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state + ) { + if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn + ) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object() + ) + .withStyle(ChatFormatting.GOLD) + ); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state + ) { + if ( + state.is(BlockTags.MINEABLE_WITH_HOE) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + if ( + state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) + ) return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state + ); + return false; + } + } + ); + + public static final RegistryObject UA_ALLOY = BLOCKS.register( + "unobtainium_allthemodium_alloy_block", + UAAlloyBlock::new + ); + public static final RegistryObject UV_ALLOY = BLOCKS.register( + "unobtainium_vibranium_alloy_block", + UVAlloyBlock::new + ); + public static final RegistryObject VA_ALLOY = BLOCKS.register( + "vibranium_allthemodium_alloy_block", + VAAlloyBlock::new + ); + + public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register( + "unobtainium_allthemodium_alloy_block", + () -> + new BlockItem( + UA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register( + "unobtainium_vibranium_alloy_block", + () -> + new BlockItem( + UV_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register( + "vibranium_allthemodium_alloy_block", + () -> + new BlockItem( + VA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP) + ) + ); + + public static final RegistryObject PIGLICH_HEART = ITEMS.register( + "piglich_heart", + () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP)) + ); + public static final RegistryObject> PIGLICH = + createMonsterEntity( + "piglich", + PiglichEntity::new, + 0.6F, + 3.0F, + 0x000000, + 0xebe834 + ); + + private static RegistryObject< + EntityType + > createMonsterEntity( + String name, + EntityType.EntityFactory factory, + float width, + float height, + int eggPrimary, + int eggSecondary + ) { + ResourceLocation location = new ResourceLocation( + Reference.MOD_ID, + name + ); + + return ENTITIES.register( + name, + () -> + EntityType.Builder + .of(factory, MobCategory.MONSTER) + .sized(width, height) + .setTrackingRange(64) + .setUpdateInterval(1) + .build(location.toString()) + ); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + } + + // private static RegistryObject> createShulkerEntity(String name, + // EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { + // ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + // } + + @SubscribeEvent + public static void addEntityAttributes(EntityAttributeCreationEvent event) { + event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); + // event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); + } + + private static RotatedPillarBlock log( + MaterialColor color1, + MaterialColor color2 + ) { + return new RotatedPillarBlock( + BlockBehaviour.Properties + .of( + Material.NETHER_WOOD, + woodLog -> { + return ( + woodLog.getValue(RotatedPillarBlock.AXIS) == + Direction.Axis.Y + ) + ? color1 + : color2; + } + ) + .strength(2.0F) + .sound(SoundType.WOOD) + ); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java index 7001e018..db2e602b 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java @@ -2,157 +2,350 @@ import com.thevortex.allthemodium.reference.Reference; import net.minecraft.core.Registry; -import net.minecraft.data.tags.TagsProvider; -import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.*; import net.minecraft.world.item.Item; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.data.ForgeItemTagsProvider; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; public class TagRegistry { - public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create(Reference.ore("allthemodium")); - public static final TagKey VIBRANIUM_ORE = BlockTags.create(Reference.ore("vibranium")); - public static final TagKey UNOBTAINIUM_ORE = BlockTags.create(Reference.ore("unobtainium")); - - public static final TagKey OTHER_PROTECTION = BlockTags.create(Reference.atm("blocks/blocklist")); - - public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = BlockTags.create(Reference.forge("needs_allthemodium_tool")); - public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create(Reference.forge("needs_allthemodiumalloy_tool")); - - public static final TagKey FORGE_SWORDS = ItemTags.create(Reference.forge("tools/swords")); - public static final TagKey FORGE_PICKAXES = ItemTags.create(Reference.forge("tools/pickaxes")); - public static final TagKey FORGE_AXES = ItemTags.create(Reference.forge("tools/axes")); - public static final TagKey FORGE_SHOVELS = ItemTags.create(Reference.forge("tools/shovels")); - public static final TagKey FORGE_HOES = ItemTags.create(Reference.forge("tools/hoes")); - public static final TagKey PAXEL_TARGETS = BlockTags.create(Reference.atm("paxel_effective")); - - public static final TagKey PIGLIN_LOVED = ItemTags.create(Reference.location("minecraft:items/piglin_loved")); - public static final TagKey RAW_MATERIALS = ItemTags.create(Reference.forge("raw_materials")); - - public static final TagKey SAPLINGS = ItemTags.create(Reference.location("saplings")); - public static final TagKey DUSTS = ItemTags.create(Reference.forge("dusts")); - public static final TagKey INGOTS = ItemTags.create(Reference.forge("ingots")); - public static final TagKey ORES = ItemTags.create(Reference.forge("ores")); - public static final TagKey BLOCK_ORES = BlockTags.create(Reference.forge("ores")); - - public static final TagKey OTHER_BIOMES = TagKey.create(Registry.BIOME_REGISTRY, Reference.location("allthemodium:other_biomes")); - - public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create(Reference.location("allthemodium:other_te_whitelist")); - public static final TagKey ANCIENT_DIRT = BlockTags.create(Reference.location("allthemodium:ancient_dirt")); - public static final TagKey ANCIENT_STONE = BlockTags.create(Reference.location("allthemodium:ancient_stone")); - public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_stone")); - public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create(Reference.location("allthemodium:ancient_planks")); - public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_planks")); - public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create(Reference.location("allthemodium:demonic_planks")); - public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = ItemTags.create(Reference.location("allthemodium:demonic_planks")); - public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create(Reference.location("allthemodium:soul_planks")); - public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create(Reference.location("allthemodium:soul_planks")); - - public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create(Reference.location("allthemodium:ancient_mossy_stone")); - public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_mossy_stone")); - public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create(Reference.location("allthemodium:ancient_smooth_stone")); - public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_smooth_stone")); - public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create(Reference.location("allthemodium:ancient_polished_stone")); - public static final TagKey ANCIENT_POLISHED_STONE_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_polished_stone")); - public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create(Reference.location("allthemodium:ancient_stone_bricks")); - public static final TagKey ANCIENT_STONE_BRICKS_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_stone_bricks")); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = BlockTags.create(Reference.location("allthemodium:ancient_cracked_stone_bricks")); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_cracked_stone_bricks")); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = BlockTags.create(Reference.location("allthemodium:ancient_chiseled_stone_bricks")); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = ItemTags.create(Reference.location("allthemodium:ancient_chiseled_stone_bricks")); - - - public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create(Reference.ore("allthemodium")); - public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create(Reference.ore("vibranium")); - public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create(Reference.ore("unobtainium")); - - public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create(Reference.block("allthemodium")); - public static final TagKey VIBRANIUM_BLOCK = BlockTags.create(Reference.block("vibranium")); - public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create(Reference.block("unobtainium")); - - public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create(Reference.block("raw_allthemodium")); - public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create(Reference.block("raw_vibranium")); - public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create(Reference.block("raw_unobtainium")); - - public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create(Reference.block("allthemodium")); - public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create(Reference.block("vibranium")); - public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create(Reference.block("unobtainium")); - - public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create(Reference.ingot("allthemodium")); - public static final TagKey VIBRANIUM_INGOT = ItemTags.create(Reference.ingot("vibranium")); - public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create(Reference.ingot("unobtainium")); - public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = ItemTags.create(Reference.ingot("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = ItemTags.create(Reference.ingot("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = ItemTags.create(Reference.ingot("unobtainium_allthemodium_alloy")); - - public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = ItemTags.create(Reference.block("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = ItemTags.create(Reference.block("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = ItemTags.create(Reference.block("unobtainium_allthemodium_alloy")); - - - public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create(Reference.plate("allthemodium")); - public static final TagKey VIBRANIUM_PLATE = ItemTags.create(Reference.plate("vibranium")); - public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create(Reference.plate("unobtainium")); - - public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create(Reference.gear("allthemodium")); - public static final TagKey VIBRANIUM_GEAR = ItemTags.create(Reference.gear("vibranium")); - public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create(Reference.gear("unobtainium")); - - public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create(Reference.rod("allthemodium")); - public static final TagKey VIBRANIUM_ROD = ItemTags.create(Reference.rod("vibranium")); - public static final TagKey UNOBTAINIUM_ROD = ItemTags.create(Reference.rod("unobtainium")); - - public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create(Reference.dust("allthemodium")); - public static final TagKey VIBRANIUM_DUST = ItemTags.create(Reference.dust("vibranium")); - public static final TagKey UNOBTAINIUM_DUST = ItemTags.create(Reference.dust("unobtainium")); - - public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create(Reference.nugget("allthemodium")); - public static final TagKey VIBRANIUM_NUGGET = ItemTags.create(Reference.nugget("vibranium")); - public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create(Reference.nugget("unobtainium")); - - public static final TagKey SOUL_LAVA = FluidTags.create(Reference.forge("soul_lava")); - public static final TagKey ALLTHEMODIUM = FluidTags.create(Reference.forge("molten_allthemodium")); - public static final TagKey VIBRANIUM = FluidTags.create(Reference.forge("molten_vibranium")); - public static final TagKey UNOBTAINIUM = FluidTags.create(Reference.forge("molten_unobtainium")); - - public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create(Reference.raw_ores("allthemodium")); - public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create(Reference.raw_ores("vibranium")); - public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create(Reference.raw_ores("unobtainium")); - - - public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create(Reference.material("allthemodium")); - public static final TagKey RAW_VIBRANIUM = ItemTags.create(Reference.material("vibranium")); - public static final TagKey RAW_UNOBTAINIUM = ItemTags.create(Reference.material("unobtainium")); - - public static final TagKey DIRTYDUST = ItemTags.create(Reference.mek("dirty_dusts")); - public static final TagKey CRYSTAL = ItemTags.create(Reference.mek("crystals")); - public static final TagKey CLUMP = ItemTags.create(Reference.mek("clumps")); - public static final TagKey SHARD = ItemTags.create(Reference.mek("shards")); - - - public static final TagKey ALLTHEMODIUM_DIRTYDUST = ItemTags.create(Reference.dirty("allthemodium")); - public static final TagKey VIBRANIUM_DIRTYDUST = ItemTags.create(Reference.dirty("vibranium")); - public static final TagKey UNOBTAINIUM_DIRTYDUST = ItemTags.create(Reference.dirty("unobtainium")); - - public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create(Reference.crystal("allthemodium")); - public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create(Reference.crystal("vibranium")); - public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create(Reference.crystal("unobtainium")); - - public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create(Reference.clump("allthemodium")); - public static final TagKey VIBRANIUM_CLUMP = ItemTags.create(Reference.clump("vibranium")); - public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create(Reference.clump("unobtainium")); - - public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create(Reference.shard("allthemodium")); - public static final TagKey VIBRANIUM_SHARD = ItemTags.create(Reference.shard("vibranium")); - public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create(Reference.shard("unobtainium")); - + public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create( + Reference.ore("allthemodium") + ); + public static final TagKey VIBRANIUM_ORE = BlockTags.create( + Reference.ore("vibranium") + ); + public static final TagKey UNOBTAINIUM_ORE = BlockTags.create( + Reference.ore("unobtainium") + ); + + public static final TagKey OTHER_PROTECTION = BlockTags.create( + Reference.atm("blocks/blocklist") + ); + + public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = + BlockTags.create(Reference.forge("needs_allthemodium_tool")); + public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create( + Reference.forge("needs_allthemodiumalloy_tool") + ); + + public static final TagKey FORGE_SWORDS = ItemTags.create( + Reference.forge("tools/swords") + ); + public static final TagKey FORGE_PICKAXES = ItemTags.create( + Reference.forge("tools/pickaxes") + ); + public static final TagKey FORGE_AXES = ItemTags.create( + Reference.forge("tools/axes") + ); + public static final TagKey FORGE_SHOVELS = ItemTags.create( + Reference.forge("tools/shovels") + ); + public static final TagKey FORGE_HOES = ItemTags.create( + Reference.forge("tools/hoes") + ); + public static final TagKey PAXEL_TARGETS = BlockTags.create( + Reference.atm("paxel_effective") + ); + + public static final TagKey PIGLIN_LOVED = ItemTags.create( + Reference.location("minecraft:items/piglin_loved") + ); + public static final TagKey RAW_MATERIALS = ItemTags.create( + Reference.forge("raw_materials") + ); + + public static final TagKey SAPLINGS = ItemTags.create( + Reference.location("saplings") + ); + public static final TagKey DUSTS = ItemTags.create( + Reference.forge("dusts") + ); + public static final TagKey INGOTS = ItemTags.create( + Reference.forge("ingots") + ); + public static final TagKey ORES = ItemTags.create( + Reference.forge("ores") + ); + public static final TagKey BLOCK_ORES = BlockTags.create( + Reference.forge("ores") + ); + + public static final TagKey OTHER_BIOMES = TagKey.create( + Registry.BIOME_REGISTRY, + Reference.location("allthemodium:other_biomes") + ); + + public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create( + Reference.location("allthemodium:other_te_whitelist") + ); + public static final TagKey ANCIENT_DIRT = BlockTags.create( + Reference.location("allthemodium:ancient_dirt") + ); + public static final TagKey ANCIENT_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_stone") + ); + public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_stone") + ); + public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:ancient_planks") + ); + public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = + ItemTags.create(Reference.location("allthemodium:ancient_planks")); + public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:demonic_planks") + ); + public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = + ItemTags.create(Reference.location("allthemodium:demonic_planks")); + public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:soul_planks") + ); + public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create( + Reference.location("allthemodium:soul_planks") + ); + + public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_mossy_stone") + ); + public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_mossy_stone") + ); + public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_smooth_stone") + ); + public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = + ItemTags.create( + Reference.location("allthemodium:ancient_smooth_stone") + ); + public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_polished_stone") + ); + public static final TagKey ANCIENT_POLISHED_STONE_ITEM = + ItemTags.create( + Reference.location("allthemodium:ancient_polished_stone") + ); + public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_stone_bricks") + ); + public static final TagKey ANCIENT_STONE_BRICKS_ITEM = + ItemTags.create( + Reference.location("allthemodium:ancient_stone_bricks") + ); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = + BlockTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks") + ); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = + ItemTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks") + ); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = + BlockTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks") + ); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = + ItemTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks") + ); + + public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create( + Reference.ore("allthemodium") + ); + public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create( + Reference.ore("vibranium") + ); + public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create( + Reference.ore("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create( + Reference.block("allthemodium") + ); + public static final TagKey VIBRANIUM_BLOCK = BlockTags.create( + Reference.block("vibranium") + ); + public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create( + Reference.block("unobtainium") + ); + + public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create( + Reference.block("raw_allthemodium") + ); + public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create( + Reference.block("raw_vibranium") + ); + public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create( + Reference.block("raw_unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("allthemodium") + ); + public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("vibranium") + ); + public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create( + Reference.ingot("allthemodium") + ); + public static final TagKey VIBRANIUM_INGOT = ItemTags.create( + Reference.ingot("vibranium") + ); + public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create( + Reference.ingot("unobtainium") + ); + public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = + ItemTags.create(Reference.ingot("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = + ItemTags.create(Reference.ingot("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = + ItemTags.create(Reference.ingot("unobtainium_allthemodium_alloy")); + + public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = + ItemTags.create(Reference.block("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = + ItemTags.create(Reference.block("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = + ItemTags.create(Reference.block("unobtainium_allthemodium_alloy")); + + public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create( + Reference.plate("allthemodium") + ); + public static final TagKey VIBRANIUM_PLATE = ItemTags.create( + Reference.plate("vibranium") + ); + public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create( + Reference.plate("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create( + Reference.gear("allthemodium") + ); + public static final TagKey VIBRANIUM_GEAR = ItemTags.create( + Reference.gear("vibranium") + ); + public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create( + Reference.gear("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create( + Reference.rod("allthemodium") + ); + public static final TagKey VIBRANIUM_ROD = ItemTags.create( + Reference.rod("vibranium") + ); + public static final TagKey UNOBTAINIUM_ROD = ItemTags.create( + Reference.rod("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create( + Reference.dust("allthemodium") + ); + public static final TagKey VIBRANIUM_DUST = ItemTags.create( + Reference.dust("vibranium") + ); + public static final TagKey UNOBTAINIUM_DUST = ItemTags.create( + Reference.dust("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create( + Reference.nugget("allthemodium") + ); + public static final TagKey VIBRANIUM_NUGGET = ItemTags.create( + Reference.nugget("vibranium") + ); + public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create( + Reference.nugget("unobtainium") + ); + + public static final TagKey SOUL_LAVA = FluidTags.create( + Reference.forge("soul_lava") + ); + public static final TagKey ALLTHEMODIUM = FluidTags.create( + Reference.forge("molten_allthemodium") + ); + public static final TagKey VIBRANIUM = FluidTags.create( + Reference.forge("molten_vibranium") + ); + public static final TagKey UNOBTAINIUM = FluidTags.create( + Reference.forge("molten_unobtainium") + ); + + public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create( + Reference.raw_ores("allthemodium") + ); + public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create( + Reference.raw_ores("vibranium") + ); + public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create( + Reference.raw_ores("unobtainium") + ); + + public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create( + Reference.material("allthemodium") + ); + public static final TagKey RAW_VIBRANIUM = ItemTags.create( + Reference.material("vibranium") + ); + public static final TagKey RAW_UNOBTAINIUM = ItemTags.create( + Reference.material("unobtainium") + ); + + public static final TagKey DIRTY_DUST = ItemTags.create( + Reference.mek("dirty_dusts") + ); + public static final TagKey CRYSTAL = ItemTags.create( + Reference.mek("crystals") + ); + public static final TagKey CLUMP = ItemTags.create( + Reference.mek("clumps") + ); + public static final TagKey SHARD = ItemTags.create( + Reference.mek("shards") + ); + + public static final TagKey ALLTHEMODIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("allthemodium") + ); + public static final TagKey VIBRANIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("vibranium") + ); + public static final TagKey UNOBTAINIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create( + Reference.crystal("allthemodium") + ); + public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create( + Reference.crystal("vibranium") + ); + public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create( + Reference.crystal("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create( + Reference.clump("allthemodium") + ); + public static final TagKey VIBRANIUM_CLUMP = ItemTags.create( + Reference.clump("vibranium") + ); + public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create( + Reference.clump("unobtainium") + ); + + public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create( + Reference.shard("allthemodium") + ); + public static final TagKey VIBRANIUM_SHARD = ItemTags.create( + Reference.shard("vibranium") + ); + public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create( + Reference.shard("unobtainium") + ); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java index bdb0f34d..11a30ece 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java @@ -1,49 +1,62 @@ package com.thevortex.allthemodium.registry.client; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.Tesselator; -import com.mojang.blaze3d.vertex.VertexBuffer; import com.mojang.math.Matrix4f; -import com.thevortex.allthemodium.worldgen.biomes.ATMBiomes; -import net.minecraft.client.Camera; -import net.minecraft.client.Minecraft; +import javax.annotation.Nonnull; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.DimensionSpecialEffects; -import net.minecraft.client.renderer.FogRenderer; -import net.minecraft.client.renderer.ShaderInstance; -import net.minecraft.world.level.material.FogType; import net.minecraft.world.phys.Vec3; public class OtherSky extends DimensionSpecialEffects { + public OtherSky( + float p_108866_, + boolean p_108867_, + SkyType p_108868_, + boolean p_108869_, + boolean p_108870_ + ) { + super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); + } + + @Override + public Vec3 getBrightnessDependentFogColor( + @Nonnull Vec3 p_108878_, + float p_108879_ + ) { + return p_108878_; + } + + @Override + public boolean isFoggyAt(int p_108874_, int p_108875_) { + return true; + } + + @Override + public float getCloudHeight() { + return Float.NaN; + } + + @Override + public boolean renderClouds( + @Nonnull ClientLevel level, + int ticks, + float partialTick, + @Nonnull PoseStack poseStack, + double camX, + double camY, + double camZ, + @Nonnull Matrix4f projectionMatrix + ) { + return false; + } + // @Override + // public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, + // Matrix4f projectionMatrix, + // boolean isFoggy, Runnable setupFog) { + // return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); + // } - public OtherSky(float p_108866_, boolean p_108867_, SkyType p_108868_, boolean p_108869_, boolean p_108870_) { - super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); - } - - @Override - public Vec3 getBrightnessDependentFogColor(Vec3 p_108878_, float p_108879_) { - return p_108878_; - } - - @Override - public boolean isFoggyAt(int p_108874_, int p_108875_) { - return true; - } - - @Override - public float getCloudHeight() { return Float.NaN; } - @Override - public boolean renderClouds(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, double camX, double camY, double camZ, Matrix4f projectionMatrix) { - return false; - } -/* - @Override - public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, Matrix4f projectionMatrix, boolean isFoggy, Runnable setupFog) { - return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); - } - - */ } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java index a46cbe2c..c1c1241e 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java @@ -8,13 +8,34 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; - -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + bus = Mod.EventBusSubscriber.Bus.MOD, + value = Dist.CLIENT +) public class SkyRegistry { - @SubscribeEvent - public static void register(RegisterDimensionSpecialEffectsEvent event) { - event.register(new ResourceLocation(Reference.MOD_ID, "the_other"), new OtherSky(Float.NaN, true, DimensionSpecialEffects.SkyType.NORMAL, false, false)); - event.register(new ResourceLocation(Reference.MOD_ID, "mining"), new OtherSky(Float.NaN, true, DimensionSpecialEffects.SkyType.NORMAL, true, true)); - } + @SubscribeEvent + public static void register(RegisterDimensionSpecialEffectsEvent event) { + event.register( + new ResourceLocation(Reference.MOD_ID, "the_other"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + false, + false + ) + ); + event.register( + new ResourceLocation(Reference.MOD_ID, "mining"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + true, + true + ) + ); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java index 5496f7ad..f8cd9d4b 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.registry.resource; import com.thevortex.allthemodium.registry.TagRegistry; +import java.util.function.Supplier; import mekanism.common.resource.BlockResourceInfo; import mekanism.common.resource.IResource; import mekanism.common.resource.ResourceType; @@ -8,62 +9,69 @@ import net.minecraft.world.item.Item; import org.jetbrains.annotations.Nullable; -import java.util.function.Supplier; - public enum ATMResource implements IResource { - ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), - VIBRANIUM("vibranium",2547336,TagRegistry.VIBRANIUM_ORE_ITEM), - UNOBTAINIUM("unobtainium",13718243,TagRegistry.UNOBTAINIUM_ORE_ITEM); + ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), + VIBRANIUM("vibranium", 2547336, TagRegistry.VIBRANIUM_ORE_ITEM), + UNOBTAINIUM("unobtainium", 13718243, TagRegistry.UNOBTAINIUM_ORE_ITEM); - private final String name; - private final int tint; - //Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource - private final Supplier> oreTag; - private final boolean isVanilla; - private final BlockResourceInfo resourceBlockInfo; - private final BlockResourceInfo rawResourceBlockInfo; + private final String name; + private final int tint; + // Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource + private final Supplier> oreTag; + private final boolean isVanilla; + private final BlockResourceInfo resourceBlockInfo; + private final BlockResourceInfo rawResourceBlockInfo; - ATMResource(String name, int colour, TagKey oreTag) { - this(name, colour, () -> oreTag,true, null,null); - } - ATMResource(String name, int tint, Supplier> oreTag, boolean isVanilla, BlockResourceInfo resourceBlockInfo, BlockResourceInfo rawResourceBlockInfo) { - this.name = name; - this.tint = tint; - this.oreTag = oreTag; - this.isVanilla = isVanilla; - this.resourceBlockInfo = resourceBlockInfo; - this.rawResourceBlockInfo = rawResourceBlockInfo; - } + ATMResource(String name, int colour, TagKey oreTag) { + this(name, colour, () -> oreTag, true, null, null); + } - @Override - public String getRegistrySuffix() { - return name; - } + ATMResource( + String name, + int tint, + Supplier> oreTag, + boolean isVanilla, + BlockResourceInfo resourceBlockInfo, + BlockResourceInfo rawResourceBlockInfo + ) { + this.name = name; + this.tint = tint; + this.oreTag = oreTag; + this.isVanilla = isVanilla; + this.resourceBlockInfo = resourceBlockInfo; + this.rawResourceBlockInfo = rawResourceBlockInfo; + } - public int getTint() { - return tint; - } + @Override + public String getRegistrySuffix() { + return name; + } - public TagKey getOreTag() { - return oreTag.get(); - } + public int getTint() { + return tint; + } - public boolean has(ResourceType type) { - return type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla()); - } + public TagKey getOreTag() { + return oreTag.get(); + } - public boolean isVanilla() { - return isVanilla; - } + public boolean has(ResourceType type) { + return ( + type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla()) + ); + } - @Nullable - public BlockResourceInfo getResourceBlockInfo() { - return resourceBlockInfo; - } + public boolean isVanilla() { + return isVanilla; + } - @Nullable - public BlockResourceInfo getRawResourceBlockInfo() { - return rawResourceBlockInfo; - } + @Nullable + public BlockResourceInfo getResourceBlockInfo() { + return resourceBlockInfo; } + @Nullable + public BlockResourceInfo getRawResourceBlockInfo() { + return rawResourceBlockInfo; + } +} diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java index d16de13e..e0ce4c5f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java @@ -2,16 +2,21 @@ import com.thevortex.allthemodium.reference.Reference; import com.thevortex.allthemodium.registry.MekRegistry; -import mekanism.api.chemical.slurry.Slurry; -import mekanism.common.registration.impl.SlurryRegistryObject; - import java.util.LinkedHashMap; import java.util.Map; +import mekanism.api.chemical.slurry.Slurry; +import mekanism.common.registration.impl.SlurryRegistryObject; public class ATMSlurries { - public static final MekRegistry SLURRIES = new MekRegistry(Reference.MOD_ID); - public static final Map> PROCESSED_RESOURCES = new LinkedHashMap<>(); + public static final MekRegistry SLURRIES = new MekRegistry( + Reference.MOD_ID + ); + + public static final Map< + ATMResource, + SlurryRegistryObject + > PROCESSED_RESOURCES = new LinkedHashMap<>(); static { for (ATMResource resource : EnumFunc.PRIMARY_RESOURCES) { diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java index 82162ce6..9604475c 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java @@ -1,6 +1,6 @@ package com.thevortex.allthemodium.registry.resource; public class EnumFunc { - public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); + public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java index 08b02b57..06427a32 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.math.Vector3f; import com.thevortex.allthemodium.reference.Reference; +import java.util.function.Consumer; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -21,8 +22,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.function.Consumer; - public class MoltenATMType extends FluidType { public MoltenATMType(Properties properties) { @@ -30,65 +29,109 @@ public MoltenATMType(Properties properties) { } @Override - public @Nullable BlockPathTypes getBlockPathType(FluidState state, BlockGetter level, BlockPos pos, @Nullable Mob mob, boolean canFluidLog) { - return canFluidLog ? super.getBlockPathType(state, level, pos, mob, true) : null; + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog + ) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; } @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation(Reference.MOD_ID, "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation(Reference.MOD_ID, "block/fluid/atm_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation(Reference.MOD_ID, "block/fluid/atm_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation(Reference.MOD_ID, "block/fluid/atm_molten_still"); - - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } - - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } - - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } - - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } - - @Override - public @NotNull Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + public void initializeClient( + Consumer consumer + ) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = + new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png" + ); + private static final ResourceLocation FLUID_STILL = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still" + ); + private static final ResourceLocation FLUID_FLOW = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_flow" + ); + private static final ResourceLocation FLUID_OVERLAY = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still" + ); + + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - Entity entity = camera.getEntity(); + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor + ) { + return new Vector3f(0.08F, 0.08F, 0.0F); } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape + ) { + nearDistance = -8.0F; + farDistance = 96.0F; + + Entity entity = camera.getEntity(); + + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localPlayer = (LocalPlayer) entity; + farDistance *= + Math.max(0.25F, localPlayer.getWaterVision()); + } + + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } + + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } } - }); + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java index 894ffe98..20db49a6 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.math.Vector3f; import com.thevortex.allthemodium.reference.Reference; +import java.util.function.Consumer; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -21,8 +22,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.function.Consumer; - public class MoltenUNOBType extends FluidType { public MoltenUNOBType(Properties properties) { @@ -30,65 +29,109 @@ public MoltenUNOBType(Properties properties) { } @Override - public @Nullable BlockPathTypes getBlockPathType(FluidState state, BlockGetter level, BlockPos pos, @Nullable Mob mob, boolean canFluidLog) { - return canFluidLog ? super.getBlockPathType(state, level, pos, mob, true) : null; + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog + ) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; } @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation(Reference.MOD_ID, "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation(Reference.MOD_ID, "block/fluid/unobtainium_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation(Reference.MOD_ID, "block/fluid/unobtainium_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation(Reference.MOD_ID, "block/fluid/unobtainium_molten_still"); - - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } - - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } - - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } - - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } - - @Override - public @NotNull Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + public void initializeClient( + Consumer consumer + ) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = + new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png" + ); + private static final ResourceLocation FLUID_STILL = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still" + ); + private static final ResourceLocation FLUID_FLOW = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_flow" + ); + private static final ResourceLocation FLUID_OVERLAY = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still" + ); + + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - Entity entity = camera.getEntity(); + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor + ) { + return new Vector3f(0.08F, 0.08F, 0.0F); } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape + ) { + nearDistance = -8.0F; + farDistance = 96.0F; + + Entity entity = camera.getEntity(); + + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= + Math.max(0.25F, localplayer.getWaterVision()); + } + + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } + + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } } - }); + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java index 92fbb787..3de56a9f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.math.Vector3f; import com.thevortex.allthemodium.reference.Reference; +import java.util.function.Consumer; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -21,8 +22,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.function.Consumer; - public class MoltenVIBType extends FluidType { public MoltenVIBType(Properties properties) { @@ -30,65 +29,109 @@ public MoltenVIBType(Properties properties) { } @Override - public @Nullable BlockPathTypes getBlockPathType(FluidState state, BlockGetter level, BlockPos pos, @Nullable Mob mob, boolean canFluidLog) { - return canFluidLog ? super.getBlockPathType(state, level, pos, mob, true) : null; + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog + ) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; } @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation(Reference.MOD_ID, "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation(Reference.MOD_ID, "block/fluid/vibranium_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation(Reference.MOD_ID, "block/fluid/vibranium_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation(Reference.MOD_ID, "block/fluid/vibranium_molten_still"); - - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } - - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } - - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } - - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } - - @Override - public @NotNull Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + public void initializeClient( + Consumer consumer + ) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = + new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png" + ); + private static final ResourceLocation FLUID_STILL = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still" + ); + private static final ResourceLocation FLUID_FLOW = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_flow" + ); + private static final ResourceLocation FLUID_OVERLAY = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still" + ); + + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - Entity entity = camera.getEntity(); + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor + ) { + return new Vector3f(0.08F, 0.08F, 0.0F); } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape + ) { + nearDistance = -8.0F; + farDistance = 96.0F; + + Entity entity = camera.getEntity(); + + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= + Math.max(0.25F, localplayer.getWaterVision()); + } + + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } + + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } } - }); + ); } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java index 7476e87a..29306dc2 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.math.Vector3f; import com.thevortex.allthemodium.reference.Reference; +import java.util.function.Consumer; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -21,73 +22,116 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.function.Consumer; - public class SoulLavaType extends FluidType { + public SoulLavaType(Properties properties) { super(properties); } @Override - public @Nullable BlockPathTypes getBlockPathType(FluidState state, BlockGetter level, BlockPos pos, @Nullable Mob mob, boolean canFluidLog) { - return canFluidLog ? super.getBlockPathType(state, level, pos, mob, true) : null; + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog + ) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; } @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation(Reference.MOD_ID, "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation(Reference.MOD_ID, "block/fluid/soul_lava_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation(Reference.MOD_ID, "block/fluid/soul_lava_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation(Reference.MOD_ID, "block/fluid/soul_lava_still"); + public void initializeClient( + Consumer consumer + ) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = + new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png" + ); + private static final ResourceLocation FLUID_STILL = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still" + ); + private static final ResourceLocation FLUID_FLOW = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_flow" + ); + private static final ResourceLocation FLUID_OVERLAY = + new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still" + ); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor + ) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape + ) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= + Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } } - }); + ); } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java index f3c0ceb4..8cf8e8cd 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java @@ -1,13 +1,14 @@ package com.thevortex.allthemodium.worldgen; - import com.google.common.collect.ImmutableList; import com.thevortex.allthemodium.blocks.ACaveVines; import com.thevortex.allthemodium.blocks.AncientCaveVines; import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.registry.ModRegistry; +import com.thevortex.allthemodium.registry.TagRegistry; import com.thevortex.allthemodium.worldgen.features.VolcanoConfig; +import java.util.List; +import java.util.OptionalInt; import net.minecraft.core.Direction; import net.minecraft.core.Holder; import net.minecraft.core.Registry; @@ -30,96 +31,407 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.BlockMatchTest; import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; -import java.util.List; -import java.util.OptionalInt; - public class ATMConfiguredFeature { - public static final ImmutableList ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList.of(OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState()), OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState())); - public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, 4); - - public static Holder> ORE_ALLTHEMODIUM = FeatureUtils.register("allthemodium:ore_allthemodium", - Feature.ORE - ,ORE_ALLTHEMODIUM_CONFIG); - - public static Holder> ORE_ATM_MINING = FeatureUtils.register("allthemodium:ore_atm_mining", - Feature.ORE - ,ORE_ALLTHEMODIUM_CONFIG); - - public static Holder> ORE_VIBRANIUM = FeatureUtils.register("allthemodium:ore_vibranium", - Feature.ORE - ,new OreConfiguration(OreFeatures.NETHER_ORE_REPLACEABLES, - ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), 4)); - - public static Holder> OTHER_ORE_VIBRANIUM = FeatureUtils.register("allthemodium:other_ore_vibranium", - Feature.ORE - ,new OreConfiguration(new TagMatchTest(TagRegistry.ANCIENT_STONE), - ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), 3)); - - public static Holder> ORE_UNOBTAINIUM = FeatureUtils.register("allthemodium:ore_unobtainium", - Feature.ORE - ,new OreConfiguration(new BlockMatchTest(Blocks.END_STONE), - ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), 4)); - - public static Holder> VOLCANO_CF = FeatureUtils.register("allthemodium:volcano",ModRegistry.VOLCANO.get(),VolcanoConfig.INSTANCE); - - public static final Holder> MOD_DELTAS = FeatureUtils.register("allthemodium:other_deltas", Feature.DELTA_FEATURE,new DeltaFeatureConfiguration(ModRegistry.ANCIENT_STONE.get().defaultBlockState(), Blocks.MAGMA_BLOCK.defaultBlockState(), UniformInt.of(3, 4), UniformInt.of(0, 2))); - - public static final Holder> ANCIENT_TREE_GIANT = FeatureUtils.register("allthemodium:ancient_tree_giant", Feature.TREE,createAncientGiantTree().build()); - public static final Holder> ANCIENT_TREE_MEDIUM = FeatureUtils.register("allthemodium:ancient_tree_medium", Feature.TREE,createAncientMediumTree().build()); - public static final Holder> ANCIENT_TREE = FeatureUtils.register("allthemodium:ancient_tree", Feature.TREE,createAncientTree().build()); - - public static final Holder> DEMONIC_TREE_GIANT = FeatureUtils.register("allthemodium:demonic_tree_giant", Feature.TREE,createDemonicGiantTree().build()); - public static final Holder> DEMONIC_TREE_MEDIUM = FeatureUtils.register("allthemodium:demonic_tree_medium", Feature.TREE,createDemonicMediumTree().build()); - public static final Holder> DEMONIC_TREE = FeatureUtils.register("allthemodium:demonic_tree", Feature.TREE,createDemonicTree().build()); - - public static final Holder> SOUL_TREE_GIANT = FeatureUtils.register("allthemodium:soul_tree_giant", Feature.TREE,createSoulGiantTree().build()); - public static final Holder> SOUL_TREE_MEDIUM = FeatureUtils.register("allthemodium:soul_tree_medium", Feature.TREE,createSoulMediumTree().build()); - public static final Holder> SOUL_TREE = FeatureUtils.register("allthemodium:soul_tree", Feature.TREE,createSoulTree().build()); - - - private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = new WeightedStateProvider(SimpleWeightedRandomList.builder().add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get().defaultBlockState(), 4).add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get().defaultBlockState().setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), 1)); - private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = new RandomizedIntStateProvider(new WeightedStateProvider(SimpleWeightedRandomList.builder().add(ModRegistry.ANCIENT_CAVEVINES_.get().defaultBlockState(), 4).add(ModRegistry.ANCIENT_CAVEVINES_.get().defaultBlockState().setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), 1)), AncientCaveVines.AGE, UniformInt.of(23, 25)); - public static final Holder> CAVE_VINE = FeatureUtils.register("allthemodium:cave_vine", Feature.BLOCK_COLUMN,new BlockColumnConfiguration(List.of(BlockColumnConfiguration.layer(new WeightedListInt(SimpleWeightedRandomList.builder().add(UniformInt.of(0, 19), 2).add(UniformInt.of(0, 2), 3).add(UniformInt.of(0, 6), 10).build()), CAVE_VINES_BODY_PROVIDER), BlockColumnConfiguration.layer(ConstantInt.of(1), CAVE_VINES_HEAD_PROVIDER)), Direction.DOWN, BlockPredicate.ONLY_IN_AIR_PREDICATE, true)); - - public static final Holder> PATCH_ANCIENT_HERB = FeatureUtils.register("allthemodium:patch_ancient_herb", Feature.RANDOM_PATCH,FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK,new SimpleBlockConfiguration(BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get())))); - - - private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), new FancyTrunkPlacer(26, 7, 7), BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), new FancyTrunkPlacer(17, 5, 5), BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), new FancyTrunkPlacer(8, 3, 3), BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), new FancyTrunkPlacer(26, 7, 7), BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), new FancyTrunkPlacer(17, 5, 5), BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), new FancyTrunkPlacer(8, 3, 3), BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), new FancyTrunkPlacer(26, 7, 7), BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.SOUL_LOG_1.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), new FancyTrunkPlacer(17, 5, 5), BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.SOUL_LOG_2.get().defaultBlockState()))); - } - private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { - return (new TreeConfiguration.TreeConfigurationBuilder(BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), new FancyTrunkPlacer(8, 3, 3), BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))).dirt(new SimpleStateProvider(ModRegistry.SOUL_LOG_0.get().defaultBlockState()))); - } - - - - public static ConfiguredFeature newConfiguredFeature(String registryName, - ConfiguredFeature configuredFeature) { - Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation(Reference.MOD_ID, registryName), - configuredFeature); - return configuredFeature; - } + public static final ImmutableList< + OreConfiguration.TargetBlockState + > ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList.of( + OreConfiguration.target( + OreFeatures.STONE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState() + ), + OreConfiguration.target( + OreFeatures.DEEPSLATE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState() + ) + ); + public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = + new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, 4); + + public static Holder< + ConfiguredFeature + > ORE_ALLTHEMODIUM = FeatureUtils.register( + "allthemodium:ore_allthemodium", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG + ); + + public static Holder< + ConfiguredFeature + > ORE_ATM_MINING = FeatureUtils.register( + "allthemodium:ore_atm_mining", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG + ); + + public static Holder> ORE_VIBRANIUM = + FeatureUtils.register( + "allthemodium:ore_vibranium", + Feature.ORE, + new OreConfiguration( + OreFeatures.NETHER_ORE_REPLACEABLES, + ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), + 4 + ) + ); + + public static Holder< + ConfiguredFeature + > OTHER_ORE_VIBRANIUM = FeatureUtils.register( + "allthemodium:other_ore_vibranium", + Feature.ORE, + new OreConfiguration( + new TagMatchTest(TagRegistry.ANCIENT_STONE), + ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), + 3 + ) + ); + + public static Holder< + ConfiguredFeature + > ORE_UNOBTAINIUM = FeatureUtils.register( + "allthemodium:ore_unobtainium", + Feature.ORE, + new OreConfiguration( + new BlockMatchTest(Blocks.END_STONE), + ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), + 4 + ) + ); + + public static Holder> VOLCANO_CF = + FeatureUtils.register( + "allthemodium:volcano", + ModRegistry.VOLCANO.get(), + VolcanoConfig.INSTANCE + ); + + public static final Holder< + ConfiguredFeature + > MOD_DELTAS = FeatureUtils.register( + "allthemodium:other_deltas", + Feature.DELTA_FEATURE, + new DeltaFeatureConfiguration( + ModRegistry.ANCIENT_STONE.get().defaultBlockState(), + Blocks.MAGMA_BLOCK.defaultBlockState(), + UniformInt.of(3, 4), + UniformInt.of(0, 2) + ) + ); + + public static final Holder< + ConfiguredFeature + > ANCIENT_TREE_GIANT = FeatureUtils.register( + "allthemodium:ancient_tree_giant", + Feature.TREE, + createAncientGiantTree().build() + ); + public static final Holder< + ConfiguredFeature + > ANCIENT_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:ancient_tree_medium", + Feature.TREE, + createAncientMediumTree().build() + ); + public static final Holder< + ConfiguredFeature + > ANCIENT_TREE = FeatureUtils.register( + "allthemodium:ancient_tree", + Feature.TREE, + createAncientTree().build() + ); + + public static final Holder< + ConfiguredFeature + > DEMONIC_TREE_GIANT = FeatureUtils.register( + "allthemodium:demonic_tree_giant", + Feature.TREE, + createDemonicGiantTree().build() + ); + public static final Holder< + ConfiguredFeature + > DEMONIC_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:demonic_tree_medium", + Feature.TREE, + createDemonicMediumTree().build() + ); + public static final Holder< + ConfiguredFeature + > DEMONIC_TREE = FeatureUtils.register( + "allthemodium:demonic_tree", + Feature.TREE, + createDemonicTree().build() + ); + + public static final Holder< + ConfiguredFeature + > SOUL_TREE_GIANT = FeatureUtils.register( + "allthemodium:soul_tree_giant", + Feature.TREE, + createSoulGiantTree().build() + ); + public static final Holder< + ConfiguredFeature + > SOUL_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:soul_tree_medium", + Feature.TREE, + createSoulMediumTree().build() + ); + public static final Holder< + ConfiguredFeature + > SOUL_TREE = FeatureUtils.register( + "allthemodium:soul_tree", + Feature.TREE, + createSoulTree().build() + ); + + private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = + new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState(), + 4 + ) + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState() + .setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), + 1 + ) + ); + private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = + new RandomizedIntStateProvider( + new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState(), + 4 + ) + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState() + .setValue( + ACaveVines.BERRIES, + Boolean.valueOf(true) + ), + 1 + ) + ), + AncientCaveVines.AGE, + UniformInt.of(23, 25) + ); + public static final Holder< + ConfiguredFeature + > CAVE_VINE = FeatureUtils.register( + "allthemodium:cave_vine", + Feature.BLOCK_COLUMN, + new BlockColumnConfiguration( + List.of( + BlockColumnConfiguration.layer( + new WeightedListInt( + SimpleWeightedRandomList + .builder() + .add(UniformInt.of(0, 19), 2) + .add(UniformInt.of(0, 2), 3) + .add(UniformInt.of(0, 6), 10) + .build() + ), + CAVE_VINES_BODY_PROVIDER + ), + BlockColumnConfiguration.layer( + ConstantInt.of(1), + CAVE_VINES_HEAD_PROVIDER + ) + ), + Direction.DOWN, + BlockPredicate.ONLY_IN_AIR_PREDICATE, + true + ) + ); + + public static final Holder< + ConfiguredFeature + > PATCH_ANCIENT_HERB = FeatureUtils.register( + "allthemodium:patch_ancient_herb", + Feature.RANDOM_PATCH, + FeatureUtils.simplePatchConfiguration( + Feature.SIMPLE_BLOCK, + new SimpleBlockConfiguration( + BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get()) + ) + ) + ); + + private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_1.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_2.get().defaultBlockState() + ) + ) + ); + } + + private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { + return ( + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) + ) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_0.get().defaultBlockState() + ) + ) + ); + } + public static ConfiguredFeature newConfiguredFeature( + String registryName, + ConfiguredFeature configuredFeature + ) { + Registry.register( + BuiltinRegistries.CONFIGURED_FEATURE, + new ResourceLocation(Reference.MOD_ID, registryName), + configuredFeature + ); + return configuredFeature; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java index d21ab4ea..7117c6ee 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java @@ -1,17 +1,11 @@ package com.thevortex.allthemodium.worldgen; import com.google.common.collect.ImmutableList; -import com.thevortex.allthemodium.registry.ModRegistry; -import net.allthemods.alltheores.worldgen.features.ATOOtherFeatures; -import net.minecraft.client.renderer.RenderType; +import java.util.List; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; -import net.minecraft.data.worldgen.features.CaveFeatures; -import net.minecraft.data.worldgen.features.NetherFeatures; -import net.minecraft.data.worldgen.placement.OrePlacements; import net.minecraft.data.worldgen.placement.PlacementUtils; -import net.minecraft.data.worldgen.placement.TreePlacements; import net.minecraft.data.worldgen.placement.VegetationPlacements; import net.minecraft.util.valueproviders.ConstantInt; import net.minecraft.world.level.block.Block; @@ -19,70 +13,240 @@ import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate; import net.minecraft.world.level.levelgen.placement.*; -import java.util.List; -import java.util.Random; - public class ATMPlacedFeature { - - public static final Holder ORE_ALLTHEMODIUM = PlacementUtils.register("allthemodium:ore_allthemodium", ATMConfiguredFeature.ORE_ALLTHEMODIUM,rareOrePlacement(9, HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(15), VerticalAnchor.absolute(20)))); - public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = PlacementUtils.register("allthemodium:ore_allthemodium_mountain", ATMConfiguredFeature.ORE_ALLTHEMODIUM,commonOrePlacement(10, HeightRangePlacement.uniform(VerticalAnchor.absolute(170),VerticalAnchor.belowTop(20)))); - public static final Holder ORE_ATM_MINING = PlacementUtils.register("allthemodium:ore_atm_mining", ATMConfiguredFeature.ORE_ATM_MINING,rareOrePlacement(9, HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(5), VerticalAnchor.absolute(20)))); - public static final Holder ORE_VIBRANIUM = PlacementUtils.register("allthemodium:ore_vibranium", ATMConfiguredFeature.ORE_VIBRANIUM,rareOrePlacement(7, HeightRangePlacement.uniform(VerticalAnchor.belowTop(28), VerticalAnchor.belowTop(5)))); - public static final Holder ORE_VIBRANIUM_OTHER = PlacementUtils.register("allthemodium:other_vibranium_ore", ATMConfiguredFeature.OTHER_ORE_VIBRANIUM,commonOrePlacement(2, HeightRangePlacement.uniform(VerticalAnchor.absolute(1), VerticalAnchor.absolute(20)))); - - public static final Holder ORE_UNOBTAINIUM = PlacementUtils.register("allthemodium:ore_unobtainium", ATMConfiguredFeature.ORE_UNOBTAINIUM,rareOrePlacement(9, HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(15), VerticalAnchor.absolute(78)))); - - public static final Holder VOLCANO_CF = PlacementUtils.register("allthemodium:volcano", ATMConfiguredFeature.VOLCANO_CF); - public static final Holder MOD_DELTAS = PlacementUtils.register("allthemodium:other_deltas", ATMConfiguredFeature.MOD_DELTAS); - public static final Holder ANCIENT_TREE = PlacementUtils.register("allthemodium:ancient_tree", ATMConfiguredFeature.ANCIENT_TREE,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder ANCIENT_TREE_MEDIUM = PlacementUtils.register("allthemodium:ancient_tree_medium", ATMConfiguredFeature.ANCIENT_TREE_MEDIUM,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder ANCIENT_TREE_GIANT = PlacementUtils.register("allthemodium:ancient_tree_giant", ATMConfiguredFeature.ANCIENT_TREE_GIANT,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - - public static final Holder DEMONIC_TREE = PlacementUtils.register("allthemodium:demonic_tree", ATMConfiguredFeature.DEMONIC_TREE,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE_MEDIUM = PlacementUtils.register("allthemodium:demonic_tree_medium", ATMConfiguredFeature.DEMONIC_TREE_MEDIUM,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE_GIANT = PlacementUtils.register("allthemodium:demonic_tree_giant", ATMConfiguredFeature.DEMONIC_TREE_GIANT,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - - public static final Holder SOUL_TREE = PlacementUtils.register("allthemodium:soul_tree", ATMConfiguredFeature.SOUL_TREE,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE_MEDIUM = PlacementUtils.register("allthemodium:soul_tree_medium", ATMConfiguredFeature.SOUL_TREE_MEDIUM,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE_GIANT = PlacementUtils.register("allthemodium:soul_tree_giant", ATMConfiguredFeature.SOUL_TREE_GIANT,treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - - public static final Holder CAVE_VINES = PlacementUtils.register("allthemodium:cave_vines", ATMConfiguredFeature.CAVE_VINE,CountPlacement.of(188), InSquarePlacement.spread(), PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, EnvironmentScanPlacement.scanningFor(Direction.UP, BlockPredicate.hasSturdyFace(Direction.DOWN), BlockPredicate.ONLY_IN_AIR_PREDICATE, 12), RandomOffsetPlacement.vertical(ConstantInt.of(-1)), BiomeFilter.biome()); - - - public static final Holder CAVE_ATM = PlacementUtils.register("allthemodium:cave_ore", ATMConfiguredFeature.ORE_ALLTHEMODIUM,CountPlacement.of(50), InSquarePlacement.spread(), PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, EnvironmentScanPlacement.scanningFor(Direction.UP, BlockPredicate.hasSturdyFace(Direction.DOWN), BlockPredicate.ONLY_IN_AIR_PREDICATE, 12), RandomOffsetPlacement.vertical(ConstantInt.of(-1)), BiomeFilter.biome()); - - - - - - - - - - - - private static List orePlacement(PlacementModifier placement, PlacementModifier placement2) { - return List.of(placement, InSquarePlacement.spread(), placement2, BiomeFilter.biome()); - + public static final Holder ORE_ALLTHEMODIUM = + PlacementUtils.register( + "allthemodium:ore_allthemodium", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(20) + ) + ) + ); + public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = + PlacementUtils.register( + "allthemodium:ore_allthemodium_mountain", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + commonOrePlacement( + 10, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(170), + VerticalAnchor.belowTop(20) + ) + ) + ); + public static final Holder ORE_ATM_MINING = + PlacementUtils.register( + "allthemodium:ore_atm_mining", + ATMConfiguredFeature.ORE_ATM_MINING, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(5), + VerticalAnchor.absolute(20) + ) + ) + ); + public static final Holder ORE_VIBRANIUM = + PlacementUtils.register( + "allthemodium:ore_vibranium", + ATMConfiguredFeature.ORE_VIBRANIUM, + rareOrePlacement( + 7, + HeightRangePlacement.uniform( + VerticalAnchor.belowTop(28), + VerticalAnchor.belowTop(5) + ) + ) + ); + public static final Holder ORE_VIBRANIUM_OTHER = + PlacementUtils.register( + "allthemodium:other_vibranium_ore", + ATMConfiguredFeature.OTHER_ORE_VIBRANIUM, + commonOrePlacement( + 2, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(1), + VerticalAnchor.absolute(20) + ) + ) + ); + + public static final Holder ORE_UNOBTAINIUM = + PlacementUtils.register( + "allthemodium:ore_unobtainium", + ATMConfiguredFeature.ORE_UNOBTAINIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(78) + ) + ) + ); + + public static final Holder VOLCANO_CF = + PlacementUtils.register( + "allthemodium:volcano", + ATMConfiguredFeature.VOLCANO_CF + ); + public static final Holder MOD_DELTAS = + PlacementUtils.register( + "allthemodium:other_deltas", + ATMConfiguredFeature.MOD_DELTAS + ); + public static final Holder ANCIENT_TREE = + PlacementUtils.register( + "allthemodium:ancient_tree", + ATMConfiguredFeature.ANCIENT_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder ANCIENT_TREE_MEDIUM = + PlacementUtils.register( + "allthemodium:ancient_tree_medium", + ATMConfiguredFeature.ANCIENT_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder ANCIENT_TREE_GIANT = + PlacementUtils.register( + "allthemodium:ancient_tree_giant", + ATMConfiguredFeature.ANCIENT_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + + public static final Holder DEMONIC_TREE = + PlacementUtils.register( + "allthemodium:demonic_tree", + ATMConfiguredFeature.DEMONIC_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder DEMONIC_TREE_MEDIUM = + PlacementUtils.register( + "allthemodium:demonic_tree_medium", + ATMConfiguredFeature.DEMONIC_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder DEMONIC_TREE_GIANT = + PlacementUtils.register( + "allthemodium:demonic_tree_giant", + ATMConfiguredFeature.DEMONIC_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + + public static final Holder SOUL_TREE = + PlacementUtils.register( + "allthemodium:soul_tree", + ATMConfiguredFeature.SOUL_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder SOUL_TREE_MEDIUM = + PlacementUtils.register( + "allthemodium:soul_tree_medium", + ATMConfiguredFeature.SOUL_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + public static final Holder SOUL_TREE_GIANT = + PlacementUtils.register( + "allthemodium:soul_tree_giant", + ATMConfiguredFeature.SOUL_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) + ); + + public static final Holder CAVE_VINES = + PlacementUtils.register( + "allthemodium:cave_vines", + ATMConfiguredFeature.CAVE_VINE, + CountPlacement.of(188), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12 + ), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome() + ); + + public static final Holder CAVE_ATM = + PlacementUtils.register( + "allthemodium:cave_ore", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + CountPlacement.of(50), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12 + ), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome() + ); + + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2 + ) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome() + ); } - private static List commonOrePlacement(int count, PlacementModifier pm) { + private static List commonOrePlacement( + int count, + PlacementModifier pm + ) { return orePlacement(CountPlacement.of(count), pm); } - private static List rareOrePlacement(int rarity, PlacementModifier pm) { + private static List rareOrePlacement( + int rarity, + PlacementModifier pm + ) { return orePlacement(RarityFilter.onAverageOnceEvery(rarity), pm); } - private static ImmutableList.Builder treePlacementBase(PlacementModifier p_195485_) { - return ImmutableList.builder().add(p_195485_).add(InSquarePlacement.spread()).add(VegetationPlacements.TREE_THRESHOLD).add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE).add(BiomeFilter.biome()); + + private static ImmutableList.Builder treePlacementBase( + PlacementModifier p_195485_ + ) { + return ImmutableList + .builder() + .add(p_195485_) + .add(InSquarePlacement.spread()) + .add(VegetationPlacements.TREE_THRESHOLD) + .add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE) + .add(BiomeFilter.biome()); } - public static List treePlacement(PlacementModifier p_195480_) { + public static List treePlacement( + PlacementModifier p_195480_ + ) { return treePlacementBase(p_195480_).build(); } - public static List treePlacement(PlacementModifier p_195482_, Block p_195483_) { - return treePlacementBase(p_195482_).add(BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(p_195483_.defaultBlockState(), BlockPos.ZERO))).build(); + public static List treePlacement( + PlacementModifier p_195482_, + Block p_195483_ + ) { + return treePlacementBase(p_195482_) + .add( + BlockPredicateFilter.forPredicate( + BlockPredicate.wouldSurvive( + p_195483_.defaultBlockState(), + BlockPos.ZERO + ) + ) + ) + .build(); } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java index 982850ad..0d7d9486 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java @@ -1,31 +1,127 @@ package com.thevortex.allthemodium.worldgen; +import java.util.List; import net.allthemods.alltheores.worldgen.features.ATOOtherFeatures; import net.minecraft.core.Holder; import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.placement.*; -import java.util.List; - - public class ATOtherPlacedFeatures { - public static final Holder OTHER_ORE_COAL = PlacementUtils.register("allthemodium:ore_coal", ATOOtherFeatures.OTHER_ORE_COAL,commonOrePlacement(30, HeightRangePlacement.uniform(VerticalAnchor.absolute(136), VerticalAnchor.top()))); - public static final Holder OTHER_ORE_COPPER = PlacementUtils.register("allthemodium:ore_copper", ATOOtherFeatures.OTHER_ORE_COPPER,commonOrePlacement(16, HeightRangePlacement.triangle(VerticalAnchor.absolute(-16), VerticalAnchor.absolute(112)))); - public static final Holder OTHER_ORE_DIAMOND = PlacementUtils.register("allthemodium:ore_diamond", ATOOtherFeatures.OTHER_ORE_DIAMOND,commonOrePlacement(14, HeightRangePlacement.triangle(VerticalAnchor.absolute(-10), VerticalAnchor.absolute(129)))); - public static final Holder OTHER_ORE_EMERALD = PlacementUtils.register("allthemodium:ore_emerald", ATOOtherFeatures.OTHER_ORE_EMERALD,commonOrePlacement(20, HeightRangePlacement.triangle(VerticalAnchor.absolute(-16), VerticalAnchor.absolute(480)))); - public static final Holder OTHER_ORE_GOLD = PlacementUtils.register("allthemodium:ore_gold", ATOOtherFeatures.OTHER_ORE_GOLD,commonOrePlacement(20, PlacementUtils.RANGE_10_10)); - public static final Holder OTHER_ORE_IRON = PlacementUtils.register("allthemodium:ore_iron", ATOOtherFeatures.OTHER_ORE_IRON,commonOrePlacement(50, HeightRangePlacement.triangle(VerticalAnchor.absolute(-24), VerticalAnchor.absolute(384)))); - public static final Holder OTHER_ORE_LAPIS = PlacementUtils.register("allthemodium:ore_lapis", ATOOtherFeatures.OTHER_ORE_LAPIS,commonOrePlacement(4, HeightRangePlacement.uniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(64)))); - public static final Holder OTHER_ORE_QUARTZ = PlacementUtils.register("allthemodium:ore_quartz", ATOOtherFeatures.OTHER_ORE_QUARTZ,commonOrePlacement(16, PlacementUtils.RANGE_10_10)); - public static final Holder OTHER_ORE_REDSTONE = PlacementUtils.register("allthemodium:ore_redstone", ATOOtherFeatures.OTHER_ORE_REDSTONE,commonOrePlacement(14, HeightRangePlacement.uniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(15)))); - - private static List orePlacement(PlacementModifier placement, PlacementModifier placement2) { - return List.of(placement, InSquarePlacement.spread(), placement2, BiomeFilter.biome()); + public static final Holder OTHER_ORE_COAL = + PlacementUtils.register( + "allthemodium:ore_coal", + ATOOtherFeatures.OTHER_ORE_COAL, + commonOrePlacement( + 30, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(136), + VerticalAnchor.top() + ) + ) + ); + public static final Holder OTHER_ORE_COPPER = + PlacementUtils.register( + "allthemodium:ore_copper", + ATOOtherFeatures.OTHER_ORE_COPPER, + commonOrePlacement( + 16, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(112) + ) + ) + ); + public static final Holder OTHER_ORE_DIAMOND = + PlacementUtils.register( + "allthemodium:ore_diamond", + ATOOtherFeatures.OTHER_ORE_DIAMOND, + commonOrePlacement( + 14, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-10), + VerticalAnchor.absolute(129) + ) + ) + ); + public static final Holder OTHER_ORE_EMERALD = + PlacementUtils.register( + "allthemodium:ore_emerald", + ATOOtherFeatures.OTHER_ORE_EMERALD, + commonOrePlacement( + 20, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(480) + ) + ) + ); + public static final Holder OTHER_ORE_GOLD = + PlacementUtils.register( + "allthemodium:ore_gold", + ATOOtherFeatures.OTHER_ORE_GOLD, + commonOrePlacement(20, PlacementUtils.RANGE_10_10) + ); + public static final Holder OTHER_ORE_IRON = + PlacementUtils.register( + "allthemodium:ore_iron", + ATOOtherFeatures.OTHER_ORE_IRON, + commonOrePlacement( + 50, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-24), + VerticalAnchor.absolute(384) + ) + ) + ); + public static final Holder OTHER_ORE_LAPIS = + PlacementUtils.register( + "allthemodium:ore_lapis", + ATOOtherFeatures.OTHER_ORE_LAPIS, + commonOrePlacement( + 4, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(64) + ) + ) + ); + public static final Holder OTHER_ORE_QUARTZ = + PlacementUtils.register( + "allthemodium:ore_quartz", + ATOOtherFeatures.OTHER_ORE_QUARTZ, + commonOrePlacement(16, PlacementUtils.RANGE_10_10) + ); + public static final Holder OTHER_ORE_REDSTONE = + PlacementUtils.register( + "allthemodium:ore_redstone", + ATOOtherFeatures.OTHER_ORE_REDSTONE, + commonOrePlacement( + 14, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(15) + ) + ) + ); + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2 + ) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome() + ); } - private static List commonOrePlacement(int count, PlacementModifier pm) { + + private static List commonOrePlacement( + int count, + PlacementModifier pm + ) { return orePlacement(CountPlacement.of(count), pm); } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java index a5833212..18c0ba00 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java @@ -10,13 +10,23 @@ public class MiningDimSource extends FlatLevelSource { - public static final Codec CODEC = RecordCodecBuilder.create((p_204551_) -> { - return commonCodec(p_204551_).and(FlatLevelGeneratorSettings.CODEC.fieldOf("settings").forGetter(FlatLevelSource::settings)).apply(p_204551_, p_204551_.stable(MiningDimSource::new)); - }); + public static final Codec CODEC = + RecordCodecBuilder.create(p_204551_ -> { + return commonCodec(p_204551_) + .and( + FlatLevelGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(FlatLevelSource::settings) + ) + .apply(p_204551_, p_204551_.stable(MiningDimSource::new)); + }); private final FlatLevelGeneratorSettings settings; - public MiningDimSource(Registry structureSetRegistry, FlatLevelGeneratorSettings settings) { - super(structureSetRegistry,settings); + public MiningDimSource( + Registry structureSetRegistry, + FlatLevelGeneratorSettings settings + ) { + super(structureSetRegistry, settings); this.settings = settings; } @@ -33,4 +43,4 @@ public FlatLevelGeneratorSettings settings() { public int getMinY() { return -64; } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java index 36d81418..d4d011ec 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java @@ -2,44 +2,47 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import net.minecraft.SharedConstants; -import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.core.Registry; -import net.minecraft.data.BuiltinRegistries; import net.minecraft.resources.RegistryOps; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.world.level.StructureManager; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeManager; import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.MultiNoiseBiomeSource; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.levelgen.*; -import net.minecraft.world.level.levelgen.blending.Blender; -import net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings; import net.minecraft.world.level.levelgen.structure.StructureSet; import net.minecraft.world.level.levelgen.synth.NormalNoise; -import java.util.function.Supplier; - public class TheOtherDimSource extends NoiseBasedChunkGenerator { - public static final Codec CODEC = RecordCodecBuilder.create((p_188643_) -> { - return commonCodec(p_188643_).and(p_188643_.group(RegistryOps.retrieveRegistry(Registry.NOISE_REGISTRY).forGetter((p_188716_) -> { - return p_188716_.noises; - }), BiomeSource.CODEC.fieldOf("biome_source").forGetter((p_188711_) -> { - return p_188711_.biomeSource; - }), NoiseGeneratorSettings.CODEC.fieldOf("settings").forGetter((p_204585_) -> { - return p_204585_.settings; - }))).apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); - }); - + public static final Codec CODEC = + RecordCodecBuilder.create(p_188643_ -> { + return commonCodec(p_188643_) + .and( + p_188643_.group( + RegistryOps + .retrieveRegistry(Registry.NOISE_REGISTRY) + .forGetter(p_188716_ -> { + return p_188716_.noises; + }), + BiomeSource.CODEC + .fieldOf("biome_source") + .forGetter(p_188711_ -> { + return p_188711_.biomeSource; + }), + NoiseGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(p_204585_ -> { + return p_204585_.settings; + }) + ) + ) + .apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); + }); - public TheOtherDimSource(Registry p_224206_, Registry p_224207_, BiomeSource p_224208_, Holder p_224209_) { + public TheOtherDimSource( + Registry p_224206_, + Registry p_224207_, + BiomeSource p_224208_, + Holder p_224209_ + ) { super(p_224206_, p_224207_, p_224208_, p_224209_); } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java index f9a7ac5c..fe5d784e 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java @@ -1,17 +1,9 @@ package com.thevortex.allthemodium.worldgen.biomes; -import com.thevortex.allthemodium.AllTheModium; import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.worldgen.ATMPlacedFeature; -import com.thevortex.allthemodium.worldgen.ATOtherPlacedFeatures; -import net.allthemods.alltheores.worldgen.ATOPlacedFeatures; -import net.minecraft.core.Registry; import net.minecraft.data.worldgen.BiomeDefaultFeatures; import net.minecraft.data.worldgen.Carvers; import net.minecraft.data.worldgen.placement.NetherPlacements; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraft.world.level.biome.Biome; @@ -19,10 +11,12 @@ import net.minecraft.world.level.biome.BiomeSpecialEffects; import net.minecraft.world.level.biome.MobSpawnSettings; import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@Mod.EventBusSubscriber( + modid = Reference.MOD_ID, + bus = Mod.EventBusSubscriber.Bus.MOD +) public class ATMBiomes { public static Biome The_Other = the_other(); @@ -33,104 +27,423 @@ public class ATMBiomes { public static Biome Soul_Sand_Valley = soul_sand_valley(); public static Biome Warped_Forest = warped_forest(); - - - - private static TagKey register(String names) { - return TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(Reference.MOD_ID,names)); - } - - public static void addDefaultCarvers(BiomeGenerationSettings.Builder builder) { - builder.addCarver(GenerationStep.Carving.AIR , Carvers.NETHER_CAVE); - builder.addCarver(GenerationStep.Carving.AIR , Carvers.CAVE); - builder.addCarver(GenerationStep.Carving.AIR , Carvers.CANYON); + public static void addDefaultCarvers( + BiomeGenerationSettings.Builder builder + ) { + builder.addCarver(GenerationStep.Carving.AIR, Carvers.NETHER_CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CANYON); } - - public static Biome mining() { - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(new MobSpawnSettings.Builder().build()) - .temperature(1.0f) - .downfall(0f) - .specialEffects(new BiomeSpecialEffects.Builder().fogColor(12341234).waterColor(4159204).waterFogColor(329011).skyColor(7254527).foliageColorOverride(1787717).grassColorOverride(9470000).build()) - .generationSettings(new BiomeGenerationSettings.Builder().build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(new MobSpawnSettings.Builder().build()) + .temperature(1.0f) + .downfall(0f) + .specialEffects( + new BiomeSpecialEffects.Builder() + .fogColor(12341234) + .waterColor(4159204) + .waterFogColor(329011) + .skyColor(7254527) + .foliageColorOverride(1787717) + .grassColorOverride(9470000) + .build() + ) + .generationSettings(new BiomeGenerationSettings.Builder().build()) + .build(); } + public static Biome the_other() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(3343107).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.BLAZE, 120, 3, 5)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.5f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.5f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } public static Biome basalt_deltas() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(6840176).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addLushCavesVegetationFeatures(biomeGenerationSettings); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(6840176) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addLushCavesVegetationFeatures( + biomeGenerationSettings + ); addDefaultCarvers(biomeGenerationSettings); - biomeGenerationSettings.addFeature(GenerationStep.Decoration.LOCAL_MODIFICATIONS, NetherPlacements.BASALT_BLOBS); - biomeGenerationSettings.addFeature(GenerationStep.Decoration.LOCAL_MODIFICATIONS, NetherPlacements.SMALL_BASALT_COLUMNS); - biomeGenerationSettings.addFeature(GenerationStep.Decoration.LOCAL_MODIFICATIONS, NetherPlacements.LARGE_BASALT_COLUMNS); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.BASALT_BLOBS + ); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.SMALL_BASALT_COLUMNS + ); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.LARGE_BASALT_COLUMNS + ); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.MAGMA_CUBE, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.MAGMA_CUBE, 100, 5, 10)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.BLAZE, 120, 3, 5)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); - - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(2.0f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(2.0f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } + public static Biome crimson_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(3343107).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.BLAZE, 120, 3, 5)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.3f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.3f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } + public static Biome desert() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(3343107).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(EntityType.RABBIT, 120, 3, 5)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.8f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.8f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } + public static Biome desert_hills() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(3343107).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(EntityType.RABBIT, 120, 3, 5)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.7f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.7f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } + public static Biome soul_sand_valley() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(3343107).waterColor(3343107).waterFogColor(3343107).skyColor(3343107).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.GHAST, 120, 3, 3)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.GHAST, + 120, + 3, + 3 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.1f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.1f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } + public static Biome warped_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder().fogColor(1705242).waterColor(3343107).waterFogColor(3343107).skyColor(1705242).foliageColorOverride(1787717).grassColorOverride(1787717).build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(1705242) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(1705242) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = + new BiomeGenerationSettings.Builder(); BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.WITHER_SKELETON, 100, 5, 10)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.ENDERMAN, 160, 3, 7)).addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(EntityType.PIGLIN_BRUTE, 140, 8, 12)).build(); + MobSpawnSettings mobSpawnInfo = + (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.ENDERMAN, + 160, + 3, + 7 + ) + ) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN_BRUTE, + 140, + 8, + 12 + ) + ) + .build(); - return new Biome.BiomeBuilder().precipitation(Biome.Precipitation.NONE).mobSpawnSettings(mobSpawnInfo).temperature(1.2f).downfall(0f).specialEffects(effects).generationSettings(biomeGenerationSettings.build()).build(); + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.2f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); } - } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java index e17a6381..6ccdd730 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java @@ -1,24 +1,28 @@ package com.thevortex.allthemodium.worldgen.features; import com.thevortex.allthemodium.worldgen.ATMConfiguredFeature; +import javax.annotation.Nonnull; import net.minecraft.core.Holder; import net.minecraft.util.RandomSource; -import net.minecraft.world.level.block.grower.AbstractMegaTreeGrower; import net.minecraft.world.level.block.grower.AbstractTreeGrower; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; import org.jetbrains.annotations.Nullable; -import java.util.Random; - public class AncientTreeGrower extends AbstractTreeGrower { @Nullable @Override - protected Holder> getConfiguredFeature(RandomSource random, boolean bool) { + protected Holder< + ConfiguredFeature + > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { int temp = random.nextInt(10); - if(temp == 1) { return ATMConfiguredFeature.ANCIENT_TREE_GIANT; } - if(temp > 6) { return ATMConfiguredFeature.ANCIENT_TREE; } + if (temp == 1) { + return ATMConfiguredFeature.ANCIENT_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.ANCIENT_TREE; + } return ATMConfiguredFeature.ANCIENT_TREE_MEDIUM; } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java index e7309b55..628c436f 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.worldgen.features; import com.thevortex.allthemodium.worldgen.ATMConfiguredFeature; +import javax.annotation.Nonnull; import net.minecraft.core.Holder; import net.minecraft.util.RandomSource; import net.minecraft.world.level.block.grower.AbstractTreeGrower; @@ -8,16 +9,20 @@ import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; import org.jetbrains.annotations.Nullable; -import java.util.Random; - public class DemonicTreeGrower extends AbstractTreeGrower { @Nullable @Override - protected Holder> getConfiguredFeature(RandomSource random, boolean bool) { + protected Holder< + ConfiguredFeature + > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { int temp = random.nextInt(10); - if(temp == 1) { return ATMConfiguredFeature.DEMONIC_TREE_GIANT; } - if(temp > 6) { return ATMConfiguredFeature.DEMONIC_TREE; } + if (temp == 1) { + return ATMConfiguredFeature.DEMONIC_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.DEMONIC_TREE; + } return ATMConfiguredFeature.DEMONIC_TREE_MEDIUM; } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java index e3a1e089..29dcbf4b 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java @@ -53,74 +53,68 @@ // /*FMLdouble*/ double // /*FNLfloat*/ double -public class FastNoiseLite -{ - public enum NoiseType - { +public class FastNoiseLite { + + public enum NoiseType { OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, - Value - }; + Value, + } - public enum RotationType3D - { + public enum RotationType3D { None, ImproveXYPlanes, - ImproveXZPlanes - }; + ImproveXZPlanes, + } - public enum FractalType - { + public enum FractalType { None, FBm, Ridged, PingPong, DomainWarpProgressive, - DomainWarpIndependent - }; + DomainWarpIndependent, + } - public enum CellularDistanceFunction - { + public enum CellularDistanceFunction { Euclidean, EuclideanSq, Manhattan, - Hybrid - }; + Hybrid, + } - public enum CellularReturnType - { + public enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, - Distance2Div - }; + Distance2Div, + } - public enum DomainWarpType - { + public enum DomainWarpType { OpenSimplex2, OpenSimplex2Reduced, - BasicGrid - }; + BasicGrid, + } - private enum TransformType3D - { + private enum TransformType3D { None, ImproveXYPlanes, ImproveXZPlanes, - DefaultOpenSimplex2 - }; + DefaultOpenSimplex2, + } private int mSeed = 1337; private float mFrequency = 0.01f; private NoiseType mNoiseType = NoiseType.OpenSimplex2; private RotationType3D mRotationType3D = RotationType3D.None; - private TransformType3D mTransformType3D = TransformType3D.DefaultOpenSimplex2; + private TransformType3D mTransformType3D = + TransformType3D.DefaultOpenSimplex2; private FractalType mFractalType = FractalType.None; private int mOctaves = 3; @@ -131,24 +125,26 @@ private enum TransformType3D private float mFractalBounding = 1 / 1.75f; - private CellularDistanceFunction mCellularDistanceFunction = CellularDistanceFunction.EuclideanSq; - private CellularReturnType mCellularReturnType = CellularReturnType.Distance; + private CellularDistanceFunction mCellularDistanceFunction = + CellularDistanceFunction.EuclideanSq; + private CellularReturnType mCellularReturnType = + CellularReturnType.Distance; private float mCellularJitterModifier = 1.0f; private DomainWarpType mDomainWarpType = DomainWarpType.OpenSimplex2; - private TransformType3D mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + private TransformType3D mWarpTransformType3D = + TransformType3D.DefaultOpenSimplex2; private float mDomainWarpAmp = 1.0f; /// /// Create new FastNoise object with default seed /// - public FastNoiseLite() { } + public FastNoiseLite() {} /// /// Create new FastNoise object with specified seed /// - public FastNoiseLite(int seed) - { + public FastNoiseLite(int seed) { SetSeed(seed); } @@ -158,7 +154,9 @@ public FastNoiseLite(int seed) /// /// Default: 1337 /// - public void SetSeed(int seed) { mSeed = seed; } + public void SetSeed(int seed) { + mSeed = seed; + } /// /// Sets frequency for all noise types @@ -166,7 +164,9 @@ public FastNoiseLite(int seed) /// /// Default: 0.01 /// - public void SetFrequency(float frequency) { mFrequency = frequency; } + public void SetFrequency(float frequency) { + mFrequency = frequency; + } /// /// Sets noise algorithm used for GetNoise(...) @@ -174,8 +174,7 @@ public FastNoiseLite(int seed) /// /// Default: OpenSimplex2 /// - public void SetNoiseType(NoiseType noiseType) - { + public void SetNoiseType(NoiseType noiseType) { mNoiseType = noiseType; UpdateTransformType3D(); } @@ -187,8 +186,7 @@ public void SetNoiseType(NoiseType noiseType) /// /// Default: None /// - public void SetRotationType3D(RotationType3D rotationType3D) - { + public void SetRotationType3D(RotationType3D rotationType3D) { mRotationType3D = rotationType3D; UpdateTransformType3D(); UpdateWarpTransformType3D(); @@ -201,7 +199,9 @@ public void SetRotationType3D(RotationType3D rotationType3D) /// Default: None /// Note: FractalType.DomainWarp... only affects DomainWarp(...) /// - public void SetFractalType(FractalType fractalType) { mFractalType = fractalType; } + public void SetFractalType(FractalType fractalType) { + mFractalType = fractalType; + } /// /// Sets octave count for all fractal noise types @@ -209,8 +209,7 @@ public void SetRotationType3D(RotationType3D rotationType3D) /// /// Default: 3 /// - public void SetFractalOctaves(int octaves) - { + public void SetFractalOctaves(int octaves) { mOctaves = octaves; CalculateFractalBounding(); } @@ -221,7 +220,9 @@ public void SetFractalOctaves(int octaves) /// /// Default: 2.0 /// - public void SetFractalLacunarity(float lacunarity) { mLacunarity = lacunarity; } + public void SetFractalLacunarity(float lacunarity) { + mLacunarity = lacunarity; + } /// /// Sets octave gain for all fractal noise types @@ -229,8 +230,7 @@ public void SetFractalOctaves(int octaves) /// /// Default: 0.5 /// - public void SetFractalGain(float gain) - { + public void SetFractalGain(float gain) { mGain = gain; CalculateFractalBounding(); } @@ -242,7 +242,9 @@ public void SetFractalGain(float gain) /// Default: 0.0 /// Note: Keep between 0...1 to maintain -1...1 output bounding /// - public void SetFractalWeightedStrength(float weightedStrength) { mWeightedStrength = weightedStrength; } + public void SetFractalWeightedStrength(float weightedStrength) { + mWeightedStrength = weightedStrength; + } /// /// Sets strength of the fractal ping pong effect @@ -250,8 +252,9 @@ public void SetFractalGain(float gain) /// /// Default: 2.0 /// - public void SetFractalPingPongStrength(float pingPongStrength) { mPingPongStength = pingPongStrength; } - + public void SetFractalPingPongStrength(float pingPongStrength) { + mPingPongStength = pingPongStrength; + } /// /// Sets distance function used in cellular noise calculations @@ -259,7 +262,11 @@ public void SetFractalGain(float gain) /// /// Default: Distance /// - public void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { mCellularDistanceFunction = cellularDistanceFunction; } + public void SetCellularDistanceFunction( + CellularDistanceFunction cellularDistanceFunction + ) { + mCellularDistanceFunction = cellularDistanceFunction; + } /// /// Sets return type from cellular noise calculations @@ -267,7 +274,9 @@ public void SetFractalGain(float gain) /// /// Default: EuclideanSq /// - public void SetCellularReturnType(CellularReturnType cellularReturnType) { mCellularReturnType = cellularReturnType; } + public void SetCellularReturnType(CellularReturnType cellularReturnType) { + mCellularReturnType = cellularReturnType; + } /// /// Sets the maximum distance a cellular point can move from it's grid position @@ -276,8 +285,9 @@ public void SetFractalGain(float gain) /// Default: 1.0 /// Note: Setting this higher than 1 will cause artifacts /// - public void SetCellularJitter(float cellularJitter) { mCellularJitterModifier = cellularJitter; } - + public void SetCellularJitter(float cellularJitter) { + mCellularJitterModifier = cellularJitter; + } /// /// Sets the warp algorithm when using DomainWarp(...) @@ -285,21 +295,20 @@ public void SetFractalGain(float gain) /// /// Default: OpenSimplex2 /// - public void SetDomainWarpType(DomainWarpType domainWarpType) - { + public void SetDomainWarpType(DomainWarpType domainWarpType) { mDomainWarpType = domainWarpType; UpdateWarpTransformType3D(); } - /// /// Sets the maximum warp distance from original position when using DomainWarp(...) /// /// /// Default: 1.0 /// - public void SetDomainWarpAmp(float domainWarpAmp) { mDomainWarpAmp = domainWarpAmp; } - + public void SetDomainWarpAmp(float domainWarpAmp) { + mDomainWarpAmp = domainWarpAmp; + } /// /// 2D noise at given position using current settings @@ -307,29 +316,27 @@ public void SetDomainWarpType(DomainWarpType domainWarpType) /// /// Noise output bounded between -1...1 /// - public float GetNoise(/*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + public float GetNoise(/*FMLdouble*/double x, /*FMLdouble*/double y) { x *= mFrequency; y *= mFrequency; - switch (mNoiseType) - { + switch (mNoiseType) { case OpenSimplex2: case OpenSimplex2S: - { - final /*FMLdouble*/ double SQRT3 = (/*FMLdouble*/ double)1.7320508075688772935274463415059; - final /*FMLdouble*/ double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/ double t = (x + y) * F2; - x += t; - y += t; - } - break; + { + final /*FMLdouble*/double SQRT3 = + (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (x + y) * F2; + x += t; + y += t; + } + break; default: break; } - switch (mFractalType) - { + switch (mFractalType) { default: return GenNoiseSingle(mSeed, x, y); case FBm: @@ -347,49 +354,53 @@ public float GetNoise(/*FMLdouble*/ double x, /*FMLdouble*/ double y) /// /// Noise output bounded between -1...1 /// - public float GetNoise(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + public float GetNoise( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { x *= mFrequency; y *= mFrequency; z *= mFrequency; - switch (mTransformType3D) - { + switch (mTransformType3D) { case ImproveXYPlanes: - { - /*FMLdouble*/ double xy = x + y; - /*FMLdouble*/ double s2 = xy * -(/*FMLdouble*/ double)0.211324865405187; - z *= (/*FMLdouble*/ double)0.577350269189626; - x += s2 - z; - y = y + s2 - z; - z += xy * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xy = x + y; + /*FMLdouble*/double s2 = + xy * -(/*FMLdouble*/double) 0.211324865405187; + z *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - z; + y = y + s2 - z; + z += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; case ImproveXZPlanes: - { - /*FMLdouble*/ double xz = x + z; - /*FMLdouble*/ double s2 = xz * -(/*FMLdouble*/ double)0.211324865405187; - y *= (/*FMLdouble*/ double)0.577350269189626; - x += s2 - y; - z += s2 - y; - y += xz * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xz = x + z; + /*FMLdouble*/double s2 = + xz * -(/*FMLdouble*/double) 0.211324865405187; + y *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - y; + z += s2 - y; + y += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; case DefaultOpenSimplex2: - { - final /*FMLdouble*/ double R3 = (/*FMLdouble*/ double)(2.0 / 3.0); - /*FMLdouble*/ double r = (x + y + z) * R3; // Rotation, not skew - x = r - x; - y = r - y; - z = r - z; - } - break; + { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + } + break; default: break; } - switch (mFractalType) - { + switch (mFractalType) { default: return GenNoiseSingle(mSeed, x, y, z); case FBm: @@ -401,7 +412,6 @@ public float GetNoise(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdoubl } } - /// /// 2D warps the input position using current domain warp settings /// @@ -410,10 +420,8 @@ public float GetNoise(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdoubl /// DomainWarp(coord) /// noise = GetNoise(x, y) /// - public void DomainWarp(Vector2 coord) - { - switch (mFractalType) - { + public void DomainWarp(Vector2 coord) { + switch (mFractalType) { default: DomainWarpSingle(coord); break; @@ -434,10 +442,8 @@ public void DomainWarp(Vector2 coord) /// DomainWarp(coord) /// noise = GetNoise(x, y, z) /// - public void DomainWarp(Vector3 coord) - { - switch (mFractalType) - { + public void DomainWarp(Vector3 coord) { + switch (mFractalType) { default: DomainWarpSingle(coord); break; @@ -450,169 +456,2123 @@ public void DomainWarp(Vector3 coord) } } - private static final float[] Gradients2D = { - 0.130526192220052f, 0.99144486137381f, 0.38268343236509f, 0.923879532511287f, 0.608761429008721f, 0.793353340291235f, 0.793353340291235f, 0.608761429008721f, - 0.923879532511287f, 0.38268343236509f, 0.99144486137381f, 0.130526192220051f, 0.99144486137381f, -0.130526192220051f, 0.923879532511287f, -0.38268343236509f, - 0.793353340291235f, -0.60876142900872f, 0.608761429008721f, -0.793353340291235f, 0.38268343236509f, -0.923879532511287f, 0.130526192220052f, -0.99144486137381f, - -0.130526192220052f, -0.99144486137381f, -0.38268343236509f, -0.923879532511287f, -0.608761429008721f, -0.793353340291235f, -0.793353340291235f, -0.608761429008721f, - -0.923879532511287f, -0.38268343236509f, -0.99144486137381f, -0.130526192220052f, -0.99144486137381f, 0.130526192220051f, -0.923879532511287f, 0.38268343236509f, - -0.793353340291235f, 0.608761429008721f, -0.608761429008721f, 0.793353340291235f, -0.38268343236509f, 0.923879532511287f, -0.130526192220052f, 0.99144486137381f, - 0.130526192220052f, 0.99144486137381f, 0.38268343236509f, 0.923879532511287f, 0.608761429008721f, 0.793353340291235f, 0.793353340291235f, 0.608761429008721f, - 0.923879532511287f, 0.38268343236509f, 0.99144486137381f, 0.130526192220051f, 0.99144486137381f, -0.130526192220051f, 0.923879532511287f, -0.38268343236509f, - 0.793353340291235f, -0.60876142900872f, 0.608761429008721f, -0.793353340291235f, 0.38268343236509f, -0.923879532511287f, 0.130526192220052f, -0.99144486137381f, - -0.130526192220052f, -0.99144486137381f, -0.38268343236509f, -0.923879532511287f, -0.608761429008721f, -0.793353340291235f, -0.793353340291235f, -0.608761429008721f, - -0.923879532511287f, -0.38268343236509f, -0.99144486137381f, -0.130526192220052f, -0.99144486137381f, 0.130526192220051f, -0.923879532511287f, 0.38268343236509f, - -0.793353340291235f, 0.608761429008721f, -0.608761429008721f, 0.793353340291235f, -0.38268343236509f, 0.923879532511287f, -0.130526192220052f, 0.99144486137381f, - 0.130526192220052f, 0.99144486137381f, 0.38268343236509f, 0.923879532511287f, 0.608761429008721f, 0.793353340291235f, 0.793353340291235f, 0.608761429008721f, - 0.923879532511287f, 0.38268343236509f, 0.99144486137381f, 0.130526192220051f, 0.99144486137381f, -0.130526192220051f, 0.923879532511287f, -0.38268343236509f, - 0.793353340291235f, -0.60876142900872f, 0.608761429008721f, -0.793353340291235f, 0.38268343236509f, -0.923879532511287f, 0.130526192220052f, -0.99144486137381f, - -0.130526192220052f, -0.99144486137381f, -0.38268343236509f, -0.923879532511287f, -0.608761429008721f, -0.793353340291235f, -0.793353340291235f, -0.608761429008721f, - -0.923879532511287f, -0.38268343236509f, -0.99144486137381f, -0.130526192220052f, -0.99144486137381f, 0.130526192220051f, -0.923879532511287f, 0.38268343236509f, - -0.793353340291235f, 0.608761429008721f, -0.608761429008721f, 0.793353340291235f, -0.38268343236509f, 0.923879532511287f, -0.130526192220052f, 0.99144486137381f, - 0.130526192220052f, 0.99144486137381f, 0.38268343236509f, 0.923879532511287f, 0.608761429008721f, 0.793353340291235f, 0.793353340291235f, 0.608761429008721f, - 0.923879532511287f, 0.38268343236509f, 0.99144486137381f, 0.130526192220051f, 0.99144486137381f, -0.130526192220051f, 0.923879532511287f, -0.38268343236509f, - 0.793353340291235f, -0.60876142900872f, 0.608761429008721f, -0.793353340291235f, 0.38268343236509f, -0.923879532511287f, 0.130526192220052f, -0.99144486137381f, - -0.130526192220052f, -0.99144486137381f, -0.38268343236509f, -0.923879532511287f, -0.608761429008721f, -0.793353340291235f, -0.793353340291235f, -0.608761429008721f, - -0.923879532511287f, -0.38268343236509f, -0.99144486137381f, -0.130526192220052f, -0.99144486137381f, 0.130526192220051f, -0.923879532511287f, 0.38268343236509f, - -0.793353340291235f, 0.608761429008721f, -0.608761429008721f, 0.793353340291235f, -0.38268343236509f, 0.923879532511287f, -0.130526192220052f, 0.99144486137381f, - 0.130526192220052f, 0.99144486137381f, 0.38268343236509f, 0.923879532511287f, 0.608761429008721f, 0.793353340291235f, 0.793353340291235f, 0.608761429008721f, - 0.923879532511287f, 0.38268343236509f, 0.99144486137381f, 0.130526192220051f, 0.99144486137381f, -0.130526192220051f, 0.923879532511287f, -0.38268343236509f, - 0.793353340291235f, -0.60876142900872f, 0.608761429008721f, -0.793353340291235f, 0.38268343236509f, -0.923879532511287f, 0.130526192220052f, -0.99144486137381f, - -0.130526192220052f, -0.99144486137381f, -0.38268343236509f, -0.923879532511287f, -0.608761429008721f, -0.793353340291235f, -0.793353340291235f, -0.608761429008721f, - -0.923879532511287f, -0.38268343236509f, -0.99144486137381f, -0.130526192220052f, -0.99144486137381f, 0.130526192220051f, -0.923879532511287f, 0.38268343236509f, - -0.793353340291235f, 0.608761429008721f, -0.608761429008721f, 0.793353340291235f, -0.38268343236509f, 0.923879532511287f, -0.130526192220052f, 0.99144486137381f, - 0.38268343236509f, 0.923879532511287f, 0.923879532511287f, 0.38268343236509f, 0.923879532511287f, -0.38268343236509f, 0.38268343236509f, -0.923879532511287f, - -0.38268343236509f, -0.923879532511287f, -0.923879532511287f, -0.38268343236509f, -0.923879532511287f, 0.38268343236509f, -0.38268343236509f, 0.923879532511287f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.923879532511287f, + 0.38268343236509f, + 0.923879532511287f, + -0.38268343236509f, + 0.38268343236509f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + 0.38268343236509f, + -0.38268343236509f, + 0.923879532511287f, }; private static final float[] RandVecs2D = { - -0.2700222198f, -0.9628540911f, 0.3863092627f, -0.9223693152f, 0.04444859006f, -0.999011673f, -0.5992523158f, -0.8005602176f, -0.7819280288f, 0.6233687174f, 0.9464672271f, 0.3227999196f, -0.6514146797f, -0.7587218957f, 0.9378472289f, 0.347048376f, - -0.8497875957f, -0.5271252623f, -0.879042592f, 0.4767432447f, -0.892300288f, -0.4514423508f, -0.379844434f, -0.9250503802f, -0.9951650832f, 0.0982163789f, 0.7724397808f, -0.6350880136f, 0.7573283322f, -0.6530343002f, -0.9928004525f, -0.119780055f, - -0.0532665713f, 0.9985803285f, 0.9754253726f, -0.2203300762f, -0.7665018163f, 0.6422421394f, 0.991636706f, 0.1290606184f, -0.994696838f, 0.1028503788f, -0.5379205513f, -0.84299554f, 0.5022815471f, -0.8647041387f, 0.4559821461f, -0.8899889226f, - -0.8659131224f, -0.5001944266f, 0.0879458407f, -0.9961252577f, -0.5051684983f, 0.8630207346f, 0.7753185226f, -0.6315704146f, -0.6921944612f, 0.7217110418f, -0.5191659449f, -0.8546734591f, 0.8978622882f, -0.4402764035f, -0.1706774107f, 0.9853269617f, - -0.9353430106f, -0.3537420705f, -0.9992404798f, 0.03896746794f, -0.2882064021f, -0.9575683108f, -0.9663811329f, 0.2571137995f, -0.8759714238f, -0.4823630009f, -0.8303123018f, -0.5572983775f, 0.05110133755f, -0.9986934731f, -0.8558373281f, -0.5172450752f, - 0.09887025282f, 0.9951003332f, 0.9189016087f, 0.3944867976f, -0.2439375892f, -0.9697909324f, -0.8121409387f, -0.5834613061f, -0.9910431363f, 0.1335421355f, 0.8492423985f, -0.5280031709f, -0.9717838994f, -0.2358729591f, 0.9949457207f, 0.1004142068f, - 0.6241065508f, -0.7813392434f, 0.662910307f, 0.7486988212f, -0.7197418176f, 0.6942418282f, -0.8143370775f, -0.5803922158f, 0.104521054f, -0.9945226741f, -0.1065926113f, -0.9943027784f, 0.445799684f, -0.8951327509f, 0.105547406f, 0.9944142724f, - -0.992790267f, 0.1198644477f, -0.8334366408f, 0.552615025f, 0.9115561563f, -0.4111755999f, 0.8285544909f, -0.5599084351f, 0.7217097654f, -0.6921957921f, 0.4940492677f, -0.8694339084f, -0.3652321272f, -0.9309164803f, -0.9696606758f, 0.2444548501f, - 0.08925509731f, -0.996008799f, 0.5354071276f, -0.8445941083f, -0.1053576186f, 0.9944343981f, -0.9890284586f, 0.1477251101f, 0.004856104961f, 0.9999882091f, 0.9885598478f, 0.1508291331f, 0.9286129562f, -0.3710498316f, -0.5832393863f, -0.8123003252f, - 0.3015207509f, 0.9534596146f, -0.9575110528f, 0.2883965738f, 0.9715802154f, -0.2367105511f, 0.229981792f, 0.9731949318f, 0.955763816f, -0.2941352207f, 0.740956116f, 0.6715534485f, -0.9971513787f, -0.07542630764f, 0.6905710663f, -0.7232645452f, - -0.290713703f, -0.9568100872f, 0.5912777791f, -0.8064679708f, -0.9454592212f, -0.325740481f, 0.6664455681f, 0.74555369f, 0.6236134912f, 0.7817328275f, 0.9126993851f, -0.4086316587f, -0.8191762011f, 0.5735419353f, -0.8812745759f, -0.4726046147f, - 0.9953313627f, 0.09651672651f, 0.9855650846f, -0.1692969699f, -0.8495980887f, 0.5274306472f, 0.6174853946f, -0.7865823463f, 0.8508156371f, 0.52546432f, 0.9985032451f, -0.05469249926f, 0.1971371563f, -0.9803759185f, 0.6607855748f, -0.7505747292f, - -0.03097494063f, 0.9995201614f, -0.6731660801f, 0.739491331f, -0.7195018362f, -0.6944905383f, 0.9727511689f, 0.2318515979f, 0.9997059088f, -0.0242506907f, 0.4421787429f, -0.8969269532f, 0.9981350961f, -0.061043673f, -0.9173660799f, -0.3980445648f, - -0.8150056635f, -0.5794529907f, -0.8789331304f, 0.4769450202f, 0.0158605829f, 0.999874213f, -0.8095464474f, 0.5870558317f, -0.9165898907f, -0.3998286786f, -0.8023542565f, 0.5968480938f, -0.5176737917f, 0.8555780767f, -0.8154407307f, -0.5788405779f, - 0.4022010347f, -0.9155513791f, -0.9052556868f, -0.4248672045f, 0.7317445619f, 0.6815789728f, -0.5647632201f, -0.8252529947f, -0.8403276335f, -0.5420788397f, -0.9314281527f, 0.363925262f, 0.5238198472f, 0.8518290719f, 0.7432803869f, -0.6689800195f, - -0.985371561f, -0.1704197369f, 0.4601468731f, 0.88784281f, 0.825855404f, 0.5638819483f, 0.6182366099f, 0.7859920446f, 0.8331502863f, -0.553046653f, 0.1500307506f, 0.9886813308f, -0.662330369f, -0.7492119075f, -0.668598664f, 0.743623444f, - 0.7025606278f, 0.7116238924f, -0.5419389763f, -0.8404178401f, -0.3388616456f, 0.9408362159f, 0.8331530315f, 0.5530425174f, -0.2989720662f, -0.9542618632f, 0.2638522993f, 0.9645630949f, 0.124108739f, -0.9922686234f, -0.7282649308f, -0.6852956957f, - 0.6962500149f, 0.7177993569f, -0.9183535368f, 0.3957610156f, -0.6326102274f, -0.7744703352f, -0.9331891859f, -0.359385508f, -0.1153779357f, -0.9933216659f, 0.9514974788f, -0.3076565421f, -0.08987977445f, -0.9959526224f, 0.6678496916f, 0.7442961705f, - 0.7952400393f, -0.6062947138f, -0.6462007402f, -0.7631674805f, -0.2733598753f, 0.9619118351f, 0.9669590226f, -0.254931851f, -0.9792894595f, 0.2024651934f, -0.5369502995f, -0.8436138784f, -0.270036471f, -0.9628500944f, -0.6400277131f, 0.7683518247f, - -0.7854537493f, -0.6189203566f, 0.06005905383f, -0.9981948257f, -0.02455770378f, 0.9996984141f, -0.65983623f, 0.751409442f, -0.6253894466f, -0.7803127835f, -0.6210408851f, -0.7837781695f, 0.8348888491f, 0.5504185768f, -0.1592275245f, 0.9872419133f, - 0.8367622488f, 0.5475663786f, -0.8675753916f, -0.4973056806f, -0.2022662628f, -0.9793305667f, 0.9399189937f, 0.3413975472f, 0.9877404807f, -0.1561049093f, -0.9034455656f, 0.4287028224f, 0.1269804218f, -0.9919052235f, -0.3819600854f, 0.924178821f, - 0.9754625894f, 0.2201652486f, -0.3204015856f, -0.9472818081f, -0.9874760884f, 0.1577687387f, 0.02535348474f, -0.9996785487f, 0.4835130794f, -0.8753371362f, -0.2850799925f, -0.9585037287f, -0.06805516006f, -0.99768156f, -0.7885244045f, -0.6150034663f, - 0.3185392127f, -0.9479096845f, 0.8880043089f, 0.4598351306f, 0.6476921488f, -0.7619021462f, 0.9820241299f, 0.1887554194f, 0.9357275128f, -0.3527237187f, -0.8894895414f, 0.4569555293f, 0.7922791302f, 0.6101588153f, 0.7483818261f, 0.6632681526f, - -0.7288929755f, -0.6846276581f, 0.8729032783f, -0.4878932944f, 0.8288345784f, 0.5594937369f, 0.08074567077f, 0.9967347374f, 0.9799148216f, -0.1994165048f, -0.580730673f, -0.8140957471f, -0.4700049791f, -0.8826637636f, 0.2409492979f, 0.9705377045f, - 0.9437816757f, -0.3305694308f, -0.8927998638f, -0.4504535528f, -0.8069622304f, 0.5906030467f, 0.06258973166f, 0.9980393407f, -0.9312597469f, 0.3643559849f, 0.5777449785f, 0.8162173362f, -0.3360095855f, -0.941858566f, 0.697932075f, -0.7161639607f, - -0.002008157227f, -0.9999979837f, -0.1827294312f, -0.9831632392f, -0.6523911722f, 0.7578824173f, -0.4302626911f, -0.9027037258f, -0.9985126289f, -0.05452091251f, -0.01028102172f, -0.9999471489f, -0.4946071129f, 0.8691166802f, -0.2999350194f, 0.9539596344f, - 0.8165471961f, 0.5772786819f, 0.2697460475f, 0.962931498f, -0.7306287391f, -0.6827749597f, -0.7590952064f, -0.6509796216f, -0.907053853f, 0.4210146171f, -0.5104861064f, -0.8598860013f, 0.8613350597f, 0.5080373165f, 0.5007881595f, -0.8655698812f, - -0.654158152f, 0.7563577938f, -0.8382755311f, -0.545246856f, 0.6940070834f, 0.7199681717f, 0.06950936031f, 0.9975812994f, 0.1702942185f, -0.9853932612f, 0.2695973274f, 0.9629731466f, 0.5519612192f, -0.8338697815f, 0.225657487f, -0.9742067022f, - 0.4215262855f, -0.9068161835f, 0.4881873305f, -0.8727388672f, -0.3683854996f, -0.9296731273f, -0.9825390578f, 0.1860564427f, 0.81256471f, 0.5828709909f, 0.3196460933f, -0.9475370046f, 0.9570913859f, 0.2897862643f, -0.6876655497f, -0.7260276109f, - -0.9988770922f, -0.047376731f, -0.1250179027f, 0.992154486f, -0.8280133617f, 0.560708367f, 0.9324863769f, -0.3612051451f, 0.6394653183f, 0.7688199442f, -0.01623847064f, -0.9998681473f, -0.9955014666f, -0.09474613458f, -0.81453315f, 0.580117012f, - 0.4037327978f, -0.9148769469f, 0.9944263371f, 0.1054336766f, -0.1624711654f, 0.9867132919f, -0.9949487814f, -0.100383875f, -0.6995302564f, 0.7146029809f, 0.5263414922f, -0.85027327f, -0.5395221479f, 0.841971408f, 0.6579370318f, 0.7530729462f, - 0.01426758847f, -0.9998982128f, -0.6734383991f, 0.7392433447f, 0.639412098f, -0.7688642071f, 0.9211571421f, 0.3891908523f, -0.146637214f, -0.9891903394f, -0.782318098f, 0.6228791163f, -0.5039610839f, -0.8637263605f, -0.7743120191f, -0.6328039957f, + -0.2700222198f, + -0.9628540911f, + 0.3863092627f, + -0.9223693152f, + 0.04444859006f, + -0.999011673f, + -0.5992523158f, + -0.8005602176f, + -0.7819280288f, + 0.6233687174f, + 0.9464672271f, + 0.3227999196f, + -0.6514146797f, + -0.7587218957f, + 0.9378472289f, + 0.347048376f, + -0.8497875957f, + -0.5271252623f, + -0.879042592f, + 0.4767432447f, + -0.892300288f, + -0.4514423508f, + -0.379844434f, + -0.9250503802f, + -0.9951650832f, + 0.0982163789f, + 0.7724397808f, + -0.6350880136f, + 0.7573283322f, + -0.6530343002f, + -0.9928004525f, + -0.119780055f, + -0.0532665713f, + 0.9985803285f, + 0.9754253726f, + -0.2203300762f, + -0.7665018163f, + 0.6422421394f, + 0.991636706f, + 0.1290606184f, + -0.994696838f, + 0.1028503788f, + -0.5379205513f, + -0.84299554f, + 0.5022815471f, + -0.8647041387f, + 0.4559821461f, + -0.8899889226f, + -0.8659131224f, + -0.5001944266f, + 0.0879458407f, + -0.9961252577f, + -0.5051684983f, + 0.8630207346f, + 0.7753185226f, + -0.6315704146f, + -0.6921944612f, + 0.7217110418f, + -0.5191659449f, + -0.8546734591f, + 0.8978622882f, + -0.4402764035f, + -0.1706774107f, + 0.9853269617f, + -0.9353430106f, + -0.3537420705f, + -0.9992404798f, + 0.03896746794f, + -0.2882064021f, + -0.9575683108f, + -0.9663811329f, + 0.2571137995f, + -0.8759714238f, + -0.4823630009f, + -0.8303123018f, + -0.5572983775f, + 0.05110133755f, + -0.9986934731f, + -0.8558373281f, + -0.5172450752f, + 0.09887025282f, + 0.9951003332f, + 0.9189016087f, + 0.3944867976f, + -0.2439375892f, + -0.9697909324f, + -0.8121409387f, + -0.5834613061f, + -0.9910431363f, + 0.1335421355f, + 0.8492423985f, + -0.5280031709f, + -0.9717838994f, + -0.2358729591f, + 0.9949457207f, + 0.1004142068f, + 0.6241065508f, + -0.7813392434f, + 0.662910307f, + 0.7486988212f, + -0.7197418176f, + 0.6942418282f, + -0.8143370775f, + -0.5803922158f, + 0.104521054f, + -0.9945226741f, + -0.1065926113f, + -0.9943027784f, + 0.445799684f, + -0.8951327509f, + 0.105547406f, + 0.9944142724f, + -0.992790267f, + 0.1198644477f, + -0.8334366408f, + 0.552615025f, + 0.9115561563f, + -0.4111755999f, + 0.8285544909f, + -0.5599084351f, + 0.7217097654f, + -0.6921957921f, + 0.4940492677f, + -0.8694339084f, + -0.3652321272f, + -0.9309164803f, + -0.9696606758f, + 0.2444548501f, + 0.08925509731f, + -0.996008799f, + 0.5354071276f, + -0.8445941083f, + -0.1053576186f, + 0.9944343981f, + -0.9890284586f, + 0.1477251101f, + 0.004856104961f, + 0.9999882091f, + 0.9885598478f, + 0.1508291331f, + 0.9286129562f, + -0.3710498316f, + -0.5832393863f, + -0.8123003252f, + 0.3015207509f, + 0.9534596146f, + -0.9575110528f, + 0.2883965738f, + 0.9715802154f, + -0.2367105511f, + 0.229981792f, + 0.9731949318f, + 0.955763816f, + -0.2941352207f, + 0.740956116f, + 0.6715534485f, + -0.9971513787f, + -0.07542630764f, + 0.6905710663f, + -0.7232645452f, + -0.290713703f, + -0.9568100872f, + 0.5912777791f, + -0.8064679708f, + -0.9454592212f, + -0.325740481f, + 0.6664455681f, + 0.74555369f, + 0.6236134912f, + 0.7817328275f, + 0.9126993851f, + -0.4086316587f, + -0.8191762011f, + 0.5735419353f, + -0.8812745759f, + -0.4726046147f, + 0.9953313627f, + 0.09651672651f, + 0.9855650846f, + -0.1692969699f, + -0.8495980887f, + 0.5274306472f, + 0.6174853946f, + -0.7865823463f, + 0.8508156371f, + 0.52546432f, + 0.9985032451f, + -0.05469249926f, + 0.1971371563f, + -0.9803759185f, + 0.6607855748f, + -0.7505747292f, + -0.03097494063f, + 0.9995201614f, + -0.6731660801f, + 0.739491331f, + -0.7195018362f, + -0.6944905383f, + 0.9727511689f, + 0.2318515979f, + 0.9997059088f, + -0.0242506907f, + 0.4421787429f, + -0.8969269532f, + 0.9981350961f, + -0.061043673f, + -0.9173660799f, + -0.3980445648f, + -0.8150056635f, + -0.5794529907f, + -0.8789331304f, + 0.4769450202f, + 0.0158605829f, + 0.999874213f, + -0.8095464474f, + 0.5870558317f, + -0.9165898907f, + -0.3998286786f, + -0.8023542565f, + 0.5968480938f, + -0.5176737917f, + 0.8555780767f, + -0.8154407307f, + -0.5788405779f, + 0.4022010347f, + -0.9155513791f, + -0.9052556868f, + -0.4248672045f, + 0.7317445619f, + 0.6815789728f, + -0.5647632201f, + -0.8252529947f, + -0.8403276335f, + -0.5420788397f, + -0.9314281527f, + 0.363925262f, + 0.5238198472f, + 0.8518290719f, + 0.7432803869f, + -0.6689800195f, + -0.985371561f, + -0.1704197369f, + 0.4601468731f, + 0.88784281f, + 0.825855404f, + 0.5638819483f, + 0.6182366099f, + 0.7859920446f, + 0.8331502863f, + -0.553046653f, + 0.1500307506f, + 0.9886813308f, + -0.662330369f, + -0.7492119075f, + -0.668598664f, + 0.743623444f, + 0.7025606278f, + 0.7116238924f, + -0.5419389763f, + -0.8404178401f, + -0.3388616456f, + 0.9408362159f, + 0.8331530315f, + 0.5530425174f, + -0.2989720662f, + -0.9542618632f, + 0.2638522993f, + 0.9645630949f, + 0.124108739f, + -0.9922686234f, + -0.7282649308f, + -0.6852956957f, + 0.6962500149f, + 0.7177993569f, + -0.9183535368f, + 0.3957610156f, + -0.6326102274f, + -0.7744703352f, + -0.9331891859f, + -0.359385508f, + -0.1153779357f, + -0.9933216659f, + 0.9514974788f, + -0.3076565421f, + -0.08987977445f, + -0.9959526224f, + 0.6678496916f, + 0.7442961705f, + 0.7952400393f, + -0.6062947138f, + -0.6462007402f, + -0.7631674805f, + -0.2733598753f, + 0.9619118351f, + 0.9669590226f, + -0.254931851f, + -0.9792894595f, + 0.2024651934f, + -0.5369502995f, + -0.8436138784f, + -0.270036471f, + -0.9628500944f, + -0.6400277131f, + 0.7683518247f, + -0.7854537493f, + -0.6189203566f, + 0.06005905383f, + -0.9981948257f, + -0.02455770378f, + 0.9996984141f, + -0.65983623f, + 0.751409442f, + -0.6253894466f, + -0.7803127835f, + -0.6210408851f, + -0.7837781695f, + 0.8348888491f, + 0.5504185768f, + -0.1592275245f, + 0.9872419133f, + 0.8367622488f, + 0.5475663786f, + -0.8675753916f, + -0.4973056806f, + -0.2022662628f, + -0.9793305667f, + 0.9399189937f, + 0.3413975472f, + 0.9877404807f, + -0.1561049093f, + -0.9034455656f, + 0.4287028224f, + 0.1269804218f, + -0.9919052235f, + -0.3819600854f, + 0.924178821f, + 0.9754625894f, + 0.2201652486f, + -0.3204015856f, + -0.9472818081f, + -0.9874760884f, + 0.1577687387f, + 0.02535348474f, + -0.9996785487f, + 0.4835130794f, + -0.8753371362f, + -0.2850799925f, + -0.9585037287f, + -0.06805516006f, + -0.99768156f, + -0.7885244045f, + -0.6150034663f, + 0.3185392127f, + -0.9479096845f, + 0.8880043089f, + 0.4598351306f, + 0.6476921488f, + -0.7619021462f, + 0.9820241299f, + 0.1887554194f, + 0.9357275128f, + -0.3527237187f, + -0.8894895414f, + 0.4569555293f, + 0.7922791302f, + 0.6101588153f, + 0.7483818261f, + 0.6632681526f, + -0.7288929755f, + -0.6846276581f, + 0.8729032783f, + -0.4878932944f, + 0.8288345784f, + 0.5594937369f, + 0.08074567077f, + 0.9967347374f, + 0.9799148216f, + -0.1994165048f, + -0.580730673f, + -0.8140957471f, + -0.4700049791f, + -0.8826637636f, + 0.2409492979f, + 0.9705377045f, + 0.9437816757f, + -0.3305694308f, + -0.8927998638f, + -0.4504535528f, + -0.8069622304f, + 0.5906030467f, + 0.06258973166f, + 0.9980393407f, + -0.9312597469f, + 0.3643559849f, + 0.5777449785f, + 0.8162173362f, + -0.3360095855f, + -0.941858566f, + 0.697932075f, + -0.7161639607f, + -0.002008157227f, + -0.9999979837f, + -0.1827294312f, + -0.9831632392f, + -0.6523911722f, + 0.7578824173f, + -0.4302626911f, + -0.9027037258f, + -0.9985126289f, + -0.05452091251f, + -0.01028102172f, + -0.9999471489f, + -0.4946071129f, + 0.8691166802f, + -0.2999350194f, + 0.9539596344f, + 0.8165471961f, + 0.5772786819f, + 0.2697460475f, + 0.962931498f, + -0.7306287391f, + -0.6827749597f, + -0.7590952064f, + -0.6509796216f, + -0.907053853f, + 0.4210146171f, + -0.5104861064f, + -0.8598860013f, + 0.8613350597f, + 0.5080373165f, + 0.5007881595f, + -0.8655698812f, + -0.654158152f, + 0.7563577938f, + -0.8382755311f, + -0.545246856f, + 0.6940070834f, + 0.7199681717f, + 0.06950936031f, + 0.9975812994f, + 0.1702942185f, + -0.9853932612f, + 0.2695973274f, + 0.9629731466f, + 0.5519612192f, + -0.8338697815f, + 0.225657487f, + -0.9742067022f, + 0.4215262855f, + -0.9068161835f, + 0.4881873305f, + -0.8727388672f, + -0.3683854996f, + -0.9296731273f, + -0.9825390578f, + 0.1860564427f, + 0.81256471f, + 0.5828709909f, + 0.3196460933f, + -0.9475370046f, + 0.9570913859f, + 0.2897862643f, + -0.6876655497f, + -0.7260276109f, + -0.9988770922f, + -0.047376731f, + -0.1250179027f, + 0.992154486f, + -0.8280133617f, + 0.560708367f, + 0.9324863769f, + -0.3612051451f, + 0.6394653183f, + 0.7688199442f, + -0.01623847064f, + -0.9998681473f, + -0.9955014666f, + -0.09474613458f, + -0.81453315f, + 0.580117012f, + 0.4037327978f, + -0.9148769469f, + 0.9944263371f, + 0.1054336766f, + -0.1624711654f, + 0.9867132919f, + -0.9949487814f, + -0.100383875f, + -0.6995302564f, + 0.7146029809f, + 0.5263414922f, + -0.85027327f, + -0.5395221479f, + 0.841971408f, + 0.6579370318f, + 0.7530729462f, + 0.01426758847f, + -0.9998982128f, + -0.6734383991f, + 0.7392433447f, + 0.639412098f, + -0.7688642071f, + 0.9211571421f, + 0.3891908523f, + -0.146637214f, + -0.9891903394f, + -0.782318098f, + 0.6228791163f, + -0.5039610839f, + -0.8637263605f, + -0.7743120191f, + -0.6328039957f, }; private static final float[] Gradients3D = { - 0, 1, 1, 0, 0,-1, 1, 0, 0, 1,-1, 0, 0,-1,-1, 0, - 1, 0, 1, 0, -1, 0, 1, 0, 1, 0,-1, 0, -1, 0,-1, 0, - 1, 1, 0, 0, -1, 1, 0, 0, 1,-1, 0, 0, -1,-1, 0, 0, - 0, 1, 1, 0, 0,-1, 1, 0, 0, 1,-1, 0, 0,-1,-1, 0, - 1, 0, 1, 0, -1, 0, 1, 0, 1, 0,-1, 0, -1, 0,-1, 0, - 1, 1, 0, 0, -1, 1, 0, 0, 1,-1, 0, 0, -1,-1, 0, 0, - 0, 1, 1, 0, 0,-1, 1, 0, 0, 1,-1, 0, 0,-1,-1, 0, - 1, 0, 1, 0, -1, 0, 1, 0, 1, 0,-1, 0, -1, 0,-1, 0, - 1, 1, 0, 0, -1, 1, 0, 0, 1,-1, 0, 0, -1,-1, 0, 0, - 0, 1, 1, 0, 0,-1, 1, 0, 0, 1,-1, 0, 0,-1,-1, 0, - 1, 0, 1, 0, -1, 0, 1, 0, 1, 0,-1, 0, -1, 0,-1, 0, - 1, 1, 0, 0, -1, 1, 0, 0, 1,-1, 0, 0, -1,-1, 0, 0, - 0, 1, 1, 0, 0,-1, 1, 0, 0, 1,-1, 0, 0,-1,-1, 0, - 1, 0, 1, 0, -1, 0, 1, 0, 1, 0,-1, 0, -1, 0,-1, 0, - 1, 1, 0, 0, -1, 1, 0, 0, 1,-1, 0, 0, -1,-1, 0, 0, - 1, 1, 0, 0, 0,-1, 1, 0, -1, 1, 0, 0, 0,-1,-1, 0 + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + -1, + 1, + 0, + -1, + 1, + 0, + 0, + 0, + -1, + -1, + 0, }; private static final float[] RandVecs3D = { - -0.7292736885f, -0.6618439697f, 0.1735581948f, 0, 0.790292081f, -0.5480887466f, -0.2739291014f, 0, 0.7217578935f, 0.6226212466f, -0.3023380997f, 0, 0.565683137f, -0.8208298145f, -0.0790000257f, 0, 0.760049034f, -0.5555979497f, -0.3370999617f, 0, 0.3713945616f, 0.5011264475f, 0.7816254623f, 0, -0.1277062463f, -0.4254438999f, -0.8959289049f, 0, -0.2881560924f, -0.5815838982f, 0.7607405838f, 0, - 0.5849561111f, -0.662820239f, -0.4674352136f, 0, 0.3307171178f, 0.0391653737f, 0.94291689f, 0, 0.8712121778f, -0.4113374369f, -0.2679381538f, 0, 0.580981015f, 0.7021915846f, 0.4115677815f, 0, 0.503756873f, 0.6330056931f, -0.5878203852f, 0, 0.4493712205f, 0.601390195f, 0.6606022552f, 0, -0.6878403724f, 0.09018890807f, -0.7202371714f, 0, -0.5958956522f, -0.6469350577f, 0.475797649f, 0, - -0.5127052122f, 0.1946921978f, -0.8361987284f, 0, -0.9911507142f, -0.05410276466f, -0.1212153153f, 0, -0.2149721042f, 0.9720882117f, -0.09397607749f, 0, -0.7518650936f, -0.5428057603f, 0.3742469607f, 0, 0.5237068895f, 0.8516377189f, -0.02107817834f, 0, 0.6333504779f, 0.1926167129f, -0.7495104896f, 0, -0.06788241606f, 0.3998305789f, 0.9140719259f, 0, -0.5538628599f, -0.4729896695f, -0.6852128902f, 0, - -0.7261455366f, -0.5911990757f, 0.3509933228f, 0, -0.9229274737f, -0.1782808786f, 0.3412049336f, 0, -0.6968815002f, 0.6511274338f, 0.3006480328f, 0, 0.9608044783f, -0.2098363234f, -0.1811724921f, 0, 0.06817146062f, -0.9743405129f, 0.2145069156f, 0, -0.3577285196f, -0.6697087264f, -0.6507845481f, 0, -0.1868621131f, 0.7648617052f, -0.6164974636f, 0, -0.6541697588f, 0.3967914832f, 0.6439087246f, 0, - 0.6993340405f, -0.6164538506f, 0.3618239211f, 0, -0.1546665739f, 0.6291283928f, 0.7617583057f, 0, -0.6841612949f, -0.2580482182f, -0.6821542638f, 0, 0.5383980957f, 0.4258654885f, 0.7271630328f, 0, -0.5026987823f, -0.7939832935f, -0.3418836993f, 0, 0.3202971715f, 0.2834415347f, 0.9039195862f, 0, 0.8683227101f, -0.0003762656404f, -0.4959995258f, 0, 0.791120031f, -0.08511045745f, 0.6057105799f, 0, - -0.04011016052f, -0.4397248749f, 0.8972364289f, 0, 0.9145119872f, 0.3579346169f, -0.1885487608f, 0, -0.9612039066f, -0.2756484276f, 0.01024666929f, 0, 0.6510361721f, -0.2877799159f, -0.7023778346f, 0, -0.2041786351f, 0.7365237271f, 0.644859585f, 0, -0.7718263711f, 0.3790626912f, 0.5104855816f, 0, -0.3060082741f, -0.7692987727f, 0.5608371729f, 0, 0.454007341f, -0.5024843065f, 0.7357899537f, 0, - 0.4816795475f, 0.6021208291f, -0.6367380315f, 0, 0.6961980369f, -0.3222197429f, 0.641469197f, 0, -0.6532160499f, -0.6781148932f, 0.3368515753f, 0, 0.5089301236f, -0.6154662304f, -0.6018234363f, 0, -0.1635919754f, -0.9133604627f, -0.372840892f, 0, 0.52408019f, -0.8437664109f, 0.1157505864f, 0, 0.5902587356f, 0.4983817807f, -0.6349883666f, 0, 0.5863227872f, 0.494764745f, 0.6414307729f, 0, - 0.6779335087f, 0.2341345225f, 0.6968408593f, 0, 0.7177054546f, -0.6858979348f, 0.120178631f, 0, -0.5328819713f, -0.5205125012f, 0.6671608058f, 0, -0.8654874251f, -0.0700727088f, -0.4960053754f, 0, -0.2861810166f, 0.7952089234f, 0.5345495242f, 0, -0.04849529634f, 0.9810836427f, -0.1874115585f, 0, -0.6358521667f, 0.6058348682f, 0.4781800233f, 0, 0.6254794696f, -0.2861619734f, 0.7258696564f, 0, - -0.2585259868f, 0.5061949264f, -0.8227581726f, 0, 0.02136306781f, 0.5064016808f, -0.8620330371f, 0, 0.200111773f, 0.8599263484f, 0.4695550591f, 0, 0.4743561372f, 0.6014985084f, -0.6427953014f, 0, 0.6622993731f, -0.5202474575f, -0.5391679918f, 0, 0.08084972818f, -0.6532720452f, 0.7527940996f, 0, -0.6893687501f, 0.0592860349f, 0.7219805347f, 0, -0.1121887082f, -0.9673185067f, 0.2273952515f, 0, - 0.7344116094f, 0.5979668656f, -0.3210532909f, 0, 0.5789393465f, -0.2488849713f, 0.7764570201f, 0, 0.6988182827f, 0.3557169806f, -0.6205791146f, 0, -0.8636845529f, -0.2748771249f, -0.4224826141f, 0, -0.4247027957f, -0.4640880967f, 0.777335046f, 0, 0.5257722489f, -0.8427017621f, 0.1158329937f, 0, 0.9343830603f, 0.316302472f, -0.1639543925f, 0, -0.1016836419f, -0.8057303073f, -0.5834887393f, 0, - -0.6529238969f, 0.50602126f, -0.5635892736f, 0, -0.2465286165f, -0.9668205684f, -0.06694497494f, 0, -0.9776897119f, -0.2099250524f, -0.007368825344f, 0, 0.7736893337f, 0.5734244712f, 0.2694238123f, 0, -0.6095087895f, 0.4995678998f, 0.6155736747f, 0, 0.5794535482f, 0.7434546771f, 0.3339292269f, 0, -0.8226211154f, 0.08142581855f, 0.5627293636f, 0, -0.510385483f, 0.4703667658f, 0.7199039967f, 0, - -0.5764971849f, -0.07231656274f, -0.8138926898f, 0, 0.7250628871f, 0.3949971505f, -0.5641463116f, 0, -0.1525424005f, 0.4860840828f, -0.8604958341f, 0, -0.5550976208f, -0.4957820792f, 0.667882296f, 0, -0.1883614327f, 0.9145869398f, 0.357841725f, 0, 0.7625556724f, -0.5414408243f, -0.3540489801f, 0, -0.5870231946f, -0.3226498013f, -0.7424963803f, 0, 0.3051124198f, 0.2262544068f, -0.9250488391f, 0, - 0.6379576059f, 0.577242424f, -0.5097070502f, 0, -0.5966775796f, 0.1454852398f, -0.7891830656f, 0, -0.658330573f, 0.6555487542f, -0.3699414651f, 0, 0.7434892426f, 0.2351084581f, 0.6260573129f, 0, 0.5562114096f, 0.8264360377f, -0.0873632843f, 0, -0.3028940016f, -0.8251527185f, 0.4768419182f, 0, 0.1129343818f, -0.985888439f, -0.1235710781f, 0, 0.5937652891f, -0.5896813806f, 0.5474656618f, 0, - 0.6757964092f, -0.5835758614f, -0.4502648413f, 0, 0.7242302609f, -0.1152719764f, 0.6798550586f, 0, -0.9511914166f, 0.0753623979f, -0.2992580792f, 0, 0.2539470961f, -0.1886339355f, 0.9486454084f, 0, 0.571433621f, -0.1679450851f, -0.8032795685f, 0, -0.06778234979f, 0.3978269256f, 0.9149531629f, 0, 0.6074972649f, 0.733060024f, -0.3058922593f, 0, -0.5435478392f, 0.1675822484f, 0.8224791405f, 0, - -0.5876678086f, -0.3380045064f, -0.7351186982f, 0, -0.7967562402f, 0.04097822706f, -0.6029098428f, 0, -0.1996350917f, 0.8706294745f, 0.4496111079f, 0, -0.02787660336f, -0.9106232682f, -0.4122962022f, 0, -0.7797625996f, -0.6257634692f, 0.01975775581f, 0, -0.5211232846f, 0.7401644346f, -0.4249554471f, 0, 0.8575424857f, 0.4053272873f, -0.3167501783f, 0, 0.1045223322f, 0.8390195772f, -0.5339674439f, 0, - 0.3501822831f, 0.9242524096f, -0.1520850155f, 0, 0.1987849858f, 0.07647613266f, 0.9770547224f, 0, 0.7845996363f, 0.6066256811f, -0.1280964233f, 0, 0.09006737436f, -0.9750989929f, -0.2026569073f, 0, -0.8274343547f, -0.542299559f, 0.1458203587f, 0, -0.3485797732f, -0.415802277f, 0.840000362f, 0, -0.2471778936f, -0.7304819962f, -0.6366310879f, 0, -0.3700154943f, 0.8577948156f, 0.3567584454f, 0, - 0.5913394901f, -0.548311967f, -0.5913303597f, 0, 0.1204873514f, -0.7626472379f, -0.6354935001f, 0, 0.616959265f, 0.03079647928f, 0.7863922953f, 0, 0.1258156836f, -0.6640829889f, -0.7369967419f, 0, -0.6477565124f, -0.1740147258f, -0.7417077429f, 0, 0.6217889313f, -0.7804430448f, -0.06547655076f, 0, 0.6589943422f, -0.6096987708f, 0.4404473475f, 0, -0.2689837504f, -0.6732403169f, -0.6887635427f, 0, - -0.3849775103f, 0.5676542638f, 0.7277093879f, 0, 0.5754444408f, 0.8110471154f, -0.1051963504f, 0, 0.9141593684f, 0.3832947817f, 0.131900567f, 0, -0.107925319f, 0.9245493968f, 0.3654593525f, 0, 0.377977089f, 0.3043148782f, 0.8743716458f, 0, -0.2142885215f, -0.8259286236f, 0.5214617324f, 0, 0.5802544474f, 0.4148098596f, -0.7008834116f, 0, -0.1982660881f, 0.8567161266f, -0.4761596756f, 0, - -0.03381553704f, 0.3773180787f, -0.9254661404f, 0, -0.6867922841f, -0.6656597827f, 0.2919133642f, 0, 0.7731742607f, -0.2875793547f, -0.5652430251f, 0, -0.09655941928f, 0.9193708367f, -0.3813575004f, 0, 0.2715702457f, -0.9577909544f, -0.09426605581f, 0, 0.2451015704f, -0.6917998565f, -0.6792188003f, 0, 0.977700782f, -0.1753855374f, 0.1155036542f, 0, -0.5224739938f, 0.8521606816f, 0.02903615945f, 0, - -0.7734880599f, -0.5261292347f, 0.3534179531f, 0, -0.7134492443f, -0.269547243f, 0.6467878011f, 0, 0.1644037271f, 0.5105846203f, -0.8439637196f, 0, 0.6494635788f, 0.05585611296f, 0.7583384168f, 0, -0.4711970882f, 0.5017280509f, -0.7254255765f, 0, -0.6335764307f, -0.2381686273f, -0.7361091029f, 0, -0.9021533097f, -0.270947803f, -0.3357181763f, 0, -0.3793711033f, 0.872258117f, 0.3086152025f, 0, - -0.6855598966f, -0.3250143309f, 0.6514394162f, 0, 0.2900942212f, -0.7799057743f, -0.5546100667f, 0, -0.2098319339f, 0.85037073f, 0.4825351604f, 0, -0.4592603758f, 0.6598504336f, -0.5947077538f, 0, 0.8715945488f, 0.09616365406f, -0.4807031248f, 0, -0.6776666319f, 0.7118504878f, -0.1844907016f, 0, 0.7044377633f, 0.312427597f, 0.637304036f, 0, -0.7052318886f, -0.2401093292f, -0.6670798253f, 0, - 0.081921007f, -0.7207336136f, -0.6883545647f, 0, -0.6993680906f, -0.5875763221f, -0.4069869034f, 0, -0.1281454481f, 0.6419895885f, 0.7559286424f, 0, -0.6337388239f, -0.6785471501f, -0.3714146849f, 0, 0.5565051903f, -0.2168887573f, -0.8020356851f, 0, -0.5791554484f, 0.7244372011f, -0.3738578718f, 0, 0.1175779076f, -0.7096451073f, 0.6946792478f, 0, -0.6134619607f, 0.1323631078f, 0.7785527795f, 0, - 0.6984635305f, -0.02980516237f, -0.715024719f, 0, 0.8318082963f, -0.3930171956f, 0.3919597455f, 0, 0.1469576422f, 0.05541651717f, -0.9875892167f, 0, 0.708868575f, -0.2690503865f, 0.6520101478f, 0, 0.2726053183f, 0.67369766f, -0.68688995f, 0, -0.6591295371f, 0.3035458599f, -0.6880466294f, 0, 0.4815131379f, -0.7528270071f, 0.4487723203f, 0, 0.9430009463f, 0.1675647412f, -0.2875261255f, 0, - 0.434802957f, 0.7695304522f, -0.4677277752f, 0, 0.3931996188f, 0.594473625f, 0.7014236729f, 0, 0.7254336655f, -0.603925654f, 0.3301814672f, 0, 0.7590235227f, -0.6506083235f, 0.02433313207f, 0, -0.8552768592f, -0.3430042733f, 0.3883935666f, 0, -0.6139746835f, 0.6981725247f, 0.3682257648f, 0, -0.7465905486f, -0.5752009504f, 0.3342849376f, 0, 0.5730065677f, 0.810555537f, -0.1210916791f, 0, - -0.9225877367f, -0.3475211012f, -0.167514036f, 0, -0.7105816789f, -0.4719692027f, -0.5218416899f, 0, -0.08564609717f, 0.3583001386f, 0.929669703f, 0, -0.8279697606f, -0.2043157126f, 0.5222271202f, 0, 0.427944023f, 0.278165994f, 0.8599346446f, 0, 0.5399079671f, -0.7857120652f, -0.3019204161f, 0, 0.5678404253f, -0.5495413974f, -0.6128307303f, 0, -0.9896071041f, 0.1365639107f, -0.04503418428f, 0, - -0.6154342638f, -0.6440875597f, 0.4543037336f, 0, 0.1074204368f, -0.7946340692f, 0.5975094525f, 0, -0.3595449969f, -0.8885529948f, 0.28495784f, 0, -0.2180405296f, 0.1529888965f, 0.9638738118f, 0, -0.7277432317f, -0.6164050508f, -0.3007234646f, 0, 0.7249729114f, -0.00669719484f, 0.6887448187f, 0, -0.5553659455f, -0.5336586252f, 0.6377908264f, 0, 0.5137558015f, 0.7976208196f, -0.3160000073f, 0, - -0.3794024848f, 0.9245608561f, -0.03522751494f, 0, 0.8229248658f, 0.2745365933f, -0.4974176556f, 0, -0.5404114394f, 0.6091141441f, 0.5804613989f, 0, 0.8036581901f, -0.2703029469f, 0.5301601931f, 0, 0.6044318879f, 0.6832968393f, 0.4095943388f, 0, 0.06389988817f, 0.9658208605f, -0.2512108074f, 0, 0.1087113286f, 0.7402471173f, -0.6634877936f, 0, -0.713427712f, -0.6926784018f, 0.1059128479f, 0, - 0.6458897819f, -0.5724548511f, -0.5050958653f, 0, -0.6553931414f, 0.7381471625f, 0.159995615f, 0, 0.3910961323f, 0.9188871375f, -0.05186755998f, 0, -0.4879022471f, -0.5904376907f, 0.6429111375f, 0, 0.6014790094f, 0.7707441366f, -0.2101820095f, 0, -0.5677173047f, 0.7511360995f, 0.3368851762f, 0, 0.7858573506f, 0.226674665f, 0.5753666838f, 0, -0.4520345543f, -0.604222686f, -0.6561857263f, 0, - 0.002272116345f, 0.4132844051f, -0.9105991643f, 0, -0.5815751419f, -0.5162925989f, 0.6286591339f, 0, -0.03703704785f, 0.8273785755f, 0.5604221175f, 0, -0.5119692504f, 0.7953543429f, -0.3244980058f, 0, -0.2682417366f, -0.9572290247f, -0.1084387619f, 0, -0.2322482736f, -0.9679131102f, -0.09594243324f, 0, 0.3554328906f, -0.8881505545f, 0.2913006227f, 0, 0.7346520519f, -0.4371373164f, 0.5188422971f, 0, - 0.9985120116f, 0.04659011161f, -0.02833944577f, 0, -0.3727687496f, -0.9082481361f, 0.1900757285f, 0, 0.91737377f, -0.3483642108f, 0.1925298489f, 0, 0.2714911074f, 0.4147529736f, -0.8684886582f, 0, 0.5131763485f, -0.7116334161f, 0.4798207128f, 0, -0.8737353606f, 0.18886992f, -0.4482350644f, 0, 0.8460043821f, -0.3725217914f, 0.3814499973f, 0, 0.8978727456f, -0.1780209141f, -0.4026575304f, 0, - 0.2178065647f, -0.9698322841f, -0.1094789531f, 0, -0.1518031304f, -0.7788918132f, -0.6085091231f, 0, -0.2600384876f, -0.4755398075f, -0.8403819825f, 0, 0.572313509f, -0.7474340931f, -0.3373418503f, 0, -0.7174141009f, 0.1699017182f, -0.6756111411f, 0, -0.684180784f, 0.02145707593f, -0.7289967412f, 0, -0.2007447902f, 0.06555605789f, -0.9774476623f, 0, -0.1148803697f, -0.8044887315f, 0.5827524187f, 0, - -0.7870349638f, 0.03447489231f, 0.6159443543f, 0, -0.2015596421f, 0.6859872284f, 0.6991389226f, 0, -0.08581082512f, -0.10920836f, -0.9903080513f, 0, 0.5532693395f, 0.7325250401f, -0.396610771f, 0, -0.1842489331f, -0.9777375055f, -0.1004076743f, 0, 0.0775473789f, -0.9111505856f, 0.4047110257f, 0, 0.1399838409f, 0.7601631212f, -0.6344734459f, 0, 0.4484419361f, -0.845289248f, 0.2904925424f, 0 + -0.7292736885f, + -0.6618439697f, + 0.1735581948f, + 0, + 0.790292081f, + -0.5480887466f, + -0.2739291014f, + 0, + 0.7217578935f, + 0.6226212466f, + -0.3023380997f, + 0, + 0.565683137f, + -0.8208298145f, + -0.0790000257f, + 0, + 0.760049034f, + -0.5555979497f, + -0.3370999617f, + 0, + 0.3713945616f, + 0.5011264475f, + 0.7816254623f, + 0, + -0.1277062463f, + -0.4254438999f, + -0.8959289049f, + 0, + -0.2881560924f, + -0.5815838982f, + 0.7607405838f, + 0, + 0.5849561111f, + -0.662820239f, + -0.4674352136f, + 0, + 0.3307171178f, + 0.0391653737f, + 0.94291689f, + 0, + 0.8712121778f, + -0.4113374369f, + -0.2679381538f, + 0, + 0.580981015f, + 0.7021915846f, + 0.4115677815f, + 0, + 0.503756873f, + 0.6330056931f, + -0.5878203852f, + 0, + 0.4493712205f, + 0.601390195f, + 0.6606022552f, + 0, + -0.6878403724f, + 0.09018890807f, + -0.7202371714f, + 0, + -0.5958956522f, + -0.6469350577f, + 0.475797649f, + 0, + -0.5127052122f, + 0.1946921978f, + -0.8361987284f, + 0, + -0.9911507142f, + -0.05410276466f, + -0.1212153153f, + 0, + -0.2149721042f, + 0.9720882117f, + -0.09397607749f, + 0, + -0.7518650936f, + -0.5428057603f, + 0.3742469607f, + 0, + 0.5237068895f, + 0.8516377189f, + -0.02107817834f, + 0, + 0.6333504779f, + 0.1926167129f, + -0.7495104896f, + 0, + -0.06788241606f, + 0.3998305789f, + 0.9140719259f, + 0, + -0.5538628599f, + -0.4729896695f, + -0.6852128902f, + 0, + -0.7261455366f, + -0.5911990757f, + 0.3509933228f, + 0, + -0.9229274737f, + -0.1782808786f, + 0.3412049336f, + 0, + -0.6968815002f, + 0.6511274338f, + 0.3006480328f, + 0, + 0.9608044783f, + -0.2098363234f, + -0.1811724921f, + 0, + 0.06817146062f, + -0.9743405129f, + 0.2145069156f, + 0, + -0.3577285196f, + -0.6697087264f, + -0.6507845481f, + 0, + -0.1868621131f, + 0.7648617052f, + -0.6164974636f, + 0, + -0.6541697588f, + 0.3967914832f, + 0.6439087246f, + 0, + 0.6993340405f, + -0.6164538506f, + 0.3618239211f, + 0, + -0.1546665739f, + 0.6291283928f, + 0.7617583057f, + 0, + -0.6841612949f, + -0.2580482182f, + -0.6821542638f, + 0, + 0.5383980957f, + 0.4258654885f, + 0.7271630328f, + 0, + -0.5026987823f, + -0.7939832935f, + -0.3418836993f, + 0, + 0.3202971715f, + 0.2834415347f, + 0.9039195862f, + 0, + 0.8683227101f, + -0.0003762656404f, + -0.4959995258f, + 0, + 0.791120031f, + -0.08511045745f, + 0.6057105799f, + 0, + -0.04011016052f, + -0.4397248749f, + 0.8972364289f, + 0, + 0.9145119872f, + 0.3579346169f, + -0.1885487608f, + 0, + -0.9612039066f, + -0.2756484276f, + 0.01024666929f, + 0, + 0.6510361721f, + -0.2877799159f, + -0.7023778346f, + 0, + -0.2041786351f, + 0.7365237271f, + 0.644859585f, + 0, + -0.7718263711f, + 0.3790626912f, + 0.5104855816f, + 0, + -0.3060082741f, + -0.7692987727f, + 0.5608371729f, + 0, + 0.454007341f, + -0.5024843065f, + 0.7357899537f, + 0, + 0.4816795475f, + 0.6021208291f, + -0.6367380315f, + 0, + 0.6961980369f, + -0.3222197429f, + 0.641469197f, + 0, + -0.6532160499f, + -0.6781148932f, + 0.3368515753f, + 0, + 0.5089301236f, + -0.6154662304f, + -0.6018234363f, + 0, + -0.1635919754f, + -0.9133604627f, + -0.372840892f, + 0, + 0.52408019f, + -0.8437664109f, + 0.1157505864f, + 0, + 0.5902587356f, + 0.4983817807f, + -0.6349883666f, + 0, + 0.5863227872f, + 0.494764745f, + 0.6414307729f, + 0, + 0.6779335087f, + 0.2341345225f, + 0.6968408593f, + 0, + 0.7177054546f, + -0.6858979348f, + 0.120178631f, + 0, + -0.5328819713f, + -0.5205125012f, + 0.6671608058f, + 0, + -0.8654874251f, + -0.0700727088f, + -0.4960053754f, + 0, + -0.2861810166f, + 0.7952089234f, + 0.5345495242f, + 0, + -0.04849529634f, + 0.9810836427f, + -0.1874115585f, + 0, + -0.6358521667f, + 0.6058348682f, + 0.4781800233f, + 0, + 0.6254794696f, + -0.2861619734f, + 0.7258696564f, + 0, + -0.2585259868f, + 0.5061949264f, + -0.8227581726f, + 0, + 0.02136306781f, + 0.5064016808f, + -0.8620330371f, + 0, + 0.200111773f, + 0.8599263484f, + 0.4695550591f, + 0, + 0.4743561372f, + 0.6014985084f, + -0.6427953014f, + 0, + 0.6622993731f, + -0.5202474575f, + -0.5391679918f, + 0, + 0.08084972818f, + -0.6532720452f, + 0.7527940996f, + 0, + -0.6893687501f, + 0.0592860349f, + 0.7219805347f, + 0, + -0.1121887082f, + -0.9673185067f, + 0.2273952515f, + 0, + 0.7344116094f, + 0.5979668656f, + -0.3210532909f, + 0, + 0.5789393465f, + -0.2488849713f, + 0.7764570201f, + 0, + 0.6988182827f, + 0.3557169806f, + -0.6205791146f, + 0, + -0.8636845529f, + -0.2748771249f, + -0.4224826141f, + 0, + -0.4247027957f, + -0.4640880967f, + 0.777335046f, + 0, + 0.5257722489f, + -0.8427017621f, + 0.1158329937f, + 0, + 0.9343830603f, + 0.316302472f, + -0.1639543925f, + 0, + -0.1016836419f, + -0.8057303073f, + -0.5834887393f, + 0, + -0.6529238969f, + 0.50602126f, + -0.5635892736f, + 0, + -0.2465286165f, + -0.9668205684f, + -0.06694497494f, + 0, + -0.9776897119f, + -0.2099250524f, + -0.007368825344f, + 0, + 0.7736893337f, + 0.5734244712f, + 0.2694238123f, + 0, + -0.6095087895f, + 0.4995678998f, + 0.6155736747f, + 0, + 0.5794535482f, + 0.7434546771f, + 0.3339292269f, + 0, + -0.8226211154f, + 0.08142581855f, + 0.5627293636f, + 0, + -0.510385483f, + 0.4703667658f, + 0.7199039967f, + 0, + -0.5764971849f, + -0.07231656274f, + -0.8138926898f, + 0, + 0.7250628871f, + 0.3949971505f, + -0.5641463116f, + 0, + -0.1525424005f, + 0.4860840828f, + -0.8604958341f, + 0, + -0.5550976208f, + -0.4957820792f, + 0.667882296f, + 0, + -0.1883614327f, + 0.9145869398f, + 0.357841725f, + 0, + 0.7625556724f, + -0.5414408243f, + -0.3540489801f, + 0, + -0.5870231946f, + -0.3226498013f, + -0.7424963803f, + 0, + 0.3051124198f, + 0.2262544068f, + -0.9250488391f, + 0, + 0.6379576059f, + 0.577242424f, + -0.5097070502f, + 0, + -0.5966775796f, + 0.1454852398f, + -0.7891830656f, + 0, + -0.658330573f, + 0.6555487542f, + -0.3699414651f, + 0, + 0.7434892426f, + 0.2351084581f, + 0.6260573129f, + 0, + 0.5562114096f, + 0.8264360377f, + -0.0873632843f, + 0, + -0.3028940016f, + -0.8251527185f, + 0.4768419182f, + 0, + 0.1129343818f, + -0.985888439f, + -0.1235710781f, + 0, + 0.5937652891f, + -0.5896813806f, + 0.5474656618f, + 0, + 0.6757964092f, + -0.5835758614f, + -0.4502648413f, + 0, + 0.7242302609f, + -0.1152719764f, + 0.6798550586f, + 0, + -0.9511914166f, + 0.0753623979f, + -0.2992580792f, + 0, + 0.2539470961f, + -0.1886339355f, + 0.9486454084f, + 0, + 0.571433621f, + -0.1679450851f, + -0.8032795685f, + 0, + -0.06778234979f, + 0.3978269256f, + 0.9149531629f, + 0, + 0.6074972649f, + 0.733060024f, + -0.3058922593f, + 0, + -0.5435478392f, + 0.1675822484f, + 0.8224791405f, + 0, + -0.5876678086f, + -0.3380045064f, + -0.7351186982f, + 0, + -0.7967562402f, + 0.04097822706f, + -0.6029098428f, + 0, + -0.1996350917f, + 0.8706294745f, + 0.4496111079f, + 0, + -0.02787660336f, + -0.9106232682f, + -0.4122962022f, + 0, + -0.7797625996f, + -0.6257634692f, + 0.01975775581f, + 0, + -0.5211232846f, + 0.7401644346f, + -0.4249554471f, + 0, + 0.8575424857f, + 0.4053272873f, + -0.3167501783f, + 0, + 0.1045223322f, + 0.8390195772f, + -0.5339674439f, + 0, + 0.3501822831f, + 0.9242524096f, + -0.1520850155f, + 0, + 0.1987849858f, + 0.07647613266f, + 0.9770547224f, + 0, + 0.7845996363f, + 0.6066256811f, + -0.1280964233f, + 0, + 0.09006737436f, + -0.9750989929f, + -0.2026569073f, + 0, + -0.8274343547f, + -0.542299559f, + 0.1458203587f, + 0, + -0.3485797732f, + -0.415802277f, + 0.840000362f, + 0, + -0.2471778936f, + -0.7304819962f, + -0.6366310879f, + 0, + -0.3700154943f, + 0.8577948156f, + 0.3567584454f, + 0, + 0.5913394901f, + -0.548311967f, + -0.5913303597f, + 0, + 0.1204873514f, + -0.7626472379f, + -0.6354935001f, + 0, + 0.616959265f, + 0.03079647928f, + 0.7863922953f, + 0, + 0.1258156836f, + -0.6640829889f, + -0.7369967419f, + 0, + -0.6477565124f, + -0.1740147258f, + -0.7417077429f, + 0, + 0.6217889313f, + -0.7804430448f, + -0.06547655076f, + 0, + 0.6589943422f, + -0.6096987708f, + 0.4404473475f, + 0, + -0.2689837504f, + -0.6732403169f, + -0.6887635427f, + 0, + -0.3849775103f, + 0.5676542638f, + 0.7277093879f, + 0, + 0.5754444408f, + 0.8110471154f, + -0.1051963504f, + 0, + 0.9141593684f, + 0.3832947817f, + 0.131900567f, + 0, + -0.107925319f, + 0.9245493968f, + 0.3654593525f, + 0, + 0.377977089f, + 0.3043148782f, + 0.8743716458f, + 0, + -0.2142885215f, + -0.8259286236f, + 0.5214617324f, + 0, + 0.5802544474f, + 0.4148098596f, + -0.7008834116f, + 0, + -0.1982660881f, + 0.8567161266f, + -0.4761596756f, + 0, + -0.03381553704f, + 0.3773180787f, + -0.9254661404f, + 0, + -0.6867922841f, + -0.6656597827f, + 0.2919133642f, + 0, + 0.7731742607f, + -0.2875793547f, + -0.5652430251f, + 0, + -0.09655941928f, + 0.9193708367f, + -0.3813575004f, + 0, + 0.2715702457f, + -0.9577909544f, + -0.09426605581f, + 0, + 0.2451015704f, + -0.6917998565f, + -0.6792188003f, + 0, + 0.977700782f, + -0.1753855374f, + 0.1155036542f, + 0, + -0.5224739938f, + 0.8521606816f, + 0.02903615945f, + 0, + -0.7734880599f, + -0.5261292347f, + 0.3534179531f, + 0, + -0.7134492443f, + -0.269547243f, + 0.6467878011f, + 0, + 0.1644037271f, + 0.5105846203f, + -0.8439637196f, + 0, + 0.6494635788f, + 0.05585611296f, + 0.7583384168f, + 0, + -0.4711970882f, + 0.5017280509f, + -0.7254255765f, + 0, + -0.6335764307f, + -0.2381686273f, + -0.7361091029f, + 0, + -0.9021533097f, + -0.270947803f, + -0.3357181763f, + 0, + -0.3793711033f, + 0.872258117f, + 0.3086152025f, + 0, + -0.6855598966f, + -0.3250143309f, + 0.6514394162f, + 0, + 0.2900942212f, + -0.7799057743f, + -0.5546100667f, + 0, + -0.2098319339f, + 0.85037073f, + 0.4825351604f, + 0, + -0.4592603758f, + 0.6598504336f, + -0.5947077538f, + 0, + 0.8715945488f, + 0.09616365406f, + -0.4807031248f, + 0, + -0.6776666319f, + 0.7118504878f, + -0.1844907016f, + 0, + 0.7044377633f, + 0.312427597f, + 0.637304036f, + 0, + -0.7052318886f, + -0.2401093292f, + -0.6670798253f, + 0, + 0.081921007f, + -0.7207336136f, + -0.6883545647f, + 0, + -0.6993680906f, + -0.5875763221f, + -0.4069869034f, + 0, + -0.1281454481f, + 0.6419895885f, + 0.7559286424f, + 0, + -0.6337388239f, + -0.6785471501f, + -0.3714146849f, + 0, + 0.5565051903f, + -0.2168887573f, + -0.8020356851f, + 0, + -0.5791554484f, + 0.7244372011f, + -0.3738578718f, + 0, + 0.1175779076f, + -0.7096451073f, + 0.6946792478f, + 0, + -0.6134619607f, + 0.1323631078f, + 0.7785527795f, + 0, + 0.6984635305f, + -0.02980516237f, + -0.715024719f, + 0, + 0.8318082963f, + -0.3930171956f, + 0.3919597455f, + 0, + 0.1469576422f, + 0.05541651717f, + -0.9875892167f, + 0, + 0.708868575f, + -0.2690503865f, + 0.6520101478f, + 0, + 0.2726053183f, + 0.67369766f, + -0.68688995f, + 0, + -0.6591295371f, + 0.3035458599f, + -0.6880466294f, + 0, + 0.4815131379f, + -0.7528270071f, + 0.4487723203f, + 0, + 0.9430009463f, + 0.1675647412f, + -0.2875261255f, + 0, + 0.434802957f, + 0.7695304522f, + -0.4677277752f, + 0, + 0.3931996188f, + 0.594473625f, + 0.7014236729f, + 0, + 0.7254336655f, + -0.603925654f, + 0.3301814672f, + 0, + 0.7590235227f, + -0.6506083235f, + 0.02433313207f, + 0, + -0.8552768592f, + -0.3430042733f, + 0.3883935666f, + 0, + -0.6139746835f, + 0.6981725247f, + 0.3682257648f, + 0, + -0.7465905486f, + -0.5752009504f, + 0.3342849376f, + 0, + 0.5730065677f, + 0.810555537f, + -0.1210916791f, + 0, + -0.9225877367f, + -0.3475211012f, + -0.167514036f, + 0, + -0.7105816789f, + -0.4719692027f, + -0.5218416899f, + 0, + -0.08564609717f, + 0.3583001386f, + 0.929669703f, + 0, + -0.8279697606f, + -0.2043157126f, + 0.5222271202f, + 0, + 0.427944023f, + 0.278165994f, + 0.8599346446f, + 0, + 0.5399079671f, + -0.7857120652f, + -0.3019204161f, + 0, + 0.5678404253f, + -0.5495413974f, + -0.6128307303f, + 0, + -0.9896071041f, + 0.1365639107f, + -0.04503418428f, + 0, + -0.6154342638f, + -0.6440875597f, + 0.4543037336f, + 0, + 0.1074204368f, + -0.7946340692f, + 0.5975094525f, + 0, + -0.3595449969f, + -0.8885529948f, + 0.28495784f, + 0, + -0.2180405296f, + 0.1529888965f, + 0.9638738118f, + 0, + -0.7277432317f, + -0.6164050508f, + -0.3007234646f, + 0, + 0.7249729114f, + -0.00669719484f, + 0.6887448187f, + 0, + -0.5553659455f, + -0.5336586252f, + 0.6377908264f, + 0, + 0.5137558015f, + 0.7976208196f, + -0.3160000073f, + 0, + -0.3794024848f, + 0.9245608561f, + -0.03522751494f, + 0, + 0.8229248658f, + 0.2745365933f, + -0.4974176556f, + 0, + -0.5404114394f, + 0.6091141441f, + 0.5804613989f, + 0, + 0.8036581901f, + -0.2703029469f, + 0.5301601931f, + 0, + 0.6044318879f, + 0.6832968393f, + 0.4095943388f, + 0, + 0.06389988817f, + 0.9658208605f, + -0.2512108074f, + 0, + 0.1087113286f, + 0.7402471173f, + -0.6634877936f, + 0, + -0.713427712f, + -0.6926784018f, + 0.1059128479f, + 0, + 0.6458897819f, + -0.5724548511f, + -0.5050958653f, + 0, + -0.6553931414f, + 0.7381471625f, + 0.159995615f, + 0, + 0.3910961323f, + 0.9188871375f, + -0.05186755998f, + 0, + -0.4879022471f, + -0.5904376907f, + 0.6429111375f, + 0, + 0.6014790094f, + 0.7707441366f, + -0.2101820095f, + 0, + -0.5677173047f, + 0.7511360995f, + 0.3368851762f, + 0, + 0.7858573506f, + 0.226674665f, + 0.5753666838f, + 0, + -0.4520345543f, + -0.604222686f, + -0.6561857263f, + 0, + 0.002272116345f, + 0.4132844051f, + -0.9105991643f, + 0, + -0.5815751419f, + -0.5162925989f, + 0.6286591339f, + 0, + -0.03703704785f, + 0.8273785755f, + 0.5604221175f, + 0, + -0.5119692504f, + 0.7953543429f, + -0.3244980058f, + 0, + -0.2682417366f, + -0.9572290247f, + -0.1084387619f, + 0, + -0.2322482736f, + -0.9679131102f, + -0.09594243324f, + 0, + 0.3554328906f, + -0.8881505545f, + 0.2913006227f, + 0, + 0.7346520519f, + -0.4371373164f, + 0.5188422971f, + 0, + 0.9985120116f, + 0.04659011161f, + -0.02833944577f, + 0, + -0.3727687496f, + -0.9082481361f, + 0.1900757285f, + 0, + 0.91737377f, + -0.3483642108f, + 0.1925298489f, + 0, + 0.2714911074f, + 0.4147529736f, + -0.8684886582f, + 0, + 0.5131763485f, + -0.7116334161f, + 0.4798207128f, + 0, + -0.8737353606f, + 0.18886992f, + -0.4482350644f, + 0, + 0.8460043821f, + -0.3725217914f, + 0.3814499973f, + 0, + 0.8978727456f, + -0.1780209141f, + -0.4026575304f, + 0, + 0.2178065647f, + -0.9698322841f, + -0.1094789531f, + 0, + -0.1518031304f, + -0.7788918132f, + -0.6085091231f, + 0, + -0.2600384876f, + -0.4755398075f, + -0.8403819825f, + 0, + 0.572313509f, + -0.7474340931f, + -0.3373418503f, + 0, + -0.7174141009f, + 0.1699017182f, + -0.6756111411f, + 0, + -0.684180784f, + 0.02145707593f, + -0.7289967412f, + 0, + -0.2007447902f, + 0.06555605789f, + -0.9774476623f, + 0, + -0.1148803697f, + -0.8044887315f, + 0.5827524187f, + 0, + -0.7870349638f, + 0.03447489231f, + 0.6159443543f, + 0, + -0.2015596421f, + 0.6859872284f, + 0.6991389226f, + 0, + -0.08581082512f, + -0.10920836f, + -0.9903080513f, + 0, + 0.5532693395f, + 0.7325250401f, + -0.396610771f, + 0, + -0.1842489331f, + -0.9777375055f, + -0.1004076743f, + 0, + 0.0775473789f, + -0.9111505856f, + 0.4047110257f, + 0, + 0.1399838409f, + 0.7601631212f, + -0.6344734459f, + 0, + 0.4484419361f, + -0.845289248f, + 0.2904925424f, + 0, }; + private static float FastMin(float a, float b) { + return a < b ? a : b; + } - private static float FastMin(float a, float b) { return a < b ? a : b; } - - private static float FastMax(float a, float b) { return a > b ? a : b; } + private static float FastMax(float a, float b) { + return a > b ? a : b; + } - private static float FastAbs(float f) { return f < 0 ? -f : f; } + private static float FastAbs(float f) { + return f < 0 ? -f : f; + } - private static float FastSqrt(float f) { return (float)Math.sqrt(f); } + private static float FastSqrt(float f) { + return (float) Math.sqrt(f); + } - private static int FastFloor(/*FMLdouble*/ double f) { return f >= 0 ? (int)f : (int)f - 1; } + private static int FastFloor(/*FMLdouble*/double f) { + return f >= 0 ? (int) f : (int) f - 1; + } - private static int FastRound(/*FMLdouble*/ double f) { return f >= 0 ? (int)(f + 0.5f) : (int)(f - 0.5f); } + private static int FastRound(/*FMLdouble*/double f) { + return f >= 0 ? (int) (f + 0.5f) : (int) (f - 0.5f); + } - private static float Lerp(float a, float b, float t) { return a + t * (b - a); } + private static float Lerp(float a, float b, float t) { + return a + t * (b - a); + } - private static float InterpHermite(float t) { return t * t * (3 - 2 * t); } + private static float InterpHermite(float t) { + return t * t * (3 - 2 * t); + } - private static float InterpQuintic(float t) { return t * t * t * (t * (t * 6 - 15) + 10); } + private static float InterpQuintic(float t) { + return t * t * t * (t * (t * 6 - 15) + 10); + } - private static float CubicLerp(float a, float b, float c, float d, float t) - { + private static float CubicLerp( + float a, + float b, + float c, + float d, + float t + ) { float p = (d - c) - (a - b); return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; } - private static float PingPong(float t) - { - t -= (int)(t * 0.5f) * 2; + private static float PingPong(float t) { + t -= (int) (t * 0.5f) * 2; return t < 1 ? t : 2 - t; } - private void CalculateFractalBounding() - { + private void CalculateFractalBounding() { float gain = FastAbs(mGain); float amp = gain; float ampFractal = 1.0f; - for (int i = 1; i < mOctaves; i++) - { + for (int i = 1; i < mOctaves; i++) { ampFractal += amp; amp *= gain; } @@ -624,24 +2584,21 @@ private void CalculateFractalBounding() private static final int PrimeY = 1136930381; private static final int PrimeZ = 1720413743; - private static int Hash(int seed, int xPrimed, int yPrimed) - { + private static int Hash(int seed, int xPrimed, int yPrimed) { int hash = seed ^ xPrimed ^ yPrimed; hash *= 0x27d4eb2d; return hash; } - private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) - { + private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed; hash *= 0x27d4eb2d; return hash; } - private static float ValCoord(int seed, int xPrimed, int yPrimed) - { + private static float ValCoord(int seed, int xPrimed, int yPrimed) { int hash = Hash(seed, xPrimed, yPrimed); hash *= hash; @@ -649,8 +2606,12 @@ private static float ValCoord(int seed, int xPrimed, int yPrimed) return hash * (1 / 2147483648.0f); } - private static float ValCoord(int seed, int xPrimed, int yPrimed, int zPrimed) - { + private static float ValCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed + ) { int hash = Hash(seed, xPrimed, yPrimed, zPrimed); hash *= hash; @@ -658,8 +2619,13 @@ private static float ValCoord(int seed, int xPrimed, int yPrimed, int zPrimed) return hash * (1 / 2147483648.0f); } - private static float GradCoord(int seed, int xPrimed, int yPrimed, float xd, float yd) - { + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + float xd, + float yd + ) { int hash = Hash(seed, xPrimed, yPrimed); hash ^= hash >> 15; hash &= 127 << 1; @@ -670,8 +2636,15 @@ private static float GradCoord(int seed, int xPrimed, int yPrimed, float xd, flo return xd * xg + yd * yg; } - private static float GradCoord(int seed, int xPrimed, int yPrimed, int zPrimed, float xd, float yd, float zd) - { + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed, + float xd, + float yd, + float zd + ) { int hash = Hash(seed, xPrimed, yPrimed, zPrimed); hash ^= hash >> 15; hash &= 63 << 2; @@ -683,13 +2656,14 @@ private static float GradCoord(int seed, int xPrimed, int yPrimed, int zPrimed, return xd * xg + yd * yg + zd * zg; } - // Generic noise gen - private float GenNoiseSingle(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { - switch (mNoiseType) - { + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { + switch (mNoiseType) { case OpenSimplex2: return SingleSimplex(seed, x, y); case OpenSimplex2S: @@ -707,10 +2681,13 @@ private float GenNoiseSingle(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } } - private float GenNoiseSingle(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { - switch (mNoiseType) - { + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { + switch (mNoiseType) { case OpenSimplex2: return SingleOpenSimplex2(seed, x, y, z); case OpenSimplex2S: @@ -728,13 +2705,10 @@ private float GenNoiseSingle(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } } - // Noise Coordinate Transforms (frequency, and possible skew or rotation) - private void UpdateTransformType3D() - { - switch (mRotationType3D) - { + private void UpdateTransformType3D() { + switch (mRotationType3D) { case ImproveXYPlanes: mTransformType3D = TransformType3D.ImproveXYPlanes; break; @@ -742,8 +2716,7 @@ private void UpdateTransformType3D() mTransformType3D = TransformType3D.ImproveXZPlanes; break; default: - switch (mNoiseType) - { + switch (mNoiseType) { case OpenSimplex2: case OpenSimplex2S: mTransformType3D = TransformType3D.DefaultOpenSimplex2; @@ -756,10 +2729,8 @@ private void UpdateTransformType3D() } } - private void UpdateWarpTransformType3D() - { - switch (mRotationType3D) - { + private void UpdateWarpTransformType3D() { + switch (mRotationType3D) { case ImproveXYPlanes: mWarpTransformType3D = TransformType3D.ImproveXYPlanes; break; @@ -767,11 +2738,11 @@ private void UpdateWarpTransformType3D() mWarpTransformType3D = TransformType3D.ImproveXZPlanes; break; default: - switch (mDomainWarpType) - { + switch (mDomainWarpType) { case OpenSimplex2: case OpenSimplex2Reduced: - mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + mWarpTransformType3D = + TransformType3D.DefaultOpenSimplex2; break; default: mWarpTransformType3D = TransformType3D.None; @@ -781,17 +2752,14 @@ private void UpdateWarpTransformType3D() } } - // Fractal FBm - private float GenFractalFBm(/*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float GenFractalFBm(/*FMLdouble*/double x, /*FMLdouble*/double y) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { float noise = GenNoiseSingle(seed++, x, y); sum += noise * amp; amp *= Lerp(1.0f, FastMin(noise + 1, 2) * 0.5f, mWeightedStrength); @@ -804,14 +2772,16 @@ private float GenFractalFBm(/*FMLdouble*/ double x, /*FMLdouble*/ double y) return sum; } - private float GenFractalFBm(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float GenFractalFBm( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { float noise = GenNoiseSingle(seed++, x, y, z); sum += noise * amp; amp *= Lerp(1.0f, (noise + 1) * 0.5f, mWeightedStrength); @@ -825,17 +2795,17 @@ private float GenFractalFBm(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FM return sum; } - // Fractal Ridged - private float GenFractalRidged(/*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { float noise = FastAbs(GenNoiseSingle(seed++, x, y)); sum += (noise * -2 + 1) * amp; amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); @@ -848,14 +2818,16 @@ private float GenFractalRidged(/*FMLdouble*/ double x, /*FMLdouble*/ double y) return sum; } - private float GenFractalRidged(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { float noise = FastAbs(GenNoiseSingle(seed++, x, y, z)); sum += (noise * -2 + 1) * amp; amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); @@ -869,18 +2841,20 @@ private float GenFractalRidged(/*FMLdouble*/ double x, /*FMLdouble*/ double y, / return sum; } - // Fractal PingPong - private float GenFractalPingPong(/*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { - float noise = PingPong((GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength); + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength + ); sum += (noise - 0.5f) * 2 * amp; amp *= Lerp(1.0f, noise, mWeightedStrength); @@ -892,15 +2866,19 @@ private float GenFractalPingPong(/*FMLdouble*/ double x, /*FMLdouble*/ double y) return sum; } - private float GenFractalPingPong(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int seed = mSeed; float sum = 0; float amp = mFractalBounding; - for (int i = 0; i < mOctaves; i++) - { - float noise = PingPong((GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength); + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength + ); sum += (noise - 0.5f) * 2 * amp; amp *= Lerp(1.0f, noise, mWeightedStrength); @@ -913,11 +2891,13 @@ private float GenFractalPingPong(/*FMLdouble*/ double x, /*FMLdouble*/ double y, return sum; } - // Simplex/OpenSimplex2 Noise - private float SingleSimplex(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SingleSimplex( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. final float SQRT3 = 1.7320508075688772935274463415059f; @@ -932,12 +2912,12 @@ private float SingleSimplex(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doub int i = FastFloor(x); int j = FastFloor(y); - float xi = (float)(x - i); - float yi = (float)(y - j); + float xi = (float) (x - i); + float yi = (float) (y - j); float t = (xi + yi) * G2; - float x0 = (float)(xi - t); - float y0 = (float)(yi - t); + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); i *= PrimeX; j *= PrimeY; @@ -945,40 +2925,32 @@ private float SingleSimplex(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doub float n0, n1, n2; float a = 0.5f - x0 * x0 - y0 * y0; - if (a <= 0) n0 = 0; - else - { + if (a <= 0) n0 = 0; else { n0 = (a * a) * (a * a) * GradCoord(seed, i, j, x0, y0); } - float c = (float)(2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + ((float)(-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c <= 0) n2 = 0; - else - { - float x2 = x0 + (2 * (float)G2 - 1); - float y2 = y0 + (2 * (float)G2 - 1); - n2 = (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); + float c = + (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c <= 0) n2 = 0; else { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); + n2 = + (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); } - if (y0 > x0) - { - float x1 = x0 + (float)G2; - float y1 = y0 + ((float)G2 - 1); + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) n1 = 0; - else - { + if (b <= 0) n1 = 0; else { n1 = (b * b) * (b * b) * GradCoord(seed, i, j + PrimeY, x1, y1); } - } - else - { - float x1 = x0 + ((float)G2 - 1); - float y1 = y0 + (float)G2; + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) n1 = 0; - else - { + if (b <= 0) n1 = 0; else { n1 = (b * b) * (b * b) * GradCoord(seed, i + PrimeX, j, x1, y1); } } @@ -986,8 +2958,12 @@ private float SingleSimplex(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doub return (n0 + n1 + n2) * 99.83685446303647f; } - private float SingleOpenSimplex2(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SingleOpenSimplex2( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { // 3D OpenSimplex2 case uses two offset rotated cube grids. /* @@ -1000,13 +2976,13 @@ private float SingleOpenSimplex2(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ int i = FastRound(x); int j = FastRound(y); int k = FastRound(z); - float x0 = (float)(x - i); - float y0 = (float)(y - j); - float z0 = (float)(z - k); + float x0 = (float) (x - i); + float y0 = (float) (y - j); + float z0 = (float) (z - k); - int xNSign = (int)(-1.0f - x0) | 1; - int yNSign = (int)(-1.0f - y0) | 1; - int zNSign = (int)(-1.0f - z0) | 1; + int xNSign = (int) (-1.0f - x0) | 1; + int yNSign = (int) (-1.0f - y0) | 1; + int zNSign = (int) (-1.0f - z0) | 1; float ax0 = xNSign * -x0; float ay0 = yNSign * -y0; @@ -1019,38 +2995,62 @@ private float SingleOpenSimplex2(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ float value = 0; float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - for (int l = 0; ; l++) - { - if (a > 0) - { - value += (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); + for (int l = 0;; l++) { + if (a > 0) { + value += + (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); } - if (ax0 >= ay0 && ax0 >= az0) - { + if (ax0 >= ay0 && ax0 >= az0) { float b = a + ax0 + ax0; - if (b > 1) - { + if (b > 1) { b -= 1; - value += (b * b) * (b * b) * GradCoord(seed, i - xNSign * PrimeX, j, k, x0 + xNSign, y0, z0); + value += + (b * b) * + (b * b) * + GradCoord( + seed, + i - xNSign * PrimeX, + j, + k, + x0 + xNSign, + y0, + z0 + ); } - } - else if (ay0 > ax0 && ay0 >= az0) - { + } else if (ay0 > ax0 && ay0 >= az0) { float b = a + ay0 + ay0; - if (b > 1) - { + if (b > 1) { b -= 1; - value += (b * b) * (b * b) * GradCoord(seed, i, j - yNSign * PrimeY, k, x0, y0 + yNSign, z0); + value += + (b * b) * + (b * b) * + GradCoord( + seed, + i, + j - yNSign * PrimeY, + k, + x0, + y0 + yNSign, + z0 + ); } - } - else - { + } else { float b = a + az0 + az0; - if (b > 1) - { + if (b > 1) { b -= 1; - value += (b * b) * (b * b) * GradCoord(seed, i, j, k - zNSign * PrimeZ, x0, y0, z0 + zNSign); + value += + (b * b) * + (b * b) * + GradCoord( + seed, + i, + j, + k - zNSign * PrimeZ, + x0, + y0, + z0 + zNSign + ); } } @@ -1080,15 +3080,18 @@ else if (ay0 > ax0 && ay0 >= az0) return value * 32.69428253173828125f; } - // OpenSimplex2S Noise - private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { // 2D OpenSimplex2S case is a modified 2D simplex noise. - final /*FMLdouble*/ double SQRT3 = (/*FMLdouble*/ double)1.7320508075688772935274463415059; - final /*FMLdouble*/ double G2 = (3 - SQRT3) / 6; + final /*FMLdouble*/double SQRT3 = + (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double G2 = (3 - SQRT3) / 6; /* * --- Skew moved to TransformNoiseCoordinate method --- @@ -1099,113 +3102,116 @@ private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble* int i = FastFloor(x); int j = FastFloor(y); - float xi = (float)(x - i); - float yi = (float)(y - j); + float xi = (float) (x - i); + float yi = (float) (y - j); i *= PrimeX; j *= PrimeY; int i1 = i + PrimeX; int j1 = j + PrimeY; - float t = (xi + yi) * (float)G2; + float t = (xi + yi) * (float) G2; float x0 = xi - t; float y0 = yi - t; float a0 = (2.0f / 3.0f) - x0 * x0 - y0 * y0; float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, i, j, x0, y0); - float a1 = (float)(2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + ((float)(-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); - float x1 = x0 - (float)(1 - 2 * G2); - float y1 = y0 - (float)(1 - 2 * G2); + float a1 = + (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); + float x1 = x0 - (float) (1 - 2 * G2); + float y1 = y0 - (float) (1 - 2 * G2); value += (a1 * a1) * (a1 * a1) * GradCoord(seed, i1, j1, x1, y1); // Nested conditionals were faster than compact bit logic/arithmetic. float xmyi = xi - yi; - if (t > G2) - { - if (xi + xmyi > 1) - { - float x2 = x0 + (float)(3 * G2 - 2); - float y2 = y0 + (float)(3 * G2 - 1); + if (t > G2) { + if (xi + xmyi > 1) { + float x2 = x0 + (float) (3 * G2 - 2); + float y2 = y0 + (float) (3 * G2 - 1); float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); } - } - else - { - float x2 = x0 + (float)G2; - float y2 = y0 + (float)(G2 - 1); + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i, j + PrimeY, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); } } - if (yi - xmyi > 1) - { - float x3 = x0 + (float)(3 * G2 - 1); - float y3 = y0 + (float)(3 * G2 - 2); + if (yi - xmyi > 1) { + float x3 = x0 + (float) (3 * G2 - 1); + float y3 = y0 + (float) (3 * G2 - 2); float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) - { - value += (a3 * a3) * (a3 * a3) * GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); + if (a3 > 0) { + value += + (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); } - } - else - { - float x3 = x0 + (float)(G2 - 1); - float y3 = y0 + (float)G2; + } else { + float x3 = x0 + (float) (G2 - 1); + float y3 = y0 + (float) G2; float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) - { - value += (a3 * a3) * (a3 * a3) * GradCoord(seed, i + PrimeX, j, x3, y3); + if (a3 > 0) { + value += + (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j, x3, y3); } } - } - else - { - if (xi + xmyi < 0) - { - float x2 = x0 + (float)(1 - G2); - float y2 = y0 - (float)G2; + } else { + if (xi + xmyi < 0) { + float x2 = x0 + (float) (1 - G2); + float y2 = y0 - (float) G2; float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i - PrimeX, j, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i - PrimeX, j, x2, y2); } - } - else - { - float x2 = x0 + (float)(G2 - 1); - float y2 = y0 + (float)G2; + } else { + float x2 = x0 + (float) (G2 - 1); + float y2 = y0 + (float) G2; float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i + PrimeX, j, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + PrimeX, j, x2, y2); } } - if (yi < xmyi) - { - float x2 = x0 - (float)G2; - float y2 = y0 - (float)(G2 - 1); + if (yi < xmyi) { + float x2 = x0 - (float) G2; + float y2 = y0 - (float) (G2 - 1); float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i, j - PrimeY, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j - PrimeY, x2, y2); } - } - else - { - float x2 = x0 + (float)G2; - float y2 = y0 + (float)(G2 - 1); + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) - { - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, i, j + PrimeY, x2, y2); + if (a2 > 0) { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); } } } @@ -1213,8 +3219,12 @@ private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble* return value * 18.24196194486065f; } - private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { // 3D OpenSimplex2S case uses two offset rotated cube grids. /* @@ -1227,32 +3237,44 @@ private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble* int i = FastFloor(x); int j = FastFloor(y); int k = FastFloor(z); - float xi = (float)(x - i); - float yi = (float)(y - j); - float zi = (float)(z - k); + float xi = (float) (x - i); + float yi = (float) (y - j); + float zi = (float) (z - k); i *= PrimeX; j *= PrimeY; k *= PrimeZ; int seed2 = seed + 1293373; - int xNMask = (int)(-0.5f - xi); - int yNMask = (int)(-0.5f - yi); - int zNMask = (int)(-0.5f - zi); + int xNMask = (int) (-0.5f - xi); + int yNMask = (int) (-0.5f - yi); + int zNMask = (int) (-0.5f - zi); float x0 = xi + xNMask; float y0 = yi + yNMask; float z0 = zi + zNMask; float a0 = 0.75f - x0 * x0 - y0 * y0 - z0 * z0; - float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, - i + (xNMask & PrimeX), j + (yNMask & PrimeY), k + (zNMask & PrimeZ), x0, y0, z0); + float value = + (a0 * a0) * + (a0 * a0) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x0, + y0, + z0 + ); float x1 = xi - 0.5f; float y1 = yi - 0.5f; float z1 = zi - 0.5f; float a1 = 0.75f - x1 * x1 - y1 * y1 - z1 * z1; - value += (a1 * a1) * (a1 * a1) * GradCoord(seed2, - i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); + value += + (a1 * a1) * + (a1 * a1) * + GradCoord(seed2, i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); float xAFlipMask0 = ((xNMask | 1) << 1) * x1; float yAFlipMask0 = ((yNMask | 1) << 1) * y1; @@ -1263,153 +3285,254 @@ private float SingleOpenSimplex2S(int seed, /*FMLdouble*/ double x, /*FMLdouble* boolean skip5 = false; float a2 = xAFlipMask0 + a0; - if (a2 > 0) - { + if (a2 > 0) { float x2 = x0 - (xNMask | 1); float y2 = y0; float z2 = z0; - value += (a2 * a2) * (a2 * a2) * GradCoord(seed, - i + (~xNMask & PrimeX), j + (yNMask & PrimeY), k + (zNMask & PrimeZ), x2, y2, z2); - } - else - { + value += + (a2 * a2) * + (a2 * a2) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x2, + y2, + z2 + ); + } else { float a3 = yAFlipMask0 + zAFlipMask0 + a0; - if (a3 > 0) - { + if (a3 > 0) { float x3 = x0; float y3 = y0 - (yNMask | 1); float z3 = z0 - (zNMask | 1); - value += (a3 * a3) * (a3 * a3) * GradCoord(seed, - i + (xNMask & PrimeX), j + (~yNMask & PrimeY), k + (~zNMask & PrimeZ), x3, y3, z3); + value += + (a3 * a3) * + (a3 * a3) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x3, + y3, + z3 + ); } float a4 = xAFlipMask1 + a1; - if (a4 > 0) - { + if (a4 > 0) { float x4 = (xNMask | 1) + x1; float y4 = y1; float z4 = z1; - value += (a4 * a4) * (a4 * a4) * GradCoord(seed2, - i + (xNMask & (PrimeX * 2)), j + PrimeY, k + PrimeZ, x4, y4, z4); + value += + (a4 * a4) * + (a4 * a4) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + PrimeZ, + x4, + y4, + z4 + ); skip5 = true; } } boolean skip9 = false; float a6 = yAFlipMask0 + a0; - if (a6 > 0) - { + if (a6 > 0) { float x6 = x0; float y6 = y0 - (yNMask | 1); float z6 = z0; - value += (a6 * a6) * (a6 * a6) * GradCoord(seed, - i + (xNMask & PrimeX), j + (~yNMask & PrimeY), k + (zNMask & PrimeZ), x6, y6, z6); - } - else - { + value += + (a6 * a6) * + (a6 * a6) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + x6, + y6, + z6 + ); + } else { float a7 = xAFlipMask0 + zAFlipMask0 + a0; - if (a7 > 0) - { + if (a7 > 0) { float x7 = x0 - (xNMask | 1); float y7 = y0; float z7 = z0 - (zNMask | 1); - value += (a7 * a7) * (a7 * a7) * GradCoord(seed, - i + (~xNMask & PrimeX), j + (yNMask & PrimeY), k + (~zNMask & PrimeZ), x7, y7, z7); + value += + (a7 * a7) * + (a7 * a7) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x7, + y7, + z7 + ); } float a8 = yAFlipMask1 + a1; - if (a8 > 0) - { + if (a8 > 0) { float x8 = x1; float y8 = (yNMask | 1) + y1; float z8 = z1; - value += (a8 * a8) * (a8 * a8) * GradCoord(seed2, - i + PrimeX, j + (yNMask & (PrimeY << 1)), k + PrimeZ, x8, y8, z8); + value += + (a8 * a8) * + (a8 * a8) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + x8, + y8, + z8 + ); skip9 = true; } } boolean skipD = false; float aA = zAFlipMask0 + a0; - if (aA > 0) - { + if (aA > 0) { float xA = x0; float yA = y0; float zA = z0 - (zNMask | 1); - value += (aA * aA) * (aA * aA) * GradCoord(seed, - i + (xNMask & PrimeX), j + (yNMask & PrimeY), k + (~zNMask & PrimeZ), xA, yA, zA); - } - else - { + value += + (aA * aA) * + (aA * aA) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + xA, + yA, + zA + ); + } else { float aB = xAFlipMask0 + yAFlipMask0 + a0; - if (aB > 0) - { + if (aB > 0) { float xB = x0 - (xNMask | 1); float yB = y0 - (yNMask | 1); float zB = z0; - value += (aB * aB) * (aB * aB) * GradCoord(seed, - i + (~xNMask & PrimeX), j + (~yNMask & PrimeY), k + (zNMask & PrimeZ), xB, yB, zB); + value += + (aB * aB) * + (aB * aB) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + xB, + yB, + zB + ); } float aC = zAFlipMask1 + a1; - if (aC > 0) - { + if (aC > 0) { float xC = x1; float yC = y1; float zC = (zNMask | 1) + z1; - value += (aC * aC) * (aC * aC) * GradCoord(seed2, - i + PrimeX, j + PrimeY, k + (zNMask & (PrimeZ << 1)), xC, yC, zC); + value += + (aC * aC) * + (aC * aC) * + GradCoord( + seed2, + i + PrimeX, + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + xC, + yC, + zC + ); skipD = true; } } - if (!skip5) - { + if (!skip5) { float a5 = yAFlipMask1 + zAFlipMask1 + a1; - if (a5 > 0) - { + if (a5 > 0) { float x5 = x1; float y5 = (yNMask | 1) + y1; float z5 = (zNMask | 1) + z1; - value += (a5 * a5) * (a5 * a5) * GradCoord(seed2, - i + PrimeX, j + (yNMask & (PrimeY << 1)), k + (zNMask & (PrimeZ << 1)), x5, y5, z5); + value += + (a5 * a5) * + (a5 * a5) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + (zNMask & (PrimeZ << 1)), + x5, + y5, + z5 + ); } } - if (!skip9) - { + if (!skip9) { float a9 = xAFlipMask1 + zAFlipMask1 + a1; - if (a9 > 0) - { + if (a9 > 0) { float x9 = (xNMask | 1) + x1; float y9 = y1; float z9 = (zNMask | 1) + z1; - value += (a9 * a9) * (a9 * a9) * GradCoord(seed2, - i + (xNMask & (PrimeX * 2)), j + PrimeY, k + (zNMask & (PrimeZ << 1)), x9, y9, z9); + value += + (a9 * a9) * + (a9 * a9) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + x9, + y9, + z9 + ); } } - if (!skipD) - { + if (!skipD) { float aD = xAFlipMask1 + yAFlipMask1 + a1; - if (aD > 0) - { + if (aD > 0) { float xD = (xNMask | 1) + x1; float yD = (yNMask | 1) + y1; float zD = z1; - value += (aD * aD) * (aD * aD) * GradCoord(seed2, - i + (xNMask & (PrimeX << 1)), j + (yNMask & (PrimeY << 1)), k + PrimeZ, xD, yD, zD); + value += + (aD * aD) * + (aD * aD) * + GradCoord( + seed2, + i + (xNMask & (PrimeX << 1)), + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + xD, + yD, + zD + ); } } return value * 9.046026385208288f; } - // Cellular Noise - private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int xr = FastRound(x); int yr = FastRound(y); @@ -1422,28 +3545,28 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou int xPrimed = (xr - 1) * PrimeX; int yPrimedBase = (yr - 1) * PrimeY; - switch (mCellularDistanceFunction) - { + switch (mCellularDistanceFunction) { default: case Euclidean: case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int hash = Hash(seed, xPrimed, yPrimed); int idx = hash & (255 << 1); - float vecX = (float)(xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs2D[idx | 1] * cellularJitter; + float vecX = + (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; float newDistance = vecX * vecX + vecY * vecY; - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1453,23 +3576,24 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } break; case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int hash = Hash(seed, xPrimed, yPrimed); int idx = hash & (255 << 1); - float vecX = (float)(xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs2D[idx | 1] * cellularJitter; + float vecX = + (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; float newDistance = FastAbs(vecX) + FastAbs(vecY); - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1479,23 +3603,26 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } break; case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int hash = Hash(seed, xPrimed, yPrimed); int idx = hash & (255 << 1); - float vecX = (float)(xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs2D[idx | 1] * cellularJitter; + float vecX = + (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; - float newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); + float newDistance = + (FastAbs(vecX) + FastAbs(vecY)) + + (vecX * vecX + vecY * vecY); - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1506,18 +3633,18 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou break; } - if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && mCellularReturnType != CellularReturnType.CellValue) - { + if ( + mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue + ) { distance0 = FastSqrt(distance0); - if (mCellularReturnType != CellularReturnType.CellValue) - { + if (mCellularReturnType != CellularReturnType.CellValue) { distance1 = FastSqrt(distance1); } } - switch (mCellularReturnType) - { + switch (mCellularReturnType) { case CellValue: return closestHash * (1 / 2147483648.0f); case Distance: @@ -1537,8 +3664,12 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } } - private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int xr = FastRound(x); int yr = FastRound(y); int zr = FastRound(z); @@ -1553,32 +3684,35 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou int yPrimedBase = (yr - 1) * PrimeY; int zPrimedBase = (zr - 1) * PrimeZ; - switch (mCellularDistanceFunction) - { + switch (mCellularDistanceFunction) { case Euclidean: case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int zPrimed = zPrimedBase; - for (int zi = zr - 1; zi <= zr + 1; zi++) - { + for (int zi = zr - 1; zi <= zr + 1; zi++) { int hash = Hash(seed, xPrimed, yPrimed, zPrimed); int idx = hash & (255 << 2); - float vecX = (float)(xi - x) + RandVecs3D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float)(zi - z) + RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + float vecX = + (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = + (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = + vecX * vecX + vecY * vecY + vecZ * vecZ; + + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1590,28 +3724,32 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } break; case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int zPrimed = zPrimedBase; - for (int zi = zr - 1; zi <= zr + 1; zi++) - { + for (int zi = zr - 1; zi <= zr + 1; zi++) { int hash = Hash(seed, xPrimed, yPrimed, zPrimed); int idx = hash & (255 << 2); - float vecX = (float)(xi - x) + RandVecs3D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float)(zi - z) + RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + float vecX = + (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = + (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = + FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1623,28 +3761,35 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } break; case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { + for (int xi = xr - 1; xi <= xr + 1; xi++) { int yPrimed = yPrimedBase; - for (int yi = yr - 1; yi <= yr + 1; yi++) - { + for (int yi = yr - 1; yi <= yr + 1; yi++) { int zPrimed = zPrimedBase; - for (int zi = zr - 1; zi <= zr + 1; zi++) - { + for (int zi = zr - 1; zi <= zr + 1; zi++) { int hash = Hash(seed, xPrimed, yPrimed, zPrimed); int idx = hash & (255 << 2); - float vecX = (float)(xi - x) + RandVecs3D[idx] * cellularJitter; - float vecY = (float)(yi - y) + RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float)(zi - z) + RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) - { + float vecX = + (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = + (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = + (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = + (FastAbs(vecX) + + FastAbs(vecY) + + FastAbs(vecZ)) + + (vecX * vecX + vecY * vecY + vecZ * vecZ); + + distance1 = + FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { distance0 = newDistance; closestHash = hash; } @@ -1659,18 +3804,18 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou break; } - if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && mCellularReturnType != CellularReturnType.CellValue) - { + if ( + mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue + ) { distance0 = FastSqrt(distance0); - if (mCellularReturnType != CellularReturnType.CellValue) - { + if (mCellularReturnType != CellularReturnType.CellValue) { distance1 = FastSqrt(distance1); } } - switch (mCellularReturnType) - { + switch (mCellularReturnType) { case CellValue: return closestHash * (1 / 2147483648.0f); case Distance: @@ -1690,16 +3835,18 @@ private float SingleCellular(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ dou } } - // Perlin Noise - private float SinglePerlin(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int x0 = FastFloor(x); int y0 = FastFloor(y); - float xd0 = (float)(x - x0); - float yd0 = (float)(y - y0); + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); float xd1 = xd0 - 1; float yd1 = yd0 - 1; @@ -1711,21 +3858,33 @@ private float SinglePerlin(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doubl int x1 = x0 + PrimeX; int y1 = y0 + PrimeY; - float xf0 = Lerp(GradCoord(seed, x0, y0, xd0, yd0), GradCoord(seed, x1, y0, xd1, yd0), xs); - float xf1 = Lerp(GradCoord(seed, x0, y1, xd0, yd1), GradCoord(seed, x1, y1, xd1, yd1), xs); + float xf0 = Lerp( + GradCoord(seed, x0, y0, xd0, yd0), + GradCoord(seed, x1, y0, xd1, yd0), + xs + ); + float xf1 = Lerp( + GradCoord(seed, x0, y1, xd0, yd1), + GradCoord(seed, x1, y1, xd1, yd1), + xs + ); return Lerp(xf0, xf1, ys) * 1.4247691104677813f; } - private float SinglePerlin(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); - float xd0 = (float)(x - x0); - float yd0 = (float)(y - y0); - float zd0 = (float)(z - z0); + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); + float zd0 = (float) (z - z0); float xd1 = xd0 - 1; float yd1 = yd0 - 1; float zd1 = zd0 - 1; @@ -1741,10 +3900,26 @@ private float SinglePerlin(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doubl int y1 = y0 + PrimeY; int z1 = z0 + PrimeZ; - float xf00 = Lerp(GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), xs); - float xf10 = Lerp(GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), xs); - float xf01 = Lerp(GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), xs); - float xf11 = Lerp(GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), xs); + float xf00 = Lerp( + GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), + GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), + xs + ); + float xf10 = Lerp( + GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), + GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), + xs + ); + float xf01 = Lerp( + GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), + GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), + xs + ); + float xf11 = Lerp( + GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), + GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), + xs + ); float yf0 = Lerp(xf00, xf10, ys); float yf1 = Lerp(xf01, xf11, ys); @@ -1752,16 +3927,18 @@ private float SinglePerlin(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ doubl return Lerp(yf0, yf1, zs) * 0.964921414852142333984375f; } - // Value Cubic Noise - private float SingleValueCubic(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int x1 = FastFloor(x); int y1 = FastFloor(y); - float xs = (float)(x - x1); - float ys = (float)(y - y1); + float xs = (float) (x - x1); + float ys = (float) (y - y1); x1 *= PrimeX; y1 *= PrimeY; @@ -1772,27 +3949,55 @@ private float SingleValueCubic(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ d int x3 = x1 + (PrimeX << 1); int y3 = y1 + (PrimeY << 1); - return CubicLerp( - CubicLerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), ValCoord(seed, x2, y0), ValCoord(seed, x3, y0), - xs), - CubicLerp(ValCoord(seed, x0, y1), ValCoord(seed, x1, y1), ValCoord(seed, x2, y1), ValCoord(seed, x3, y1), - xs), - CubicLerp(ValCoord(seed, x0, y2), ValCoord(seed, x1, y2), ValCoord(seed, x2, y2), ValCoord(seed, x3, y2), - xs), - CubicLerp(ValCoord(seed, x0, y3), ValCoord(seed, x1, y3), ValCoord(seed, x2, y3), ValCoord(seed, x3, y3), - xs), - ys) * (1 / (1.5f * 1.5f)); + return ( + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0), + ValCoord(seed, x1, y0), + ValCoord(seed, x2, y0), + ValCoord(seed, x3, y0), + xs + ), + CubicLerp( + ValCoord(seed, x0, y1), + ValCoord(seed, x1, y1), + ValCoord(seed, x2, y1), + ValCoord(seed, x3, y1), + xs + ), + CubicLerp( + ValCoord(seed, x0, y2), + ValCoord(seed, x1, y2), + ValCoord(seed, x2, y2), + ValCoord(seed, x3, y2), + xs + ), + CubicLerp( + ValCoord(seed, x0, y3), + ValCoord(seed, x1, y3), + ValCoord(seed, x2, y3), + ValCoord(seed, x3, y3), + xs + ), + ys + ) * + (1 / (1.5f * 1.5f)) + ); } - private float SingleValueCubic(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int x1 = FastFloor(x); int y1 = FastFloor(y); int z1 = FastFloor(z); - float xs = (float)(x - x1); - float ys = (float)(y - y1); - float zs = (float)(z - z1); + float xs = (float) (x - x1); + float ys = (float) (y - y1); + float zs = (float) (z - z1); x1 *= PrimeX; y1 *= PrimeY; @@ -1808,45 +4013,150 @@ private float SingleValueCubic(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ d int y3 = y1 + (PrimeY << 1); int z3 = z1 + (PrimeZ << 1); - - return CubicLerp( + return ( + CubicLerp( CubicLerp( - CubicLerp(ValCoord(seed, x0, y0, z0), ValCoord(seed, x1, y0, z0), ValCoord(seed, x2, y0, z0), ValCoord(seed, x3, y0, z0), xs), - CubicLerp(ValCoord(seed, x0, y1, z0), ValCoord(seed, x1, y1, z0), ValCoord(seed, x2, y1, z0), ValCoord(seed, x3, y1, z0), xs), - CubicLerp(ValCoord(seed, x0, y2, z0), ValCoord(seed, x1, y2, z0), ValCoord(seed, x2, y2, z0), ValCoord(seed, x3, y2, z0), xs), - CubicLerp(ValCoord(seed, x0, y3, z0), ValCoord(seed, x1, y3, z0), ValCoord(seed, x2, y3, z0), ValCoord(seed, x3, y3, z0), xs), - ys), + CubicLerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + ValCoord(seed, x2, y0, z0), + ValCoord(seed, x3, y0, z0), + xs + ), + CubicLerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + ValCoord(seed, x2, y1, z0), + ValCoord(seed, x3, y1, z0), + xs + ), + CubicLerp( + ValCoord(seed, x0, y2, z0), + ValCoord(seed, x1, y2, z0), + ValCoord(seed, x2, y2, z0), + ValCoord(seed, x3, y2, z0), + xs + ), + CubicLerp( + ValCoord(seed, x0, y3, z0), + ValCoord(seed, x1, y3, z0), + ValCoord(seed, x2, y3, z0), + ValCoord(seed, x3, y3, z0), + xs + ), + ys + ), CubicLerp( - CubicLerp(ValCoord(seed, x0, y0, z1), ValCoord(seed, x1, y0, z1), ValCoord(seed, x2, y0, z1), ValCoord(seed, x3, y0, z1), xs), - CubicLerp(ValCoord(seed, x0, y1, z1), ValCoord(seed, x1, y1, z1), ValCoord(seed, x2, y1, z1), ValCoord(seed, x3, y1, z1), xs), - CubicLerp(ValCoord(seed, x0, y2, z1), ValCoord(seed, x1, y2, z1), ValCoord(seed, x2, y2, z1), ValCoord(seed, x3, y2, z1), xs), - CubicLerp(ValCoord(seed, x0, y3, z1), ValCoord(seed, x1, y3, z1), ValCoord(seed, x2, y3, z1), ValCoord(seed, x3, y3, z1), xs), - ys), + CubicLerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + ValCoord(seed, x2, y0, z1), + ValCoord(seed, x3, y0, z1), + xs + ), + CubicLerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + ValCoord(seed, x2, y1, z1), + ValCoord(seed, x3, y1, z1), + xs + ), + CubicLerp( + ValCoord(seed, x0, y2, z1), + ValCoord(seed, x1, y2, z1), + ValCoord(seed, x2, y2, z1), + ValCoord(seed, x3, y2, z1), + xs + ), + CubicLerp( + ValCoord(seed, x0, y3, z1), + ValCoord(seed, x1, y3, z1), + ValCoord(seed, x2, y3, z1), + ValCoord(seed, x3, y3, z1), + xs + ), + ys + ), CubicLerp( - CubicLerp(ValCoord(seed, x0, y0, z2), ValCoord(seed, x1, y0, z2), ValCoord(seed, x2, y0, z2), ValCoord(seed, x3, y0, z2), xs), - CubicLerp(ValCoord(seed, x0, y1, z2), ValCoord(seed, x1, y1, z2), ValCoord(seed, x2, y1, z2), ValCoord(seed, x3, y1, z2), xs), - CubicLerp(ValCoord(seed, x0, y2, z2), ValCoord(seed, x1, y2, z2), ValCoord(seed, x2, y2, z2), ValCoord(seed, x3, y2, z2), xs), - CubicLerp(ValCoord(seed, x0, y3, z2), ValCoord(seed, x1, y3, z2), ValCoord(seed, x2, y3, z2), ValCoord(seed, x3, y3, z2), xs), - ys), + CubicLerp( + ValCoord(seed, x0, y0, z2), + ValCoord(seed, x1, y0, z2), + ValCoord(seed, x2, y0, z2), + ValCoord(seed, x3, y0, z2), + xs + ), + CubicLerp( + ValCoord(seed, x0, y1, z2), + ValCoord(seed, x1, y1, z2), + ValCoord(seed, x2, y1, z2), + ValCoord(seed, x3, y1, z2), + xs + ), + CubicLerp( + ValCoord(seed, x0, y2, z2), + ValCoord(seed, x1, y2, z2), + ValCoord(seed, x2, y2, z2), + ValCoord(seed, x3, y2, z2), + xs + ), + CubicLerp( + ValCoord(seed, x0, y3, z2), + ValCoord(seed, x1, y3, z2), + ValCoord(seed, x2, y3, z2), + ValCoord(seed, x3, y3, z2), + xs + ), + ys + ), CubicLerp( - CubicLerp(ValCoord(seed, x0, y0, z3), ValCoord(seed, x1, y0, z3), ValCoord(seed, x2, y0, z3), ValCoord(seed, x3, y0, z3), xs), - CubicLerp(ValCoord(seed, x0, y1, z3), ValCoord(seed, x1, y1, z3), ValCoord(seed, x2, y1, z3), ValCoord(seed, x3, y1, z3), xs), - CubicLerp(ValCoord(seed, x0, y2, z3), ValCoord(seed, x1, y2, z3), ValCoord(seed, x2, y2, z3), ValCoord(seed, x3, y2, z3), xs), - CubicLerp(ValCoord(seed, x0, y3, z3), ValCoord(seed, x1, y3, z3), ValCoord(seed, x2, y3, z3), ValCoord(seed, x3, y3, z3), xs), - ys), - zs) * (1 / (1.5f * 1.5f * 1.5f)); + CubicLerp( + ValCoord(seed, x0, y0, z3), + ValCoord(seed, x1, y0, z3), + ValCoord(seed, x2, y0, z3), + ValCoord(seed, x3, y0, z3), + xs + ), + CubicLerp( + ValCoord(seed, x0, y1, z3), + ValCoord(seed, x1, y1, z3), + ValCoord(seed, x2, y1, z3), + ValCoord(seed, x3, y1, z3), + xs + ), + CubicLerp( + ValCoord(seed, x0, y2, z3), + ValCoord(seed, x1, y2, z3), + ValCoord(seed, x2, y2, z3), + ValCoord(seed, x3, y2, z3), + xs + ), + CubicLerp( + ValCoord(seed, x0, y3, z3), + ValCoord(seed, x1, y3, z3), + ValCoord(seed, x2, y3, z3), + ValCoord(seed, x3, y3, z3), + xs + ), + ys + ), + zs + ) * + (1 / (1.5f * 1.5f * 1.5f)) + ); } - // Value Noise - private float SingleValue(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y + ) { int x0 = FastFloor(x); int y0 = FastFloor(y); - float xs = InterpHermite((float)(x - x0)); - float ys = InterpHermite((float)(y - y0)); + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); x0 *= PrimeX; y0 *= PrimeY; @@ -1859,15 +4169,19 @@ private float SingleValue(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double return Lerp(xf0, xf1, ys); } - private float SingleValue(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); - float xs = InterpHermite((float)(x - x0)); - float ys = InterpHermite((float)(y - y0)); - float zs = InterpHermite((float)(z - z0)); + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); + float zs = InterpHermite((float) (z - z0)); x0 *= PrimeX; y0 *= PrimeY; @@ -1876,10 +4190,26 @@ private float SingleValue(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double int y1 = y0 + PrimeY; int z1 = z0 + PrimeZ; - float xf00 = Lerp(ValCoord(seed, x0, y0, z0), ValCoord(seed, x1, y0, z0), xs); - float xf10 = Lerp(ValCoord(seed, x0, y1, z0), ValCoord(seed, x1, y1, z0), xs); - float xf01 = Lerp(ValCoord(seed, x0, y0, z1), ValCoord(seed, x1, y0, z1), xs); - float xf11 = Lerp(ValCoord(seed, x0, y1, z1), ValCoord(seed, x1, y1, z1), xs); + float xf00 = Lerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + xs + ); + float xf10 = Lerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + xs + ); + float xf01 = Lerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + xs + ); + float xf11 = Lerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + xs + ); float yf0 = Lerp(xf00, xf10, ys); float yf1 = Lerp(xf01, xf11, ys); @@ -1887,18 +4217,38 @@ private float SingleValue(int seed, /*FMLdouble*/ double x, /*FMLdouble*/ double return Lerp(yf0, yf1, zs); } - // Domain Warp - private void DoSingleDomainWarp(int seed, float amp, float freq, /*FMLdouble*/ double x, /*FMLdouble*/ double y, Vector2 coord) - { - switch (mDomainWarpType) - { + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord + ) { + switch (mDomainWarpType) { case OpenSimplex2: - SingleDomainWarpSimplexGradient(seed, amp * 38.283687591552734375f, freq, x, y, coord, false); + SingleDomainWarpSimplexGradient( + seed, + amp * 38.283687591552734375f, + freq, + x, + y, + coord, + false + ); break; case OpenSimplex2Reduced: - SingleDomainWarpSimplexGradient(seed, amp * 16.0f, freq, x, y, coord, true); + SingleDomainWarpSimplexGradient( + seed, + amp * 16.0f, + freq, + x, + y, + coord, + true + ); break; case BasicGrid: SingleDomainWarpBasicGrid(seed, amp, freq, x, y, coord); @@ -1906,15 +4256,39 @@ private void DoSingleDomainWarp(int seed, float amp, float freq, /*FMLdouble*/ d } } - private void DoSingleDomainWarp(int seed, float amp, float freq, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z, Vector3 coord) - { - switch (mDomainWarpType) - { + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord + ) { + switch (mDomainWarpType) { case OpenSimplex2: - SingleDomainWarpOpenSimplex2Gradient(seed, amp * 32.69428253173828125f, freq, x, y, z, coord, false); + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 32.69428253173828125f, + freq, + x, + y, + z, + coord, + false + ); break; case OpenSimplex2Reduced: - SingleDomainWarpOpenSimplex2Gradient(seed, amp * 7.71604938271605f, freq, x, y, z, coord, true); + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 7.71604938271605f, + freq, + x, + y, + z, + coord, + true + ); break; case BasicGrid: SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, coord); @@ -1922,28 +4296,27 @@ private void DoSingleDomainWarp(int seed, float amp, float freq, /*FMLdouble*/ d } } - // Domain Warp Single Wrapper - private void DomainWarpSingle(Vector2 coord) - { + private void DomainWarpSingle(Vector2 coord) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - switch (mDomainWarpType) - { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { case OpenSimplex2: case OpenSimplex2Reduced: - { - final /*FMLdouble*/ double SQRT3 = (/*FMLdouble*/ double)1.7320508075688772935274463415059; - final /*FMLdouble*/ double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/ double t = (xs + ys) * F2; - xs += t; ys += t; - } - break; + { + final /*FMLdouble*/double SQRT3 = + (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; default: break; } @@ -1951,45 +4324,47 @@ private void DomainWarpSingle(Vector2 coord) DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); } - private void DomainWarpSingle(Vector3 coord) - { + private void DomainWarpSingle(Vector3 coord) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - /*FMLdouble*/ double zs = coord.z; - switch (mWarpTransformType3D) - { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { case ImproveXYPlanes: - { - /*FMLdouble*/ double xy = xs + ys; - /*FMLdouble*/ double s2 = xy * -(/*FMLdouble*/ double)0.211324865405187; - zs *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = + xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; case ImproveXZPlanes: - { - /*FMLdouble*/ double xz = xs + zs; - /*FMLdouble*/ double s2 = xz * -(/*FMLdouble*/ double)0.211324865405187; - ys *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - ys; zs += s2 - ys; - ys += xz * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = + xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; case DefaultOpenSimplex2: - { - final /*FMLdouble*/ double R3 = (/*FMLdouble*/ double)(2.0 / 3.0); - /*FMLdouble*/ double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; + { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; default: break; } @@ -1997,30 +4372,28 @@ private void DomainWarpSingle(Vector3 coord) DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); } - // Domain Warp Fractal Progressive - private void DomainWarpFractalProgressive(Vector2 coord) - { + private void DomainWarpFractalProgressive(Vector2 coord) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - for (int i = 0; i < mOctaves; i++) - { - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - switch (mDomainWarpType) - { + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { case OpenSimplex2: case OpenSimplex2Reduced: - { - final /*FMLdouble*/ double SQRT3 = (/*FMLdouble*/ double)1.7320508075688772935274463415059; - final /*FMLdouble*/ double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/ double t = (xs + ys) * F2; - xs += t; ys += t; - } - break; + { + final /*FMLdouble*/double SQRT3 = + (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; default: break; } @@ -2033,47 +4406,48 @@ private void DomainWarpFractalProgressive(Vector2 coord) } } - private void DomainWarpFractalProgressive(Vector3 coord) - { + private void DomainWarpFractalProgressive(Vector3 coord) { int seed = mSeed; float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - for (int i = 0; i < mOctaves; i++) - { - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - /*FMLdouble*/ double zs = coord.z; - switch (mWarpTransformType3D) - { + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { case ImproveXYPlanes: - { - /*FMLdouble*/ double xy = xs + ys; - /*FMLdouble*/ double s2 = xy * -(/*FMLdouble*/ double)0.211324865405187; - zs *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = + xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; case ImproveXZPlanes: - { - /*FMLdouble*/ double xz = xs + zs; - /*FMLdouble*/ double s2 = xz * -(/*FMLdouble*/ double)0.211324865405187; - ys *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - ys; zs += s2 - ys; - ys += xz * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = + xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; case DefaultOpenSimplex2: - { - final /*FMLdouble*/ double R3 = (/*FMLdouble*/ double)(2.0 / 3.0); - /*FMLdouble*/ double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; + { + final /*FMLdouble*/double R3 = + (/*FMLdouble*/double) (2.0 / 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; default: break; } @@ -2086,23 +4460,22 @@ private void DomainWarpFractalProgressive(Vector3 coord) } } - // Domain Warp Fractal Independant - private void DomainWarpFractalIndependent(Vector2 coord) - { - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - switch (mDomainWarpType) - { + private void DomainWarpFractalIndependent(Vector2 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { case OpenSimplex2: case OpenSimplex2Reduced: - { - final /*FMLdouble*/ double SQRT3 = (/*FMLdouble*/ double)1.7320508075688772935274463415059; - final /*FMLdouble*/ double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/ double t = (xs + ys) * F2; - xs += t; ys += t; - } - break; + { + final /*FMLdouble*/double SQRT3 = + (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; default: break; } @@ -2111,8 +4484,7 @@ private void DomainWarpFractalIndependent(Vector2 coord) float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); seed++; @@ -2121,41 +4493,43 @@ private void DomainWarpFractalIndependent(Vector2 coord) } } - private void DomainWarpFractalIndependent(Vector3 coord) - { - /*FMLdouble*/ double xs = coord.x; - /*FMLdouble*/ double ys = coord.y; - /*FMLdouble*/ double zs = coord.z; - switch (mWarpTransformType3D) - { + private void DomainWarpFractalIndependent(Vector3 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { case ImproveXYPlanes: - { - /*FMLdouble*/ double xy = xs + ys; - /*FMLdouble*/ double s2 = xy * -(/*FMLdouble*/ double)0.211324865405187; - zs *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = + xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; case ImproveXZPlanes: - { - /*FMLdouble*/ double xz = xs + zs; - /*FMLdouble*/ double s2 = xz * -(/*FMLdouble*/ double)0.211324865405187; - ys *= (/*FMLdouble*/ double)0.577350269189626; - xs += s2 - ys; zs += s2 - ys; - ys += xz * (/*FMLdouble*/ double)0.577350269189626; - } - break; + { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = + xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; case DefaultOpenSimplex2: - { - final /*FMLdouble*/ double R3 = (/*FMLdouble*/ double)(2.0 / 3.0); - /*FMLdouble*/ double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; + { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; default: break; } @@ -2164,8 +4538,7 @@ private void DomainWarpFractalIndependent(Vector3 coord) float amp = mDomainWarpAmp * mFractalBounding; float freq = mFrequency; - for (int i = 0; i < mOctaves; i++) - { + for (int i = 0; i < mOctaves; i++) { DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); seed++; @@ -2174,19 +4547,24 @@ private void DomainWarpFractalIndependent(Vector3 coord) } } - // Domain Warp Basic Grid - private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, /*FMLdouble*/ double x, /*FMLdouble*/ double y, Vector2 coord) - { - /*FMLdouble*/ double xf = x * frequency; - /*FMLdouble*/ double yf = y * frequency; + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord + ) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; int x0 = FastFloor(xf); int y0 = FastFloor(yf); - float xs = InterpHermite((float)(xf - x0)); - float ys = InterpHermite((float)(yf - y0)); + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); x0 *= PrimeX; y0 *= PrimeY; @@ -2209,19 +4587,26 @@ private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, coord.y += Lerp(ly0x, ly1x, ys) * warpAmp; } - private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z, Vector3 coord) - { - /*FMLdouble*/ double xf = x * frequency; - /*FMLdouble*/ double yf = y * frequency; - /*FMLdouble*/ double zf = z * frequency; + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord + ) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; + /*FMLdouble*/double zf = z * frequency; int x0 = FastFloor(xf); int y0 = FastFloor(yf); int z0 = FastFloor(zf); - float xs = InterpHermite((float)(xf - x0)); - float ys = InterpHermite((float)(yf - y0)); - float zs = InterpHermite((float)(zf - z0)); + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); + float zs = InterpHermite((float) (zf - z0)); x0 *= PrimeX; y0 *= PrimeY; @@ -2267,10 +4652,16 @@ private void SingleDomainWarpBasicGrid(int seed, float warpAmp, float frequency, coord.z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; } - // Domain Warp Simplex/OpenSimplex2 - private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float frequency, /*FMLdouble*/ double x, /*FMLdouble*/ double y, Vector2 coord, boolean outGradOnly) - { + private void SingleDomainWarpSimplexGradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord, + boolean outGradOnly + ) { final float SQRT3 = 1.7320508075688772935274463415059f; final float G2 = (3 - SQRT3) / 6; @@ -2286,12 +4677,12 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq int i = FastFloor(x); int j = FastFloor(y); - float xi = (float)(x - i); - float yi = (float)(y - j); + float xi = (float) (x - i); + float yi = (float) (y - j); float t = (xi + yi) * G2; - float x0 = (float)(xi - t); - float y0 = (float)(yi - t); + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); i *= PrimeX; j *= PrimeY; @@ -2300,18 +4691,14 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq vx = vy = 0; float a = 0.5f - x0 * x0 - y0 * y0; - if (a > 0) - { + if (a > 0) { float aaaa = (a * a) * (a * a); float xo, yo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i, j) & (255 << 1); xo = RandVecs2D[hash]; yo = RandVecs2D[hash | 1]; - } - else - { + } else { int hash = Hash(seed, i, j); int index1 = hash & (127 << 1); int index2 = (hash >> 7) & (255 << 1); @@ -2327,21 +4714,19 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq vy += aaaa * yo; } - float c = (float)(2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + ((float)(-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c > 0) - { - float x2 = x0 + (2 * (float)G2 - 1); - float y2 = y0 + (2 * (float)G2 - 1); + float c = + (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c > 0) { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); float cccc = (c * c) * (c * c); float xo, yo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i + PrimeX, j + PrimeY) & (255 << 1); xo = RandVecs2D[hash]; yo = RandVecs2D[hash | 1]; - } - else - { + } else { int hash = Hash(seed, i + PrimeX, j + PrimeY); int index1 = hash & (127 << 1); int index2 = (hash >> 7) & (255 << 1); @@ -2357,23 +4742,18 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq vy += cccc * yo; } - if (y0 > x0) - { - float x1 = x0 + (float)G2; - float y1 = y0 + ((float)G2 - 1); + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) - { + if (b > 0) { float bbbb = (b * b) * (b * b); float xo, yo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i, j + PrimeY) & (255 << 1); xo = RandVecs2D[hash]; yo = RandVecs2D[hash | 1]; - } - else - { + } else { int hash = Hash(seed, i, j + PrimeY); int index1 = hash & (127 << 1); int index2 = (hash >> 7) & (255 << 1); @@ -2388,24 +4768,18 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq vx += bbbb * xo; vy += bbbb * yo; } - } - else - { - float x1 = x0 + ((float)G2 - 1); - float y1 = y0 + (float)G2; + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) - { + if (b > 0) { float bbbb = (b * b) * (b * b); float xo, yo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i + PrimeX, j) & (255 << 1); xo = RandVecs2D[hash]; yo = RandVecs2D[hash | 1]; - } - else - { + } else { int hash = Hash(seed, i + PrimeX, j); int index1 = hash & (127 << 1); int index2 = (hash >> 7) & (255 << 1); @@ -2426,8 +4800,16 @@ private void SingleDomainWarpSimplexGradient(int seed, float warpAmp, float freq coord.y += vy * warpAmp; } - private void SingleDomainWarpOpenSimplex2Gradient(int seed, float warpAmp, float frequency, /*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z, Vector3 coord, boolean outGradOnly) - { + private void SingleDomainWarpOpenSimplex2Gradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord, + boolean outGradOnly + ) { x *= frequency; y *= frequency; z *= frequency; @@ -2442,13 +4824,13 @@ private void SingleDomainWarpOpenSimplex2Gradient(int seed, float warpAmp, float int i = FastRound(x); int j = FastRound(y); int k = FastRound(z); - float x0 = (float)x - i; - float y0 = (float)y - j; - float z0 = (float)z - k; + float x0 = (float) x - i; + float y0 = (float) y - j; + float z0 = (float) z - k; - int xNSign = (int)(-x0 - 1.0f) | 1; - int yNSign = (int)(-y0 - 1.0f) | 1; - int zNSign = (int)(-z0 - 1.0f) | 1; + int xNSign = (int) (-x0 - 1.0f) | 1; + int yNSign = (int) (-y0 - 1.0f) | 1; + int zNSign = (int) (-z0 - 1.0f) | 1; float ax0 = xNSign * -x0; float ay0 = yNSign * -y0; @@ -2462,21 +4844,16 @@ private void SingleDomainWarpOpenSimplex2Gradient(int seed, float warpAmp, float vx = vy = vz = 0; float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - for (int l = 0; ; l++) - { - if (a > 0) - { + for (int l = 0;; l++) { + if (a > 0) { float aaaa = (a * a) * (a * a); float xo, yo, zo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i, j, k) & (255 << 2); xo = RandVecs3D[hash]; yo = RandVecs3D[hash | 1]; zo = RandVecs3D[hash | 2]; - } - else - { + } else { int hash = Hash(seed, i, j, k); int index1 = hash & (63 << 2); int index2 = (hash >> 6) & (255 << 2); @@ -2504,39 +4881,30 @@ private void SingleDomainWarpOpenSimplex2Gradient(int seed, float warpAmp, float float y1 = y0; float z1 = z0; - if (ax0 >= ay0 && ax0 >= az0) - { + if (ax0 >= ay0 && ax0 >= az0) { x1 += xNSign; b = b + ax0 + ax0; i1 -= xNSign * PrimeX; - } - else if (ay0 > ax0 && ay0 >= az0) - { + } else if (ay0 > ax0 && ay0 >= az0) { y1 += yNSign; b = b + ay0 + ay0; j1 -= yNSign * PrimeY; - } - else - { + } else { z1 += zNSign; b = b + az0 + az0; k1 -= zNSign * PrimeZ; } - if (b > 1) - { + if (b > 1) { b -= 1; float bbbb = (b * b) * (b * b); float xo, yo, zo; - if (outGradOnly) - { + if (outGradOnly) { int hash = Hash(seed, i1, j1, k1) & (255 << 2); xo = RandVecs3D[hash]; yo = RandVecs3D[hash | 1]; zo = RandVecs3D[hash | 2]; - } - else - { + } else { int hash = Hash(seed, i1, j1, k1); int index1 = hash & (63 << 2); int index2 = (hash >> 6) & (255 << 2); @@ -2584,24 +4952,28 @@ else if (ay0 > ax0 && ay0 >= az0) coord.z += vz * warpAmp; } - public static class Vector2 - { - public /*FMLdouble*/ double x; - public /*FMLdouble*/ double y; - public Vector2(/*FMLdouble*/ double x, /*FMLdouble*/ double y) - { + public static class Vector2 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + + public Vector2(/*FMLdouble*/double x, /*FMLdouble*/double y) { this.x = x; this.y = y; } } - public static class Vector3 - { - public /*FMLdouble*/ double x; - public /*FMLdouble*/ double y; - public /*FMLdouble*/ double z; - public Vector3(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ double z) - { + public static class Vector3 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + public /*FMLdouble*/double z; + + public Vector3( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z + ) { this.x = x; this.y = y; this.z = z; @@ -2611,13 +4983,16 @@ public Vector3(/*FMLdouble*/ double x, /*FMLdouble*/ double y, /*FMLdouble*/ dou public static FastNoiseLite createSpongePerlin(int seed) { FastNoiseLite fnlNoise = new FastNoiseLite(seed); fnlNoise.SetNoiseType(FastNoiseLite.NoiseType.Perlin); // We will use 3D with a domain rotation to improve the look. - fnlNoise.SetRotationType3D(FastNoiseLite.RotationType3D.ImproveXZPlanes); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. + fnlNoise.SetRotationType3D( + FastNoiseLite.RotationType3D.ImproveXZPlanes + ); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. fnlNoise.SetFractalType(FastNoiseLite.FractalType.FBm); fnlNoise.SetFractalOctaves(6); return fnlNoise; } - private static final double SPONGE_COMPATIBILITY_RATIO = 2 * Math.sqrt(3.0) / 1.7252359327388492; + private static final double SPONGE_COMPATIBILITY_RATIO = + (2 * Math.sqrt(3.0)) / 1.7252359327388492; public static float getSpongePerlinValue(float noise3) { noise3 = noise3 * 0.5f + 0.5f; // Rescale to 0 to 1 to match new Sponge @@ -2625,4 +5000,4 @@ public static float getSpongePerlinValue(float noise3) { noise3 *= SPONGE_COMPATIBILITY_RATIO; // Now make it match old Sponge. return noise3; } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java index 38413d2b..c6d07b04 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java @@ -1,6 +1,7 @@ package com.thevortex.allthemodium.worldgen.features; import com.thevortex.allthemodium.worldgen.ATMConfiguredFeature; +import javax.annotation.Nonnull; import net.minecraft.core.Holder; import net.minecraft.util.RandomSource; import net.minecraft.world.level.block.grower.AbstractTreeGrower; @@ -8,16 +9,20 @@ import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; import org.jetbrains.annotations.Nullable; -import java.util.Random; - public class SoulTreeGrower extends AbstractTreeGrower { @Nullable @Override - protected Holder> getConfiguredFeature(RandomSource random, boolean bool) { + protected Holder< + ConfiguredFeature + > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { int temp = random.nextInt(10); - if(temp == 1) { return ATMConfiguredFeature.SOUL_TREE_GIANT; } - if(temp > 6) { return ATMConfiguredFeature.SOUL_TREE; } + if (temp == 1) { + return ATMConfiguredFeature.SOUL_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.SOUL_TREE; + } return ATMConfiguredFeature.SOUL_TREE_MEDIUM; } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java index 6705c1a5..ef5bd162 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java @@ -3,46 +3,53 @@ import com.mojang.serialization.Codec; import com.thevortex.allthemodium.registry.BlockRegistry; import com.thevortex.allthemodium.registry.ModRegistry; -import com.thevortex.allthemodium.worldgen.biomes.ATMBiomes; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.util.RandomSource; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.RandomState; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; -import java.util.Random; - public class Volcano extends Feature { FastNoiseLite fnlPerlin = null; - BlockPos lastpos = new BlockPos(0, 0, 0); + BlockPos lastPos = new BlockPos(0, 0, 0); public Volcano(Codec codec) { super(codec); } @Override - public boolean place(FeaturePlaceContext p_159749_) { - return place(p_159749_.level(),p_159749_.chunkGenerator(),p_159749_.random(),p_159749_.origin(),FeatureConfiguration.NONE); - + public boolean place( + @Nonnull FeaturePlaceContext p_159749_ + ) { + return place( + p_159749_.level(), + p_159749_.chunkGenerator(), + p_159749_.random(), + p_159749_.origin(), + FeatureConfiguration.NONE + ); } - - private boolean place(WorldGenLevel world, ChunkGenerator generator, RandomSource rand, BlockPos pos, FeatureConfiguration config) { - + private boolean place( + WorldGenLevel world, + ChunkGenerator generator, + RandomSource rand, + BlockPos pos, + FeatureConfiguration config + ) { setSeed(world.getSeed()); - int landHeight = generator.getSpawnHeight(world.getChunk(pos).getHeightAccessorForGeneration()); + int landHeight = generator.getSpawnHeight( + world.getChunk(pos).getHeightAccessorForGeneration() + ); if (rand.nextFloat() < 0.0005F) { - /* - pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); + // pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); - */ - pos = new BlockPos(pos.getX(),landHeight, pos.getZ()); + pos = new BlockPos(pos.getX(), landHeight, pos.getZ()); BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); double baseRadius = 16; @@ -53,23 +60,53 @@ private boolean place(WorldGenLevel world, ChunkGenerator generator, RandomSourc for (double x = -volcanoConeSize; x <= volcanoConeSize; x++) { for (double y = -volcanoConeSize; y <= -15; y++) { - for (double z = -volcanoConeSize; z <= volcanoConeSize; z++) { - mutable.set(pos).move((int) x, (int) y + volcanoStartHeight, (int) z); - float noise3 = FastNoiseLite.getSpongePerlinValue(fnlPerlin.GetNoise(mutable.getX(), mutable.getZ())); - - double scaledNoise = (noise3 / 11) * (-(y * baseRadius) / ((x * x) + (z * z))); + for ( + double z = -volcanoConeSize; + z <= volcanoConeSize; + z++ + ) { + mutable + .set(pos) + .move( + (int) x, + (int) y + volcanoStartHeight, + (int) z + ); + float noise3 = FastNoiseLite.getSpongePerlinValue( + fnlPerlin.GetNoise(mutable.getX(), mutable.getZ()) + ); + + double scaledNoise = + (noise3 / 11) * + (-(y * baseRadius) / ((x * x) + (z * z))); if (scaledNoise - lavaLeakage >= threshold) { - if (mutable.getY() <= pos.getY() + (volcanoStartHeight - 19)) { - world.setBlock(mutable, BlockRegistry.SOULLAVA_BLOCK.get().defaultBlockState(), 2); - + if ( + mutable.getY() <= + pos.getY() + (volcanoStartHeight - 19) + ) { + world.setBlock( + mutable, + BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState(), + 2 + ); } } else if (scaledNoise >= threshold) { - world.setBlock(mutable, rand.nextBoolean() ? Blocks.BASALT.defaultBlockState() : ModRegistry.ANCIENT_STONE.get().defaultBlockState(), 2); + world.setBlock( + mutable, + rand.nextBoolean() + ? Blocks.BASALT.defaultBlockState() + : ModRegistry.ANCIENT_STONE + .get() + .defaultBlockState(), + 2 + ); } } } } - } + } return true; } @@ -80,4 +117,4 @@ public void setSeed(long seed) { fnlPerlin.SetFrequency(0.2F); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java index 069c4e7b..61f7b768 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java @@ -5,13 +5,13 @@ public class VolcanoConfig implements FeatureConfiguration { - public static final Codec CODEC; - public static final VolcanoConfig INSTANCE = new VolcanoConfig(); - - static { - CODEC = Codec.unit(() -> { - return INSTANCE; - }); - } + public static final Codec CODEC; + public static final VolcanoConfig INSTANCE = new VolcanoConfig(); + static { + CODEC = + Codec.unit(() -> { + return INSTANCE; + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java index 35285b0e..69cbcf96 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java @@ -1,45 +1,54 @@ package com.thevortex.allthemodium.worldgen.structures; -import com.google.common.collect.ImmutableList; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Optional; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobCategory; import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.biome.MobSpawnSettings; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.WorldGenerationContext; import net.minecraft.world.level.levelgen.heightproviders.HeightProvider; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.Structure; import net.minecraft.world.level.levelgen.structure.StructureType; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; -import net.minecraftforge.common.util.Lazy; - -import java.util.List; -import java.util.Optional; public class APStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder.mapCodec(instance -> - instance.group(APStructure.settingsCodec(instance), - StructureTemplatePool.CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool), - ResourceLocation.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName), - Codec.intRange(0, 30).fieldOf("size").forGetter(structure -> structure.size), - HeightProvider.CODEC.fieldOf("start_height").forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC.optionalFieldOf("project_start_to_heightmap").forGetter(structure -> structure.projectStartToHeightmap), - Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter) - ).apply(instance, APStructure::new)).codec(); + + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> + instance + .group( + APStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> + structure.projectStartToHeightmap + ), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter) + ) + .apply(instance, APStructure::new) + ) + .codec(); private final Holder startPool; private final Optional startJigsawName; private final int size; @@ -47,14 +56,15 @@ public class APStructure extends Structure { private final Optional projectStartToHeightmap; private final int maxDistanceFromCenter; - public APStructure(Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) - { + public APStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter + ) { super(config); this.startPool = startPool; this.startJigsawName = startJigsawName; @@ -65,81 +75,112 @@ public APStructure(Structure.StructureSettings config, } /* - * This is where extra checks can be done to determine if the structure can spawn here. - * This only needs to be overridden if you're adding additional spawn conditions. + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. * * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are passed in - * which allows you to spawn structures only at certain coordinates in the world. + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. * - * Basically, this method is used for determining if the land is at a suitable height, - * if certain other structures are too close or not, or some other restrictive condition. + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. * - * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. - * (Bedrock Edition seems to not have the same check) + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) * - * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. - * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. - * Then loop through it and look for land with air above it and set blockpos's Y value to it. - * Make sure to set the final boolean in JigsawPlacement.addPieces to false so - * that the structure spawns at blockpos's y value instead of placing the structure on the Bedrock roof! + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! * - * Also, please for the love of god, do not do dimension checking here. - * If you do and another mod's dimension is trying to spawn your structure, - * the locate command will make minecraft hang forever and break the game. - * Use the biome tags for where to spawn the structure and users can datapack - * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. */ - private static boolean extraSpawningChecks(Structure.GenerationContext context) { + private static boolean extraSpawningChecks( + Structure.GenerationContext context + ) { // Grabs the chunk position we are at - ChunkPos chunkpos = context.chunkPos(); + ChunkPos chunkPos = context.chunkPos(); // Checks to make sure our structure does not spawn above land that's higher than y = 150 // to demonstrate how this method is good for checking extra conditions for spawning - return context.chunkGenerator().getFirstOccupiedHeight( - chunkpos.getMinBlockX(), - chunkpos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 150; + return ( + context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState() + ) < + 150 + ); } @Override - public Optional findGenerationPoint(Structure.GenerationContext context) { - + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context + ) { // Check if the spot is valid for our structure. This is just as another method for cleanness. // Returning an empty optional tells the game to skip this spot as it will not generate the structure. if (!APStructure.extraSpawningChecks(context)) { return Optional.empty(); } - // Set's our spawning blockpos's y offset to be 60 blocks up. + // Set's our spawning block pos's y offset to be 60 blocks up. // Since we are going to have heightmap/terrain height spawning set to true further down, this will make it so we spawn 60 blocks above terrain. // If we wanted to spawn on ocean floor, we would set heightmap/terrain height spawning to false and the grab the y value of the terrain with OCEAN_FLOOR_WG heightmap. - int startY = this.startHeight.sample(context.random(), new WorldGenerationContext(context.chunkGenerator(), context.heightAccessor())); + int startY = + this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor() + ) + ); - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner + // of that chunk) ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos(chunkPos.getMinBlockX(), startY, chunkPos.getMinBlockZ()); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ() + ); Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in blockpos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter + ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. /* - * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure - * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. - * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. */ // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. @@ -150,4 +191,4 @@ public Optional findGenerationPoint(Structure.Generati public StructureType type() { return ATMStructures.ANCIENT_PYRAMID.get(); } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java index 1da7ed86..ec6aae90 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java @@ -4,17 +4,32 @@ import net.minecraft.core.Registry; import net.minecraft.world.level.levelgen.structure.StructureType; import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ATMStructures { - public static final DeferredRegister> STRUCTURES = DeferredRegister.create(Registry.STRUCTURE_TYPE_REGISTRY, Reference.MOD_ID); - - -public static final RegistryObject> ANCIENT_PYRAMID = STRUCTURES.register("ancient_pyramid", () -> () -> APStructure.CODEC); - public static final RegistryObject> PIGLIN_VILLAGE = STRUCTURES.register("piglin_village", () -> () -> PVStructure.CODEC); - public static final RegistryObject> ANCIENT_DUNGEON = STRUCTURES.register("dungeon", () -> () -> DungeonStructure.CODEC); - + public static final DeferredRegister> STRUCTURES = + DeferredRegister.create( + Registry.STRUCTURE_TYPE_REGISTRY, + Reference.MOD_ID + ); + public static final RegistryObject< + StructureType + > ANCIENT_PYRAMID = STRUCTURES.register( + "ancient_pyramid", + () -> () -> APStructure.CODEC + ); + public static final RegistryObject< + StructureType + > PIGLIN_VILLAGE = STRUCTURES.register( + "piglin_village", + () -> () -> PVStructure.CODEC + ); + public static final RegistryObject< + StructureType + > ANCIENT_DUNGEON = STRUCTURES.register( + "dungeon", + () -> () -> DungeonStructure.CODEC + ); } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java index 82d6309c..b6158ed9 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java @@ -1,47 +1,54 @@ package com.thevortex.allthemodium.worldgen.structures; -import com.google.common.collect.ImmutableList; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.thevortex.allthemodium.AllTheModium; -import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Optional; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; -import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobCategory; import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.biome.MobSpawnSettings; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.WorldGenerationContext; import net.minecraft.world.level.levelgen.heightproviders.HeightProvider; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.Structure; import net.minecraft.world.level.levelgen.structure.StructureType; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; -import java.util.List; -import java.util.Optional; - public class DungeonStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder.mapCodec(instance -> - instance.group(DungeonStructure.settingsCodec(instance), - StructureTemplatePool.CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool), - ResourceLocation.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName), - Codec.intRange(0, 30).fieldOf("size").forGetter(structure -> structure.size), - HeightProvider.CODEC.fieldOf("start_height").forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC.optionalFieldOf("project_start_to_heightmap").forGetter(structure -> structure.projectStartToHeightmap), - Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter) - ).apply(instance, DungeonStructure::new)).codec(); + + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> + instance + .group( + DungeonStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> + structure.projectStartToHeightmap + ), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter) + ) + .apply(instance, DungeonStructure::new) + ) + .codec(); private final Holder startPool; private final Optional startJigsawName; private final int size; @@ -49,14 +56,15 @@ public class DungeonStructure extends Structure { private final Optional projectStartToHeightmap; private final int maxDistanceFromCenter; - public DungeonStructure(Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) - { + public DungeonStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter + ) { super(config); this.startPool = startPool; this.startJigsawName = startJigsawName; @@ -67,74 +75,106 @@ public DungeonStructure(Structure.StructureSettings config, } /* - * This is where extra checks can be done to determine if the structure can spawn here. - * This only needs to be overridden if you're adding additional spawn conditions. + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. * * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are passed in - * which allows you to spawn structures only at certain coordinates in the world. + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. * - * Basically, this method is used for determining if the land is at a suitable height, - * if certain other structures are too close or not, or some other restrictive condition. + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. * - * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. - * (Bedrock Edition seems to not have the same check) + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) * - * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. - * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. - * Then loop through it and look for land with air above it and set blockpos's Y value to it. - * Make sure to set the final boolean in JigsawPlacement.addPieces to false so - * that the structure spawns at blockpos's y value instead of placing the structure on the Bedrock roof! + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! * - * Also, please for the love of god, do not do dimension checking here. - * If you do and another mod's dimension is trying to spawn your structure, - * the locate command will make minecraft hang forever and break the game. - * Use the biome tags for where to spawn the structure and users can datapack - * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. */ - private static boolean extraSpawningChecks(Structure.GenerationContext context) { + private static boolean extraSpawningChecks( + Structure.GenerationContext context + ) { // Grabs the chunk position we are at - ChunkPos chunkpos = context.chunkPos(); + ChunkPos chunkPos = context.chunkPos(); // Checks to make sure our structure does not spawn above land that's higher than y = 150 // to demonstrate how this method is good for checking extra conditions for spawning - return context.chunkGenerator().getFirstFreeHeight( - chunkpos.getMinBlockX(), - chunkpos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 150; + return ( + context + .chunkGenerator() + .getFirstFreeHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState() + ) < + 150 + ); } + @Override - public Optional findGenerationPoint(Structure.GenerationContext context) { + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context + ) { if (!DungeonStructure.extraSpawningChecks(context)) { return Optional.empty(); } - int startY = this.startHeight.sample(context.random(), new WorldGenerationContext(context.chunkGenerator(), context.heightAccessor())); + int startY = + this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor() + ) + ); // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos(chunkPos.getMinBlockX(), startY, chunkPos.getMinBlockZ()); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ() + ); Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in blockpos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter + ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. /* - * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure - * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. - * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. */ // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. @@ -145,4 +185,4 @@ public Optional findGenerationPoint(Structure.Generati public StructureType type() { return ATMStructures.ANCIENT_DUNGEON.get(); } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java index 5fdd696e..2a8bef26 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java @@ -1,51 +1,53 @@ package com.thevortex.allthemodium.worldgen.structures; -import com.google.common.collect.ImmutableList; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.thevortex.allthemodium.reference.Reference; -import com.thevortex.allthemodium.registry.ModRegistry; +import java.util.Optional; +import javax.annotation.Nonnull; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; -import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobCategory; import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.biome.MobSpawnSettings; -import net.minecraft.world.level.block.AirBlock; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.WorldGenerationContext; import net.minecraft.world.level.levelgen.heightproviders.HeightProvider; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.Structure; import net.minecraft.world.level.levelgen.structure.StructureType; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; -import net.minecraftforge.common.util.Lazy; - -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; public class PVStructure extends Structure { - - public static final Codec CODEC = RecordCodecBuilder.mapCodec(instance -> - instance.group(PVStructure.settingsCodec(instance), - StructureTemplatePool.CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool), - ResourceLocation.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName), - Codec.intRange(0, 30).fieldOf("size").forGetter(structure -> structure.size), - HeightProvider.CODEC.fieldOf("start_height").forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC.optionalFieldOf("project_start_to_heightmap").forGetter(structure -> structure.projectStartToHeightmap), - Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter) - ).apply(instance, PVStructure::new)).codec(); + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> + instance + .group( + PVStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> + structure.projectStartToHeightmap + ), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter) + ) + .apply(instance, PVStructure::new) + ) + .codec(); private final Holder startPool; private final Optional startJigsawName; private final int size; @@ -53,14 +55,15 @@ public class PVStructure extends Structure { private final Optional projectStartToHeightmap; private final int maxDistanceFromCenter; - public PVStructure(Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) - { + public PVStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter + ) { super(config); this.startPool = startPool; this.startJigsawName = startJigsawName; @@ -86,9 +89,9 @@ public PVStructure(Structure.StructureSettings config, * * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. - * Then loop through it and look for land with air above it and set blockpos's Y value to it. + * Then loop through it and look for land with air above it and set block pos's Y value to it. * Make sure to set the final boolean in JigsawPlacement.addPieces to false so - * that the structure spawns at blockpos's y value instead of placing the structure on the Bedrock roof! + * that the structure spawns at block pos's y value instead of placing the structure on the Bedrock roof! * * Also, please for the love of god, do not do dimension checking here. * If you do and another mod's dimension is trying to spawn your structure, @@ -96,47 +99,60 @@ public PVStructure(Structure.StructureSettings config, * Use the biome tags for where to spawn the structure and users can datapack * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. */ - private static boolean extraSpawningChecks(Structure.GenerationContext context) { + private static boolean extraSpawningChecks( + Structure.GenerationContext context + ) { // Grabs the chunk position we are at - ChunkPos chunkpos = context.chunkPos(); + ChunkPos chunkPos = context.chunkPos(); // Checks to make sure our structure does not spawn above land that's higher than y = 150 // to demonstrate how this method is good for checking extra conditions for spawning - return context.chunkGenerator().getFirstOccupiedHeight( - chunkpos.getMinBlockX(), - chunkpos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 100; + return ( + context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState() + ) < + 100 + ); } @Override - public Optional findGenerationPoint(Structure.GenerationContext context) { - + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context + ) { // Check if the spot is valid for our structure. This is just as another method for cleanness. // Returning an empty optional tells the game to skip this spot as it will not generate the structure. if (!PVStructure.extraSpawningChecks(context)) { return Optional.empty(); } - int startY = this.startHeight.sample(context.random(), new WorldGenerationContext(context.chunkGenerator(), context.heightAccessor())); // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos(chunkPos.getMinBlockX(), 0, chunkPos.getMinBlockZ()); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + 0, + chunkPos.getMinBlockZ() + ); Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in blockpos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in blockpos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter + ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. /* * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure @@ -152,4 +168,4 @@ public Optional findGenerationPoint(Structure.Generati public StructureType type() { return ATMStructures.PIGLIN_VILLAGE.get(); } -} \ No newline at end of file +} diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java index fe598459..14a2d25b 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java @@ -11,9 +11,23 @@ import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; public class VillagePieces { - public static final Holder START = Pools.register(new StructureTemplatePool(new ResourceLocation(Reference.MOD_ID , "village/start_pool"), new ResourceLocation(Reference.MOD_ID , "village/start_pool"), ImmutableList.of(Pair.of(StructurePoolElement.legacy(Reference.MOD_ID + ":illager_keep", ProcessorLists.EMPTY), 1)), StructureTemplatePool.Projection.RIGID)); - public static void bootstrap() { + public static final Holder START = Pools.register( + new StructureTemplatePool( + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + ImmutableList.of( + Pair.of( + StructurePoolElement.legacy( + Reference.MOD_ID + ":illager_keep", + ProcessorLists.EMPTY + ), + 1 + ) + ), + StructureTemplatePool.Projection.RIGID + ) + ); - } + public static void bootstrap() {} } From 0b4077bd31bbb592e2396853dd18de4daa85bdf9 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:26:57 -0600 Subject: [PATCH 13/17] Switched to using the eclipse formatter --- build.gradle | 3 +- eclipse-formatter.xml | 315 + .../thevortex/allthemodium/AllTheModium.java | 251 +- .../allthemodium/blocks/ACaveVines.java | 80 +- .../blocks/AllthemodiumBlock.java | 28 +- .../allthemodium/blocks/AllthemodiumOre.java | 194 +- .../allthemodium/blocks/AncientBookShelf.java | 21 +- .../allthemodium/blocks/AncientCaveVines.java | 175 +- .../blocks/AncientCaveVinesPlant.java | 145 +- .../allthemodium/blocks/AncientDirt.java | 25 +- .../blocks/AncientFenceBlock.java | 355 +- .../allthemodium/blocks/AncientGrass.java | 53 +- .../allthemodium/blocks/AncientHerb.java | 54 +- .../allthemodium/blocks/AncientLeaves.java | 361 +- .../blocks/AncientLeavesBottom.java | 335 +- .../allthemodium/blocks/AncientLog.java | 6 +- .../blocks/AncientSaplingBlock.java | 243 +- .../allthemodium/blocks/DemonicLeaves.java | 403 +- .../blocks/DemonicLeavesBottom.java | 335 +- .../thevortex/allthemodium/blocks/RawATM.java | 3 +- .../thevortex/allthemodium/blocks/RawUNO.java | 3 +- .../thevortex/allthemodium/blocks/RawVIB.java | 3 +- .../allthemodium/blocks/SoulLava.java | 383 +- .../allthemodium/blocks/SoulLeaves.java | 405 +- .../allthemodium/blocks/SoulLeavesBottom.java | 335 +- .../allthemodium/blocks/TeleportPad.java | 574 +- .../allthemodium/blocks/UAAlloyBlock.java | 28 +- .../allthemodium/blocks/UVAlloyBlock.java | 28 +- .../allthemodium/blocks/UnobtainiumBlock.java | 28 +- .../allthemodium/blocks/UnobtainiumOre.java | 110 +- .../allthemodium/blocks/VAAlloyBlock.java | 28 +- .../allthemodium/blocks/VibraniumBlock.java | 28 +- .../allthemodium/blocks/VibraniumOre.java | 110 +- .../config/AllthemodiumServerConfigs.java | 81 +- .../crafting/ATMCraftingSetup.java | 23 +- .../crafting/ATMRecipeSerializer.java | 66 +- .../crafting/ATMShapedRecipe.java | 203 +- .../crafting/ATMShapelessRecipe.java | 137 +- .../ATMShapelessRecipeSerializer.java | 80 +- .../crafting/IATMShapedRecipe.java | 7 +- .../crafting/IATMShapelessRecipe.java | 7 +- .../allthemodium/datagen/DataGenerators.java | 58 +- .../allthemodium/datagen/RecipeException.java | 6 +- .../datagen/builder/ShapedAncientStones.java | 404 +- .../datagen/builder/ShapedArmorBuilder.java | 222 +- .../datagen/builder/ShapedBlockBuilder.java | 232 +- .../datagen/builder/ShapedIngotBuilder.java | 132 +- .../datagen/client/BlockStates.java | 555 +- .../datagen/client/ItemModels.java | 514 +- .../datagen/server/BlastingRecipes.java | 179 +- .../datagen/server/BlockTags.java | 861 +- .../datagen/server/CraftingRecipes.java | 626 +- .../datagen/server/FluidTags.java | 37 +- .../allthemodium/datagen/server/ItemTags.java | 502 +- .../datagen/server/LootTables.java | 260 +- .../datagen/server/ShapelessCrafting.java | 565 +- .../datagen/server/SmeltingRecipes.java | 179 +- .../allthemodium/entity/PiglichEntity.java | 844 +- .../allthemodium/entity/PiglichModel.java | 709 +- .../allthemodium/entity/PiglichModelOld.java | 393 +- .../allthemodium/entity/PiglichRenderer.java | 61 +- .../entity/shulkers/atm/ATMShulkerEntity.java | 29 +- .../entity/shulkers/atm/ATMShulkerModel.java | 153 +- .../shulkers/atm/ATMShulkerRenderer.java | 70 +- .../shulkers/unob/UNOBShulkerEntity.java | 29 +- .../shulkers/unob/UNOBShulkerModel.java | 153 +- .../shulkers/unob/UNOBShulkerRenderer.java | 73 +- .../entity/shulkers/vib/VIBShulkerEntity.java | 29 +- .../entity/shulkers/vib/VIBShulkerModel.java | 153 +- .../shulkers/vib/VIBShulkerRenderer.java | 70 +- .../allthemodium/events/ArmorEvents.java | 99 +- .../allthemodium/events/BlockBreak.java | 90 +- .../allthemodium/events/ClientEvents.java | 218 +- .../allthemodium/events/PlayerHarvest.java | 36 +- .../allthemodium/fluid/FluidATM.java | 335 +- .../allthemodium/fluid/FluidSoulLava.java | 335 +- .../allthemodium/fluid/FluidUNOB.java | 335 +- .../allthemodium/fluid/FluidVIB.java | 335 +- .../thevortex/allthemodium/init/ModFoods.java | 49 +- .../allthemodium/items/AlloyDust.java | 6 +- .../allthemodium/items/AlloyIngot.java | 6 +- .../allthemodium/items/AllthemodiumApple.java | 82 +- .../allthemodium/items/AllthemodiumBlock.java | 6 +- .../items/AllthemodiumCarrot.java | 82 +- .../items/AllthemodiumOreItem.java | 58 +- .../thevortex/allthemodium/items/Clump.java | 6 +- .../thevortex/allthemodium/items/Crystal.java | 6 +- .../allthemodium/items/DirtyDust.java | 6 +- .../thevortex/allthemodium/items/Dust.java | 6 +- .../thevortex/allthemodium/items/Gear.java | 6 +- .../thevortex/allthemodium/items/Ingot.java | 6 +- .../thevortex/allthemodium/items/Nugget.java | 6 +- .../allthemodium/items/PiglichHeart.java | 6 +- .../thevortex/allthemodium/items/Plate.java | 6 +- .../thevortex/allthemodium/items/RawOre.java | 6 +- .../com/thevortex/allthemodium/items/Rod.java | 6 +- .../thevortex/allthemodium/items/Shard.java | 6 +- .../allthemodium/items/SoulBerries.java | 47 +- .../allthemodium/items/SoulBucket.java | 27 +- .../allthemodium/items/TeleportPad.java | 6 +- .../allthemodium/items/UnobtainiumBlock.java | 6 +- .../items/UnobtainiumOreItem.java | 58 +- .../allthemodium/items/VibraniumBlock.java | 6 +- .../items/Vibranium_Ore_Item.java | 56 +- .../toolitems/armor/AllthemodiumBoots.java | 45 +- .../armor/AllthemodiumChestplate.java | 37 +- .../toolitems/armor/AllthemodiumHelmet.java | 59 +- .../toolitems/armor/AllthemodiumLeggings.java | 37 +- .../armor/models/AllthemodiumHelmetModel.java | 301 +- .../items/toolitems/tools/AlloyAxe.java | 105 +- .../items/toolitems/tools/AlloyPaxel.java | 561 +- .../items/toolitems/tools/AlloyPick.java | 114 +- .../items/toolitems/tools/AlloyShovel.java | 114 +- .../items/toolitems/tools/AlloySword.java | 80 +- .../allthemodium/material/AArmorMaterial.java | 143 +- .../allthemodium/material/ToolTiers.java | 64 +- .../allthemodium/mixins/MixinConnector.java | 14 +- .../allthemodium/reference/Reference.java | 169 +- .../allthemodium/registry/BlockRegistry.java | 106 +- .../registry/FluidInteractionsRegistry.java | 57 +- .../allthemodium/registry/FluidRegistry.java | 39 +- .../registry/FluidTypeRegistry.java | 167 +- .../allthemodium/registry/ItemRegistry.java | 218 +- .../allthemodium/registry/LevelRegistry.java | 14 +- .../allthemodium/registry/MekRegistry.java | 44 +- .../allthemodium/registry/ModRegistry.java | 4186 +++---- .../allthemodium/registry/TagRegistry.java | 574 +- .../registry/client/OtherSky.java | 95 +- .../registry/client/SkyRegistry.java | 48 +- .../registry/resource/ATMResource.java | 104 +- .../registry/resource/ATMSlurries.java | 20 +- .../registry/resource/EnumFunc.java | 2 +- .../registry/resource/MoltenATMType.java | 182 +- .../registry/resource/MoltenUNOBType.java | 182 +- .../registry/resource/MoltenVIBType.java | 182 +- .../registry/resource/SoulLavaType.java | 182 +- .../worldgen/ATMConfiguredFeature.java | 635 +- .../worldgen/ATMPlacedFeature.java | 382 +- .../worldgen/ATOtherPlacedFeatures.java | 191 +- .../worldgen/MiningDimSource.java | 55 +- .../worldgen/TheOtherDimSource.java | 60 +- .../worldgen/biomes/ATMBiomes.java | 751 +- .../worldgen/features/AncientTreeGrower.java | 27 +- .../worldgen/features/DemonicTreeGrower.java | 27 +- .../worldgen/features/FastNoiseLite.java | 9685 ++++++++--------- .../worldgen/features/SoulTreeGrower.java | 27 +- .../worldgen/features/Volcano.java | 170 +- .../worldgen/features/VolcanoConfig.java | 15 +- .../worldgen/structures/APStructure.java | 308 +- .../worldgen/structures/ATMStructures.java | 35 +- .../worldgen/structures/DungeonStructure.java | 296 +- .../worldgen/structures/PVStructure.java | 269 +- .../worldgen/structures/VillagePieces.java | 30 +- 153 files changed, 17622 insertions(+), 20086 deletions(-) create mode 100644 eclipse-formatter.xml diff --git a/build.gradle b/build.gradle index 1d367448..ddc6a26c 100644 --- a/build.gradle +++ b/build.gradle @@ -189,8 +189,7 @@ spotless { setEncoding('utf-8') } java { - prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0']) - .config(['parser': 'java', 'tabWidth': 4, 'plugins': ['prettier-plugin-java']]) + eclipse().configFile('eclipse-formatter.xml') } json { target 'resources/**/*.json' diff --git a/eclipse-formatter.xml b/eclipse-formatter.xml new file mode 100644 index 00000000..ecc327e3 --- /dev/null +++ b/eclipse-formatter.xml @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index 99b40326..21effacf 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -35,139 +35,124 @@ // The value here should match an entry in the META-INF/mods.toml file @Mod("allthemodium") -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - bus = Mod.EventBusSubscriber.Bus.MOD -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class AllTheModium { - public static final ResourceKey OverWorld = Level.OVERWORLD; - public static final ResourceKey Nether = Level.NETHER; - public static final ResourceKey The_End = Level.END; - public static final ResourceLocation MINING_DIM_ID = new ResourceLocation( - MOD_ID, - "mining" - ); - public static final ResourceLocation THE_OTHER_DIM_ID = - new ResourceLocation(MOD_ID, "the_other"); - public static final ResourceKey THE_OTHER = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - THE_OTHER_DIM_ID - ); - // public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); - // public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); - // public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); - public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - public static boolean ALLOW_TELEPORT_MINING = true; - public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { - public ItemStack makeIcon() { - return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - } - }; - - public AllTheModium() { - // Register the setup method for mod loading - - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); - - FluidTypeRegistry.FLUID_TYPES.register(modEventBus); - FluidRegistry.FLUIDS.register(modEventBus); - BlockRegistry.BLOCKS.register(modEventBus); - ModRegistry.BLOCKS.register(modEventBus); - ModRegistry.SHAPED_BLOCKS.register(modEventBus); - ModRegistry.STAIR_BLOCKS.register(modEventBus); - ModRegistry.SLAB_BLOCKS.register(modEventBus); - ModRegistry.WALL_BLOCKS.register(modEventBus); - ModRegistry.PILLAR_BLOCKS.register(modEventBus); - - ItemRegistry.ITEMS.register(modEventBus); - ModRegistry.ITEMS.register(modEventBus); - ModRegistry.ENTITIES.register(modEventBus); - - ModRegistry.CARVERS.register(modEventBus); - ModRegistry.BIOMES.register(modEventBus); - ATMCraftingSetup.REGISTRY.register(modEventBus); - ATMStructures.STRUCTURES.register(modEventBus); - ModRegistry.FEATURES.register(modEventBus); - - modEventBus.register(ModRegistry.class); - modEventBus.addListener(this::setup); - - GeckoLib.initialize(); - - // load configs - ModLoadingContext - .get() - .registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); - - if (ModList.get().isLoaded("mekanism")) { - ATMSlurries.SLURRIES.register(modEventBus); - } - - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); - - // Register ourselves for server and other game events we are interested in - MinecraftForge.EVENT_BUS.register(this); - MinecraftForge.EVENT_BUS.register(BlockBreak.class); - MinecraftForge.EVENT_BUS.register(ArmorEvents.class); - } - - public void setup(final FMLCommonSetupEvent event) { - event.enqueueWork(() -> { - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG.get(), - ModRegistry.SOUL_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_0.get(), - ModRegistry.SOUL_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_1.get(), - ModRegistry.SOUL_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_2.get(), - ModRegistry.SOUL_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.DEMONIC_LOG.get(), - ModRegistry.DEMONIC_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_0.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_1.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get() - ); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_2.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get() - ); - // ATMConfiguredStructures.registerConfiguredStructures(); - Registry.register( - Registry.CHUNK_GENERATOR, - MINING_DIM_ID, - MiningDimSource.CODEC - ); - Registry.register( - Registry.CHUNK_GENERATOR, - THE_OTHER_DIM_ID, - TheOtherDimSource.CODEC - ); - if (ModList.get().isLoaded("allthetweaks")) { - if (5 == Configuration.COMMON.mainmode.get()) { - ALLOW_TELEPORT_MINING = false; - } - } - }); - } - - public void setupClient(final FMLClientSetupEvent event) { - event.enqueueWork(() -> {}); - } + public static final ResourceKey OverWorld = Level.OVERWORLD; + public static final ResourceKey Nether = Level.NETHER; + public static final ResourceKey The_End = Level.END; + public static final ResourceLocation MINING_DIM_ID = new ResourceLocation( + MOD_ID, + "mining"); + public static final ResourceLocation THE_OTHER_DIM_ID = new ResourceLocation(MOD_ID, "the_other"); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID); + // public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); + // public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); + // public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + public static boolean ALLOW_TELEPORT_MINING = true; + public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { + public ItemStack makeIcon() { + return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + } + }; + + public AllTheModium() { + // Register the setup method for mod loading + + IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); + + FluidTypeRegistry.FLUID_TYPES.register(modEventBus); + FluidRegistry.FLUIDS.register(modEventBus); + BlockRegistry.BLOCKS.register(modEventBus); + ModRegistry.BLOCKS.register(modEventBus); + ModRegistry.SHAPED_BLOCKS.register(modEventBus); + ModRegistry.STAIR_BLOCKS.register(modEventBus); + ModRegistry.SLAB_BLOCKS.register(modEventBus); + ModRegistry.WALL_BLOCKS.register(modEventBus); + ModRegistry.PILLAR_BLOCKS.register(modEventBus); + + ItemRegistry.ITEMS.register(modEventBus); + ModRegistry.ITEMS.register(modEventBus); + ModRegistry.ENTITIES.register(modEventBus); + + ModRegistry.CARVERS.register(modEventBus); + ModRegistry.BIOMES.register(modEventBus); + ATMCraftingSetup.REGISTRY.register(modEventBus); + ATMStructures.STRUCTURES.register(modEventBus); + ModRegistry.FEATURES.register(modEventBus); + + modEventBus.register(ModRegistry.class); + modEventBus.addListener(this::setup); + + GeckoLib.initialize(); + + // load configs + ModLoadingContext + .get() + .registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); + + if (ModList.get().isLoaded("mekanism")) { + ATMSlurries.SLURRIES.register(modEventBus); + } + + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); + + // Register ourselves for server and other game events we are interested in + MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(BlockBreak.class); + MinecraftForge.EVENT_BUS.register(ArmorEvents.class); + } + + public void setup(final FMLCommonSetupEvent event) { + event.enqueueWork(() -> { + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_0.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_1.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_2.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.DEMONIC_LOG.get(), + ModRegistry.DEMONIC_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_0.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_1.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_2.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + // ATMConfiguredStructures.registerConfiguredStructures(); + Registry.register( + Registry.CHUNK_GENERATOR, + MINING_DIM_ID, + MiningDimSource.CODEC); + Registry.register( + Registry.CHUNK_GENERATOR, + THE_OTHER_DIM_ID, + TheOtherDimSource.CODEC); + if (ModList.get().isLoaded("allthetweaks")) { + if (5 == Configuration.COMMON.mainmode.get()) { + ALLOW_TELEPORT_MINING = false; + } + } + }); + } + + public void setupClient(final FMLClientSetupEvent event) { + event.enqueueWork(() -> { + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java index a34d60ae..f2331b4d 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java @@ -18,49 +18,45 @@ import net.minecraft.world.phys.shapes.VoxelShape; public interface ACaveVines extends CaveVines { - VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); - BooleanProperty BERRIES = BlockStateProperties.BERRIES; + VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); + BooleanProperty BERRIES = BlockStateProperties.BERRIES; - static InteractionResult use( - BlockState p_152954_, - Level p_152955_, - BlockPos p_152956_ - ) { - if (p_152954_.getValue(BERRIES)) { - Block.popResource( - p_152955_, - p_152956_, - new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1) - ); - float f = Mth.randomBetween(p_152955_.random, 0.8F, 1.2F); - p_152955_.playSound( - (Player) null, - p_152956_, - SoundEvents.CAVE_VINES_PICK_BERRIES, - SoundSource.BLOCKS, - 1.0F, - f - ); - p_152955_.setBlock( - p_152956_, - p_152954_.setValue(BERRIES, Boolean.valueOf(false)), - 2 - ); - return InteractionResult.sidedSuccess(p_152955_.isClientSide); - } else { - return InteractionResult.PASS; - } - } + static InteractionResult use( + BlockState p_152954_, + Level p_152955_, + BlockPos p_152956_) { + if (p_152954_.getValue(BERRIES)) { + Block.popResource( + p_152955_, + p_152956_, + new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1)); + float f = Mth.randomBetween(p_152955_.random, 0.8F, 1.2F); + p_152955_.playSound( + (Player) null, + p_152956_, + SoundEvents.CAVE_VINES_PICK_BERRIES, + SoundSource.BLOCKS, + 1.0F, + f); + p_152955_.setBlock( + p_152956_, + p_152954_.setValue(BERRIES, Boolean.valueOf(false)), + 2); + return InteractionResult.sidedSuccess(p_152955_.isClientSide); + } else { + return InteractionResult.PASS; + } + } - static boolean hasGlowBerries(BlockState p_152952_) { - return p_152952_.hasProperty(BERRIES) && p_152952_.getValue(BERRIES); - } + static boolean hasGlowBerries(BlockState p_152952_) { + return p_152952_.hasProperty(BERRIES) && p_152952_.getValue(BERRIES); + } - static ToIntFunction emission(int p_181218_) { - return p_181216_ -> { - return p_181216_.getValue(BlockStateProperties.BERRIES) - ? p_181218_ - : 0; - }; - } + static ToIntFunction emission(int p_181218_) { + return p_181216_ -> { + return p_181216_.getValue(BlockStateProperties.BERRIES) + ? p_181218_ + : 0; + }; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java index 247bdb1c..b24c7290 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java @@ -13,20 +13,18 @@ public class AllthemodiumBlock extends Block { - public AllthemodiumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) - ); - } + public AllthemodiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java index 518beaf9..8aade7f7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java @@ -22,117 +22,105 @@ public class AllthemodiumOre extends RedStoneOreBlock { - // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; - public AllthemodiumOre() { // func_235861_h_ = setRequiresTool - super( - BlockBehaviour.Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.ANCIENT_DEBRIS) - .lightLevel(state -> { - return 15; - }) - .strength(80.0f, 1500.0f) - ); - } + // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; + public AllthemodiumOre() { // func_235861_h_ = setRequiresTool + super( + BlockBehaviour.Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.ANCIENT_DEBRIS) + .lightLevel(state -> { + return 15; + }) + .strength(80.0f, 1500.0f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos - ) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if ( - AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() - ) return super.getDestroyProgress(state, player, getter, blockPos); + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player - ) - ? 250 - : 1500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 250 + : 1500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player - ) { - if ( - (player instanceof FakePlayer) && - (state.is(TagRegistry.ALLTHEMODIUM_ORE)) - ) { - return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { + return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); + } - return ( - super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F) - ); - } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2) - ); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } - @OnlyIn(Dist.CLIENT) - private static void activate( - BlockState p_196500_0_, - Level worldIn, - BlockPos p_196500_2_ - ) { - spawnParticles(worldIn, p_196500_2_); - } + @OnlyIn(Dist.CLIENT) + private static void activate( + BlockState p_196500_0_, + Level worldIn, + BlockPos p_196500_2_) { + spawnParticles(worldIn, p_196500_2_); + } - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick( - @Nonnull BlockState stateIn, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - spawnParticles(worldIn, pos); - } + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + spawnParticles(worldIn, pos); + } - @SuppressWarnings("unused") // TODO Remove unused suppression - @OnlyIn(Dist.CLIENT) - private static void spawnParticles(Level world, BlockPos worldIn) { - RandomSource random = world.random; + @SuppressWarnings("unused") // TODO Remove unused suppression + @OnlyIn(Dist.CLIENT) + private static void spawnParticles(Level world, BlockPos worldIn) { + RandomSource random = world.random; - for (Direction direction : Direction.values()) { - BlockPos blockPos = worldIn.offset(direction.getNormal()); - if (!world.getBlockState(blockPos).isSolidRender(world, blockPos)) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X - ? 0.5D + 0.5625D * (double) direction.getStepX() - : (double) random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y - ? 0.5D + 0.5625D * (double) direction.getStepY() - : (double) random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z - ? 0.5D + 0.5625D * (double) direction.getStepZ() - : (double) random.nextFloat(); - // TODO spawn particles - } - } - } + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if (!world.getBlockState(blockPos).isSolidRender(world, blockPos)) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + // TODO spawn particles + } + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java index 8bbcb514..aaf43db7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java @@ -7,16 +7,15 @@ public class AncientBookShelf extends RotatedPillarBlock { - public AncientBookShelf(Properties p_49795_) { - super(p_49795_); - } + public AncientBookShelf(Properties p_49795_) { + super(p_49795_); + } - @Override - public float getEnchantPowerBonus( - BlockState state, - LevelReader world, - BlockPos pos - ) { - return 2.0f; - } + @Override + public float getEnchantPowerBonus( + BlockState state, + LevelReader world, + BlockPos pos) { + return 2.0f; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java index dde5e207..e1a7b469 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java @@ -19,111 +19,98 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class AncientCaveVines - extends GrowingPlantHeadBlock - implements ACaveVines { + extends GrowingPlantHeadBlock + implements ACaveVines { - // private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; + // private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; - public AncientCaveVines( - Properties p_53928_, - Direction p_53929_, - VoxelShape p_53930_, - boolean p_53931_, - double p_53932_ - ) { - super(p_53928_, Direction.DOWN, SHAPE, false, 0.1D); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(AGE, Integer.valueOf(0)) - .setValue(BERRIES, Boolean.valueOf(false)) - ); - } + public AncientCaveVines( + Properties p_53928_, + Direction p_53929_, + VoxelShape p_53930_, + boolean p_53931_, + double p_53932_) { + super(p_53928_, Direction.DOWN, SHAPE, false, 0.1D); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(AGE, Integer.valueOf(0)) + .setValue(BERRIES, Boolean.valueOf(false))); + } - protected int getBlocksToGrowWhenBonemealed( - @Nonnull RandomSource p_152995_ - ) { - return 1; - } + protected int getBlocksToGrowWhenBonemealed( + @Nonnull RandomSource p_152995_) { + return 1; + } - protected boolean canGrowInto(@Nonnull BlockState p_152998_) { - return p_152998_.isAir(); - } + protected boolean canGrowInto(@Nonnull BlockState p_152998_) { + return p_152998_.isAir(); + } - protected BlockState updateBodyAfterConvertedFromHead( - @Nonnull BlockState p_152987_, - @Nonnull BlockState p_152988_ - ) { - return p_152988_.setValue(BERRIES, Boolean.FALSE); - } + protected BlockState updateBodyAfterConvertedFromHead( + @Nonnull BlockState p_152987_, + @Nonnull BlockState p_152988_) { + return p_152988_.setValue(BERRIES, Boolean.FALSE); + } - protected BlockState getGrowIntoState( - @Nonnull BlockState p_152990_, - @Nonnull RandomSource p_152991_ - ) { - return super - .getGrowIntoState(p_152990_, p_152991_) - .setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); - } + protected BlockState getGrowIntoState( + @Nonnull BlockState p_152990_, + @Nonnull RandomSource p_152991_) { + return super.getGrowIntoState(p_152990_, p_152991_) + .setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); + } - public ItemStack getCloneItemStack( - @Nonnull BlockGetter p_152966_, - @Nonnull BlockPos p_152967_, - @Nonnull BlockState p_152968_ - ) { - return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_.get()); - } + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_152966_, + @Nonnull BlockPos p_152967_, + @Nonnull BlockState p_152968_) { + return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_.get()); + } - public InteractionResult use( - @Nonnull BlockState p_152980_, - @Nonnull Level p_152981_, - @Nonnull BlockPos p_152982_, - @Nonnull Player p_152983_, - @Nonnull InteractionHand p_152984_, - @Nonnull BlockHitResult p_152985_ - ) { - return ACaveVines.use(p_152980_, p_152981_, p_152982_); - } + public InteractionResult use( + @Nonnull BlockState p_152980_, + @Nonnull Level p_152981_, + @Nonnull BlockPos p_152982_, + @Nonnull Player p_152983_, + @Nonnull InteractionHand p_152984_, + @Nonnull BlockHitResult p_152985_) { + return ACaveVines.use(p_152980_, p_152981_, p_152982_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_152993_ - ) { - super.createBlockStateDefinition(p_152993_); - p_152993_.add(BERRIES); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_152993_) { + super.createBlockStateDefinition(p_152993_); + p_152993_.add(BERRIES); + } - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_152970_, - @Nonnull BlockPos p_152971_, - @Nonnull BlockState p_152972_, - boolean p_152973_ - ) { - return !p_152972_.getValue(BERRIES); - } + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_152970_, + @Nonnull BlockPos p_152971_, + @Nonnull BlockState p_152972_, + boolean p_152973_) { + return !p_152972_.getValue(BERRIES); + } - public boolean isBonemealSuccess( - @Nonnull Level p_152975_, - @Nonnull RandomSource p_152976_, - @Nonnull BlockPos p_152977_, - @Nonnull BlockState p_152978_ - ) { - return true; - } + public boolean isBonemealSuccess( + @Nonnull Level p_152975_, + @Nonnull RandomSource p_152976_, + @Nonnull BlockPos p_152977_, + @Nonnull BlockState p_152978_) { + return true; + } - public void performBonemeal( - @Nonnull ServerLevel p_152961_, - @Nonnull RandomSource p_152962_, - @Nonnull BlockPos p_152963_, - @Nonnull BlockState p_152964_ - ) { - p_152961_.setBlock( - p_152963_, - p_152964_.setValue(BERRIES, Boolean.valueOf(true)), - 2 - ); - } + public void performBonemeal( + @Nonnull ServerLevel p_152961_, + @Nonnull RandomSource p_152962_, + @Nonnull BlockPos p_152963_, + @Nonnull BlockState p_152964_) { + p_152961_.setBlock( + p_152963_, + p_152964_.setValue(BERRIES, Boolean.valueOf(true)), + 2); + } - @Override - protected GrowingPlantBodyBlock getBodyBlock() { - return ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(); - } + @Override + protected GrowingPlantBodyBlock getBodyBlock() { + return ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java index 01174492..7963aba7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java @@ -19,90 +19,81 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class AncientCaveVinesPlant - extends GrowingPlantBodyBlock - implements ACaveVines { + extends GrowingPlantBodyBlock + implements ACaveVines { - public AncientCaveVinesPlant( - Properties p_53886_, - Direction p_53887_, - VoxelShape p_53888_, - boolean p_53889_ - ) { - super(p_53886_, Direction.DOWN, SHAPE, false); - } + public AncientCaveVinesPlant( + Properties p_53886_, + Direction p_53887_, + VoxelShape p_53888_, + boolean p_53889_) { + super(p_53886_, Direction.DOWN, SHAPE, false); + } - @Override - protected BlockState updateHeadAfterConvertedFromBody( - @Nonnull BlockState p_153028_, - @Nonnull BlockState p_153029_ - ) { - return p_153029_.setValue(BERRIES, Boolean.FALSE); - } + @Override + protected BlockState updateHeadAfterConvertedFromBody( + @Nonnull BlockState p_153028_, + @Nonnull BlockState p_153029_) { + return p_153029_.setValue(BERRIES, Boolean.FALSE); + } - @Override - public ItemStack getCloneItemStack( - @Nonnull BlockGetter p_153007_, - @Nonnull BlockPos p_153008_, - @Nonnull BlockState p_153009_ - ) { - return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); - } + @Override + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_153007_, + @Nonnull BlockPos p_153008_, + @Nonnull BlockState p_153009_) { + return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); + } - @Override - public InteractionResult use( - @Nonnull BlockState p_153021_, - @Nonnull Level p_153022_, - @Nonnull BlockPos p_153023_, - @Nonnull Player p_153024_, - @Nonnull InteractionHand p_153025_, - @Nonnull BlockHitResult p_153026_ - ) { - return ACaveVines.use(p_153021_, p_153022_, p_153023_); - } + @Override + public InteractionResult use( + @Nonnull BlockState p_153021_, + @Nonnull Level p_153022_, + @Nonnull BlockPos p_153023_, + @Nonnull Player p_153024_, + @Nonnull InteractionHand p_153025_, + @Nonnull BlockHitResult p_153026_) { + return ACaveVines.use(p_153021_, p_153022_, p_153023_); + } - @Override - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_153031_ - ) { - p_153031_.add(BERRIES); - } + @Override + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_153031_) { + p_153031_.add(BERRIES); + } - @Override - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_153011_, - @Nonnull BlockPos p_153012_, - @Nonnull BlockState p_153013_, - boolean p_153014_ - ) { - return !p_153013_.getValue(BERRIES); - } + @Override + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_153011_, + @Nonnull BlockPos p_153012_, + @Nonnull BlockState p_153013_, + boolean p_153014_) { + return !p_153013_.getValue(BERRIES); + } - @Override - public boolean isBonemealSuccess( - @Nonnull Level p_153016_, - @Nonnull RandomSource p_153017_, - @Nonnull BlockPos p_153018_, - @Nonnull BlockState p_153019_ - ) { - return true; - } + @Override + public boolean isBonemealSuccess( + @Nonnull Level p_153016_, + @Nonnull RandomSource p_153017_, + @Nonnull BlockPos p_153018_, + @Nonnull BlockState p_153019_) { + return true; + } - @Override - public void performBonemeal( - @Nonnull ServerLevel p_153002_, - @Nonnull RandomSource p_153003_, - @Nonnull BlockPos p_153004_, - @Nonnull BlockState p_153005_ - ) { - p_153002_.setBlock( - p_153004_, - p_153005_.setValue(BERRIES, Boolean.valueOf(true)), - 2 - ); - } + @Override + public void performBonemeal( + @Nonnull ServerLevel p_153002_, + @Nonnull RandomSource p_153003_, + @Nonnull BlockPos p_153004_, + @Nonnull BlockState p_153005_) { + p_153002_.setBlock( + p_153004_, + p_153005_.setValue(BERRIES, Boolean.valueOf(true)), + 2); + } - @Override - protected GrowingPlantHeadBlock getHeadBlock() { - return ModRegistry.ANCIENT_CAVEVINES_.get(); - } + @Override + protected GrowingPlantHeadBlock getHeadBlock() { + return ModRegistry.ANCIENT_CAVEVINES_.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java index 86f6e7ad..02d1caaa 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java @@ -9,18 +9,17 @@ public class AncientDirt extends Block { - public AncientDirt(Properties p_49795_) { - super(p_49795_); - } + public AncientDirt(Properties p_49795_) { + super(p_49795_); + } - @Override - public boolean canSustainPlant( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction facing, - IPlantable plantable - ) { - return true; - } + @Override + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java index ffefa013..ccb48e8e 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java @@ -28,212 +28,173 @@ public class AncientFenceBlock extends FenceBlock { - private final VoxelShape[] occlusionByIndex; + private final VoxelShape[] occlusionByIndex; - public AncientFenceBlock(Properties props) { - super(props); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(NORTH, Boolean.valueOf(false)) - .setValue(EAST, Boolean.valueOf(false)) - .setValue(SOUTH, Boolean.valueOf(false)) - .setValue(WEST, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - this.occlusionByIndex = this.makeShapes(2.0F, 1.0F, 16.0F, 6.0F, 15.0F); - } + public AncientFenceBlock(Properties props) { + super(props); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(NORTH, Boolean.valueOf(false)) + .setValue(EAST, Boolean.valueOf(false)) + .setValue(SOUTH, Boolean.valueOf(false)) + .setValue(WEST, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + this.occlusionByIndex = this.makeShapes(2.0F, 1.0F, 16.0F, 6.0F, 15.0F); + } - public VoxelShape getOcclusionShape( - @Nonnull BlockState p_53338_, - @Nonnull BlockGetter p_53339_, - @Nonnull BlockPos p_53340_ - ) { - return this.occlusionByIndex[this.getAABBIndex(p_53338_)]; - } + public VoxelShape getOcclusionShape( + @Nonnull BlockState p_53338_, + @Nonnull BlockGetter p_53339_, + @Nonnull BlockPos p_53340_) { + return this.occlusionByIndex[this.getAABBIndex(p_53338_)]; + } - public VoxelShape getVisualShape( - @Nonnull BlockState p_53311_, - @Nonnull BlockGetter p_53312_, - @Nonnull BlockPos p_53313_, - @Nonnull CollisionContext p_53314_ - ) { - return this.getShape(p_53311_, p_53312_, p_53313_, p_53314_); - } + public VoxelShape getVisualShape( + @Nonnull BlockState p_53311_, + @Nonnull BlockGetter p_53312_, + @Nonnull BlockPos p_53313_, + @Nonnull CollisionContext p_53314_) { + return this.getShape(p_53311_, p_53312_, p_53313_, p_53314_); + } - public boolean isPathfindable( - @Nonnull BlockState p_53306_, - @Nonnull BlockGetter p_53307_, - @Nonnull BlockPos p_53308_, - @Nonnull PathComputationType p_53309_ - ) { - return false; - } + public boolean isPathfindable( + @Nonnull BlockState p_53306_, + @Nonnull BlockGetter p_53307_, + @Nonnull BlockPos p_53308_, + @Nonnull PathComputationType p_53309_) { + return false; + } - public boolean connectsTo( - @Nonnull BlockState p_53330_, - boolean p_53331_, - @Nonnull Direction p_53332_ - ) { - Block block = p_53330_.getBlock(); - boolean flag = this.isSameFence(p_53330_); - boolean flag1 = - block instanceof FenceGateBlock && - FenceGateBlock.connectsToDirection(p_53330_, p_53332_); - return ( - (!isExceptionForConnection(p_53330_) && p_53331_) || flag || flag1 - ); - } + public boolean connectsTo( + @Nonnull BlockState p_53330_, + boolean p_53331_, + @Nonnull Direction p_53332_) { + Block block = p_53330_.getBlock(); + boolean flag = this.isSameFence(p_53330_); + boolean flag1 = block instanceof FenceGateBlock && + FenceGateBlock.connectsToDirection(p_53330_, p_53332_); + return ((!isExceptionForConnection(p_53330_) && p_53331_) || flag || flag1); + } - private boolean isSameFence(BlockState p_153255_) { - return ( - p_153255_.is(BlockTags.FENCES) && - p_153255_.is(BlockTags.WOODEN_FENCES) == - this.defaultBlockState().is(BlockTags.WOODEN_FENCES) - ); - } + private boolean isSameFence(BlockState p_153255_) { + return (p_153255_.is(BlockTags.FENCES) && + p_153255_.is(BlockTags.WOODEN_FENCES) == this.defaultBlockState().is(BlockTags.WOODEN_FENCES)); + } - public InteractionResult use( - @Nonnull BlockState p_53316_, - @Nonnull Level p_53317_, - @Nonnull BlockPos p_53318_, - @Nonnull Player p_53319_, - @Nonnull InteractionHand p_53320_, - @Nonnull BlockHitResult p_53321_ - ) { - if (p_53317_.isClientSide) { - ItemStack itemStack = p_53319_.getItemInHand(p_53320_); - return itemStack.is(Items.LEAD) - ? InteractionResult.SUCCESS - : InteractionResult.PASS; - } else { - return LeadItem.bindPlayerMobs(p_53319_, p_53317_, p_53318_); - } - } + public InteractionResult use( + @Nonnull BlockState p_53316_, + @Nonnull Level p_53317_, + @Nonnull BlockPos p_53318_, + @Nonnull Player p_53319_, + @Nonnull InteractionHand p_53320_, + @Nonnull BlockHitResult p_53321_) { + if (p_53317_.isClientSide) { + ItemStack itemStack = p_53319_.getItemInHand(p_53320_); + return itemStack.is(Items.LEAD) + ? InteractionResult.SUCCESS + : InteractionResult.PASS; + } else { + return LeadItem.bindPlayerMobs(p_53319_, p_53317_, p_53318_); + } + } - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_53304_ - ) { - BlockGetter blockGetter = p_53304_.getLevel(); - BlockPos blockPos = p_53304_.getClickedPos(); - FluidState fluidState = p_53304_ - .getLevel() - .getFluidState(p_53304_.getClickedPos()); - BlockPos blockPos1 = blockPos.north(); - BlockPos blockPos2 = blockPos.east(); - BlockPos blockPos3 = blockPos.south(); - BlockPos blockPos4 = blockPos.west(); - BlockState blockState = blockGetter.getBlockState(blockPos1); - BlockState blockState1 = blockGetter.getBlockState(blockPos2); - BlockState blockState2 = blockGetter.getBlockState(blockPos3); - BlockState blockState3 = blockGetter.getBlockState(blockPos4); - return super - .getStateForPlacement(p_53304_) - .setValue( - NORTH, - Boolean.valueOf( - this.connectsTo( - blockState, - blockState.isFaceSturdy( - blockGetter, - blockPos1, - Direction.SOUTH - ), - Direction.SOUTH - ) - ) - ) - .setValue( - EAST, - Boolean.valueOf( - this.connectsTo( - blockState1, - blockState1.isFaceSturdy( - blockGetter, - blockPos2, - Direction.WEST - ), - Direction.WEST - ) - ) - ) - .setValue( - SOUTH, - Boolean.valueOf( - this.connectsTo( - blockState2, - blockState2.isFaceSturdy( - blockGetter, - blockPos3, - Direction.NORTH - ), - Direction.NORTH - ) - ) - ) - .setValue( - WEST, - Boolean.valueOf( - this.connectsTo( - blockState3, - blockState3.isFaceSturdy( - blockGetter, - blockPos4, - Direction.EAST - ), - Direction.EAST - ) - ) - ) - .setValue( - WATERLOGGED, - Boolean.valueOf(fluidState.getType() == Fluids.WATER) - ); - } + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_53304_) { + BlockGetter blockGetter = p_53304_.getLevel(); + BlockPos blockPos = p_53304_.getClickedPos(); + FluidState fluidState = p_53304_ + .getLevel() + .getFluidState(p_53304_.getClickedPos()); + BlockPos blockPos1 = blockPos.north(); + BlockPos blockPos2 = blockPos.east(); + BlockPos blockPos3 = blockPos.south(); + BlockPos blockPos4 = blockPos.west(); + BlockState blockState = blockGetter.getBlockState(blockPos1); + BlockState blockState1 = blockGetter.getBlockState(blockPos2); + BlockState blockState2 = blockGetter.getBlockState(blockPos3); + BlockState blockState3 = blockGetter.getBlockState(blockPos4); + return super.getStateForPlacement(p_53304_) + .setValue( + NORTH, + Boolean.valueOf( + this.connectsTo( + blockState, + blockState.isFaceSturdy( + blockGetter, + blockPos1, + Direction.SOUTH), + Direction.SOUTH))) + .setValue( + EAST, + Boolean.valueOf( + this.connectsTo( + blockState1, + blockState1.isFaceSturdy( + blockGetter, + blockPos2, + Direction.WEST), + Direction.WEST))) + .setValue( + SOUTH, + Boolean.valueOf( + this.connectsTo( + blockState2, + blockState2.isFaceSturdy( + blockGetter, + blockPos3, + Direction.NORTH), + Direction.NORTH))) + .setValue( + WEST, + Boolean.valueOf( + this.connectsTo( + blockState3, + blockState3.isFaceSturdy( + blockGetter, + blockPos4, + Direction.EAST), + Direction.EAST))) + .setValue( + WATERLOGGED, + Boolean.valueOf(fluidState.getType() == Fluids.WATER)); + } - public BlockState updateShape( - @Nonnull BlockState p_53323_, - @Nonnull Direction p_53324_, - @Nonnull BlockState p_53325_, - @Nonnull LevelAccessor p_53326_, - @Nonnull BlockPos p_53327_, - @Nonnull BlockPos p_53328_ - ) { - if (p_53323_.getValue(WATERLOGGED)) { - p_53326_.scheduleTick( - p_53327_, - Fluids.WATER, - Fluids.WATER.getTickDelay(p_53326_) - ); - } + public BlockState updateShape( + @Nonnull BlockState p_53323_, + @Nonnull Direction p_53324_, + @Nonnull BlockState p_53325_, + @Nonnull LevelAccessor p_53326_, + @Nonnull BlockPos p_53327_, + @Nonnull BlockPos p_53328_) { + if (p_53323_.getValue(WATERLOGGED)) { + p_53326_.scheduleTick( + p_53327_, + Fluids.WATER, + Fluids.WATER.getTickDelay(p_53326_)); + } - return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL - ? p_53323_.setValue( - PROPERTY_BY_DIRECTION.get(p_53324_), - Boolean.valueOf( - this.connectsTo( - p_53325_, - p_53325_.isFaceSturdy( - p_53326_, - p_53328_, - p_53324_.getOpposite() - ), - p_53324_.getOpposite() - ) - ) - ) - : super.updateShape( - p_53323_, - p_53324_, - p_53325_, - p_53326_, - p_53327_, - p_53328_ - ); - } + return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL + ? p_53323_.setValue( + PROPERTY_BY_DIRECTION.get(p_53324_), + Boolean.valueOf( + this.connectsTo( + p_53325_, + p_53325_.isFaceSturdy( + p_53326_, + p_53328_, + p_53324_.getOpposite()), + p_53324_.getOpposite()))) + : super.updateShape( + p_53323_, + p_53324_, + p_53325_, + p_53326_, + p_53327_, + p_53328_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_53334_ - ) { - p_53334_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_53334_) { + p_53334_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java index 0cdf9fb1..0ff67b66 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java @@ -13,34 +13,31 @@ public class AncientGrass extends GrassBlock { - public AncientGrass(Properties p_49795_) { - super(p_49795_); - } + public AncientGrass(Properties p_49795_) { + super(p_49795_); + } - @Override - public boolean canSustainPlant( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction facing, - IPlantable plantable - ) { - return true; - } + @Override + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable) { + return true; + } - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource random - ) { - if (!level.getBlockState(pos.above()).isAir()) { - level.setBlock( - pos, - ModRegistry.ANCIENT_DIRT.get().defaultBlockState(), - 1 - ); - } - } + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random) { + if (!level.getBlockState(pos.above()).isAir()) { + level.setBlock( + pos, + ModRegistry.ANCIENT_DIRT.get().defaultBlockState(), + 1); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java index 4c8d90e6..b2655351 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java @@ -11,34 +11,32 @@ public class AncientHerb extends Block { - public AncientHerb(Properties props) { - super(props); - } + public AncientHerb(Properties props) { + super(props); + } - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random random - ) { - if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - } + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random random) { + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + } - @SuppressWarnings("deprecation") - @Override - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - super.tick(state, level, pos, rand); - if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - } + @SuppressWarnings("deprecation") + @Override + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + super.tick(state, level, pos, rand); + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java index a7e95625..f54f85c7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java @@ -24,198 +24,171 @@ public class AncientLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - - private static final int TICK_DELAY = 800; - private static int TICK_COUNT; - - public AncientLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - AncientLeaves.TICK_COUNT++; - if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - } - } - - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource p_54429_ - ) { - AncientLeaves.TICK_COUNT++; - if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - AncientLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final int TICK_DELAY = 800; + private static int TICK_COUNT; + + public AncientLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + } + + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + AncientLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java index 2366a503..7d107205 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java @@ -24,186 +24,157 @@ public class AncientLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public AncientLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - public void randomTick( - @Nonnull BlockState state, - ServerLevel level, - BlockPos pos, - Random rand - ) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_ - ) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public AncientLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + @Nonnull BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java index a44318c5..e44b1f81 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java @@ -4,7 +4,7 @@ public class AncientLog extends RotatedPillarBlock { - public AncientLog(Properties prop) { - super(prop); - } + public AncientLog(Properties prop) { + super(prop); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java index 2f324b93..6c873ad6 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java @@ -22,147 +22,126 @@ public class AncientSaplingBlock extends SaplingBlock { - public static final IntegerProperty STAGE = BlockStateProperties.STAGE; - protected static final float AABB_OFFSET = 6.0F; - protected static final VoxelShape SHAPE = Block.box( - 2.0D, - 0.0D, - 2.0D, - 14.0D, - 12.0D, - 14.0D - ); - private final AbstractTreeGrower treeGrower; + public static final IntegerProperty STAGE = BlockStateProperties.STAGE; + protected static final float AABB_OFFSET = 6.0F; + protected static final VoxelShape SHAPE = Block.box( + 2.0D, + 0.0D, + 2.0D, + 14.0D, + 12.0D, + 14.0D); + private final AbstractTreeGrower treeGrower; - public AncientSaplingBlock( - AbstractTreeGrower p_55978_, - BlockBehaviour.Properties p_55979_ - ) { - super(p_55978_, p_55979_); - this.treeGrower = p_55978_; - this.registerDefaultState( - this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0)) - ); - } + public AncientSaplingBlock( + AbstractTreeGrower p_55978_, + BlockBehaviour.Properties p_55979_) { + super(p_55978_, p_55979_); + this.treeGrower = p_55978_; + this.registerDefaultState( + this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0))); + } - public VoxelShape getShape( - @Nonnull BlockState p_56008_, - @Nonnull BlockGetter p_56009_, - @Nonnull BlockPos p_56010_, - @Nonnull CollisionContext p_56011_ - ) { - return SHAPE; - } + public VoxelShape getShape( + @Nonnull BlockState p_56008_, + @Nonnull BlockGetter p_56009_, + @Nonnull BlockPos p_56010_, + @Nonnull CollisionContext p_56011_) { + return SHAPE; + } - @Override - protected boolean mayPlaceOn( - @Nonnull BlockState state, - @Nonnull BlockGetter p_51043_, - @Nonnull BlockPos p_51044_ - ) { - return ( - state.is(TagRegistry.ANCIENT_DIRT) || - state.is(Blocks.WARPED_NYLIUM) || - state.is(Blocks.CRIMSON_NYLIUM) || - state.is(ModRegistry.ANCIENT_GRASS.get()) - ); - } + @Override + protected boolean mayPlaceOn( + @Nonnull BlockState state, + @Nonnull BlockGetter p_51043_, + @Nonnull BlockPos p_51044_) { + return (state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get())); + } - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_60581_, - @Nonnull BlockGetter p_60582_, - @Nonnull BlockPos p_60583_ - ) { - return Shapes.empty(); - } + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_60581_, + @Nonnull BlockGetter p_60582_, + @Nonnull BlockPos p_60583_) { + return Shapes.empty(); + } - @Override - public boolean canSurvive( - @Nonnull BlockState state, - @Nonnull LevelReader reader, - @Nonnull BlockPos pos - ) { - return ( - state.is(TagRegistry.ANCIENT_DIRT) || - state.is(Blocks.WARPED_NYLIUM) || - state.is(Blocks.CRIMSON_NYLIUM) || - state.is(ModRegistry.ANCIENT_GRASS.get()) - ); - } + @Override + public boolean canSurvive( + @Nonnull BlockState state, + @Nonnull LevelReader reader, + @Nonnull BlockPos pos) { + return (state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get())); + } - @SuppressWarnings("deprecation") - public void randomTick( - @Nonnull BlockState p_56003_, - @Nonnull ServerLevel p_56004_, - @Nonnull BlockPos p_56005_, - @Nonnull RandomSource p_56006_ - ) { - if ( - p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && - p_56006_.nextInt(7) == 0 - ) { - if (!p_56004_.isAreaLoaded(p_56005_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - this.advanceTree(p_56004_, p_56005_, p_56003_, p_56006_); - } - } + @SuppressWarnings("deprecation") + public void randomTick( + @Nonnull BlockState p_56003_, + @Nonnull ServerLevel p_56004_, + @Nonnull BlockPos p_56005_, + @Nonnull RandomSource p_56006_) { + if (p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && + p_56006_.nextInt(7) == 0) { + if (!p_56004_.isAreaLoaded(p_56005_, 1)) + return; // Forge: prevent loading unloaded chunks when checking neighbor's light + this.advanceTree(p_56004_, p_56005_, p_56003_, p_56006_); + } + } - public void advanceTree( - @Nonnull ServerLevel p_55981_, - @Nonnull BlockPos p_55982_, - @Nonnull BlockState p_55983_, - @Nonnull RandomSource p_55984_ - ) { - if (p_55983_.getValue(STAGE) == 0) { - p_55981_.setBlock(p_55982_, p_55983_.cycle(STAGE), 4); - } else { - if ( - !net.minecraftforge.event.ForgeEventFactory.saplingGrowTree( - p_55981_, - p_55984_, - p_55982_ - ) - ) return; - this.treeGrower.growTree( - p_55981_, - p_55981_.getChunkSource().getGenerator(), - p_55982_, - p_55983_, - p_55984_ - ); - } - } + public void advanceTree( + @Nonnull ServerLevel p_55981_, + @Nonnull BlockPos p_55982_, + @Nonnull BlockState p_55983_, + @Nonnull RandomSource p_55984_) { + if (p_55983_.getValue(STAGE) == 0) { + p_55981_.setBlock(p_55982_, p_55983_.cycle(STAGE), 4); + } else { + if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree( + p_55981_, + p_55984_, + p_55982_)) + return; + this.treeGrower.growTree( + p_55981_, + p_55981_.getChunkSource().getGenerator(), + p_55982_, + p_55983_, + p_55984_); + } + } - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_55991_, - @Nonnull BlockPos p_55992_, - @Nonnull BlockState p_55993_, - boolean p_55994_ - ) { - return true; - } + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_55991_, + @Nonnull BlockPos p_55992_, + @Nonnull BlockState p_55993_, + boolean p_55994_) { + return true; + } - public boolean isBonemealSuccess( - @Nonnull Level p_55996_, - @Nonnull RandomSource p_55997_, - @Nonnull BlockPos p_55998_, - @Nonnull BlockState p_55999_ - ) { - return (double) p_55996_.random.nextFloat() < 0.45D; - } + public boolean isBonemealSuccess( + @Nonnull Level p_55996_, + @Nonnull RandomSource p_55997_, + @Nonnull BlockPos p_55998_, + @Nonnull BlockState p_55999_) { + return (double) p_55996_.random.nextFloat() < 0.45D; + } - public void performBonemeal( - @Nonnull ServerLevel p_55986_, - @Nonnull RandomSource p_55987_, - @Nonnull BlockPos p_55988_, - @Nonnull BlockState p_55989_ - ) { - this.advanceTree(p_55986_, p_55988_, p_55989_, p_55987_); - } + public void performBonemeal( + @Nonnull ServerLevel p_55986_, + @Nonnull RandomSource p_55987_, + @Nonnull BlockPos p_55988_, + @Nonnull BlockState p_55989_) { + this.advanceTree(p_55986_, p_55988_, p_55989_, p_55987_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_56001_ - ) { - p_56001_.add(STAGE); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_56001_) { + p_56001_.add(STAGE); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java index 80fe9c50..eaec1e95 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java @@ -27,222 +27,189 @@ public class DemonicLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - private static final int TICK_DELAY = 80; - private static int TICK_COUNT; - - public DemonicLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - } - - @Override - public boolean onDestroyedByPlayer( - BlockState state, - Level world, - BlockPos pos, - Player player, - boolean willHarvest, - FluidState fluid - ) { - if ( - world.getBlockState(pos.below()).getBlock() instanceof - DemonicLeavesBottom - ) { - world.setBlockAndUpdate( - pos.below(), - Blocks.AIR.defaultBlockState() - ); - } - return super.onDestroyedByPlayer( - state, - world, - pos, - player, - willHarvest, - fluid - ); - } - - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource p_54429_ - ) { - DemonicLeaves.TICK_COUNT++; - if (DemonicLeaves.TICK_COUNT >= DemonicLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - DemonicLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + private static final int TICK_DELAY = 80; + private static int TICK_COUNT; + + public DemonicLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + + @Override + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid) { + if (world.getBlockState(pos.below()).getBlock() instanceof DemonicLeavesBottom) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState()); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid); + } + + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_) { + DemonicLeaves.TICK_COUNT++; + if (DemonicLeaves.TICK_COUNT >= DemonicLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + DemonicLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java index 6a2631cb..a7aed122 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java @@ -24,186 +24,157 @@ public class DemonicLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public DemonicLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random rand - ) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_ - ) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public DemonicLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java index 640f7da5..9a88b780 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java @@ -1,3 +1,4 @@ package com.thevortex.allthemodium.blocks; -public class RawATM extends AllthemodiumOre {} +public class RawATM extends AllthemodiumOre { +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java b/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java index d7e9059e..eee9d013 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java @@ -1,3 +1,4 @@ package com.thevortex.allthemodium.blocks; -public class RawUNO extends UnobtainiumOre {} +public class RawUNO extends UnobtainiumOre { +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java b/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java index 3e8b6fbb..84015a11 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java @@ -1,3 +1,4 @@ package com.thevortex.allthemodium.blocks; -public class RawVIB extends VibraniumOre {} +public class RawVIB extends VibraniumOre { +} diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java index e55b955e..f53b2cce 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java @@ -23,208 +23,183 @@ public class SoulLava extends LiquidBlock { - public int tickCount = 0; - protected FlowingFluid fluid; - - public SoulLava( - Supplier supplier, - Properties p_i48368_1_ - ) { - super(supplier, p_i48368_1_); - } - - @Override - public boolean isBurning( - BlockState state, - BlockGetter world, - BlockPos pos - ) { - return true; - } - - @Override - public boolean isFireSource( - BlockState state, - LevelReader world, - BlockPos pos, - Direction side - ) { - return true; - } - - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity entity - ) { - return false; - } - - @Override - public boolean canBeReplaced( - @Nonnull BlockState state, - @Nonnull BlockPlaceContext context - ) { - return false; - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource random - ) { - if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { - int i = random.nextInt(10); - if (i > 0) { - BlockPos blockPos = pos; - - for (int j = 0; j < i; ++j) { - blockPos = - blockPos.offset( - random.nextInt(10) - 1, - 1, - random.nextInt(10) - 1 - ); - if (!level.isEmptyBlock(blockPos)) { - return; - } - - BlockState blockState = level.getBlockState(blockPos); - @SuppressWarnings("unused") - BlockState FIRE = SoulFireBlock.canSurviveOnBlock( - blockState - ) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - } - } else { - for (int k = 0; k < 10; ++k) { - BlockPos blockPos1 = pos.offset( - random.nextInt(10) - 1, - 0, - random.nextInt(10) - 1 - ); - BlockState FIRE = SoulFireBlock.canSurviveOnBlock( - level.getBlockState(blockPos1) - ) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - - if (!level.isEmptyBlock(blockPos1)) { - return; - } - - level.setBlockAndUpdate( - blockPos1.above(), - ForgeEventFactory.fireFluidPlaceBlockEvent( - level, - blockPos1.above(), - pos, - FIRE - ) - ); - } - } - } - } - - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick( - @Nonnull BlockState stateIn, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - this.tickCount++; - - if ( - stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && - this.tickCount >= 40 - ) { - spawnParticles(worldIn, pos); - this.tickCount = 0; - } - super.animateTick(stateIn, worldIn, pos, rand); - } - - private static void spawnParticles(Level world, BlockPos worldIn) { - // double d0 = 0.5625D; - RandomSource random = world.random; - - if ( - world.getFluidState(worldIn).isSource() && - (random.nextBoolean() == true) - ) { - for (Direction direction : Direction.values()) { - BlockPos blockPos = worldIn.offset(direction.getNormal()); - if ( - !world - .getBlockState(blockPos) - .isSolidRender(world, blockPos) - ) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X - ? 0.5D + 0.5625D * (double) direction.getStepX() - : (double) random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y - ? 0.5D + 0.5625D * (double) direction.getStepY() - : (double) random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z - ? 0.5D + 0.5625D * (double) direction.getStepZ() - : (double) random.nextFloat(); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - random.nextFloat(), - random.nextFloat(), - random.nextFloat() - ); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - random.nextFloat(), - -random.nextFloat(), - -random.nextFloat() - ); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - -random.nextFloat(), - random.nextFloat(), - -random.nextFloat() - ); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - -random.nextFloat(), - -random.nextFloat(), - random.nextFloat() - ); - } - } - } - } - - @Override - public int getFireSpreadSpeed( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction face - ) { - return 1000; - } + public int tickCount = 0; + protected FlowingFluid fluid; + + public SoulLava( + Supplier supplier, + Properties p_i48368_1_) { + super(supplier, p_i48368_1_); + } + + @Override + public boolean isBurning( + BlockState state, + BlockGetter world, + BlockPos pos) { + return true; + } + + @Override + public boolean isFireSource( + BlockState state, + LevelReader world, + BlockPos pos, + Direction side) { + return true; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity entity) { + return false; + } + + @Override + public boolean canBeReplaced( + @Nonnull BlockState state, + @Nonnull BlockPlaceContext context) { + return false; + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random) { + if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { + int i = random.nextInt(10); + if (i > 0) { + BlockPos blockPos = pos; + + for (int j = 0; j < i; ++j) { + blockPos = blockPos.offset( + random.nextInt(10) - 1, + 1, + random.nextInt(10) - 1); + if (!level.isEmptyBlock(blockPos)) { + return; + } + + BlockState blockState = level.getBlockState(blockPos); + @SuppressWarnings("unused") + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + blockState) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + } + } else { + for (int k = 0; k < 10; ++k) { + BlockPos blockPos1 = pos.offset( + random.nextInt(10) - 1, + 0, + random.nextInt(10) - 1); + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + level.getBlockState(blockPos1)) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + + if (!level.isEmptyBlock(blockPos1)) { + return; + } + + level.setBlockAndUpdate( + blockPos1.above(), + ForgeEventFactory.fireFluidPlaceBlockEvent( + level, + blockPos1.above(), + pos, + FIRE)); + } + } + } + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + this.tickCount++; + + if (stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && + this.tickCount >= 40) { + spawnParticles(worldIn, pos); + this.tickCount = 0; + } + super.animateTick(stateIn, worldIn, pos, rand); + } + + private static void spawnParticles(Level world, BlockPos worldIn) { + // double d0 = 0.5625D; + RandomSource random = world.random; + + if (world.getFluidState(worldIn).isSource() && + (random.nextBoolean() == true)) { + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if (!world + .getBlockState(blockPos) + .isSolidRender(world, blockPos)) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + random.nextFloat(), + random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + -random.nextFloat(), + -random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + random.nextFloat(), + -random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + -random.nextFloat(), + random.nextFloat()); + } + } + } + } + + @Override + public int getFireSpreadSpeed( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction face) { + return 1000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java index 65d457e0..5d8cc9cb 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java @@ -28,223 +28,190 @@ public class SoulLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - - private static final int TICK_DELAY = 80; - private static int TICK_COUNT; - - public SoulLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand - ) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - } - - @Override - public boolean onDestroyedByPlayer( - BlockState state, - Level world, - BlockPos pos, - Player player, - boolean willHarvest, - FluidState fluid - ) { - if ( - world.getBlockState(pos.below()).getBlock() instanceof - SoulLeavesBottom - ) { - world.setBlockAndUpdate( - pos.below(), - Blocks.AIR.defaultBlockState() - ); - } - return super.onDestroyedByPlayer( - state, - world, - pos, - player, - willHarvest, - fluid - ); - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_ - ) { - SoulLeaves.TICK_COUNT++; - if (SoulLeaves.TICK_COUNT >= SoulLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), - 3 - ); - } - SoulLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final int TICK_DELAY = 80; + private static int TICK_COUNT; + + public SoulLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + + @Override + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid) { + if (world.getBlockState(pos.below()).getBlock() instanceof SoulLeavesBottom) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState()); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid); + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + SoulLeaves.TICK_COUNT++; + if (SoulLeaves.TICK_COUNT >= SoulLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + SoulLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java index b0ab8fc0..4cb0ba2c 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java @@ -24,186 +24,157 @@ public class SoulLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = - BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = - BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = - BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public SoulLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false)) - ); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_ - ) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return ( - p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT) - ); - } - - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random rand - ) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_ - ) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if ( - level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir() - ) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_ - ) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_ - ) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_ - ) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = - new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = - Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos) - ) + - 1 - ); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_ - ) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if ( - !blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP) - ) { - double d0 = - (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = - (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D - ); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_ - ) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_ - ) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos() - ); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public SoulLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java index 287a8d63..ce8f5070 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java @@ -28,331 +28,295 @@ public class TeleportPad extends Block { - protected static final VoxelShape TELEPORTPAD_AABB = Block.box( - 0.0D, - 0.0D, - 0.0D, - 16.0D, - 3.0D, - 16.0D - ); + protected static final VoxelShape TELEPORTPAD_AABB = Block.box( + 0.0D, + 0.0D, + 0.0D, + 16.0D, + 3.0D, + 16.0D); - public TeleportPad(Properties properties) { - super(properties); - // TODO Auto-generated constructor stub - } + public TeleportPad(Properties properties) { + super(properties); + // TODO Auto-generated constructor stub + } - @Override - public VoxelShape getShape( - @Nonnull BlockState state, - @Nonnull BlockGetter worldIn, - @Nonnull BlockPos pos, - @Nonnull CollisionContext context - ) { - return TELEPORTPAD_AABB; - } + @Override + public VoxelShape getShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context) { + return TELEPORTPAD_AABB; + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } - @Override - public VoxelShape getCollisionShape( - @Nonnull BlockState state, - @Nonnull BlockGetter worldIn, - @Nonnull BlockPos pos, - @Nonnull CollisionContext context - ) { - return TELEPORTPAD_AABB; - } + @Override + public VoxelShape getCollisionShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context) { + return TELEPORTPAD_AABB; + } - @SuppressWarnings("deprecation") - @Override - public InteractionResult use( - @Nonnull BlockState state, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull Player player, - @Nonnull InteractionHand handIn, - @Nonnull BlockHitResult hit - ) { - if ( - (player instanceof ServerPlayer) && (player.isCrouching() == true) - ) { - transferPlayer((ServerPlayer) player, pos); - worldIn.addAlwaysVisibleParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY() + 1, - pos.getZ(), - 0, - 1, - 0 - ); - } + @SuppressWarnings("deprecation") + @Override + public InteractionResult use( + @Nonnull BlockState state, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull Player player, + @Nonnull InteractionHand handIn, + @Nonnull BlockHitResult hit) { + if ((player instanceof ServerPlayer) && (player.isCrouching() == true)) { + transferPlayer((ServerPlayer) player, pos); + worldIn.addAlwaysVisibleParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY() + 1, + pos.getZ(), + 0, + 1, + 0); + } - return super.use(state, worldIn, pos, player, handIn, hit); - } + return super.use(state, worldIn, pos, player, handIn, hit); + } - @Override - public boolean canHarvestBlock( - BlockState state, - BlockGetter world, - BlockPos pos, - Player player - ) { - if ( - player.level - .dimension() - .registry() - .getNamespace() - .contains(Reference.MOD_ID) - ) { - return false; - } else { - return true; - } - } + @Override + public boolean canHarvestBlock( + BlockState state, + BlockGetter world, + BlockPos pos, + Player player) { + if (player.level + .dimension() + .registry() + .getNamespace() + .contains(Reference.MOD_ID)) { + return false; + } else { + return true; + } + } - public void transferPlayer(ServerPlayer player, BlockPos pos) { - boolean config = AllTheModium.ALLOW_TELEPORT_MINING; - if (player.level.dimension().equals(LevelRegistry.Mining)) { - ServerLevel targetWorld = player.server.getLevel( - AllTheModium.OverWorld - ); + public void transferPlayer(ServerPlayer player, BlockPos pos) { + boolean config = AllTheModium.ALLOW_TELEPORT_MINING; + if (player.level.dimension().equals(LevelRegistry.Mining)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.OverWorld); - if (targetWorld == null) return; + if (targetWorld == null) + return; - int y = 256; - boolean located = false; - while (y >= 1) { - BlockPos posA = new BlockPos( - Math.round(pos.getX()), - y, - Math.round(pos.getZ()) - ); - Block potential = targetWorld.getBlockState(posA).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - } else { - y--; - } - } - if (located) { - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - y + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya - ); + int y = 256; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ())); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); - return; - } else { - if ( - (!targetWorld.getBlockState(pos).hasBlockEntity()) && - (targetWorld - .getBlockState(pos) - .canEntityDestroy(targetWorld, pos, player)) - ) { - // targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); - } + return; + } else { + if ((!targetWorld.getBlockState(pos).hasBlockEntity()) && + (targetWorld + .getBlockState(pos) + .canEntityDestroy(targetWorld, pos, player))) { + // targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); + } - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - pos.getY() + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya - ); - } - } else if (player.level.dimension().equals(AllTheModium.Nether)) { - ServerLevel targetWorld = player.server.getLevel( - LevelRegistry.THE_OTHER - ); - BlockPos targetPos = new BlockPos( - Math.round(pos.getX()), - Math.round(pos.getY()), - Math.round(pos.getZ()) - ); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + pos.getY() + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); + } + } else if (player.level.dimension().equals(AllTheModium.Nether)) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.THE_OTHER); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + Math.round(pos.getY()), + Math.round(pos.getZ())); - if (targetWorld == null) return; + if (targetWorld == null) + return; - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - LevelHeightAccessor accessor = targetWorld - .getChunk(pos) - .getHeightAccessorForGeneration(); - int y = targetWorld - .getChunkSource() - .getGenerator() - .getSpawnHeight(accessor); - targetWorld.setBlockAndUpdate( - new BlockPos(targetPos.getX(), y, targetPos.getZ()), - ModRegistry.TELEPORT_PAD.get().defaultBlockState() - ); + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + LevelHeightAccessor accessor = targetWorld + .getChunk(pos) + .getHeightAccessorForGeneration(); + int y = targetWorld + .getChunkSource() + .getGenerator() + .getSpawnHeight(accessor); + targetWorld.setBlockAndUpdate( + new BlockPos(targetPos.getX(), y, targetPos.getZ()), + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - targetPos.getX() + 0.5D, - y + 0.25D, - targetPos.getZ() + 0.5D, - 0, - 0 - ); - } - } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { - ServerLevel targetWorld = player.server.getLevel( - AllTheModium.Nether - ); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + y + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0); + } + } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.Nether); - if (targetWorld == null) return; + if (targetWorld == null) + return; - int y = 128; - boolean located = false; - while (y >= 1) { - BlockPos posA = new BlockPos( - Math.round(pos.getX()), - y, - Math.round(pos.getZ()) - ); - Block potential = targetWorld.getBlockState(posA).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - } else { - y--; - } - } - if (located) { - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - y + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya - ); + int y = 128; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ())); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); - return; - } else { - BlockPos newPos = new BlockPos(pos.getX(), 90, pos.getZ()); - if ( - (!targetWorld.getBlockState(newPos).hasBlockEntity()) && - (targetWorld - .getBlockState(newPos) - .canEntityDestroy(targetWorld, newPos, player)) - ) { - targetWorld.setBlockAndUpdate( - newPos, - ModRegistry.TELEPORT_PAD.get().defaultBlockState() - ); - } + return; + } else { + BlockPos newPos = new BlockPos(pos.getX(), 90, pos.getZ()); + if ((!targetWorld.getBlockState(newPos).hasBlockEntity()) && + (targetWorld + .getBlockState(newPos) + .canEntityDestroy(targetWorld, newPos, player))) { + targetWorld.setBlockAndUpdate( + newPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); + } - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - newPos.getX(), - newPos.getY(), - newPos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - newPos.getX() + 0.5D, - newPos.getY() + 0.25D, - newPos.getZ() + 0.5D, - player.rotA, - player.yya - ); - } - } else if ( - player.level.dimension().equals(AllTheModium.OverWorld) && - (config == true) - ) { - ServerLevel targetWorld = player.server.getLevel( - LevelRegistry.Mining - ); - BlockPos targetPos = new BlockPos( - Math.round(pos.getX()), - 253, - Math.round(pos.getZ()) - ); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + newPos.getX(), + newPos.getY(), + newPos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + newPos.getX() + 0.5D, + newPos.getY() + 0.25D, + newPos.getZ() + 0.5D, + player.rotA, + player.yya); + } + } else if (player.level.dimension().equals(AllTheModium.OverWorld) && + (config == true)) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.Mining); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + 253, + Math.round(pos.getZ())); - if (targetWorld == null) return; + if (targetWorld == null) + return; - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - targetWorld.setBlockAndUpdate( - targetPos, - ModRegistry.TELEPORT_PAD.get().defaultBlockState() - ); - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0 - ); - player.teleportTo( - targetWorld, - targetPos.getX() + 0.5D, - targetPos.getY() + 0.25D, - targetPos.getZ() + 0.5D, - 0, - 0 - ); - } - } - } + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + targetWorld.setBlockAndUpdate( + targetPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + targetPos.getY() + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0); + } + } + } - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - return list; - } + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java index fb559cde..a0b9e497 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java @@ -13,20 +13,18 @@ public class UAAlloyBlock extends Block { - public UAAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) - ); - } + public UAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java index 2a4f2f5e..2c356cd3 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java @@ -13,20 +13,18 @@ public class UVAlloyBlock extends Block { - public UVAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) - ); - } + public UVAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java index 0d8062ef..8b7a22a9 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java @@ -13,20 +13,18 @@ public class UnobtainiumBlock extends Block { - public UnobtainiumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) - ); - } + public UnobtainiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java index e15dcba8..f84bf856 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java @@ -16,69 +16,59 @@ public class UnobtainiumOre extends DropExperienceBlock { - public UnobtainiumOre() { // func_235861_h_ = setRequiresTool - super( - Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.NETHER_GOLD_ORE) - .strength(80.0f, 5000f) - ); - } + public UnobtainiumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_GOLD_ORE) + .strength(80.0f, 5000f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos - ) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if ( - AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() - ) return super.getDestroyProgress(state, player, getter, blockPos); + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player - ) - ? 750 - : 5500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 750 + : 5500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player - ) { - if ( - (player instanceof FakePlayer) && - state.is(TagRegistry.UNOBTAINIUM_ORE) - ) { - return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); - } - return ( - super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F) - ); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + state.is(TagRegistry.UNOBTAINIUM_ORE)) { + return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); + } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2) - ); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java index 31067445..2defd0f7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java @@ -13,20 +13,18 @@ public class VAAlloyBlock extends Block { - public VAAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f) - ); - } + public VAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java index 6a5f32c0..61ab4373 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java @@ -13,20 +13,18 @@ public class VibraniumBlock extends Block { - public VibraniumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f) - ); - } + public VibraniumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder - ) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java index d0832c9b..5ceffc84 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java @@ -16,68 +16,58 @@ public class VibraniumOre extends DropExperienceBlock { - public VibraniumOre() { // func_235861_h_ = setRequiresTool - super( - Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.NETHER_ORE) - .strength(80.0f, 2500.0f) - ); - } + public VibraniumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_ORE) + .strength(80.0f, 2500.0f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos - ) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if ( - AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get() - ) return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player - ) - ? 500 - : 2500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 500 + : 2500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player - ) { - if ( - (player instanceof FakePlayer) && - state.is(TagRegistry.VIBRANIUM_ORE) - ) { - return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); - } - return ( - super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F) - ); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + state.is(TagRegistry.VIBRANIUM_ORE)) { + return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); + } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2) - ); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } } diff --git a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java index 725e7bfa..ef2b755c 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java @@ -4,52 +4,37 @@ public class AllthemodiumServerConfigs { - public static final ForgeConfigSpec.Builder BUILDER = - new ForgeConfigSpec.Builder(); - public static final ForgeConfigSpec SPEC; - - public static final ForgeConfigSpec.ConfigValue< - Boolean - > ALLTHEMODIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue< - Boolean - > UNOBTAINIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue< - Boolean - > VIBRANIUM_QUARRYABLE; - - public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; - - // public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; - - static { - BUILDER.push("AllTheModium Configs"); - ALLTHEMODIUM_QUARRYABLE = - BUILDER - .comment( - "Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)" - ) - .define("Allthemodium Quarryable", false); - UNOBTAINIUM_QUARRYABLE = - BUILDER - .comment( - "Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)" - ) - .define("Unobtainium Quarryable", false); - VIBRANIUM_QUARRYABLE = - BUILDER - .comment( - "Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)" - ) - .define("Vibranium Quarryable", false); - OTHER_PROTECTION = - BUILDER - .comment( - "Whether The Other is protected from quarries. (Default value: true)" - ) - .define("Other Protection", true); - - BUILDER.pop(); - SPEC = BUILDER.build(); - } + public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); + public static final ForgeConfigSpec SPEC; + + public static final ForgeConfigSpec.ConfigValue ALLTHEMODIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; + + public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; + + // public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; + + static { + BUILDER.push("AllTheModium Configs"); + ALLTHEMODIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Allthemodium Quarryable", false); + UNOBTAINIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Unobtainium Quarryable", false); + VIBRANIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Vibranium Quarryable", false); + OTHER_PROTECTION = BUILDER + .comment( + "Whether The Other is protected from quarries. (Default value: true)") + .define("Other Protection", true); + + BUILDER.pop(); + SPEC = BUILDER.build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java index 677454ea..befd8c1d 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java @@ -8,19 +8,14 @@ public class ATMCraftingSetup { - public static final RecipeSerializer SERIALIZER = - new ATMRecipeSerializer(); - public static final RecipeSerializer< - ATMShapelessRecipe - > SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); + public static final RecipeSerializer SERIALIZER = new ATMRecipeSerializer(); + public static final RecipeSerializer SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); - public static final DeferredRegister> REGISTRY = - DeferredRegister.create( - ForgeRegistries.RECIPE_SERIALIZERS, - Reference.MOD_ID - ); - public static final RegistryObject> ATM_DATA = - REGISTRY.register("atmshaped_crafting", () -> SERIALIZER); - public static final RegistryObject> ATM_SHAPELESS_DATA = - REGISTRY.register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); + public static final DeferredRegister> REGISTRY = DeferredRegister.create( + ForgeRegistries.RECIPE_SERIALIZERS, + Reference.MOD_ID); + public static final RegistryObject> ATM_DATA = REGISTRY.register("atmshaped_crafting", + () -> SERIALIZER); + public static final RegistryObject> ATM_SHAPELESS_DATA = REGISTRY + .register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java index 8ad6da4a..6c7aaa85 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java @@ -8,42 +8,36 @@ public class ATMRecipeSerializer implements RecipeSerializer { - @Override - public ATMShapedRecipe fromJson( - @Nonnull ResourceLocation recipeId, - @Nonnull JsonObject json - ) { - return new ATMShapedRecipe( - RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json) - ); - } + @Override + public ATMShapedRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json) { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json)); + } - @Override - public ATMShapedRecipe fromNetwork( - @Nonnull ResourceLocation recipeId, - @Nonnull FriendlyByteBuf buffer - ) { - try { - return new ATMShapedRecipe( - RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer) - ); - } catch (Exception e) { - throw e; - } - } + @Override + public ATMShapedRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer) { + try { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer)); + } catch (Exception e) { + throw e; + } + } - @Override - public void toNetwork( - @Nonnull FriendlyByteBuf buffer, - @Nonnull ATMShapedRecipe recipe - ) { - try { - RecipeSerializer.SHAPED_RECIPE.toNetwork( - buffer, - recipe.getInternal() - ); - } catch (Exception e) { - throw e; - } - } + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapedRecipe recipe) { + try { + RecipeSerializer.SHAPED_RECIPE.toNetwork( + buffer, + recipe.getInternal()); + } catch (Exception e) { + throw e; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java index 97a47d7b..f8d6dcb4 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java @@ -16,110 +16,101 @@ public class ATMShapedRecipe implements IATMShapedRecipe { - private final ShapedRecipe internal; - - public ATMShapedRecipe(ShapedRecipe internal) { - this.internal = internal; - } - - public ShapedRecipe getInternal() { - return internal; - } - - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_DATA.get(); - } - - @Override - public boolean matches( - @Nonnull CraftingContainer inv, - @Nonnull Level world - ) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return internal.matches(inv, world) && !assemble(inv).isEmpty(); - } - - @Override - public ItemStack assemble(@Nonnull CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); - Map enchant = new HashMap<>(); - - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = - EnchantmentHelper.getEnchantments(stack); - for (Enchantment e : temp.keySet()) { - if ( - enchant.containsKey(e) && - (enchant.get(e) == temp.get(e)) - ) { - enchant.put(e, temp.get(e) + 1); - } - if ( - enchant.containsKey(e) && (enchant.get(e) < temp.get(e)) - ) { - enchant.put(e, temp.get(e)); - } - if ( - enchant.containsKey(e) && (enchant.get(e) > temp.get(e)) - ) { - break; - } else { - enchant.put(e, temp.get(e)); - } - } - } - } - EnchantmentHelper.setEnchantments(enchant, toReturn); - return toReturn; - } - - @Override - public boolean canCraftInDimensions(int width, int height) { - return internal.canCraftInDimensions(width, height); - } - - @Override - public ItemStack getResultItem() { - return internal.getResultItem(); - } - - @Override - public NonNullList getRemainingItems( - @Nonnull CraftingContainer inv - ) { - return internal.getRemainingItems(inv); - } - - @Override - public NonNullList getIngredients() { - return internal.getIngredients(); - } - - @Override - public boolean isSpecial() { - return internal.isSpecial(); - } - - @Override - public String getGroup() { - return internal.getGroup(); - } - - @Override - public ItemStack getToastSymbol() { - return internal.getToastSymbol(); - } - - @Override - public ResourceLocation getId() { - return internal.getId(); - } + private final ShapedRecipe internal; + + public ATMShapedRecipe(ShapedRecipe internal) { + this.internal = internal; + } + + public ShapedRecipe getInternal() { + return internal; + } + + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_DATA.get(); + } + + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return internal.matches(inv, world) && !assemble(inv).isEmpty(); + } + + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); + Map enchant = new HashMap<>(); + + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if (enchant.containsKey(e) && + (enchant.get(e) == temp.get(e))) { + enchant.put(e, temp.get(e) + 1); + } + if (enchant.containsKey(e) && (enchant.get(e) < temp.get(e))) { + enchant.put(e, temp.get(e)); + } + if (enchant.containsKey(e) && (enchant.get(e) > temp.get(e))) { + break; + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return internal.canCraftInDimensions(width, height); + } + + @Override + public ItemStack getResultItem() { + return internal.getResultItem(); + } + + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv) { + return internal.getRemainingItems(inv); + } + + @Override + public NonNullList getIngredients() { + return internal.getIngredients(); + } + + @Override + public boolean isSpecial() { + return internal.isSpecial(); + } + + @Override + public String getGroup() { + return internal.getGroup(); + } + + @Override + public ItemStack getToastSymbol() { + return internal.getToastSymbol(); + } + + @Override + public ResourceLocation getId() { + return internal.getId(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java index bc3fc28a..86a163e6 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java @@ -15,87 +15,82 @@ public class ATMShapelessRecipe implements IATMShapelessRecipe { - private final ShapelessRecipe recipe; + private final ShapelessRecipe recipe; - public ATMShapelessRecipe(ShapelessRecipe recipe) { - this.recipe = recipe; - } + public ATMShapelessRecipe(ShapelessRecipe recipe) { + this.recipe = recipe; + } - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); - } + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); + } - @Override - public boolean matches( - @Nonnull CraftingContainer inv, - @Nonnull Level world - ) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return recipe.matches(inv, world) && !assemble(inv).isEmpty(); - } + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return recipe.matches(inv, world) && !assemble(inv).isEmpty(); + } - @Override - public ItemStack assemble(@Nonnull CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); - Map enchant = new HashMap<>(); + Map enchant = new HashMap<>(); - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = - EnchantmentHelper.getEnchantments(stack); - for (Enchantment e : temp.keySet()) { - if ( - enchant.containsKey(e) && - (enchant.get(e) == temp.get(e)) - ) { - enchant.put(e, temp.get(e) + 1); - } else { - enchant.put(e, temp.get(e)); - } - } - } - } - EnchantmentHelper.setEnchantments(enchant, toReturn); - return toReturn; - } + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if (enchant.containsKey(e) && + (enchant.get(e) == temp.get(e))) { + enchant.put(e, temp.get(e) + 1); + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } - @Override - public NonNullList getRemainingItems( - @Nonnull CraftingContainer inv - ) { - return recipe.getRemainingItems(inv); - } + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv) { + return recipe.getRemainingItems(inv); + } - @Override - public ItemStack getToastSymbol() { - return recipe.getToastSymbol(); - } + @Override + public ItemStack getToastSymbol() { + return recipe.getToastSymbol(); + } - @Override - public NonNullList getIngredients() { - return recipe.getIngredients(); - } + @Override + public NonNullList getIngredients() { + return recipe.getIngredients(); + } - @Override - public boolean canCraftInDimensions(int width, int height) { - return recipe.canCraftInDimensions(width, height); - } + @Override + public boolean canCraftInDimensions(int width, int height) { + return recipe.canCraftInDimensions(width, height); + } - @Override - public ItemStack getResultItem() { - return recipe.getResultItem(); - } + @Override + public ItemStack getResultItem() { + return recipe.getResultItem(); + } - @Override - public ResourceLocation getId() { - return recipe.getId(); - } + @Override + public ResourceLocation getId() { + return recipe.getId(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java index cd8da6d3..02d75787 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java @@ -8,51 +8,45 @@ import net.minecraft.world.item.crafting.ShapelessRecipe; public class ATMShapelessRecipeSerializer - implements RecipeSerializer { + implements RecipeSerializer { - @Override - public ATMShapelessRecipe fromJson( - @Nonnull ResourceLocation recipeId, - @Nonnull JsonObject json - ) { - return new ATMShapelessRecipe( - RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json) - ); - } + @Override + public ATMShapelessRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json) { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json)); + } - @Override - public ATMShapelessRecipe fromNetwork( - @Nonnull ResourceLocation recipeId, - @Nonnull FriendlyByteBuf buffer - ) { - try { - return new ATMShapelessRecipe( - RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer) - ); - } catch (Exception e) { - throw e; - } - } + @Override + public ATMShapelessRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer) { + try { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer)); + } catch (Exception e) { + throw e; + } + } - private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { - try { - RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); - } catch (Exception e) { - throw e; - } - } + private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { + try { + RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); + } catch (Exception e) { + throw e; + } + } - @Override - public void toNetwork( - @Nonnull FriendlyByteBuf buffer, - @Nonnull ATMShapelessRecipe recipe - ) { - ShapelessRecipe newRecipe = new ShapelessRecipe( - recipe.getId(), - recipe.getGroup(), - recipe.getResultItem(), - recipe.getIngredients() - ); - write(buffer, newRecipe); - } + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapelessRecipe recipe) { + ShapelessRecipe newRecipe = new ShapelessRecipe( + recipe.getId(), + recipe.getGroup(), + recipe.getResultItem(), + recipe.getIngredients()); + write(buffer, newRecipe); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java index e740383e..3301413f 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java @@ -5,8 +5,7 @@ import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapedRecipe extends CraftingRecipe { - ResourceLocation RECIPE_TYPE = new ResourceLocation( - Reference.MOD_ID, - "atmshaped_crafting" - ); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshaped_crafting"); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java index dbee2d3b..90d46c10 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java @@ -5,8 +5,7 @@ import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapelessRecipe extends CraftingRecipe { - ResourceLocation RECIPE_TYPE = new ResourceLocation( - Reference.MOD_ID, - "atmshapeless_crafting" - ); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshapeless_crafting"); } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java index abd36866..53e55ef7 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java @@ -15,36 +15,34 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public final class DataGenerators { - private DataGenerators() {} + private DataGenerators() { + } - @SubscribeEvent - public static void gatherData(GatherDataEvent event) throws IOException { - DataGenerator generator = event.getGenerator(); - ExistingFileHelper fileHelper = event.getExistingFileHelper(); + @SubscribeEvent + public static void gatherData(GatherDataEvent event) throws IOException { + DataGenerator generator = event.getGenerator(); + ExistingFileHelper fileHelper = event.getExistingFileHelper(); - if (event.includeServer()) { - BlockTagsProvider blockTagsProvider = new BlockTags( - generator, - fileHelper - ); - generator.addProvider( - true, - new ItemTags(generator, blockTagsProvider, fileHelper) - ); - generator.addProvider(true, blockTagsProvider); - generator.addProvider( - true, - new FluidTags(generator, Reference.MOD_ID, fileHelper) - ); - generator.addProvider(true, new CraftingRecipes(generator)); - generator.addProvider(true, new ShapelessCrafting(generator)); - generator.addProvider(true, new BlastingRecipes(generator)); - generator.addProvider(true, new SmeltingRecipes(generator)); - generator.addProvider(true, new LootTables(generator)); - } - if (event.includeClient()) { - generator.addProvider(true, new BlockStates(generator, fileHelper)); - generator.addProvider(true, new ItemModels(generator, fileHelper)); - } - } + if (event.includeServer()) { + BlockTagsProvider blockTagsProvider = new BlockTags( + generator, + fileHelper); + generator.addProvider( + true, + new ItemTags(generator, blockTagsProvider, fileHelper)); + generator.addProvider(true, blockTagsProvider); + generator.addProvider( + true, + new FluidTags(generator, Reference.MOD_ID, fileHelper)); + generator.addProvider(true, new CraftingRecipes(generator)); + generator.addProvider(true, new ShapelessCrafting(generator)); + generator.addProvider(true, new BlastingRecipes(generator)); + generator.addProvider(true, new SmeltingRecipes(generator)); + generator.addProvider(true, new LootTables(generator)); + } + if (event.includeClient()) { + generator.addProvider(true, new BlockStates(generator, fileHelper)); + generator.addProvider(true, new ItemModels(generator, fileHelper)); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java index d46120ef..e0297a2a 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java @@ -2,7 +2,7 @@ public class RecipeException extends IllegalStateException { - public RecipeException(String id, String message) { - super(String.format("recipe error: %s - %s", id, message)); - } + public RecipeException(String id, String message) { + super(String.format("recipe error: %s - %s", id, message)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java index ba037ed7..d72b7c48 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java @@ -20,212 +20,200 @@ public class ShapedAncientStones { - public enum Slot { - BOOKSHELF, - TRAPDOOR, - BRICK, - FENCE, - FENCEGATE, - STAIRS, - WALL, - SLAB, - DOOR; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ancientStone; - - public ShapedAncientStones(TagKey ancientStone) { - this.ancientStone = ancientStone; - - this.criteriaName = - String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ancientStone) - .build(); - this.criterion = - InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedAncientStones builder(TagKey ancientStone) { - return new ShapedAncientStones(ancientStone); - } - - public ShapedAncientStones setBookShelf(RegistryObject object) { - pieces.put(Slot.BOOKSHELF, object.get()); - return this; - } - - public ShapedAncientStones setDoor(RegistryObject object) { - pieces.put(Slot.DOOR, object.get()); - return this; - } - - public ShapedAncientStones setTrapDoor(RegistryObject object) { - pieces.put(Slot.TRAPDOOR, object.get()); - return this; - } - - public ShapedAncientStones setBrick(RegistryObject object) { - pieces.put(Slot.BRICK, object.get()); - return this; - } - - public ShapedAncientStones setStairs(RegistryObject object) { - pieces.put(Slot.STAIRS, object.get()); - return this; - } - - public ShapedAncientStones setFence(RegistryObject object) { - pieces.put(Slot.FENCE, object.get()); - return this; - } - - public ShapedAncientStones setFenceGate(RegistryObject object) { - pieces.put(Slot.FENCEGATE, object.get()); - return this; - } - - public ShapedAncientStones setSlab(RegistryObject object) { - pieces.put(Slot.SLAB, object.get()); - return this; - } - - public ShapedAncientStones setWall(RegistryObject object) { - pieces.put(Slot.WALL, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output" - ); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> - builder.save(consumer); - Optional - .ofNullable(pieces.get(Slot.BOOKSHELF)) - .map(this::bookshelf) - .map(this::addBookCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.TRAPDOOR)) - .map(this::trapdoor) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.WALL)) - .map(this::wall) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.BRICK)) - .map(this::brick) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.SLAB)) - .map(this::slab) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.DOOR)) - .map(this::door) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.STAIRS)) - .map(this::stairs) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.FENCE)) - .map(this::fence) - .map(this::addStickCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.FENCEGATE)) - .map(this::fencegate) - .map(this::addStickCriterion) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { - return ShapedRecipeBuilder - .shaped(provider, integer) - .group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .define('s', Items.STICK) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .define('b', Items.BOOK) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder bookshelf(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("bbb").pattern("aaa"); - } - - private ShapedRecipeBuilder fence(ItemLike provider) { - return shaped(provider, 3).pattern(" ").pattern("asa").pattern("asa"); - } - - private ShapedRecipeBuilder trapdoor(ItemLike provider) { - return shaped(provider, 2).pattern(" ").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder door(ItemLike provider) { - return shaped(provider, 3).pattern("aa ").pattern("aa ").pattern("aa "); - } - - private ShapedRecipeBuilder brick(ItemLike provider) { - return shaped(provider, 4).pattern(" ").pattern("aa ").pattern("aa "); - } - - private ShapedRecipeBuilder fencegate(ItemLike provider) { - return shaped(provider).pattern(" ").pattern("sas").pattern("sas"); - } - - private ShapedRecipeBuilder stairs(ItemLike provider) { - return shaped(provider, 4).pattern("a ").pattern("aa ").pattern("aaa"); - } - - private ShapedRecipeBuilder wall(ItemLike provider) { - return shaped(provider, 6).pattern(" ").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder slab(ItemLike provider) { - return shaped(provider, 6).pattern(" ").pattern(" ").pattern("aaa"); - } + public enum Slot { + BOOKSHELF, TRAPDOOR, BRICK, FENCE, FENCEGATE, STAIRS, WALL, SLAB, DOOR; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ancientStone; + + public ShapedAncientStones(TagKey ancientStone) { + this.ancientStone = ancientStone; + + this.criteriaName = String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ancientStone) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedAncientStones builder(TagKey ancientStone) { + return new ShapedAncientStones(ancientStone); + } + + public ShapedAncientStones setBookShelf(RegistryObject object) { + pieces.put(Slot.BOOKSHELF, object.get()); + return this; + } + + public ShapedAncientStones setDoor(RegistryObject object) { + pieces.put(Slot.DOOR, object.get()); + return this; + } + + public ShapedAncientStones setTrapDoor(RegistryObject object) { + pieces.put(Slot.TRAPDOOR, object.get()); + return this; + } + + public ShapedAncientStones setBrick(RegistryObject object) { + pieces.put(Slot.BRICK, object.get()); + return this; + } + + public ShapedAncientStones setStairs(RegistryObject object) { + pieces.put(Slot.STAIRS, object.get()); + return this; + } + + public ShapedAncientStones setFence(RegistryObject object) { + pieces.put(Slot.FENCE, object.get()); + return this; + } + + public ShapedAncientStones setFenceGate(RegistryObject object) { + pieces.put(Slot.FENCEGATE, object.get()); + return this; + } + + public ShapedAncientStones setSlab(RegistryObject object) { + pieces.put(Slot.SLAB, object.get()); + return this; + } + + public ShapedAncientStones setWall(RegistryObject object) { + pieces.put(Slot.WALL, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + Optional + .ofNullable(pieces.get(Slot.BOOKSHELF)) + .map(this::bookshelf) + .map(this::addBookCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.TRAPDOOR)) + .map(this::trapdoor) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.WALL)) + .map(this::wall) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.BRICK)) + .map(this::brick) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.SLAB)) + .map(this::slab) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.DOOR)) + .map(this::door) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.STAIRS)) + .map(this::stairs) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCE)) + .map(this::fence) + .map(this::addStickCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCEGATE)) + .map(this::fencegate) + .map(this::addStickCriterion) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { + return ShapedRecipeBuilder + .shaped(provider, integer) + .group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .define('s', Items.STICK) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .define('b', Items.BOOK) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder bookshelf(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("bbb").pattern("aaa"); + } + + private ShapedRecipeBuilder fence(ItemLike provider) { + return shaped(provider, 3).pattern(" ").pattern("asa").pattern("asa"); + } + + private ShapedRecipeBuilder trapdoor(ItemLike provider) { + return shaped(provider, 2).pattern(" ").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder door(ItemLike provider) { + return shaped(provider, 3).pattern("aa ").pattern("aa ").pattern("aa "); + } + + private ShapedRecipeBuilder brick(ItemLike provider) { + return shaped(provider, 4).pattern(" ").pattern("aa ").pattern("aa "); + } + + private ShapedRecipeBuilder fencegate(ItemLike provider) { + return shaped(provider).pattern(" ").pattern("sas").pattern("sas"); + } + + private ShapedRecipeBuilder stairs(ItemLike provider) { + return shaped(provider, 4).pattern("a ").pattern("aa ").pattern("aaa"); + } + + private ShapedRecipeBuilder wall(ItemLike provider) { + return shaped(provider, 6).pattern(" ").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder slab(ItemLike provider) { + return shaped(provider, 6).pattern(" ").pattern(" ").pattern("aaa"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java index 080c7132..20a17abd 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java @@ -19,118 +19,112 @@ public class ShapedArmorBuilder { - public enum Slot { - HELMET, - CHESTPLATE, - LEGGINGS, - BOOTS; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ingot; - - public ShapedArmorBuilder(TagKey ingot) { - this.ingot = ingot; - - this.criteriaName = String.format("has_%s_ingot", ingot); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ingot) - .build(); - this.criterion = - InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedArmorBuilder builder(TagKey ingot) { - return new ShapedArmorBuilder(ingot); - } - - public ShapedArmorBuilder setHelmet(RegistryObject object) { - pieces.put(Slot.HELMET, object.get()); - return this; - } - - public ShapedArmorBuilder setChestplate(RegistryObject object) { - pieces.put(Slot.CHESTPLATE, object.get()); - return this; - } - - public ShapedArmorBuilder setLeggings(RegistryObject object) { - pieces.put(Slot.LEGGINGS, object.get()); - return this; - } - - public ShapedArmorBuilder setBoots(RegistryObject object) { - pieces.put(Slot.BOOTS, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output" - ); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> - builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.HELMET)) - .map(this::helmet) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.CHESTPLATE)) - .map(this::chestplate) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.LEGGINGS)) - .map(this::leggings) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.BOOTS)) - .map(this::boots) - .map(this::addCriterion) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { - return builder.define('a', ingot).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder helmet(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern(" "); - } - - private ShapedRecipeBuilder chestplate(ItemLike provider) { - return shaped(provider).pattern("a a").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder leggings(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern("a a"); - } - - private ShapedRecipeBuilder boots(ItemLike provider) { - return shaped(provider).pattern("a a").pattern("a a").pattern(" "); - } + public enum Slot { + HELMET, CHESTPLATE, LEGGINGS, BOOTS; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ingot; + + public ShapedArmorBuilder(TagKey ingot) { + this.ingot = ingot; + + this.criteriaName = String.format("has_%s_ingot", ingot); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedArmorBuilder builder(TagKey ingot) { + return new ShapedArmorBuilder(ingot); + } + + public ShapedArmorBuilder setHelmet(RegistryObject object) { + pieces.put(Slot.HELMET, object.get()); + return this; + } + + public ShapedArmorBuilder setChestplate(RegistryObject object) { + pieces.put(Slot.CHESTPLATE, object.get()); + return this; + } + + public ShapedArmorBuilder setLeggings(RegistryObject object) { + pieces.put(Slot.LEGGINGS, object.get()); + return this; + } + + public ShapedArmorBuilder setBoots(RegistryObject object) { + pieces.put(Slot.BOOTS, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.HELMET)) + .map(this::helmet) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.CHESTPLATE)) + .map(this::chestplate) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.LEGGINGS)) + .map(this::leggings) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.BOOTS)) + .map(this::boots) + .map(this::addCriterion) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder helmet(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern(" "); + } + + private ShapedRecipeBuilder chestplate(ItemLike provider) { + return shaped(provider).pattern("a a").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder leggings(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern("a a"); + } + + private ShapedRecipeBuilder boots(ItemLike provider) { + return shaped(provider).pattern("a a").pattern("a a").pattern(" "); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java index 207781d3..e867d599 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java @@ -18,123 +18,117 @@ public class ShapedBlockBuilder { - public enum Slot { - BLOCK, - GEAR, - ROD, - PLATE; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ingot; - - public ShapedBlockBuilder(TagKey ingot) { - this.ingot = ingot; - - this.criteriaName = String.format("has_%s_ingot", ingot); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ingot) - .build(); - this.criterion = - InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedBlockBuilder builder(TagKey ingot) { - return new ShapedBlockBuilder(ingot); - } - - public ShapedBlockBuilder setBlock(RegistryObject object) { - pieces.put(Slot.BLOCK, object.get()); - return this; - } - - public ShapedBlockBuilder setGear(RegistryObject object) { - pieces.put(Slot.GEAR, object.get()); - return this; - } - - public ShapedBlockBuilder setPlate(RegistryObject object) { - pieces.put(Slot.PLATE, object.get()); - return this; - } - - public ShapedBlockBuilder setRod(RegistryObject object) { - pieces.put(Slot.ROD, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output" - ); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> - builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.BLOCK)) - .map(this::block) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.GEAR)) - .map(this::gear) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.ROD)) - .map(this::rod) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.PLATE)) - .map(this::plate) - .map(this::addCriterionIngot) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterionIngot(ShapedRecipeBuilder builder) { - return builder.define('a', ingot).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder block(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); - } - - // private ShapedRecipeBuilder ingot(ItemLike provider) { - // return shaped(provider) - // .pattern("aaa") - // .pattern("aaa") - // .pattern("aaa"); - - // } - - private ShapedRecipeBuilder gear(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern("aaa"); - } - - private ShapedRecipeBuilder rod(ItemLike provider) { - return shaped(provider).pattern("a ").pattern("a ").pattern("a "); - } - - private ShapedRecipeBuilder plate(ItemLike provider) { - return shaped(provider).pattern("aa ").pattern("aa ").pattern(" "); - } + public enum Slot { + BLOCK, GEAR, ROD, PLATE; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ingot; + + public ShapedBlockBuilder(TagKey ingot) { + this.ingot = ingot; + + this.criteriaName = String.format("has_%s_ingot", ingot); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedBlockBuilder builder(TagKey ingot) { + return new ShapedBlockBuilder(ingot); + } + + public ShapedBlockBuilder setBlock(RegistryObject object) { + pieces.put(Slot.BLOCK, object.get()); + return this; + } + + public ShapedBlockBuilder setGear(RegistryObject object) { + pieces.put(Slot.GEAR, object.get()); + return this; + } + + public ShapedBlockBuilder setPlate(RegistryObject object) { + pieces.put(Slot.PLATE, object.get()); + return this; + } + + public ShapedBlockBuilder setRod(RegistryObject object) { + pieces.put(Slot.ROD, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.BLOCK)) + .map(this::block) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.GEAR)) + .map(this::gear) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.ROD)) + .map(this::rod) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.PLATE)) + .map(this::plate) + .map(this::addCriterionIngot) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterionIngot(ShapedRecipeBuilder builder) { + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder block(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); + } + + // private ShapedRecipeBuilder ingot(ItemLike provider) { + // return shaped(provider) + // .pattern("aaa") + // .pattern("aaa") + // .pattern("aaa"); + + // } + + private ShapedRecipeBuilder gear(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern("aaa"); + } + + private ShapedRecipeBuilder rod(ItemLike provider) { + return shaped(provider).pattern("a ").pattern("a ").pattern("a "); + } + + private ShapedRecipeBuilder plate(ItemLike provider) { + return shaped(provider).pattern("aa ").pattern("aa ").pattern(" "); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java index a50c8ca7..98adf6d6 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java @@ -18,72 +18,68 @@ public class ShapedIngotBuilder { - public enum Slot { - INGOT; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey nugget; - - public ShapedIngotBuilder(TagKey nugget) { - this.nugget = nugget; - - this.criteriaName = String.format("has_%s_nugget", nugget); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(nugget) - .build(); - this.criterion = - InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedIngotBuilder builder(TagKey nugget) { - return new ShapedIngotBuilder(nugget); - } - - public ShapedIngotBuilder setIngot(RegistryObject object) { - pieces.put(Slot.INGOT, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output" - ); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> - builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.INGOT)) - .map(this::ingot) - .map(this::addCriterionNugget) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterionNugget( - ShapedRecipeBuilder builder - ) { - return builder.define('a', nugget).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder ingot(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); - } + public enum Slot { + INGOT; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey nugget; + + public ShapedIngotBuilder(TagKey nugget) { + this.nugget = nugget; + + this.criteriaName = String.format("has_%s_nugget", nugget); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(nugget) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedIngotBuilder builder(TagKey nugget) { + return new ShapedIngotBuilder(nugget); + } + + public ShapedIngotBuilder setIngot(RegistryObject object) { + pieces.put(Slot.INGOT, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.INGOT)) + .map(this::ingot) + .map(this::addCriterionNugget) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterionNugget( + ShapedRecipeBuilder builder) { + return builder.define('a', nugget).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder ingot(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java index 4f64c747..efe890d8 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java @@ -15,327 +15,264 @@ public class BlockStates extends BlockStateProvider { - public BlockStates(DataGenerator generator, ExistingFileHelper fileHelper) { - super(generator, Reference.MOD_ID, fileHelper); - } + public BlockStates(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, Reference.MOD_ID, fileHelper); + } - @Override - protected void registerStatesAndModels() { - List entries = ModRegistry.BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .filter(block -> !(block instanceof GrassBlock)) - .filter(block -> !(block instanceof LiquidBlock)) - .collect(Collectors.toList()); + @Override + protected void registerStatesAndModels() { + List entries = ModRegistry.BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .filter(block -> !(block instanceof GrassBlock)) + .filter(block -> !(block instanceof LiquidBlock)) + .collect(Collectors.toList()); - entries.forEach(this::simpleBlockAndItem); + entries.forEach(this::simpleBlockAndItem); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_0.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_1.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_2.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_0.get(), - models().getBuilder("ancient_log_0") - ); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_1.get(), - models().getBuilder("ancient_log_1") - ); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_2.get(), - models().getBuilder("ancient_log_2") - ); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_STRIPPED.get(), - models().getBuilder("stripped_ancient_log") - ); - // trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new - // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); - simpleBlockItem( - ModRegistry.ANCIENT_BOOKSHELF.get(), - models().getBuilder("ancient_bookshelf") - ); - stairsBlock( - ModRegistry.ANCIENT_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_0.get(), + models().getBuilder("ancient_log_0")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_1.get(), + models().getBuilder("ancient_log_1")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_2.get(), + models().getBuilder("ancient_log_2")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_STRIPPED.get(), + models().getBuilder("stripped_ancient_log")); + // trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); + simpleBlockItem( + ModRegistry.ANCIENT_BOOKSHELF.get(), + models().getBuilder("ancient_bookshelf")); + stairsBlock( + ModRegistry.ANCIENT_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_0.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_1.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_2.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.SOUL_LOG.get(), - models().getBuilder("soul_log") - ); - simpleBlockItem( - ModRegistry.SOUL_LOG_0.get(), - models().getBuilder("soul_log_0") - ); - simpleBlockItem( - ModRegistry.SOUL_LOG_1.get(), - models().getBuilder("soul_log_1") - ); - simpleBlockItem( - ModRegistry.SOUL_LOG_2.get(), - models().getBuilder("soul_log_2") - ); - simpleBlockItem( - ModRegistry.SOUL_LOG_STRIPPED.get(), - models().getBuilder("stripped_soul_log") - ); - simpleBlockItem( - ModRegistry.SOUL_BOOKSHELF.get(), - models().getBuilder("soul_bookshelf") - ); - stairsBlock( - ModRegistry.SOUL_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); + simpleBlockItem( + ModRegistry.SOUL_LOG.get(), + models().getBuilder("soul_log")); + simpleBlockItem( + ModRegistry.SOUL_LOG_0.get(), + models().getBuilder("soul_log_0")); + simpleBlockItem( + ModRegistry.SOUL_LOG_1.get(), + models().getBuilder("soul_log_1")); + simpleBlockItem( + ModRegistry.SOUL_LOG_2.get(), + models().getBuilder("soul_log_2")); + simpleBlockItem( + ModRegistry.SOUL_LOG_STRIPPED.get(), + models().getBuilder("stripped_soul_log")); + simpleBlockItem( + ModRegistry.SOUL_BOOKSHELF.get(), + models().getBuilder("soul_bookshelf")); + stairsBlock( + ModRegistry.SOUL_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG.get()); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.DEMONIC_LOG.get(), - models().getBuilder("demonic_log") - ); - simpleBlockItem( - ModRegistry.DEMONIC_LOG_STRIPPED.get(), - models().getBuilder("stripped_demonic_log") - ); - simpleBlockItem( - ModRegistry.DEMONIC_BOOKSHELF.get(), - models().getBuilder("demonic_bookshelf") - ); - stairsBlock( - ModRegistry.DEMONIC_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); + simpleBlockItem( + ModRegistry.DEMONIC_LOG.get(), + models().getBuilder("demonic_log")); + simpleBlockItem( + ModRegistry.DEMONIC_LOG_STRIPPED.get(), + models().getBuilder("stripped_demonic_log")); + simpleBlockItem( + ModRegistry.DEMONIC_BOOKSHELF.get(), + models().getBuilder("demonic_bookshelf")); + stairsBlock( + ModRegistry.DEMONIC_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - stairsBlock( - ModRegistry.ANCIENT_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); - stairsBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); - stairsBlock( - ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); - stairsBlock( - ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); - stairsBlock( - ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); - stairsBlock( - ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); - stairsBlock( - ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); + stairsBlock( + ModRegistry.ANCIENT_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + stairsBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + stairsBlock( + ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + stairsBlock( + ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - fenceBlock( - ModRegistry.ANCIENT_WOOD_FENCE.get(), - "ancient_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); - fenceGateBlock( - ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(), - "ancient_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); - fenceBlock( - ModRegistry.DEMONIC_WOOD_FENCE.get(), - "demonic_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); - fenceGateBlock( - ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(), - "demonic_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); - fenceBlock( - ModRegistry.SOUL_WOOD_FENCE.get(), - "soul_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); - fenceGateBlock( - ModRegistry.SOUL_WOOD_FENCE_GATE.get(), - "soul_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); + fenceBlock( + ModRegistry.ANCIENT_WOOD_FENCE.get(), + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceGateBlock( + ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(), + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceBlock( + ModRegistry.DEMONIC_WOOD_FENCE.get(), + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceGateBlock( + ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(), + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceBlock( + ModRegistry.SOUL_WOOD_FENCE.get(), + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceGateBlock( + ModRegistry.SOUL_WOOD_FENCE_GATE.get(), + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - wallBlock( - ModRegistry.ANCIENT_STONE_WALL.get(), - "ancient_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); - wallBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(), - "ancient_smooth_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); - wallBlock( - ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(), - "ancient_polished_stone_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); - wallBlock( - ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(), - "ancient_mossy_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); - wallBlock( - ModRegistry.ANCIENT_STONE_BRICK_WALL.get(), - "ancient_stone_brick_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); - wallBlock( - ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(), - "ancient_chiseled_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); - wallBlock( - ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(), - "ancient_cracked_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); + wallBlock( + ModRegistry.ANCIENT_STONE_WALL.get(), + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + wallBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(), + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + wallBlock( + ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(), + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); + wallBlock( + ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(), + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + wallBlock( + ModRegistry.ANCIENT_STONE_BRICK_WALL.get(), + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + wallBlock( + ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + wallBlock( + ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - slabBlock( - ModRegistry.ANCIENT_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); - slabBlock( - ModRegistry.DEMONIC_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); - slabBlock( - ModRegistry.SOUL_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); - slabBlock( - ModRegistry.ANCIENT_STONE_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); - slabBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); - slabBlock( - ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); - slabBlock( - ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); - slabBlock( - ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); - slabBlock( - ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); - slabBlock( - ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); + slabBlock( + ModRegistry.ANCIENT_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + slabBlock( + ModRegistry.DEMONIC_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + slabBlock( + ModRegistry.SOUL_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + slabBlock( + ModRegistry.ANCIENT_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + slabBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + slabBlock( + ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + slabBlock( + ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - doorBlock( - ModRegistry.ANCIENT_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_door_top") - ); - doorBlock( - ModRegistry.DEMONIC_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_door_top") - ); - doorBlock( - ModRegistry.SOUL_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/soul_door_top") - ); - } + doorBlock( + ModRegistry.ANCIENT_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_top")); + doorBlock( + ModRegistry.DEMONIC_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_top")); + doorBlock( + ModRegistry.SOUL_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_top")); + } - /** - * Generates an item model and block model/block state for a simple block - * - * @param block the block - */ - private void simpleBlockAndItem(Block block) { - ResourceLocation blockName = ForgeRegistries.BLOCKS.getKey(block); - simpleBlock(block); - BlockModelBuilder builder = models().getBuilder(blockName.toString()); - simpleBlockItem(block, builder); - } + /** + * Generates an item model and block model/block state for a simple block + * + * @param block + * the block + */ + private void simpleBlockAndItem(Block block) { + ResourceLocation blockName = ForgeRegistries.BLOCKS.getKey(block); + simpleBlock(block); + BlockModelBuilder builder = models().getBuilder(blockName.toString()); + simpleBlockItem(block, builder); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java index d1ee63f6..0362375e 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java @@ -10,318 +10,256 @@ public class ItemModels extends ItemModelProvider { - public ItemModels(DataGenerator generator, ExistingFileHelper fileHelper) { - super(generator, Reference.MOD_ID, fileHelper); - } + public ItemModels(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, Reference.MOD_ID, fileHelper); + } - private ResourceLocation res(String name) { - return new ResourceLocation(Reference.MOD_ID, ITEM_FOLDER + "/" + name); - } + private ResourceLocation res(String name) { + return new ResourceLocation(Reference.MOD_ID, ITEM_FOLDER + "/" + name); + } - @Override - protected void registerModels() { - ResourceLocation generated = new ResourceLocation("item/generated"); - // ResourceLocation handheld = new ResourceLocation("item/handheld"); - ModRegistry.ITEMS - .getEntries() - .stream() - .filter(item -> !(item.get() instanceof BlockItem)) - .filter(item -> !(item.get() instanceof SwordItem)) - .filter(item -> !(item.get() instanceof PickaxeItem)) - .filter(item -> !(item.get() instanceof ShovelItem)) - .filter(item -> !(item.get() instanceof AxeItem)) - .filter(item -> !(item.get() instanceof HoeItem)) - .forEach(item -> { - String name = item.getId().getPath(); - if (!name.contains("bucket")) { - withExistingParent(name, generated) - .texture("layer0", res(name)); - } - }); + @Override + protected void registerModels() { + ResourceLocation generated = new ResourceLocation("item/generated"); + // ResourceLocation handheld = new ResourceLocation("item/handheld"); + ModRegistry.ITEMS + .getEntries() + .stream() + .filter(item -> !(item.get() instanceof BlockItem)) + .filter(item -> !(item.get() instanceof SwordItem)) + .filter(item -> !(item.get() instanceof PickaxeItem)) + .filter(item -> !(item.get() instanceof ShovelItem)) + .filter(item -> !(item.get() instanceof AxeItem)) + .filter(item -> !(item.get() instanceof HoeItem)) + .forEach(item -> { + String name = item.getId().getPath(); + if (!name.contains("bucket")) { + withExistingParent(name, generated) + .texture("layer0", res(name)); + } + }); - stairs( - "ancient_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); + stairs( + "ancient_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - stairs( - "demonic_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); + stairs( + "demonic_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - stairs( - "soul_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); + stairs( + "soul_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - stairs( - "ancient_stone_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); + stairs( + "ancient_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - stairs( - "ancient_smooth_stone_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); + stairs( + "ancient_smooth_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - stairs( - "ancient_polished_stone_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); + stairs( + "ancient_polished_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - stairs( - "ancient_mossy_stone_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); + stairs( + "ancient_mossy_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - stairs( - "ancient_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); + stairs( + "ancient_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - stairs( - "ancient_chiseled_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); + stairs( + "ancient_chiseled_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); - stairs( - "ancient_cracked_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); + stairs( + "ancient_cracked_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - fenceInventory( - "ancient_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); - fenceGate( - "ancient_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); + fenceInventory( + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceGate( + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - fenceInventory( - "demonic_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); - fenceGate( - "demonic_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); + fenceInventory( + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceGate( + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - fenceInventory( - "soul_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); - fenceGate( - "soul_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); + fenceInventory( + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceGate( + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - wallInventory( - "ancient_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); - wallInventory( - "ancient_smooth_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); - wallInventory( - "ancient_polished_stone_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); - wallInventory( - "ancient_mossy_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); - wallInventory( - "ancient_stone_brick_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); - wallInventory( - "ancient_chiseled_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); - wallInventory( - "ancient_cracked_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); + wallInventory( + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + wallInventory( + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + wallInventory( + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); + wallInventory( + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + wallInventory( + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + wallInventory( + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + wallInventory( + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - slab( - "ancient_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks") - ); + slab( + "ancient_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - slab( - "demonic_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks") - ); + slab( + "demonic_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - slab( - "soul_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks") - ); + slab( + "soul_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - slab( - "ancient_stone_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone") - ); + slab( + "ancient_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - slab( - "ancient_smooth_stone_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone") - ); + slab( + "ancient_smooth_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - slab( - "ancient_polished_stone_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone" - ) - ); + slab( + "ancient_polished_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - slab( - "ancient_mossy_stone_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone") - ); + slab( + "ancient_mossy_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - slab( - "ancient_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks" - ), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks") - ); + slab( + "ancient_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - slab( - "ancient_chiseled_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks" - ) - ); + slab( + "ancient_chiseled_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); - slab( - "ancient_cracked_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks" - ) - ); - // trapdoorOrientableTop("ancient_trap_door",new - // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); - } + slab( + "ancient_cracked_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + // trapdoorOrientableTop("ancient_trap_door",new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java index 57763501..3d70c80d 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java @@ -12,110 +12,95 @@ public class BlastingRecipes extends RecipeProvider { - public BlastingRecipes(DataGenerator generator) { - super(generator); - } + public BlastingRecipes(DataGenerator generator) { + super(generator); + } - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut + "_blasting" - ); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut + "_blasting"); + } - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), - ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) - ) - .save(consumer, recipeDir("allthemodium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) - ) - .save(consumer, recipeDir("vibranium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) - ) - .save(consumer, recipeDir("unobtainium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get()) - ) - .save(consumer, recipeDir("allthemodium_ingot", "dust_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) + .save(consumer, recipeDir("allthemodium_ingot", "dust_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get()) - ) - .save(consumer, recipeDir("vibranium_ingot", "dust_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) + .save(consumer, recipeDir("vibranium_ingot", "dust_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get()) - ) - .save(consumer, recipeDir("unobtainium_ingot", "dust_blasting")); - } + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) + .save(consumer, recipeDir("unobtainium_ingot", "dust_blasting")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java index 226f5d95..897f471b 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java @@ -14,435 +14,434 @@ public class BlockTags extends BlockTagsProvider { - public BlockTags( - DataGenerator generator, - @Nullable ExistingFileHelper existingFileHelper - ) { - super(generator, Reference.MOD_ID, existingFileHelper); - } - - @Override - protected void addTags() { - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.FURNACE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BLAST_FURNACE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BREWING_STAND); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BARREL); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CHEST); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CAMPFIRE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.SOUL_CAMPFIRE); - - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); - - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(TagRegistry.ANCIENT_WOODEN_PLANKS) - .add(ModRegistry.ANCIENT_PLANKS.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(TagRegistry.SOUL_WOODEN_PLANKS).add(ModRegistry.SOUL_PLANKS.get()); - tag(TagRegistry.ANCIENT_STONE).add(ModRegistry.ANCIENT_STONE.get()); - tag(TagRegistry.ANCIENT_DIRT).add(ModRegistry.ANCIENT_DIRT.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE) - .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE) - .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE) - .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS) - .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.ANCIENT_PLANKS.get()); - - tag(net.minecraft.tags.BlockTags.CLIMBABLE) - .add(ModRegistry.ANCIENT_CAVEVINES_.get()); - tag(net.minecraft.tags.BlockTags.CLIMBABLE) - .add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); - - tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.UNOBTAINIUM_ORE.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.NYLIUM) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.BEE_GROWABLES) - .add(ModRegistry.ANCIENT_SAPLING.get()); - tag(net.minecraft.tags.BlockTags.DIRT) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.DIRT) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SAPLINGS) - .add(ModRegistry.ANCIENT_SAPLING.get()); - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); - - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); - - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.ANCIENT_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.SOUL_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.DEMONIC_LEAVES.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK) - .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE) - .add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(TagRegistry.VIBRANIUM_BLOCK).add(ModRegistry.VIBRANIUM_BLOCK.get()); - tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.VIBRANIUM_ORE) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK) - .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); - tag(TagRegistry.UNOBTAINIUM_ORE).add(ModRegistry.UNOBTAINIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UNOBTAINIUM_ORE.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UV_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UA_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VA_ALLOY.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.TELEPORT_PAD.get()); - - ModRegistry.BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.SHAPED_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.STAIR_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.SLAB_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.WALL_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.PILLAR_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.CRIMSON_NYLIUM); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.WARPED_NYLIUM); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERRACK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SAND); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SOIL); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DEEPSLATE); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_ALUMINUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COAL_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COPPER_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_DIAMOND_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LEAD_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_NICKEL_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_IRIDIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LAPIS_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_PLATINUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_SILVER_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_OSMIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_URANIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ZINC_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_TIN_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRON_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_REDSTONE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_GOLD_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_QUARTZ_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_EMERALD_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.ALUMINUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.LEAD_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.NICKEL_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OSMIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.PLATINUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.SILVER_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.TIN_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.URANIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ZINC_SLATE_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.IRIDIUM_SLATE_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_ALUMINUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_LEAD_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_NICKEL_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_OSMIUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_PLATINUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_SILVER_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_TIN_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_URANIUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ZINC_BLOCK.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_IRIDIUM_BLOCK.get()); - - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERITE_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DIAMOND_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_CLUSTER); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.GOLD_BLOCK); - - tag(TagRegistry.OTHER_PROTECTION).addTag(TagRegistry.BLOCK_ORES); - } + public BlockTags( + DataGenerator generator, + @Nullable ExistingFileHelper existingFileHelper) { + super(generator, Reference.MOD_ID, existingFileHelper); + } + + @Override + protected void addTags() { + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.FURNACE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BLAST_FURNACE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BREWING_STAND); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BARREL); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CHEST); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CAMPFIRE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.SOUL_CAMPFIRE); + + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); + + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(TagRegistry.ANCIENT_WOODEN_PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(TagRegistry.SOUL_WOODEN_PLANKS).add(ModRegistry.SOUL_PLANKS.get()); + tag(TagRegistry.ANCIENT_STONE).add(ModRegistry.ANCIENT_STONE.get()); + tag(TagRegistry.ANCIENT_DIRT).add(ModRegistry.ANCIENT_DIRT.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_.get()); + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); + + tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.NYLIUM) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.BEE_GROWABLES) + .add(ModRegistry.ANCIENT_SAPLING.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SAPLINGS) + .add(ModRegistry.ANCIENT_SAPLING.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); + + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); + + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.ANCIENT_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.SOUL_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.DEMONIC_LEAVES.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(TagRegistry.VIBRANIUM_BLOCK).add(ModRegistry.VIBRANIUM_BLOCK.get()); + tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.VIBRANIUM_ORE.get()); + tag(TagRegistry.VIBRANIUM_ORE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(TagRegistry.UNOBTAINIUM_ORE).add(ModRegistry.UNOBTAINIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UV_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UA_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VA_ALLOY.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.TELEPORT_PAD.get()); + + ModRegistry.BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SHAPED_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.CRIMSON_NYLIUM); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.WARPED_NYLIUM); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERRACK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SAND); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SOIL); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DEEPSLATE); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_ALUMINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COAL_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COPPER_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_DIAMOND_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LEAD_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_NICKEL_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_IRIDIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LAPIS_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_PLATINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_SILVER_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_OSMIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_URANIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ZINC_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_TIN_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRON_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_REDSTONE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_GOLD_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_QUARTZ_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_EMERALD_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.ALUMINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.LEAD_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.NICKEL_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OSMIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.PLATINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.SILVER_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.TIN_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.URANIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ZINC_SLATE_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.IRIDIUM_SLATE_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_ALUMINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_LEAD_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_NICKEL_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_OSMIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_PLATINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_SILVER_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_TIN_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_URANIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ZINC_BLOCK.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_IRIDIUM_BLOCK.get()); + + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERITE_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DIAMOND_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_CLUSTER); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.GOLD_BLOCK); + + tag(TagRegistry.OTHER_PROTECTION).addTag(TagRegistry.BLOCK_ORES); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java index 0d80f6a4..9f844457 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java @@ -22,328 +22,306 @@ public class CraftingRecipes extends RecipeProvider { - public CraftingRecipes(DataGenerator generatorIn) { - super(generatorIn); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private static InventoryChangeTrigger.TriggerInstance hasTag( - TagKey tagKey - ) { - return inventoryTrigger( - ItemPredicate.Builder.item().of(tagKey).build() - ); - } - - @Override - protected void buildCraftingRecipes(Consumer consumer) { - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_ALLTHEMODIUM), 9) - .unlockedBy( - "has_raw_allthemodium", - hasTag(TagRegistry.RAW_ALLTHEMODIUM) - ) - .save(consumer); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_VIBRANIUM), 9) - .unlockedBy("has_raw_vibranium", hasTag(TagRegistry.RAW_VIBRANIUM)) - .save(consumer); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_UNOBTAINIUM), 9) - .unlockedBy( - "has_raw_unobtainium", - hasTag(TagRegistry.RAW_UNOBTAINIUM) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_APPLE.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.APPLE) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_CARROT.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.CARROT) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.TELEPORT_PAD_ITEM.get()) - .pattern(" n ") - .pattern("nan") - .pattern(" n ") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.ENDER_PEARL) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build() - ) - ) - .unlockedBy( - "has_ender_pearl", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_PICKAXE.get()) - .pattern("ara") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_AXE.get()) - .pattern("aa ") - .pattern("ar ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_SHOVEL.get()) - .pattern(" a ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_HOE.get()) - .pattern("aa ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build() - ) - ) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_SWORD.get()) - .pattern(" a ") - .pattern(" a ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build() - ) - ) - .save(consumer); - - // final String hasCondition = "has_item"; - - ShapedAncientStones - .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) - .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) - .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) - .setDoor(ModRegistry.SOUL_DOOR_ITEM) - .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) - .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) - .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) - .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_STONE_ITEM) - .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .setGear(ModRegistry.ATM_GEAR) - .setPlate(ModRegistry.ATM_PLATE) - .setRod(ModRegistry.ATM_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.VIBRANIUM_INGOT) - .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) - .setGear(ModRegistry.VIB_GEAR) - .setPlate(ModRegistry.VIB_PLATE) - .setRod(ModRegistry.VIB_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_INGOT) - .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) - .setGear(ModRegistry.UNOB_GEAR) - .setPlate(ModRegistry.UNOB_PLATE) - .setRod(ModRegistry.UNOB_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.UA_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) - .setBlock(ModRegistry.UV_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.VA_ALLOY_ITEM) - .build(consumer); - - ShapedIngotBuilder - .builder(TagRegistry.ALLTHEMODIUM_NUGGET) - .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) - .build(consumer); - ShapedIngotBuilder - .builder(TagRegistry.VIBRANIUM_NUGGET) - .setIngot(ModRegistry.VIBRANIUM_INGOT) - .build(consumer); - ShapedIngotBuilder - .builder(TagRegistry.UNOBTAINIUM_NUGGET) - .setIngot(ModRegistry.UNOBTAINIUM_INGOT) - .build(consumer); - } + public CraftingRecipes(DataGenerator generatorIn) { + super(generatorIn); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private static InventoryChangeTrigger.TriggerInstance hasTag( + TagKey tagKey) { + return inventoryTrigger( + ItemPredicate.Builder.item().of(tagKey).build()); + } + + @Override + protected void buildCraftingRecipes(Consumer consumer) { + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_ALLTHEMODIUM), 9) + .unlockedBy( + "has_raw_allthemodium", + hasTag(TagRegistry.RAW_ALLTHEMODIUM)) + .save(consumer); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_VIBRANIUM), 9) + .unlockedBy("has_raw_vibranium", hasTag(TagRegistry.RAW_VIBRANIUM)) + .save(consumer); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_UNOBTAINIUM), 9) + .unlockedBy( + "has_raw_unobtainium", + hasTag(TagRegistry.RAW_UNOBTAINIUM)) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_APPLE.get()) + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.APPLE) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_CARROT.get()) + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.CARROT) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .save(consumer); + + shaped(ModRegistry.TELEPORT_PAD_ITEM.get()) + .pattern(" n ") + .pattern("nan") + .pattern(" n ") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.ENDER_PEARL) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .unlockedBy( + "has_ender_pearl", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_PICKAXE.get()) + .pattern("ara") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_AXE.get()) + .pattern("aa ") + .pattern("ar ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_SHOVEL.get()) + .pattern(" a ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_HOE.get()) + .pattern("aa ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_SWORD.get()) + .pattern(" a ") + .pattern(" a ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + // final String hasCondition = "has_item"; + + ShapedAncientStones + .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) + .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) + .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) + .setDoor(ModRegistry.SOUL_DOOR_ITEM) + .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) + .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) + .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) + .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_ITEM) + .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .setGear(ModRegistry.ATM_GEAR) + .setPlate(ModRegistry.ATM_PLATE) + .setRod(ModRegistry.ATM_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_INGOT) + .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) + .setGear(ModRegistry.VIB_GEAR) + .setPlate(ModRegistry.VIB_PLATE) + .setRod(ModRegistry.VIB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_INGOT) + .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) + .setGear(ModRegistry.UNOB_GEAR) + .setPlate(ModRegistry.UNOB_PLATE) + .setRod(ModRegistry.UNOB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.UA_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .setBlock(ModRegistry.UV_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.VA_ALLOY_ITEM) + .build(consumer); + + ShapedIngotBuilder + .builder(TagRegistry.ALLTHEMODIUM_NUGGET) + .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.VIBRANIUM_NUGGET) + .setIngot(ModRegistry.VIBRANIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.UNOBTAINIUM_NUGGET) + .setIngot(ModRegistry.UNOBTAINIUM_INGOT) + .build(consumer); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java index cb48365d..4e48a650 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java @@ -9,24 +9,23 @@ public class FluidTags extends FluidTagsProvider { - public FluidTags( - DataGenerator p_126523_, - String modId, - @Nullable ExistingFileHelper existingFileHelper - ) { - super(p_126523_, modId, existingFileHelper); - } + public FluidTags( + DataGenerator p_126523_, + String modId, + @Nullable ExistingFileHelper existingFileHelper) { + super(p_126523_, modId, existingFileHelper); + } - @Override - protected void addTags() { - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA) - .add(FluidRegistry.SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA) - .add(FluidRegistry.FLOWING_SOULLAVA.get()); - // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); - // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); - // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); - } + @Override + protected void addTags() { + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.FLOWING_SOULLAVA.get()); + // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); + // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); + // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java index baa49a93..8d63d311 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java @@ -12,256 +12,254 @@ public class ItemTags extends ItemTagsProvider { - public ItemTags( - DataGenerator generator, - BlockTagsProvider blockTagsProvider, - ExistingFileHelper existingFileHelper - ) { - super( - generator, - blockTagsProvider, - Reference.MOD_ID, - existingFileHelper - ); - } - - @Override - protected void addTags() { - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.DEMONIC_LOG_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_2_ITEM.get()); - - tag(TagRegistry.SAPLINGS).add(ModRegistry.SOUL_SAPLING_ITEM.get()); - tag(TagRegistry.SAPLINGS).add(ModRegistry.DEMONIC_SAPLING_ITEM.get()); - tag(TagRegistry.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - - tag(TagRegistry.FORGE_PICKAXES) - .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); - - tag(TagRegistry.FORGE_AXES).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - - tag(TagRegistry.FORGE_SHOVELS) - .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); - - tag(TagRegistry.FORGE_HOES).add(ModRegistry.ALLTHEMODIUM_HOE.get()); - - tag(TagRegistry.FORGE_SWORDS).add(ModRegistry.ALLTHEMODIUM_SWORD.get()); - tag(TagRegistry.FORGE_SWORDS).add(ItemRegistry.ATM_ALLOY_SWORD.get()); - - tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PICK.get()); - tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_AXE.get()); - - tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_SHOVEL.get()); - tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(Tags.Items.SHEARS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_HOES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HOE.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_BOOTS.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_HELMET.get()); - - tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) - .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) - .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) - .add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_ITEM) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) - .add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) - .add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) - .add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM) - .add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_VIBRANIUM).add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM).add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE) - .add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_VIBRANIUM_FORGE) - .add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_FORGE) - .add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.ALLTHEMODIUM_INGOT) - .add(ModRegistry.ALLTHEMODIUM_INGOT.get()); - tag(TagRegistry.VIBRANIUM_INGOT).add(ModRegistry.VIBRANIUM_INGOT.get()); - tag(TagRegistry.UNOBTAINIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_INGOT.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) - .add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.VA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.UA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) - .add(ModRegistry.UV_ALLOY_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_DUST) - .add(ModRegistry.ALLTHEMODIUM_DUST.get()); - tag(TagRegistry.VIBRANIUM_DUST).add(ModRegistry.VIBRANIUM_DUST.get()); - tag(TagRegistry.UNOBTAINIUM_DUST) - .add(ModRegistry.UNOBTAINIUM_DUST.get()); - - tag(TagRegistry.DUSTS).add(ModRegistry.ALLTHEMODIUM_DUST.get()); - tag(TagRegistry.DUSTS).add(ModRegistry.VIBRANIUM_DUST.get()); - tag(TagRegistry.DUSTS).add(ModRegistry.UNOBTAINIUM_DUST.get()); - - tag(TagRegistry.INGOTS).add(ModRegistry.ALLTHEMODIUM_INGOT.get()); - tag(TagRegistry.INGOTS).add(ModRegistry.VIBRANIUM_INGOT.get()); - tag(TagRegistry.INGOTS).add(ModRegistry.UNOBTAINIUM_INGOT.get()); - - tag(TagRegistry.ALLTHEMODIUM_NUGGET) - .add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); - tag(TagRegistry.VIBRANIUM_NUGGET) - .add(ModRegistry.VIBRANIUM_NUGGET.get()); - tag(TagRegistry.UNOBTAINIUM_NUGGET) - .add(ModRegistry.UNOBTAINIUM_NUGGET.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.VIBRANIUM_BLOCK_ITEM) - .add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) - .add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_VIBRANIUM_BLOCK) - .add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK) - .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) - .add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM) - .add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM) - .add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ORE_ITEM) - .add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); - - tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_GEAR).add(ModRegistry.ATM_GEAR.get()); - tag(TagRegistry.VIBRANIUM_GEAR).add(ModRegistry.VIB_GEAR.get()); - tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.UNOB_GEAR.get()); - - tag(TagRegistry.ALLTHEMODIUM_PLATE).add(ModRegistry.ATM_PLATE.get()); - tag(TagRegistry.VIBRANIUM_PLATE).add(ModRegistry.VIB_PLATE.get()); - tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.UNOB_PLATE.get()); - - tag(TagRegistry.ALLTHEMODIUM_ROD).add(ModRegistry.ATM_ROD.get()); - tag(TagRegistry.VIBRANIUM_ROD).add(ModRegistry.VIB_ROD.get()); - tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.UNOB_ROD.get()); - - tag(TagRegistry.ALLTHEMODIUM_SHARD).add(ModRegistry.ATM_SHARD.get()); - tag(TagRegistry.VIBRANIUM_SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.UNOB_SHARD.get()); - - tag(TagRegistry.ALLTHEMODIUM_CLUMP).add(ModRegistry.ATM_CLUMP.get()); - tag(TagRegistry.VIBRANIUM_CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.UNOB_CLUMP.get()); - - tag(TagRegistry.ALLTHEMODIUM_CRYSTAL) - .add(ModRegistry.ATM_CRYSTAL.get()); - tag(TagRegistry.VIBRANIUM_CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.UNOBTAINIUM_CRYSTAL) - .add(ModRegistry.UNOB_CRYSTAL.get()); - - tag(TagRegistry.ALLTHEMODIUM_DIRTY_DUST) - .add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.VIBRANIUM_DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.UNOBTAINIUM_DIRTY_DUST) - .add(ModRegistry.UNOB_DIRTY.get()); - - tag(TagRegistry.SHARD).add(ModRegistry.ATM_SHARD.get()); - tag(TagRegistry.SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.SHARD).add(ModRegistry.UNOB_SHARD.get()); - - tag(TagRegistry.CLUMP).add(ModRegistry.ATM_CLUMP.get()); - tag(TagRegistry.CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.CLUMP).add(ModRegistry.UNOB_CLUMP.get()); - - tag(TagRegistry.CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); - tag(TagRegistry.CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.CRYSTAL).add(ModRegistry.UNOB_CRYSTAL.get()); - - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.UNOB_DIRTY.get()); - } + public ItemTags( + DataGenerator generator, + BlockTagsProvider blockTagsProvider, + ExistingFileHelper existingFileHelper) { + super( + generator, + blockTagsProvider, + Reference.MOD_ID, + existingFileHelper); + } + + @Override + protected void addTags() { + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.DEMONIC_LOG_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_2_ITEM.get()); + + tag(TagRegistry.SAPLINGS).add(ModRegistry.SOUL_SAPLING_ITEM.get()); + tag(TagRegistry.SAPLINGS).add(ModRegistry.DEMONIC_SAPLING_ITEM.get()); + tag(TagRegistry.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + + tag(TagRegistry.FORGE_PICKAXES) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + + tag(TagRegistry.FORGE_AXES).add(ModRegistry.ALLTHEMODIUM_AXE.get()); + + tag(TagRegistry.FORGE_SHOVELS) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + + tag(TagRegistry.FORGE_HOES).add(ModRegistry.ALLTHEMODIUM_HOE.get()); + + tag(TagRegistry.FORGE_SWORDS).add(ModRegistry.ALLTHEMODIUM_SWORD.get()); + tag(TagRegistry.FORGE_SWORDS).add(ItemRegistry.ATM_ALLOY_SWORD.get()); + + tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PICK.get()); + tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_AXE.get()); + + tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_SHOVEL.get()); + tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(Tags.Items.SHEARS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_HOES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_AXE.get()); + + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HOE.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_BOOTS.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_HELMET.get()); + + tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_ITEM) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_VIBRANIUM).add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM).add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_VIBRANIUM_FORGE) + .add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_FORGE) + .add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.ALLTHEMODIUM_INGOT) + .add(ModRegistry.ALLTHEMODIUM_INGOT.get()); + tag(TagRegistry.VIBRANIUM_INGOT).add(ModRegistry.VIBRANIUM_INGOT.get()); + tag(TagRegistry.UNOBTAINIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_INGOT.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.VA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.UA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .add(ModRegistry.UV_ALLOY_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_DUST) + .add(ModRegistry.ALLTHEMODIUM_DUST.get()); + tag(TagRegistry.VIBRANIUM_DUST).add(ModRegistry.VIBRANIUM_DUST.get()); + tag(TagRegistry.UNOBTAINIUM_DUST) + .add(ModRegistry.UNOBTAINIUM_DUST.get()); + + tag(TagRegistry.DUSTS).add(ModRegistry.ALLTHEMODIUM_DUST.get()); + tag(TagRegistry.DUSTS).add(ModRegistry.VIBRANIUM_DUST.get()); + tag(TagRegistry.DUSTS).add(ModRegistry.UNOBTAINIUM_DUST.get()); + + tag(TagRegistry.INGOTS).add(ModRegistry.ALLTHEMODIUM_INGOT.get()); + tag(TagRegistry.INGOTS).add(ModRegistry.VIBRANIUM_INGOT.get()); + tag(TagRegistry.INGOTS).add(ModRegistry.UNOBTAINIUM_INGOT.get()); + + tag(TagRegistry.ALLTHEMODIUM_NUGGET) + .add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); + tag(TagRegistry.VIBRANIUM_NUGGET) + .add(ModRegistry.VIBRANIUM_NUGGET.get()); + tag(TagRegistry.UNOBTAINIUM_NUGGET) + .add(ModRegistry.UNOBTAINIUM_NUGGET.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_VIBRANIUM_BLOCK) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ORE_ITEM) + .add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); + + tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_GEAR).add(ModRegistry.ATM_GEAR.get()); + tag(TagRegistry.VIBRANIUM_GEAR).add(ModRegistry.VIB_GEAR.get()); + tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.UNOB_GEAR.get()); + + tag(TagRegistry.ALLTHEMODIUM_PLATE).add(ModRegistry.ATM_PLATE.get()); + tag(TagRegistry.VIBRANIUM_PLATE).add(ModRegistry.VIB_PLATE.get()); + tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.UNOB_PLATE.get()); + + tag(TagRegistry.ALLTHEMODIUM_ROD).add(ModRegistry.ATM_ROD.get()); + tag(TagRegistry.VIBRANIUM_ROD).add(ModRegistry.VIB_ROD.get()); + tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.UNOB_ROD.get()); + + tag(TagRegistry.ALLTHEMODIUM_SHARD).add(ModRegistry.ATM_SHARD.get()); + tag(TagRegistry.VIBRANIUM_SHARD).add(ModRegistry.VIB_SHARD.get()); + tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.UNOB_SHARD.get()); + + tag(TagRegistry.ALLTHEMODIUM_CLUMP).add(ModRegistry.ATM_CLUMP.get()); + tag(TagRegistry.VIBRANIUM_CLUMP).add(ModRegistry.VIB_CLUMP.get()); + tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.UNOB_CLUMP.get()); + + tag(TagRegistry.ALLTHEMODIUM_CRYSTAL) + .add(ModRegistry.ATM_CRYSTAL.get()); + tag(TagRegistry.VIBRANIUM_CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); + tag(TagRegistry.UNOBTAINIUM_CRYSTAL) + .add(ModRegistry.UNOB_CRYSTAL.get()); + + tag(TagRegistry.ALLTHEMODIUM_DIRTY_DUST) + .add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.VIBRANIUM_DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.UNOBTAINIUM_DIRTY_DUST) + .add(ModRegistry.UNOB_DIRTY.get()); + + tag(TagRegistry.SHARD).add(ModRegistry.ATM_SHARD.get()); + tag(TagRegistry.SHARD).add(ModRegistry.VIB_SHARD.get()); + tag(TagRegistry.SHARD).add(ModRegistry.UNOB_SHARD.get()); + + tag(TagRegistry.CLUMP).add(ModRegistry.ATM_CLUMP.get()); + tag(TagRegistry.CLUMP).add(ModRegistry.VIB_CLUMP.get()); + tag(TagRegistry.CLUMP).add(ModRegistry.UNOB_CLUMP.get()); + + tag(TagRegistry.CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); + tag(TagRegistry.CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); + tag(TagRegistry.CRYSTAL).add(ModRegistry.UNOB_CRYSTAL.get()); + + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.UNOB_DIRTY.get()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java index ca2a6558..00d03431 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java @@ -29,145 +29,123 @@ public class LootTables extends LootTableProvider { - public LootTables(DataGenerator generator) { - super(generator); - } - - @Override - protected List< - Pair< - Supplier>>, - LootContextParamSet - > - > getTables() { - return ImmutableList.of( - Pair.of(BlockLoots::new, LootContextParamSets.BLOCK) - ); - } - - public static class BlockLoots extends BlockLoot { - - @Override - public void addTables() { - getKnownBlocks().forEach(this::dropRaw); - } - - // private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[] { - // 0.05F, 0.0625F, 0.083333336F, 0.1F }; - - private void dropRaw(Block block) { - if (block instanceof LiquidBlock) { - return; - } - - if (block.getName().getString().contains("ancient_bookshelf")) { - this.add( - ModRegistry.ANCIENT_BOOKSHELF.get(), - p_124241_ -> { - return createSingleItemTableWithSilkTouch( - p_124241_, - Items.BOOK, - ConstantValue.exactly(3.0F) - ); - } - ); - } - String oreType = block.getName().getString(); - - if (block instanceof AllthemodiumOre) { - this.add( - block, - block1 -> - createOreDrop( - block1, - ModRegistry.RAW_ALLTHEMODIUM.get() - ) - ); - } else if (block instanceof VibraniumOre) { - this.add( - block, - block1 -> - createOreDrop( - block1, - ModRegistry.RAW_VIBRANIUM.get() - ) - ); - } else if (block instanceof UnobtainiumOre) { - this.add( - block, - block1 -> - createOreDrop( - block1, - ModRegistry.RAW_UNOBTAINIUM.get() - ) - ); - } else if (oreType.contains("raw_")) { - this.dropSelf(block); - } else { - this.dropSelf(block); - } - } - - @Override - protected Iterable getKnownBlocks() { - return Stream - .of( - ModRegistry.BLOCKS.getEntries(), - ModRegistry.STAIR_BLOCKS.getEntries(), - ModRegistry.SLAB_BLOCKS.getEntries(), - ModRegistry.WALL_BLOCKS.getEntries(), - ModRegistry.PILLAR_BLOCKS.getEntries() - ) - .filter(block -> !(block instanceof LeavesBlock)) - .flatMap(Collection::stream) - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownStairs() { - return ModRegistry.STAIR_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownSlabs() { - return ModRegistry.SLAB_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownWalls() { - return ModRegistry.WALL_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getUnknownBlocks() { - return ModRegistry.PILLAR_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - } - - @Override - protected void validate( - Map map, - ValidationContext validationTracker - ) { - map.forEach((name, table) -> - net.minecraft.world.level.storage.loot.LootTables.validate( - validationTracker, - name, - table - ) - ); - } + public LootTables(DataGenerator generator) { + super(generator); + } + + @Override + protected List>>, LootContextParamSet>> getTables() { + return ImmutableList.of( + Pair.of(BlockLoots::new, LootContextParamSets.BLOCK)); + } + + public static class BlockLoots extends BlockLoot { + + @Override + public void addTables() { + getKnownBlocks().forEach(this::dropRaw); + } + + // private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[] { + // 0.05F, 0.0625F, 0.083333336F, 0.1F }; + + private void dropRaw(Block block) { + if (block instanceof LiquidBlock) { + return; + } + + if (block.getName().getString().contains("ancient_bookshelf")) { + this.add( + ModRegistry.ANCIENT_BOOKSHELF.get(), + p_124241_ -> { + return createSingleItemTableWithSilkTouch( + p_124241_, + Items.BOOK, + ConstantValue.exactly(3.0F)); + }); + } + String oreType = block.getName().getString(); + + if (block instanceof AllthemodiumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_ALLTHEMODIUM.get())); + } else if (block instanceof VibraniumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_VIBRANIUM.get())); + } else if (block instanceof UnobtainiumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_UNOBTAINIUM.get())); + } else if (oreType.contains("raw_")) { + this.dropSelf(block); + } else { + this.dropSelf(block); + } + } + + @Override + protected Iterable getKnownBlocks() { + return Stream + .of( + ModRegistry.BLOCKS.getEntries(), + ModRegistry.STAIR_BLOCKS.getEntries(), + ModRegistry.SLAB_BLOCKS.getEntries(), + ModRegistry.WALL_BLOCKS.getEntries(), + ModRegistry.PILLAR_BLOCKS.getEntries()) + .filter(block -> !(block instanceof LeavesBlock)) + .flatMap(Collection::stream) + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownStairs() { + return ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownSlabs() { + return ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownWalls() { + return ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getUnknownBlocks() { + return ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + } + + @Override + protected void validate( + Map map, + ValidationContext validationTracker) { + map.forEach((name, table) -> net.minecraft.world.level.storage.loot.LootTables.validate( + validationTracker, + name, + table)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java index 6c9d3b0c..ca58f3a3 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java @@ -13,305 +13,268 @@ public class ShapelessCrafting extends RecipeProvider { - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut - ); - } - - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; - - ShapelessRecipeBuilder - .shapeless(ModRegistry.DEMONIC_PLANKS.get(), 4) - .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get()) - ) - .save(consumer, recipeDir("demonic_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get()) - ) - .save(consumer, recipeDir("soul_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get()) - ) - .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get()) - ) - .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get()) - ) - .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_planks_3", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(), 1) - .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) - .requires(Items.VINE) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_mossy_stone", "vinecrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(), 1) - .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) - .requires(Items.HONEYCOMB) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_polished_stone", "waxing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(), 1) - .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .build() - ) - ) - .save( - consumer, - recipeDir("ancient_cracked_stone_bricks", "crushing") - ); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(), 1) - .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .build() - ) - ) - .save( - consumer, - recipeDir("ancient_chiseled_stone_bricks", "crushing") - ); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) - ) - .save(consumer, recipeDir("allthemodium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(), 9) - .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()) - ) - .save(consumer, recipeDir("allthemodium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9) - .requires(TagRegistry.ALLTHEMODIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get()) - ) - .save(consumer, recipeDir("allthemodium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_VIBRANIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) - ) - .save(consumer, recipeDir("vibranium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_UNOBTAINIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) - ) - .save(consumer, recipeDir("unobtainium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_INGOT.get(), 9) - .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()) - ) - .save(consumer, recipeDir("vibranium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9) - .requires(TagRegistry.VIBRANIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get()) - ) - .save(consumer, recipeDir("vibranium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()) - ) - .save(consumer, recipeDir("unobtainium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get()) - ) - .save(consumer, recipeDir("unobtainium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(), 9) - .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has( - ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get() - ) - ) - .save(consumer, recipeDir("raw_allthemodium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_VIBRANIUM.get(), 9) - .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()) - ) - .save(consumer, recipeDir("raw_vibranium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(), 9) - .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()) - ) - .save(consumer, recipeDir("raw_unobtainium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get()) - ) - .save( - consumer, - recipeDir("unobtainium_allthemodium_alloy_ingot", "block") - ); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get()) - ) - .save( - consumer, - recipeDir("unobtainium_vibranium_alloy_ingot", "block") - ); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(), 9) - .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get()) - ) - .save( - consumer, - recipeDir("vibranium_allthemodium_alloy_ingot", "block") - ); - } - - public ShapelessCrafting(DataGenerator generatorIn) { - super(generatorIn); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut); + } + + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; + + ShapelessRecipeBuilder + .shapeless(ModRegistry.DEMONIC_PLANKS.get(), 4) + .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get())) + .save(consumer, recipeDir("demonic_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get())) + .save(consumer, recipeDir("soul_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get())) + .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get())) + .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get())) + .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get())) + .save(consumer, recipeDir("ancient_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_3", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) + .requires(Items.VINE) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_mossy_stone", "vinecrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) + .requires(Items.HONEYCOMB) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_polished_stone", "waxing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .build())) + .save( + consumer, + recipeDir("ancient_cracked_stone_bricks", "crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .build())) + .save( + consumer, + recipeDir("ancient_chiseled_stone_bricks", "crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get())) + .save(consumer, recipeDir("allthemodium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_VIBRANIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_UNOBTAINIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_INGOT.get(), 9) + .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("vibranium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9) + .requires(TagRegistry.VIBRANIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get())) + .save(consumer, recipeDir("vibranium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get())) + .save(consumer, recipeDir("unobtainium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(), 9) + .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has( + ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_allthemodium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_VIBRANIUM.get(), 9) + .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_vibranium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(), 9) + .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_unobtainium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("unobtainium_allthemodium_alloy_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("unobtainium_vibranium_alloy_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("vibranium_allthemodium_alloy_ingot", "block")); + } + + public ShapelessCrafting(DataGenerator generatorIn) { + super(generatorIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java index 2411ec86..3b3861a7 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java @@ -12,110 +12,95 @@ public class SmeltingRecipes extends RecipeProvider { - public SmeltingRecipes(DataGenerator generator) { - super(generator); - } + public SmeltingRecipes(DataGenerator generator) { + super(generator); + } - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut - ); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut); + } - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), - ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get()) - ) - .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()) - ) - .save(consumer, recipeDir("allthemodium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()) - ) - .save(consumer, recipeDir("vibranium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()) - ) - .save(consumer, recipeDir("unobtainium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get()) - ) - .save(consumer, recipeDir("allthemodium_ingot", "dust")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) + .save(consumer, recipeDir("allthemodium_ingot", "dust")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get()) - ) - .save(consumer, recipeDir("vibranium_ingot", "dust")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) + .save(consumer, recipeDir("vibranium_ingot", "dust")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200 - ) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get()) - ) - .save(consumer, recipeDir("unobtainium_ingot", "dust")); - } + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) + .save(consumer, recipeDir("unobtainium_ingot", "dust")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java index ea4a1234..d1148005 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java @@ -35,450 +35,402 @@ public class PiglichEntity extends Piglin implements IAnimatable { - private final SimpleContainer inventory = new SimpleContainer(8); - private AnimationFactory factory = new AnimationFactory(this); - private boolean isSummoning = false; - - public PiglichEntity(EntityType type, Level world) { - super(type, world); - this.setImmuneToZombification(true); - this.registerGoals(); - } - - @Override - public boolean canAttack(@Nonnull LivingEntity entity) { - if (entity instanceof Player) { - if (((Player) entity).isCreative()) { - return false; - } - } - return true; - } - - protected void populateDefaultEquipmentSlots(DifficultyInstance diff) { - if (this.isAdult()) { - this.maybeWearArmor( - EquipmentSlot.HEAD, - new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get()) - ); - this.maybeWearArmor( - EquipmentSlot.CHEST, - new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()) - ); - this.maybeWearArmor( - EquipmentSlot.LEGS, - new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()) - ); - this.maybeWearArmor( - EquipmentSlot.FEET, - new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get()) - ); - } - } - - private void maybeWearArmor(EquipmentSlot slot, ItemStack stack) { - if (this.level.random.nextFloat() < 0.5F) { - this.setItemSlot(slot, stack); - } - } - - @Override - public void addAdditionalSaveData(@Nonnull CompoundTag tag) { - super.addAdditionalSaveData(tag); - - tag.put("Inventory", this.inventory.createTag()); - } - - @Override - public void readAdditionalSaveData(@Nonnull CompoundTag tag) { - super.readAdditionalSaveData(tag); - this.inventory.fromTag(tag.getList("Inventory", 10)); - } - - @Override - protected void registerGoals() { - this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 3.0D, true)); - this.goalSelector.addGoal( - 2, - new MoveTowardsTargetGoal(this, 0.9D, 32.0F) - ); - this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); - this.targetSelector.addGoal( - 1, - new NearestAttackableTargetGoal( - this, - Skeleton.class, - true - ) - ); - this.targetSelector.addGoal( - 1, - new NearestAttackableTargetGoal( - this, - WitherSkeleton.class, - true - ) - ); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); - this.targetSelector.addGoal( - 3, - new NearestAttackableTargetGoal( - this, - Player.class, - true - ) - ); - this.goalSelector.addGoal( - 4, - new LookAtPlayerGoal(this, Player.class, 8.0F) - ); - this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); - this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); - } - - @Override - public MobType getMobType() { - return MobType.UNDEFINED; - } - - private ItemStack createSpawnWeapon() { - return (double) this.random.nextFloat() < 0.4D - ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) - : new ItemStack(Items.NETHERITE_SWORD); - } - - @Override - public void setImmuneToZombification(boolean p_34671_) { - super.setImmuneToZombification(true); - } - - @Override - public SpawnGroupData finalizeSpawn( - @Nonnull ServerLevelAccessor sla, - @Nonnull DifficultyInstance difficultyInstance, - @Nonnull MobSpawnType mobSpawnType, - @Nullable SpawnGroupData spawnGroupData, - @Nullable CompoundTag tag - ) { - if (mobSpawnType != MobSpawnType.STRUCTURE) { - this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); - } - - this.populateDefaultEquipmentSlots(difficultyInstance); - return super.finalizeSpawn( - sla, - difficultyInstance, - mobSpawnType, - spawnGroupData, - tag - ); - } - - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 12) - .add(Attributes.ARMOR, 24) - .add(Attributes.ARMOR_TOUGHNESS, 24) - .add(Attributes.MAX_HEALTH, 9999); - } - - private PlayState predicate( - AnimationEvent event - ) { - if (event.isMoving()) { - event - .getController() - .setAnimation( - new AnimationBuilder() - .addAnimation("walk.piglich.nik", true) - ); - return PlayState.CONTINUE; - } - if (this.isSummoning) { - event - .getController() - .setAnimation( - new AnimationBuilder() - .addAnimation("summon.piglich.nik", true) - ); - return PlayState.CONTINUE; - } - event - .getController() - .setAnimation( - new AnimationBuilder().addAnimation("idle.piglich.nik", true) - ); - return PlayState.CONTINUE; - } - - @Override - public void registerControllers(AnimationData animationData) { - animationData.addAnimationController( - new AnimationController( - this, - "controller", - 0, - this::predicate - ) - ); - } - - @Override - public AnimationFactory getFactory() { - return this.factory; - } - - static class PigLichAttackGoal extends Goal { - - private final PiglichEntity piglich; - private int attackStep; - private int attackTime; - private int lastSeen; - - public PigLichAttackGoal(PiglichEntity p_32247_) { - this.piglich = p_32247_; - this.setFlags( - EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET) - ); - } - - public boolean canUse() { - LivingEntity livingEntity = this.piglich.getTarget(); - return ( - livingEntity != null && - livingEntity.isAlive() && - this.piglich.canAttack(livingEntity) - ); - } - - public void start() { - this.attackStep = 0; - } - - public void stop() { - this.lastSeen = 0; - } - - public boolean requiresUpdateEveryTick() { - return true; - } - - @SuppressWarnings("unused") - public void tick() { - --this.attackTime; - LivingEntity livingEntity = this.piglich.getTarget(); - if (livingEntity != null) { - boolean flag = - this.piglich.getSensing().hasLineOfSight(livingEntity); - if (flag) { - this.lastSeen = 0; - } else { - ++this.lastSeen; - } - - double d0 = this.piglich.distanceToSqr(livingEntity); - if (d0 < 4.0D) { - if (!flag) { - return; - } - - if (this.attackTime <= 0) { - this.attackTime = 20; - this.piglich.doHurtTarget(livingEntity); - } - - this.piglich.getMoveControl() - .setWantedPosition( - livingEntity.getX(), - livingEntity.getY(), - livingEntity.getZ(), - 1.0D - ); - } else if ( - d0 < this.getFollowDistance() * this.getFollowDistance() && - flag - ) { - double d1 = livingEntity.getX() - this.piglich.getX(); - double d2 = - livingEntity.getY(0.5D) - this.piglich.getY(0.5D); - double d3 = livingEntity.getZ() - this.piglich.getZ(); - if (this.attackTime <= 0) { - ++this.attackStep; - if (this.attackStep == 1) { - this.attackTime = 60; - } else if (this.attackStep <= 4) { - this.attackTime = 6; - } else { - this.attackTime = 100; - this.attackStep = 0; - } - - if (this.attackStep > 1) { - double d4 = Math.sqrt(Math.sqrt(d0)) * 0.5D; - if (!this.piglich.isSilent()) { - this.piglich.level.levelEvent( - (Player) null, - 1018, - this.piglich.blockPosition(), - 0 - ); - } - // for (int i = 0; i < 3; ++i) { - // Vec3 vec3 = this.piglich.getViewVector(1.0F); - // this.piglich.isSummoning = true; - // LargeFireball largeFireball = new LargeFireball(this.piglich.level, this.piglich, d2, - // d3, d4, - // (int) this.piglich.getHealth()); - // largeFireball.setPos(this.piglich.getX() + - // vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, - // largeFireball.getZ() + vec3.z - // * 4.0D); - // this.piglich.level.addFreshEntity(largeFireball); - // } - - } - } - - this.piglich.getLookControl() - .setLookAt(livingEntity, 10.0F, 10.0F); - } else if (this.lastSeen < 5) { - this.piglich.getMoveControl() - .setWantedPosition( - livingEntity.getX(), - livingEntity.getY(), - livingEntity.getZ(), - 1.0D - ); - } - - super.tick(); - } - } - - private double getFollowDistance() { - return this.piglich.getAttributeValue(Attributes.FOLLOW_RANGE); - } - } - - @Override - public boolean hurt(@Nonnull DamageSource source, float damage) { - if (!super.hurt(source, damage)) { - return false; - } else if (!(this.level instanceof ServerLevel)) { - return false; - } else { - LivingEntity livingEntity = this.getTarget(); - if ( - livingEntity == null && - source.getEntity() instanceof LivingEntity - ) { - livingEntity = (LivingEntity) source.getEntity(); - } - - if (!(livingEntity instanceof Player)) { - return false; - } else { - int i = Mth.floor(this.getX()); - int j = Mth.floor(this.getY()); - int k = Mth.floor(this.getZ()); - return this.spawnSupport(this, i, j, k); - } - } - } - - protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { - ServerLevel serverLevel = (ServerLevel) piglich.level; - LivingEntity livingEntity = piglich.getTarget(); - int mobType = Mth.nextInt(piglich.random, 1, 6); - Monster spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create( - piglich.level - ); - switch (mobType) { - case 1: - spawnMob = - (Monster) EntityType.PIGLIN_BRUTE.create(piglich.level); - case 2: - spawnMob = (Monster) EntityType.BLAZE.create(piglich.level); - case 3: - spawnMob = (Monster) EntityType.ENDERMAN.create(piglich.level); - case 4: - spawnMob = (Monster) EntityType.EVOKER.create(piglich.level); - case 5: - spawnMob = - (Monster) EntityType.VINDICATOR.create(piglich.level); - case 6: - spawnMob = (Monster) EntityType.WITCH.create(piglich.level); - default: - for (int l = 0; l < 5; ++l) { - int i1 = - i + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - int j1 = - j + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - int k1 = - k + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - BlockPos blockPos = new BlockPos(i1, j1, k1); - - if (spawnMob == null) return false; - - EntityType entityType = spawnMob.getType(); - SpawnPlacements.Type spawnPlacements$type = - SpawnPlacements.getPlacementType(entityType); - if ( - NaturalSpawner.isSpawnPositionOk( - spawnPlacements$type, - piglich.level, - blockPos, - entityType - ) && - SpawnPlacements.checkSpawnRules( - entityType, - serverLevel, - MobSpawnType.REINFORCEMENT, - blockPos, - piglich.level.random - ) - ) { - spawnMob.setPos((double) i1, (double) j1, (double) k1); - if ( - !piglich.level.hasNearbyAlivePlayer( - (double) i1, - (double) j1, - (double) k1, - 7.0D - ) && - piglich.level.isUnobstructed(spawnMob) && - piglich.level.noCollision(spawnMob) && - !piglich.level.containsAnyLiquid( - spawnMob.getBoundingBox() - ) - ) { - if (livingEntity != null) { - spawnMob.setTarget(livingEntity); - } - - spawnMob.finalizeSpawn( - serverLevel, - piglich.level.getCurrentDifficultyAt( - spawnMob.blockPosition() - ), - MobSpawnType.REINFORCEMENT, - (SpawnGroupData) null, - (CompoundTag) null - ); - serverLevel.addFreshEntityWithPassengers(spawnMob); - } - } - } - this.isSummoning = true; - return true; - } - } + private final SimpleContainer inventory = new SimpleContainer(8); + private AnimationFactory factory = new AnimationFactory(this); + private boolean isSummoning = false; + + public PiglichEntity(EntityType type, Level world) { + super(type, world); + this.setImmuneToZombification(true); + this.registerGoals(); + } + + @Override + public boolean canAttack(@Nonnull LivingEntity entity) { + if (entity instanceof Player) { + if (((Player) entity).isCreative()) { + return false; + } + } + return true; + } + + protected void populateDefaultEquipmentSlots(DifficultyInstance diff) { + if (this.isAdult()) { + this.maybeWearArmor( + EquipmentSlot.HEAD, + new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get())); + this.maybeWearArmor( + EquipmentSlot.CHEST, + new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())); + this.maybeWearArmor( + EquipmentSlot.LEGS, + new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get())); + this.maybeWearArmor( + EquipmentSlot.FEET, + new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get())); + } + } + + private void maybeWearArmor(EquipmentSlot slot, ItemStack stack) { + if (this.level.random.nextFloat() < 0.5F) { + this.setItemSlot(slot, stack); + } + } + + @Override + public void addAdditionalSaveData(@Nonnull CompoundTag tag) { + super.addAdditionalSaveData(tag); + + tag.put("Inventory", this.inventory.createTag()); + } + + @Override + public void readAdditionalSaveData(@Nonnull CompoundTag tag) { + super.readAdditionalSaveData(tag); + this.inventory.fromTag(tag.getList("Inventory", 10)); + } + + @Override + protected void registerGoals() { + this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 3.0D, true)); + this.goalSelector.addGoal( + 2, + new MoveTowardsTargetGoal(this, 0.9D, 32.0F)); + this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + Skeleton.class, + true)); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + WitherSkeleton.class, + true)); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); + this.targetSelector.addGoal( + 3, + new NearestAttackableTargetGoal( + this, + Player.class, + true)); + this.goalSelector.addGoal( + 4, + new LookAtPlayerGoal(this, Player.class, 8.0F)); + this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); + this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); + } + + @Override + public MobType getMobType() { + return MobType.UNDEFINED; + } + + private ItemStack createSpawnWeapon() { + return (double) this.random.nextFloat() < 0.4D + ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) + : new ItemStack(Items.NETHERITE_SWORD); + } + + @Override + public void setImmuneToZombification(boolean p_34671_) { + super.setImmuneToZombification(true); + } + + @Override + public SpawnGroupData finalizeSpawn( + @Nonnull ServerLevelAccessor sla, + @Nonnull DifficultyInstance difficultyInstance, + @Nonnull MobSpawnType mobSpawnType, + @Nullable SpawnGroupData spawnGroupData, + @Nullable CompoundTag tag) { + if (mobSpawnType != MobSpawnType.STRUCTURE) { + this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); + } + + this.populateDefaultEquipmentSlots(difficultyInstance); + return super.finalizeSpawn( + sla, + difficultyInstance, + mobSpawnType, + spawnGroupData, + tag); + } + + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 12) + .add(Attributes.ARMOR, 24) + .add(Attributes.ARMOR_TOUGHNESS, 24) + .add(Attributes.MAX_HEALTH, 9999); + } + + private PlayState predicate( + AnimationEvent event) { + if (event.isMoving()) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("walk.piglich.nik", true)); + return PlayState.CONTINUE; + } + if (this.isSummoning) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("summon.piglich.nik", true)); + return PlayState.CONTINUE; + } + event + .getController() + .setAnimation( + new AnimationBuilder().addAnimation("idle.piglich.nik", true)); + return PlayState.CONTINUE; + } + + @Override + public void registerControllers(AnimationData animationData) { + animationData.addAnimationController( + new AnimationController( + this, + "controller", + 0, + this::predicate)); + } + + @Override + public AnimationFactory getFactory() { + return this.factory; + } + + static class PigLichAttackGoal extends Goal { + + private final PiglichEntity piglich; + private int attackStep; + private int attackTime; + private int lastSeen; + + public PigLichAttackGoal(PiglichEntity p_32247_) { + this.piglich = p_32247_; + this.setFlags( + EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET)); + } + + public boolean canUse() { + LivingEntity livingEntity = this.piglich.getTarget(); + return (livingEntity != null && + livingEntity.isAlive() && + this.piglich.canAttack(livingEntity)); + } + + public void start() { + this.attackStep = 0; + } + + public void stop() { + this.lastSeen = 0; + } + + public boolean requiresUpdateEveryTick() { + return true; + } + + @SuppressWarnings("unused") + public void tick() { + --this.attackTime; + LivingEntity livingEntity = this.piglich.getTarget(); + if (livingEntity != null) { + boolean flag = this.piglich.getSensing().hasLineOfSight(livingEntity); + if (flag) { + this.lastSeen = 0; + } else { + ++this.lastSeen; + } + + double d0 = this.piglich.distanceToSqr(livingEntity); + if (d0 < 4.0D) { + if (!flag) { + return; + } + + if (this.attackTime <= 0) { + this.attackTime = 20; + this.piglich.doHurtTarget(livingEntity); + } + + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D); + } else if (d0 < this.getFollowDistance() * this.getFollowDistance() && + flag) { + double d1 = livingEntity.getX() - this.piglich.getX(); + double d2 = livingEntity.getY(0.5D) - this.piglich.getY(0.5D); + double d3 = livingEntity.getZ() - this.piglich.getZ(); + if (this.attackTime <= 0) { + ++this.attackStep; + if (this.attackStep == 1) { + this.attackTime = 60; + } else if (this.attackStep <= 4) { + this.attackTime = 6; + } else { + this.attackTime = 100; + this.attackStep = 0; + } + + if (this.attackStep > 1) { + double d4 = Math.sqrt(Math.sqrt(d0)) * 0.5D; + if (!this.piglich.isSilent()) { + this.piglich.level.levelEvent( + (Player) null, + 1018, + this.piglich.blockPosition(), + 0); + } + // for (int i = 0; i < 3; ++i) { + // Vec3 vec3 = this.piglich.getViewVector(1.0F); + // this.piglich.isSummoning = true; + // LargeFireball largeFireball = new LargeFireball(this.piglich.level, this.piglich, d2, + // d3, d4, + // (int) this.piglich.getHealth()); + // largeFireball.setPos(this.piglich.getX() + + // vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, + // largeFireball.getZ() + vec3.z + // * 4.0D); + // this.piglich.level.addFreshEntity(largeFireball); + // } + + } + } + + this.piglich.getLookControl() + .setLookAt(livingEntity, 10.0F, 10.0F); + } else if (this.lastSeen < 5) { + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D); + } + + super.tick(); + } + } + + private double getFollowDistance() { + return this.piglich.getAttributeValue(Attributes.FOLLOW_RANGE); + } + } + + @Override + public boolean hurt(@Nonnull DamageSource source, float damage) { + if (!super.hurt(source, damage)) { + return false; + } else if (!(this.level instanceof ServerLevel)) { + return false; + } else { + LivingEntity livingEntity = this.getTarget(); + if (livingEntity == null && + source.getEntity() instanceof LivingEntity) { + livingEntity = (LivingEntity) source.getEntity(); + } + + if (!(livingEntity instanceof Player)) { + return false; + } else { + int i = Mth.floor(this.getX()); + int j = Mth.floor(this.getY()); + int k = Mth.floor(this.getZ()); + return this.spawnSupport(this, i, j, k); + } + } + } + + protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { + ServerLevel serverLevel = (ServerLevel) piglich.level; + LivingEntity livingEntity = piglich.getTarget(); + int mobType = Mth.nextInt(piglich.random, 1, 6); + Monster spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create( + piglich.level); + switch (mobType) { + case 1: + spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create(piglich.level); + case 2: + spawnMob = (Monster) EntityType.BLAZE.create(piglich.level); + case 3: + spawnMob = (Monster) EntityType.ENDERMAN.create(piglich.level); + case 4: + spawnMob = (Monster) EntityType.EVOKER.create(piglich.level); + case 5: + spawnMob = (Monster) EntityType.VINDICATOR.create(piglich.level); + case 6: + spawnMob = (Monster) EntityType.WITCH.create(piglich.level); + default: + for (int l = 0; l < 5; ++l) { + int i1 = i + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int j1 = j + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int k1 = k + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + BlockPos blockPos = new BlockPos(i1, j1, k1); + + if (spawnMob == null) + return false; + + EntityType entityType = spawnMob.getType(); + SpawnPlacements.Type spawnPlacements$type = SpawnPlacements.getPlacementType(entityType); + if (NaturalSpawner.isSpawnPositionOk( + spawnPlacements$type, + piglich.level, + blockPos, + entityType) && + SpawnPlacements.checkSpawnRules( + entityType, + serverLevel, + MobSpawnType.REINFORCEMENT, + blockPos, + piglich.level.random)) { + spawnMob.setPos((double) i1, (double) j1, (double) k1); + if (!piglich.level.hasNearbyAlivePlayer( + (double) i1, + (double) j1, + (double) k1, + 7.0D) && + piglich.level.isUnobstructed(spawnMob) && + piglich.level.noCollision(spawnMob) && + !piglich.level.containsAnyLiquid( + spawnMob.getBoundingBox())) { + if (livingEntity != null) { + spawnMob.setTarget(livingEntity); + } + + spawnMob.finalizeSpawn( + serverLevel, + piglich.level.getCurrentDifficultyAt( + spawnMob.blockPosition()), + MobSpawnType.REINFORCEMENT, + (SpawnGroupData) null, + (CompoundTag) null); + serverLevel.addFreshEntityWithPassengers(spawnMob); + } + } + } + this.isSummoning = true; + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java index c19eabe8..860e5c4a 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java @@ -9,402 +9,357 @@ public class PiglichModel extends AnimatedGeoModel { - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "piglich"), - "main" - ); + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main"); - public PiglichModel() {} + public PiglichModel() { + } - @SuppressWarnings("unused") - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); + @SuppressWarnings("unused") + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); - PartDefinition head = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(84, 0) - .addBox( - -5.0F, - -14.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.5F) - ) - .texOffs(48, 0) - .addBox( - -5.1F, - -8.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.35F) - ) - .texOffs(0, 0) - .addBox( - -5.0F, - -8.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.0F) - ) - .texOffs(29, 1) - .addBox( - -2.0F, - -4.0F, - -5.0F, - 4.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.0F) - ) - .texOffs(2, 0) - .addBox( - -3.0F, - -2.0F, - -5.0F, - 1.0F, - 2.0F, - 1.0F, - new CubeDeformation(0.0F) - ) - .texOffs(2, 4) - .addBox( - 2.0F, - -2.0F, - -5.0F, - 1.0F, - 2.0F, - 1.0F, - new CubeDeformation(0.0F) - ), - PartPose.offset(0.0F, -4.0F, -3.0F) - ); + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(84, 0) + .addBox( + -5.0F, + -14.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.5F)) + .texOffs(48, 0) + .addBox( + -5.1F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.35F)) + .texOffs(0, 0) + .addBox( + -5.0F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F)) + .texOffs(29, 1) + .addBox( + -2.0F, + -4.0F, + -5.0F, + 4.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 0) + .addBox( + -3.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 4) + .addBox( + 2.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, -4.0F, -3.0F)); - PartDefinition rightEar_r1 = head.addOrReplaceChild( - "rightEar_r1", - CubeListBuilder - .create() - .texOffs(104, 18) - .addBox( - -1.0F, - 0.0F, - -2.0F, - 1.0F, - 5.0F, - 4.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F) - ); + PartDefinition rightEar_r1 = head.addOrReplaceChild( + "rightEar_r1", + CubeListBuilder + .create() + .texOffs(104, 18) + .addBox( + -1.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F)); - PartDefinition leftEar_r1 = head.addOrReplaceChild( - "leftEar_r1", - CubeListBuilder - .create() - .texOffs(115, 18) - .addBox( - 0.0F, - 0.0F, - -2.0F, - 1.0F, - 5.0F, - 4.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F) - ); + PartDefinition leftEar_r1 = head.addOrReplaceChild( + "leftEar_r1", + CubeListBuilder + .create() + .texOffs(115, 18) + .addBox( + 0.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F)); - PartDefinition leftHornTop_r1 = head.addOrReplaceChild( - "leftHornTop_r1", - CubeListBuilder - .create() - .texOffs(88, 0) - .addBox( - 0.0F, - -4.0F, - 0.0F, - 1.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.3F) - ), - PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F) - ); + PartDefinition leftHornTop_r1 = head.addOrReplaceChild( + "leftHornTop_r1", + CubeListBuilder + .create() + .texOffs(88, 0) + .addBox( + 0.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F)), + PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F)); - PartDefinition leftHorn_r1 = head.addOrReplaceChild( - "leftHorn_r1", - CubeListBuilder - .create() - .texOffs(76, 0) - .addBox( - -1.0F, - -4.0F, - -1.0F, - 3.0F, - 5.0F, - 3.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F) - ); + PartDefinition leftHorn_r1 = head.addOrReplaceChild( + "leftHorn_r1", + CubeListBuilder + .create() + .texOffs(76, 0) + .addBox( + -1.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F)); - PartDefinition rightHorn_r1 = head.addOrReplaceChild( - "rightHorn_r1", - CubeListBuilder - .create() - .texOffs(44, 0) - .addBox( - -2.0F, - -4.0F, - -1.0F, - 3.0F, - 5.0F, - 3.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F) - ); + PartDefinition rightHorn_r1 = head.addOrReplaceChild( + "rightHorn_r1", + CubeListBuilder + .create() + .texOffs(44, 0) + .addBox( + -2.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F)); - PartDefinition rightHornTop_r1 = head.addOrReplaceChild( - "rightHornTop_r1", - CubeListBuilder - .create() - .texOffs(40, 0) - .addBox( - -1.0F, - -4.0F, - 0.0F, - 1.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.3F) - ), - PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F) - ); + PartDefinition rightHornTop_r1 = head.addOrReplaceChild( + "rightHornTop_r1", + CubeListBuilder + .create() + .texOffs(40, 0) + .addBox( + -1.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F)), + PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F)); - PartDefinition body = partDefinition.addOrReplaceChild( - "body", - CubeListBuilder - .create() - .texOffs(81, 38) - .addBox( - -5.0F, - -7.0F, - -3.0F, - 10.0F, - 10.0F, - 6.0F, - new CubeDeformation(0.2F) - ) - .texOffs(33, 35) - .addBox( - -3.0F, - -7.0F, - -2.0F, - 6.0F, - 7.0F, - 5.0F, - new CubeDeformation(0.0F) - ), - PartPose.offset(0.0F, 10.0F, 2.0F) - ); + PartDefinition body = partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(81, 38) + .addBox( + -5.0F, + -7.0F, + -3.0F, + 10.0F, + 10.0F, + 6.0F, + new CubeDeformation(0.2F)) + .texOffs(33, 35) + .addBox( + -3.0F, + -7.0F, + -2.0F, + 6.0F, + 7.0F, + 5.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, 10.0F, 2.0F)); - PartDefinition bodyTop = body.addOrReplaceChild( - "bodyTop", - CubeListBuilder - .create() - .texOffs(48, 46) - .addBox( - -6.0F, - -10.0F, - -4.0F, - 12.0F, - 10.0F, - 8.0F, - new CubeDeformation(0.5F) - ) - .texOffs(0, 40) - .addBox( - -6.0F, - -10.0F, - -4.0F, - 12.0F, - 10.0F, - 8.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F) - ); + PartDefinition bodyTop = body.addOrReplaceChild( + "bodyTop", + CubeListBuilder + .create() + .texOffs(48, 46) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.5F)) + .texOffs(0, 40) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); - PartDefinition leftArm = bodyTop.addOrReplaceChild( - "leftArm", - CubeListBuilder - .create() - .texOffs(84, 16) - .addBox( - -2.0F, - -2.0F, - -3.0F, - 4.0F, - 15.0F, - 6.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F) - ); + PartDefinition leftArm = bodyTop.addOrReplaceChild( + "leftArm", + CubeListBuilder + .create() + .texOffs(84, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); - PartDefinition rightArm = bodyTop.addOrReplaceChild( - "rightArm", - CubeListBuilder - .create() - .texOffs(64, 16) - .addBox( - -2.0F, - -2.0F, - -3.0F, - 4.0F, - 15.0F, - 6.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F) - ); + PartDefinition rightArm = bodyTop.addOrReplaceChild( + "rightArm", + CubeListBuilder + .create() + .texOffs(64, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); - PartDefinition leftLeg = partDefinition.addOrReplaceChild( - "leftLeg", - CubeListBuilder - .create() - .texOffs(48, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.5F) - ) - .texOffs(32, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation( - -2.0F, - 12.0F, - 1.0F, - -0.6109F, - 0.6109F, - 0.0F - ) - ); + PartDefinition leftLeg = partDefinition.addOrReplaceChild( + "leftLeg", + CubeListBuilder + .create() + .texOffs(48, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F)) + .texOffs(32, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation( + -2.0F, + 12.0F, + 1.0F, + -0.6109F, + 0.6109F, + 0.0F)); - PartDefinition leftLegDown = leftLeg.addOrReplaceChild( - "leftLegDown", - CubeListBuilder - .create() - .texOffs(16, 28) - .addBox( - -2.0F, - 0.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(-0.1F) - ), - PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F) - ); + PartDefinition leftLegDown = leftLeg.addOrReplaceChild( + "leftLegDown", + CubeListBuilder + .create() + .texOffs(16, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F)), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); - PartDefinition rightLeg = partDefinition.addOrReplaceChild( - "rightLeg", - CubeListBuilder - .create() - .texOffs(16, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.5F) - ) - .texOffs(0, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation( - 2.0F, - 12.0F, - 1.0F, - -0.6109F, - -0.6109F, - 0.0F - ) - ); + PartDefinition rightLeg = partDefinition.addOrReplaceChild( + "rightLeg", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F)) + .texOffs(0, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation( + 2.0F, + 12.0F, + 1.0F, + -0.6109F, + -0.6109F, + 0.0F)); - PartDefinition rightLegDown = rightLeg.addOrReplaceChild( - "rightLegDown", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox( - -2.0F, - 0.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(-0.1F) - ), - PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F) - ); + PartDefinition rightLegDown = rightLeg.addOrReplaceChild( + "rightLegDown", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F)), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); - return LayerDefinition.create(meshDefinition, 128, 64); - } + return LayerDefinition.create(meshDefinition, 128, 64); + } - @Override - public ResourceLocation getModelResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "geo/piglich_anim.geo.json" - ); - } + @Override + public ResourceLocation getModelResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "geo/piglich_anim.geo.json"); + } - @Override - public ResourceLocation getTextureResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/piglich.png" - ); - } + @Override + public ResourceLocation getTextureResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png"); + } - @Override - public ResourceLocation getAnimationResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "animations/piglich.animation.json" - ); - } + @Override + public ResourceLocation getAnimationResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "animations/piglich.animation.json"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java index faa453e3..d8c80758 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java @@ -19,211 +19,190 @@ @SuppressWarnings("unused") // TODO: Determine if we will keep this model around public class PiglichModelOld extends PlayerModel { - private final ModelPart rightEar = this.head.getChild("right_ear"); - private final ModelPart leftEar = this.head.getChild("left_ear"); - private final PartPose bodyDefault = this.body.storePose(); - private final PartPose headDefault = this.head.storePose(); - private final PartPose leftArmDefault = this.leftArm.storePose(); - private final PartPose rightArmDefault = this.rightArm.storePose(); - - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "piglich"), - "main" - ); - - public PiglichModelOld(ModelPart p_170821_, boolean p_170822_) { - super(p_170821_, p_170822_); - } - - public static MeshDefinition createMesh() { - CubeDeformation cubeDeformation = CubeDeformation.NONE; - MeshDefinition meshDefinition = PlayerModel.createMesh( - cubeDeformation, - false - ); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "body", - CubeListBuilder - .create() - .texOffs(16, 16) - .addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), - PartPose.ZERO - ); - PartDefinition partDefinition1 = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation) - .texOffs(31, 1) - .addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation) - .texOffs(2, 4) - .addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation) - .texOffs(2, 0) - .addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), - PartPose.ZERO - ); - partDefinition1.addOrReplaceChild( - "left_ear", - CubeListBuilder - .create() - .texOffs(51, 6) - .addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), - PartPose.offsetAndRotation( - 4.5F, - -6.0F, - 0.0F, - 0.0F, - 0.0F, - (-(float) Math.PI / 6F) - ) - ); - partDefinition1.addOrReplaceChild( - "right_ear", - CubeListBuilder - .create() - .texOffs(39, 6) - .addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), - PartPose.offsetAndRotation( - -4.5F, - -6.0F, - 0.0F, - 0.0F, - 0.0F, - ((float) Math.PI / 6F) - ) - ); - - partDefinition1.addOrReplaceChild( - "hat", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition1.addOrReplaceChild( - "right_arm", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition1.addOrReplaceChild( - "left_arm", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition1.addOrReplaceChild( - "right_leg", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition1.addOrReplaceChild( - "left_leg", - CubeListBuilder.create(), - PartPose.ZERO - ); - - return meshDefinition; - } - - @Override - protected Iterable bodyParts() { - return super.bodyParts(); - } - - @Override - public void renderEars( - @Nonnull PoseStack stack, - @Nonnull VertexConsumer consumer, - int p_103404_, - int p_103405_ - ) { - super.renderEars(stack, consumer, p_103404_, p_103405_); - } - - @Override - public void renderCloak( - @Nonnull PoseStack p_103412_, - @Nonnull VertexConsumer p_103413_, - int p_103414_, - int p_103415_ - ) { - super.renderCloak(p_103412_, p_103413_, p_103414_, p_103415_); - } - - @Override - public void setAllVisible(boolean p_103419_) { - super.setAllVisible(p_103419_); - } - - @Override - public ModelPart getRandomModelPart(@Nonnull RandomSource p_103407_) { - return super.getRandomModelPart(p_103407_); - } - - public void setupAnim( - @Nonnull T p_103366_, - float p_103367_, - float p_103368_, - float p_103369_, - float p_103370_, - float p_103371_ - ) { - super.setupAnim( - p_103366_, - p_103367_, - p_103368_, - p_103369_, - p_103370_, - p_103371_ - ); - } - - protected void setupAttackAnimation(@Nonnull T p_103363_, float p_103364_) { - super.setupAttackAnimation(p_103363_, p_103364_); - } - - @Override - public void prepareMobModel( - @Nonnull T p_102861_, - float p_102862_, - float p_102863_, - float p_102864_ - ) { - super.prepareMobModel(p_102861_, p_102862_, p_102863_, p_102864_); - setPartVisibility(); - } - - @Override - public void renderToBuffer( - @Nonnull PoseStack poseStack, - @Nonnull VertexConsumer buffer, - int packedLight, - int packedOverlay, - float red, - float green, - float blue, - float alpha - ) { - setPartVisibility(); - super.renderToBuffer( - poseStack, - buffer, - packedLight, - packedOverlay, - red, - green, - blue, - alpha - ); - } - - private void setPartVisibility() { - head.visible = true; - hat.visible = true; - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; - } + private final ModelPart rightEar = this.head.getChild("right_ear"); + private final ModelPart leftEar = this.head.getChild("left_ear"); + private final PartPose bodyDefault = this.body.storePose(); + private final PartPose headDefault = this.head.storePose(); + private final PartPose leftArmDefault = this.leftArm.storePose(); + private final PartPose rightArmDefault = this.rightArm.storePose(); + + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main"); + + public PiglichModelOld(ModelPart p_170821_, boolean p_170822_) { + super(p_170821_, p_170822_); + } + + public static MeshDefinition createMesh() { + CubeDeformation cubeDeformation = CubeDeformation.NONE; + MeshDefinition meshDefinition = PlayerModel.createMesh( + cubeDeformation, + false); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), + PartPose.ZERO); + PartDefinition partDefinition1 = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation) + .texOffs(31, 1) + .addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation) + .texOffs(2, 4) + .addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation) + .texOffs(2, 0) + .addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_ear", + CubeListBuilder + .create() + .texOffs(51, 6) + .addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + 4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + (-(float) Math.PI / 6F))); + partDefinition1.addOrReplaceChild( + "right_ear", + CubeListBuilder + .create() + .texOffs(39, 6) + .addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + -4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + ((float) Math.PI / 6F))); + + partDefinition1.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO); + + return meshDefinition; + } + + @Override + protected Iterable bodyParts() { + return super.bodyParts(); + } + + @Override + public void renderEars( + @Nonnull PoseStack stack, + @Nonnull VertexConsumer consumer, + int p_103404_, + int p_103405_) { + super.renderEars(stack, consumer, p_103404_, p_103405_); + } + + @Override + public void renderCloak( + @Nonnull PoseStack p_103412_, + @Nonnull VertexConsumer p_103413_, + int p_103414_, + int p_103415_) { + super.renderCloak(p_103412_, p_103413_, p_103414_, p_103415_); + } + + @Override + public void setAllVisible(boolean p_103419_) { + super.setAllVisible(p_103419_); + } + + @Override + public ModelPart getRandomModelPart(@Nonnull RandomSource p_103407_) { + return super.getRandomModelPart(p_103407_); + } + + public void setupAnim( + @Nonnull T p_103366_, + float p_103367_, + float p_103368_, + float p_103369_, + float p_103370_, + float p_103371_) { + super.setupAnim( + p_103366_, + p_103367_, + p_103368_, + p_103369_, + p_103370_, + p_103371_); + } + + protected void setupAttackAnimation(@Nonnull T p_103363_, float p_103364_) { + super.setupAttackAnimation(p_103363_, p_103364_); + } + + @Override + public void prepareMobModel( + @Nonnull T p_102861_, + float p_102862_, + float p_102863_, + float p_102864_) { + super.prepareMobModel(p_102861_, p_102862_, p_102863_, p_102864_); + setPartVisibility(); + } + + @Override + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha) { + setPartVisibility(); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha); + } + + private void setPartVisibility() { + head.visible = true; + hat.visible = true; + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java index 210454f1..f4304208 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java @@ -15,38 +15,35 @@ @OnlyIn(Dist.CLIENT) public class PiglichRenderer extends GeoEntityRenderer { - public PiglichRenderer(EntityRendererProvider.Context context) { - super(context, new PiglichModel()); - this.shadowRadius = 0.3f; - } + public PiglichRenderer(EntityRendererProvider.Context context) { + super(context, new PiglichModel()); + this.shadowRadius = 0.3f; + } - @Override - public ResourceLocation getTextureLocation(PiglichEntity instance) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/piglich.png" - ); - } + @Override + public ResourceLocation getTextureLocation(PiglichEntity instance) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png"); + } - @Override - public RenderType getRenderType( - PiglichEntity animatable, - float partialTicks, - PoseStack stack, - @Nullable MultiBufferSource renderTypeBuffer, - @Nullable VertexConsumer vertexBuilder, - int packedLightIn, - ResourceLocation textureLocation - ) { - stack.scale(1.1f, 1.1f, 1.1f); - return super.getRenderType( - animatable, - partialTicks, - stack, - renderTypeBuffer, - vertexBuilder, - packedLightIn, - textureLocation - ); - } + @Override + public RenderType getRenderType( + PiglichEntity animatable, + float partialTicks, + PoseStack stack, + @Nullable MultiBufferSource renderTypeBuffer, + @Nullable VertexConsumer vertexBuilder, + int packedLightIn, + ResourceLocation textureLocation) { + stack.scale(1.1f, 1.1f, 1.1f); + return super.getRenderType( + animatable, + partialTicks, + stack, + renderTypeBuffer, + vertexBuilder, + packedLightIn, + textureLocation); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java index b42c85bd..f2b399af 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java @@ -9,20 +9,19 @@ public class ATMShulkerEntity extends Shulker { - public ATMShulkerEntity( - EntityType p_33404_, - Level p_33405_ - ) { - super(p_33404_, p_33405_); - } + public ATMShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java index 6b9e97ae..7017a104 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java @@ -18,92 +18,85 @@ public class ATMShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"), - "main" - ); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"), + "main"); - public ATMShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public ATMShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F) - ); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_ - ) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = - (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java index 69e9c5e7..8dfbe823 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java @@ -9,45 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class ATMShulkerRenderer - extends MobRenderer> { + extends MobRenderer> { - public ATMShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new ATMShulkerModel<>( - context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), - true - ), - 0.5F - ); - } + public ATMShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new ATMShulkerModel<>( + context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull ATMShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_ - ) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_ - ); - } + @Override + public void render( + @Nonnull ATMShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull ATMShulkerEntity p_114482_ - ) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/allthemodium_shulker.png" - ); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull ATMShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/allthemodium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java index 485992a2..b73b9c59 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java @@ -9,20 +9,19 @@ public class UNOBShulkerEntity extends Shulker { - public UNOBShulkerEntity( - EntityType p_33404_, - Level p_33405_ - ) { - super(p_33404_, p_33405_); - } + public UNOBShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java index 61b2d181..c1768503 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java @@ -18,92 +18,85 @@ public class UNOBShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"), - "main" - ); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"), + "main"); - public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F) - ); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_ - ) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = - (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java index 9030d8ad..c6866ffd 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java @@ -9,48 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class UNOBShulkerRenderer - extends MobRenderer< - UNOBShulkerEntity, - UNOBShulkerModel - > { + extends MobRenderer> { - public UNOBShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new UNOBShulkerModel<>( - context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), - true - ), - 0.5F - ); - } + public UNOBShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new UNOBShulkerModel<>( + context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull UNOBShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_ - ) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_ - ); - } + @Override + public void render( + @Nonnull UNOBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull UNOBShulkerEntity p_114482_ - ) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/unobtainium_shulker.png" - ); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull UNOBShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/unobtainium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java index f5cdf822..97dd683f 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java @@ -9,20 +9,19 @@ public class VIBShulkerEntity extends Shulker { - public VIBShulkerEntity( - EntityType p_33404_, - Level p_33405_ - ) { - super(p_33404_, p_33405_); - } + public VIBShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java index cc2ec668..7f36ad29 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java @@ -18,92 +18,85 @@ public class VIBShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"), - "main" - ); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"), + "main"); - public VIBShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public VIBShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F) - ); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_ - ) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = - (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java index 29672e2b..b0d880d0 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java @@ -9,45 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class VIBShulkerRenderer - extends MobRenderer> { + extends MobRenderer> { - public VIBShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new VIBShulkerModel<>( - context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), - true - ), - 0.5F - ); - } + public VIBShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new VIBShulkerModel<>( + context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull VIBShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_ - ) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_ - ); - } + @Override + public void render( + @Nonnull VIBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull VIBShulkerEntity p_114482_ - ) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/vibranium_shulker.png" - ); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull VIBShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/vibranium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java index ca6e278b..00512c63 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java @@ -14,60 +14,55 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class ArmorEvents { - @SubscribeEvent - public static void onPlayerFall(LivingFallEvent event) { - Iterable armorList = event.getEntity().getArmorSlots(); - Iterator iterator = armorList.iterator(); - while (iterator.hasNext()) { - ItemStack armor = iterator.next(); - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { - event.setCanceled(true); - } - } - } + @SubscribeEvent + public static void onPlayerFall(LivingFallEvent event) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { + event.setCanceled(true); + } + } + } - @SubscribeEvent - public static void onEntityHurt(LivingAttackEvent event) { - LivingEntity entity = event.getEntity(); + @SubscribeEvent + public static void onEntityHurt(LivingAttackEvent event) { + LivingEntity entity = event.getEntity(); - if (entity instanceof PiglichEntity) {} + if (entity instanceof PiglichEntity) { + } - if (!entity.getCommandSenderWorld().isClientSide()) { - Iterable armorList = event.getEntity().getArmorSlots(); - Iterator iterator = armorList.iterator(); - while (iterator.hasNext()) { - ItemStack armor = iterator.next(); - if ( - (armor.getItem() == - ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()) - ) { - if ( - (event.getSource() == DamageSource.HOT_FLOOR) || - (event.getSource() == DamageSource.IN_FIRE) || - (event.getSource() == DamageSource.LAVA) || - (event.getSource() == DamageSource.ON_FIRE) - ) { - event.getEntity().clearFire(); - event.setCanceled(true); - } - } - if ( - (armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) - ) { - if (event.getSource() == DamageSource.FLY_INTO_WALL) { - event.setCanceled(true); - } - if (event.getSource() == DamageSource.DROWN) { - event - .getEntity() - .setAirSupply(event.getEntity().getMaxAirSupply()); - event.setCanceled(true); - } - } - } - } - } + if (!entity.getCommandSenderWorld().isClientSide()) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())) { + if ((event.getSource() == DamageSource.HOT_FLOOR) || + (event.getSource() == DamageSource.IN_FIRE) || + (event.getSource() == DamageSource.LAVA) || + (event.getSource() == DamageSource.ON_FIRE)) { + event.getEntity().clearFire(); + event.setCanceled(true); + } + } + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get())) { + if (event.getSource() == DamageSource.FLY_INTO_WALL) { + event.setCanceled(true); + } + if (event.getSource() == DamageSource.DROWN) { + event + .getEntity() + .setAirSupply(event.getEntity().getMaxAirSupply()); + event.setCanceled(true); + } + } + } + } + } - @SubscribeEvent - public static void onEntityCollide(ProjectileImpactEvent event) {} + @SubscribeEvent + public static void onEntityCollide(ProjectileImpactEvent event) { + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 97ed3ec9..90fa6514 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -10,56 +10,48 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class BlockBreak { - @SubscribeEvent - public static void on(BlockEvent.BreakEvent event) { - if (event.getPlayer().isCreative()) { - return; - } + @SubscribeEvent + public static void on(BlockEvent.BreakEvent event) { + if (event.getPlayer().isCreative()) { + return; + } - boolean fakePlayer = - (event.getPlayer() instanceof FakePlayer) || - (event.getPlayer() == null); - boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); + boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || + (event.getPlayer() == null); + boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - if ( - (event.getState().is(TagRegistry.OTHER_PROTECTION)) && - fakePlayer && - event - .getLevel() - .getBiome(event.getPos()) - .is(TagRegistry.OTHER_BIOMES) && - AllthemodiumServerConfigs.OTHER_PROTECTION.get() - ) { - event.setCanceled(true); - return; - } - if ( - (event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() - ) { - event.setCanceled(true); - return; - } + if ((event.getState().is(TagRegistry.OTHER_PROTECTION)) && + fakePlayer && + event + .getLevel() + .getBiome(event.getPos()) + .is(TagRegistry.OTHER_BIOMES) + && + AllthemodiumServerConfigs.OTHER_PROTECTION.get()) { + event.setCanceled(true); + return; + } + if ((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } - if ( - (event.getState().is(TagRegistry.VIBRANIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get() - ) { - event.setCanceled(true); - return; - } - if ( - (event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() - ) { - event.setCanceled(true); - return; - } - if (event.getPlayer() instanceof FakePlayer) { - return; - } - } + if ((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } + if ((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } + if (event.getPlayer() instanceof FakePlayer) { + return; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java index 5d3517ec..65508889 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java @@ -14,135 +14,105 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - value = Dist.CLIENT, - bus = Mod.EventBusSubscriber.Bus.MOD -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) public class ClientEvents { - @SubscribeEvent - public static void registerRenderers( - EntityRenderersEvent.RegisterRenderers event - ) { - event.registerEntityRenderer( - ModRegistry.PIGLICH.get(), - PiglichRenderer::new - ); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), - // UNOBShulkerRenderer::new); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), - // UNOBShulkerRenderer::new); - } + @SubscribeEvent + public static void registerRenderers( + EntityRenderersEvent.RegisterRenderers event) { + event.registerEntityRenderer( + ModRegistry.PIGLICH.get(), + PiglichRenderer::new); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); + } - @SuppressWarnings("removal") // TODO: Alternative required for 1.20+ - @SubscribeEvent - public static void registerTree(FMLClientSetupEvent event) { - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_HERB.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_SAPLING.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_LEAVES.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_TRAPDOOR.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_DOOR_.get(), - RenderType.cutoutMipped() - ); + @SuppressWarnings("removal") // TODO: Alternative required for 1.20+ + @SubscribeEvent + public static void registerTree(FMLClientSetupEvent event) { + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_DOOR_.get(), + RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_HERB.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_SAPLING.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_LEAVES.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_TRAPDOOR.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_DOOR_.get(), - RenderType.cutoutMipped() - ); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_DOOR_.get(), + RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_HERB.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_SAPLING.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_LEAVES.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_LEAVES_BOTTOM.get(), - RenderType.cutout() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_TRAPDOOR.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_DOOR_.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_CAVEVINES_.get(), - RenderType.cutoutMipped() - ); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), - RenderType.cutoutMipped() - ); - } + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_DOOR_.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), + RenderType.cutoutMipped()); + } - @SubscribeEvent - public static void registerMesh(EntityRenderersEvent.AddLayers event) { - event.getEntityModels().bakeLayer(PiglichModel.LAYER_LOCATION); - event.getEntityModels().bakeLayer(ATMShulkerModel.LAYER_LOCATION); - } + @SubscribeEvent + public static void registerMesh(EntityRenderersEvent.AddLayers event) { + event.getEntityModels().bakeLayer(PiglichModel.LAYER_LOCATION); + event.getEntityModels().bakeLayer(ATMShulkerModel.LAYER_LOCATION); + } - @SubscribeEvent - public static void registerLayer( - EntityRenderersEvent.RegisterLayerDefinitions event - ) { - event.registerLayerDefinition( - PiglichModel.LAYER_LOCATION, - () -> PiglichModel.createBodyLayer() - ); - event.registerLayerDefinition( - ATMShulkerModel.LAYER_LOCATION, - () -> ATMShulkerModel.createBodyLayer() - ); - event.registerLayerDefinition( - AllthemodiumHelmetModel.LAYER_LOCATION, - AllthemodiumHelmetModel::createBodyLayer - ); - } + @SubscribeEvent + public static void registerLayer( + EntityRenderersEvent.RegisterLayerDefinitions event) { + event.registerLayerDefinition( + PiglichModel.LAYER_LOCATION, + () -> PiglichModel.createBodyLayer()); + event.registerLayerDefinition( + ATMShulkerModel.LAYER_LOCATION, + () -> ATMShulkerModel.createBodyLayer()); + event.registerLayerDefinition( + AllthemodiumHelmetModel.LAYER_LOCATION, + AllthemodiumHelmetModel::createBodyLayer); + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java index b8725ab6..61cd7287 100644 --- a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java +++ b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java @@ -16,22 +16,22 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class PlayerHarvest { - // TODO: Determine if this class should be kept - // @SubscribeEvent - // public static void on(PlayerEvent.HarvestCheck event) { - // Player player = event.getPlayer(); - // BlockState blockstate = event.getTargetBlock(); - // ItemStack heldItem = player.getMainHandItem(); - // if (blockstate.getBlock() instanceof Allthemodium_Ore) { - // boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, - // player); - // event.setCanHarvest(b); - // } - // if (blockstate.getBlock() instanceof Vibranium_Ore) { - // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - // } - // if (blockstate.getBlock() instanceof Unobtainium_Ore) { - // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - // } - // } + // TODO: Determine if this class should be kept + // @SubscribeEvent + // public static void on(PlayerEvent.HarvestCheck event) { + // Player player = event.getPlayer(); + // BlockState blockstate = event.getTargetBlock(); + // ItemStack heldItem = player.getMainHandItem(); + // if (blockstate.getBlock() instanceof Allthemodium_Ore) { + // boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, + // player); + // event.setCanHarvest(b); + // } + // if (blockstate.getBlock() instanceof Vibranium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // if (blockstate.getBlock() instanceof Unobtainium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java index 6a2eef23..2f0a572e 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java @@ -30,177 +30,166 @@ public class FluidATM extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.ALLTHEMODIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_ATM_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource - ) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false - ); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D - ); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_HONEY; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state - ) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_ATM_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_)) - ); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return ( - fluidIn == FluidRegistry.ALLTHEMODIUM.get() || - fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get() - ); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_ - ) { - return ( - p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.ATM.get() - ); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.ATM.get(); - } - - public static class Flowing extends FluidATM { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_ - ) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidATM { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.ALLTHEMODIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_ATM_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_HONEY; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_ATM_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.ALLTHEMODIUM.get() || + fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.ATM.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.ATM.get(); + } + + public static class Flowing extends FluidATM { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidATM { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java index 18c272b2..1df6797b 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java @@ -27,177 +27,166 @@ public class FluidSoulLava extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_SOULLAVA.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.SOULLAVA.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.SOUL_LAVA_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource - ) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false - ); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D - ); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.SOUL_FIRE_FLAME; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state - ) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.SOULLAVA_BLOCK - .get() - .defaultBlockState() - .setValue( - SoulLava.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_)) - ); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return ( - fluidIn == FluidRegistry.SOULLAVA.get() || - fluidIn == FluidRegistry.FLOWING_SOULLAVA.get() - ); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_ - ) { - return ( - p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get() - ); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.SOULLAVA.get(); - } - - public static class Flowing extends FluidSoulLava { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_ - ) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidSoulLava { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_SOULLAVA.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.SOULLAVA.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.SOUL_LAVA_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.SOUL_FIRE_FLAME; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState() + .setValue( + SoulLava.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.SOULLAVA.get() || + fluidIn == FluidRegistry.FLOWING_SOULLAVA.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.SOULLAVA.get(); + } + + public static class Flowing extends FluidSoulLava { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidSoulLava { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java index a2b814f4..d64dd655 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java @@ -30,177 +30,166 @@ public class FluidUNOB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_UNOBTAINIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.UNOBTAINIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource - ) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false - ); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D - ); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state - ) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_UNOB_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_)) - ); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return ( - fluidIn == FluidRegistry.UNOBTAINIUM.get() || - fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get() - ); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_ - ) { - return ( - p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get() - ); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.UNOB.get(); - } - - public static class Flowing extends FluidUNOB { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_ - ) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidUNOB { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_UNOBTAINIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.UNOBTAINIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_UNOB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.UNOBTAINIUM.get() || + fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.UNOB.get(); + } + + public static class Flowing extends FluidUNOB { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidUNOB { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java index a120b19d..b25afdb2 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java @@ -30,177 +30,166 @@ public class FluidVIB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_VIBRANIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.VIBRANIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_VIB_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource - ) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false - ); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D - ); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.ELECTRIC_SPARK; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state - ) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_VIB_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_)) - ); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return ( - fluidIn == FluidRegistry.VIBRANIUM.get() || - fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get() - ); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_ - ) { - return ( - p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.VIB.get() - ); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.VIB.get(); - } - - public static class Flowing extends FluidVIB { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_ - ) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidVIB { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_VIBRANIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.VIBRANIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_VIB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.ELECTRIC_SPARK; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_VIB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.VIBRANIUM.get() || + fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.VIB.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.VIB.get(); + } + + public static class Flowing extends FluidVIB { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidVIB { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java index 37edcda8..88cf85d8 100644 --- a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java +++ b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java @@ -4,32 +4,29 @@ public class ModFoods { - public static final FoodProperties ALLTHEMODIUM_APPLE; - public static final FoodProperties ALLTHEMODIUM_CARROT; + public static final FoodProperties ALLTHEMODIUM_APPLE; + public static final FoodProperties ALLTHEMODIUM_CARROT; - public static final FoodProperties SOUL_BERRIES; + public static final FoodProperties SOUL_BERRIES; - static { - ALLTHEMODIUM_APPLE = - new FoodProperties.Builder() - .nutrition(20) - .saturationMod(2.0F) - .alwaysEat() - .fast() - .build(); - ALLTHEMODIUM_CARROT = - new FoodProperties.Builder() - .nutrition(40) - .saturationMod(4.0F) - .alwaysEat() - .fast() - .build(); - SOUL_BERRIES = - new FoodProperties.Builder() - .nutrition(5) - .saturationMod(4.0F) - .alwaysEat() - .fast() - .build(); - } + static { + ALLTHEMODIUM_APPLE = new FoodProperties.Builder() + .nutrition(20) + .saturationMod(2.0F) + .alwaysEat() + .fast() + .build(); + ALLTHEMODIUM_CARROT = new FoodProperties.Builder() + .nutrition(40) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + SOUL_BERRIES = new FoodProperties.Builder() + .nutrition(5) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java index f12889d3..5993a611 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java @@ -4,7 +4,7 @@ public class AlloyDust extends Item { - public AlloyDust(Properties properties) { - super(properties); - } + public AlloyDust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java index dc112bd7..cd36b7fd 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java @@ -4,7 +4,7 @@ public class AlloyIngot extends Item { - public AlloyIngot(Properties properties) { - super(properties); - } + public AlloyIngot(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java index 6b590de4..5481c25a 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java @@ -18,51 +18,43 @@ public class AllthemodiumApple extends Item { - public AllthemodiumApple(Properties properties) { - super(properties); - } + public AllthemodiumApple(Properties properties) { + super(properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving - ) { - if ( - (entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get()) - ) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.REGENERATION, - 600, - 1, - false, - false - ) - ); - player.addEffect( - new MobEffectInstance( - MobEffects.ABSORPTION, - 600, - 1, - false, - false - ) - ); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 1, + false, + false)); + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 1, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java index db9e36b5..00f0a618 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java @@ -5,7 +5,7 @@ public class AllthemodiumBlock extends BlockItem { - public AllthemodiumBlock(Properties properties) { - super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); - } + public AllthemodiumBlock(Properties properties) { + super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java index 8c40c58c..1fe8a377 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java @@ -17,51 +17,43 @@ public class AllthemodiumCarrot extends Item { - public AllthemodiumCarrot(Properties properties) { - super(properties); - } + public AllthemodiumCarrot(Properties properties) { + super(properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving - ) { - if ( - (entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get()) - ) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.ABSORPTION, - 600, - 2, - false, - false - ) - ); - player.addEffect( - new MobEffectInstance( - MobEffects.REGENERATION, - 600, - 2, - false, - false - ) - ); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 2, + false, + false)); + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 2, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java index 62c6276e..6b85b3df 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java @@ -16,37 +16,31 @@ public class AllthemodiumOreItem extends BlockItem { - public AllthemodiumOreItem(Block block, Properties properties) { - super(block, properties); - } + public AllthemodiumOreItem(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.loc", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - if ( - !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get() - ) tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Clump.java b/src/main/java/com/thevortex/allthemodium/items/Clump.java index 16c4107e..3595c02a 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Clump.java +++ b/src/main/java/com/thevortex/allthemodium/items/Clump.java @@ -4,7 +4,7 @@ public class Clump extends Item { - public Clump(Properties properties) { - super(properties); - } + public Clump(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Crystal.java b/src/main/java/com/thevortex/allthemodium/items/Crystal.java index 7b9f9aff..60d174b7 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Crystal.java +++ b/src/main/java/com/thevortex/allthemodium/items/Crystal.java @@ -4,7 +4,7 @@ public class Crystal extends Item { - public Crystal(Properties properties) { - super(properties); - } + public Crystal(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java b/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java index 15139819..337133d5 100644 --- a/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java +++ b/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java @@ -4,7 +4,7 @@ public class DirtyDust extends Item { - public DirtyDust(Properties properties) { - super(properties); - } + public DirtyDust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Dust.java b/src/main/java/com/thevortex/allthemodium/items/Dust.java index cbc0ae8a..cb909a5c 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Dust.java +++ b/src/main/java/com/thevortex/allthemodium/items/Dust.java @@ -4,7 +4,7 @@ public class Dust extends Item { - public Dust(Properties properties) { - super(properties); - } + public Dust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Gear.java b/src/main/java/com/thevortex/allthemodium/items/Gear.java index 7759dc6d..9d5e8f22 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Gear.java +++ b/src/main/java/com/thevortex/allthemodium/items/Gear.java @@ -4,7 +4,7 @@ public class Gear extends Item { - public Gear(Properties properties) { - super(properties); - } + public Gear(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Ingot.java b/src/main/java/com/thevortex/allthemodium/items/Ingot.java index fb3c5695..b4a72f40 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Ingot.java +++ b/src/main/java/com/thevortex/allthemodium/items/Ingot.java @@ -4,7 +4,7 @@ public class Ingot extends Item { - public Ingot(Properties properties) { - super(properties); - } + public Ingot(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Nugget.java b/src/main/java/com/thevortex/allthemodium/items/Nugget.java index b1c0a74e..a4c318b4 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Nugget.java +++ b/src/main/java/com/thevortex/allthemodium/items/Nugget.java @@ -4,7 +4,7 @@ public class Nugget extends Item { - public Nugget(Properties properties) { - super(properties); - } + public Nugget(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java index 43e5e2ae..6a931adc 100644 --- a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java +++ b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java @@ -4,7 +4,7 @@ public class PiglichHeart extends Item { - public PiglichHeart(Properties properties) { - super(properties); - } + public PiglichHeart(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Plate.java b/src/main/java/com/thevortex/allthemodium/items/Plate.java index 41f2083d..6d9bf537 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Plate.java +++ b/src/main/java/com/thevortex/allthemodium/items/Plate.java @@ -4,7 +4,7 @@ public class Plate extends Item { - public Plate(Properties properties) { - super(properties); - } + public Plate(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/RawOre.java b/src/main/java/com/thevortex/allthemodium/items/RawOre.java index 681bd2eb..c754ba25 100644 --- a/src/main/java/com/thevortex/allthemodium/items/RawOre.java +++ b/src/main/java/com/thevortex/allthemodium/items/RawOre.java @@ -4,7 +4,7 @@ public class RawOre extends Item { - public RawOre(Properties properties) { - super(properties); - } + public RawOre(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Rod.java b/src/main/java/com/thevortex/allthemodium/items/Rod.java index 9a1e6914..40a0964b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Rod.java +++ b/src/main/java/com/thevortex/allthemodium/items/Rod.java @@ -4,7 +4,7 @@ public class Rod extends Item { - public Rod(Properties properties) { - super(properties); - } + public Rod(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Shard.java b/src/main/java/com/thevortex/allthemodium/items/Shard.java index 6ed515d9..2be23e4e 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Shard.java +++ b/src/main/java/com/thevortex/allthemodium/items/Shard.java @@ -4,7 +4,7 @@ public class Shard extends Item { - public Shard(Properties properties) { - super(properties); - } + public Shard(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java index b9b78021..0102a538 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java @@ -13,31 +13,26 @@ public class SoulBerries extends ItemNameBlockItem { - public SoulBerries(Block block, Properties properties) { - super(block, properties); - } + public SoulBerries(Block block, Properties properties) { + super(block, properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving - ) { - if ( - (entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get()) - ) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.NIGHT_VISION, - 1200, - 2, - false, - false - ) - ); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.NIGHT_VISION, + 1200, + 2, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java index 551a3744..573416fb 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java @@ -13,20 +13,19 @@ public class SoulBucket extends BucketItem { - public SoulBucket(Supplier supplier, Properties builder) { - super(supplier, builder); - } + public SoulBucket(Supplier supplier, Properties builder) { + super(supplier, builder); + } - @Override - public ICapabilityProvider initCapabilities( - @Nonnull ItemStack stack, - @Nullable CompoundTag nbt - ) { - return new FluidBucketWrapper(stack); - } + @Override + public ICapabilityProvider initCapabilities( + @Nonnull ItemStack stack, + @Nullable CompoundTag nbt) { + return new FluidBucketWrapper(stack); + } - @Override - public int getBurnTime(ItemStack itemStack, RecipeType provider) { - return 100000; - } + @Override + public int getBurnTime(ItemStack itemStack, RecipeType provider) { + return 100000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java index ea663565..20304116 100644 --- a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java @@ -5,7 +5,7 @@ public class TeleportPad extends BlockItem { - public TeleportPad(Block blockIn, Properties builder) { - super(blockIn, builder); - } + public TeleportPad(Block blockIn, Properties builder) { + super(blockIn, builder); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java index 7960f319..894fe958 100644 --- a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java @@ -12,7 +12,7 @@ */ public class UnobtainiumBlock extends BlockItem { - public UnobtainiumBlock(Properties properties) { - super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); - } + public UnobtainiumBlock(Properties properties) { + super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java index a1e0bddd..abaa5009 100644 --- a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java @@ -16,37 +16,31 @@ public class UnobtainiumOreItem extends BlockItem { - public UnobtainiumOreItem(Block block, Properties properties) { - super(block, properties); - } + public UnobtainiumOreItem(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "unobtainium.loc", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - if ( - !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get() - ) tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "unobtainium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java index 906bb8ac..7bda452f 100644 --- a/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java @@ -12,7 +12,7 @@ */ public class VibraniumBlock extends BlockItem { - public VibraniumBlock(Properties properties) { - super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); - } + public VibraniumBlock(Properties properties) { + super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java index 516b04d6..245e5a5b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java @@ -16,35 +16,31 @@ public class Vibranium_Ore_Item extends BlockItem { - public Vibranium_Ore_Item(Block block, Properties properties) { - super(block, properties); - } + public Vibranium_Ore_Item(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "vibranium.loc", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - if (!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "vibranium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java index 822a7c76..ed1f575b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java @@ -8,31 +8,30 @@ public class AllthemodiumBoots extends ArmorItem { - public AllthemodiumBoots( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder - ) { - super(materialIn, slot, builder); - } + public AllthemodiumBoots( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { - return stack.is(ModRegistry.ALLTHEMODIUM_BOOTS.get()); - } + @Override + public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { + return stack.is(ModRegistry.ALLTHEMODIUM_BOOTS.get()); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java index 01e2fd6b..c6bab80b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java @@ -9,26 +9,25 @@ public class AllthemodiumChestplate extends ArmorItem { - public AllthemodiumChestplate( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder - ) { - super(materialIn, slot, builder); - } + public AllthemodiumChestplate( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java index 0d986a3b..200a1b39 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java @@ -12,39 +12,36 @@ public class AllthemodiumHelmet extends ArmorItem { - public AllthemodiumHelmet( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder - ) { - super(materialIn, slot, builder); - } + public AllthemodiumHelmet( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } - @Override - public void onArmorTick(ItemStack stack, Level world, Player player) { - if ( - (stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && - (!world.isClientSide) - ) { - if (player.isInWater() && player.isSwimming()) { - player.setAirSupply(300); - } - } - super.onArmorTick(stack, world, player); - } + @Override + public void onArmorTick(ItemStack stack, Level world, Player player) { + if ((stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && + (!world.isClientSide)) { + if (player.isInWater() && player.isSwimming()) { + player.setAirSupply(300); + } + } + super.onArmorTick(stack, world, player); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java index 1ec526e4..543bd465 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java @@ -9,26 +9,25 @@ public class AllthemodiumLeggings extends ArmorItem { - public AllthemodiumLeggings( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder - ) { - super(materialIn, slot, builder); - } + public AllthemodiumLeggings( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java index 824314db..e428c2e7 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java @@ -19,172 +19,155 @@ import net.minecraft.world.entity.LivingEntity; public class AllthemodiumHelmetModel - extends HumanoidModel { + extends HumanoidModel { - // This layer location should be baked with EntityRendererProvider.Context in - // the entity renderer and passed into this model's constructor - public static final ModelLayerLocation LAYER_LOCATION = - new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), - "main" - ); - protected final EquipmentSlot slot; + // This layer location should be baked with EntityRendererProvider.Context in + // the entity renderer and passed into this model's constructor + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), + "main"); + protected final EquipmentSlot slot; - public AllthemodiumHelmetModel(ModelPart root, EquipmentSlot slot) { - super(root); - this.slot = slot; - } + public AllthemodiumHelmetModel(ModelPart root, EquipmentSlot slot) { + super(root); + this.slot = slot; + } - @SuppressWarnings("unused") - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); + @SuppressWarnings("unused") + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); - PartDefinition head = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox( - -4.0F, - -8.5F, - -4.0F, - 8.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.0F) - ), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox( + -4.0F, + -8.5F, + -4.0F, + 8.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, 24.0F, 0.0F)); - PartDefinition horn_r_1_r1 = head.addOrReplaceChild( - "horn_r_1_r1", - CubeListBuilder - .create() - .texOffs(0, 2) - .addBox( - -1.0F, - -3.0F, - 1.0F, - 1.0F, - 1.0F, - 1.0F, - new CubeDeformation(0.0F) - ) - .texOffs(2, 2) - .addBox( - -1.0F, - -3.0F, - -1.0F, - 1.0F, - 4.0F, - 2.0F, - new CubeDeformation(0.0F) - ) - .texOffs(28, 2) - .addBox( - 8.0F, - -3.0F, - 1.0F, - 1.0F, - 1.0F, - 1.0F, - new CubeDeformation(0.0F) - ) - .texOffs(24, 2) - .addBox( - 8.0F, - -3.0F, - -1.0F, - 1.0F, - 4.0F, - 2.0F, - new CubeDeformation(0.0F) - ), - PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F) - ); + PartDefinition horn_r_1_r1 = head.addOrReplaceChild( + "horn_r_1_r1", + CubeListBuilder + .create() + .texOffs(0, 2) + .addBox( + -1.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 2) + .addBox( + -1.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F)) + .texOffs(28, 2) + .addBox( + 8.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(24, 2) + .addBox( + 8.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "hat", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition.addOrReplaceChild( - "body", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition.addOrReplaceChild( - "right_arm", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition.addOrReplaceChild( - "left_arm", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition.addOrReplaceChild( - "right_leg", - CubeListBuilder.create(), - PartPose.ZERO - ); - partDefinition.addOrReplaceChild( - "left_leg", - CubeListBuilder.create(), - PartPose.ZERO - ); + partDefinition.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO); - return LayerDefinition.create(meshDefinition, 64, 32); - } + return LayerDefinition.create(meshDefinition, 64, 32); + } - @Override - public void renderToBuffer( - @Nonnull PoseStack poseStack, - @Nonnull VertexConsumer buffer, - int packedLight, - int packedOverlay, - float red, - float green, - float blue, - float alpha - ) { - setPartVisibility(slot); - super.renderToBuffer( - poseStack, - buffer, - packedLight, - packedOverlay, - red, - green, - blue, - alpha - ); - } + @Override + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha) { + setPartVisibility(slot); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha); + } - private void setPartVisibility(EquipmentSlot slot) { - setAllVisible(false); - switch (slot) { - case HEAD: - head.visible = true; - hat.visible = true; - break; - case CHEST: - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - break; - case LEGS: - body.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; - break; - case FEET: - rightLeg.visible = true; - leftLeg.visible = true; - case MAINHAND: - case OFFHAND: - break; - } - } + private void setPartVisibility(EquipmentSlot slot) { + setAllVisible(false); + switch (slot) { + case HEAD: + head.visible = true; + hat.visible = true; + break; + case CHEST: + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + break; + case LEGS: + body.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + break; + case FEET: + rightLeg.visible = true; + leftLeg.visible = true; + case MAINHAND: + case OFFHAND: + break; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java index 68ebf5e4..22b81dd9 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java @@ -20,67 +20,60 @@ public class AlloyAxe extends AxeItem { - public AlloyAxe(Tier tier, int damage, float speed, Properties properties) { - super(tier, damage, speed, properties); - } + public AlloyAxe(Tier tier, int damage, float speed, Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if ( - state.is(BlockTags.MINEABLE_WITH_AXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java index 4a1a619a..89c78bac 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java @@ -32,325 +32,288 @@ public class AlloyPaxel extends DiggerItem { - public static Map STRIPPABLES = AxeItem.STRIPPABLES; + public static Map STRIPPABLES = AxeItem.STRIPPABLES; - public AlloyPaxel( - float attack, - float speed, - Tier tier, - TagKey effectiveBlocks, - Properties properties - ) { - super(attack, speed, tier, effectiveBlocks, properties); - } + public AlloyPaxel( + float attack, + float speed, + Tier tier, + TagKey effectiveBlocks, + Properties properties) { + super(attack, speed, tier, effectiveBlocks, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed * 1.4f; - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed * 1.8f; - if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed * 1.8f; - if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed * 1.9f; - if (state.is(Tags.Blocks.GLASS)) return speed * 3.0F; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed * 1.4f; + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return speed * 1.9f; + if (state.is(Tags.Blocks.GLASS)) + return speed * 3.0F; + return super.getDestroySpeed(stack, state); + } - @Override - public net.minecraft.world.InteractionResult interactLivingEntity( - @Nonnull ItemStack stack, - @Nonnull net.minecraft.world.entity.player.Player playerIn, - @Nonnull LivingEntity entity, - @Nonnull net.minecraft.world.InteractionHand hand - ) { - if ( - entity instanceof net.minecraftforge.common.IForgeShearable target - ) { - if ( - entity.level.isClientSide - ) return net.minecraft.world.InteractionResult.SUCCESS; - BlockPos pos = new BlockPos( - entity.getX(), - entity.getY(), - entity.getZ() - ); - if (target.isShearable(stack, entity.level, pos)) { - @SuppressWarnings("deprecation") - java.util.List drops = target.onSheared( - playerIn, - stack, - entity.level, - pos, - net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel( - net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, - stack - ) - ); - java.util.Random rand = new java.util.Random(); - drops.forEach(d -> { - net.minecraft.world.entity.item.ItemEntity dropEntity = - entity.spawnAtLocation(d, 1.0F); - if (dropEntity == null) return; + @Override + public net.minecraft.world.InteractionResult interactLivingEntity( + @Nonnull ItemStack stack, + @Nonnull net.minecraft.world.entity.player.Player playerIn, + @Nonnull LivingEntity entity, + @Nonnull net.minecraft.world.InteractionHand hand) { + if (entity instanceof net.minecraftforge.common.IForgeShearable target) { + if (entity.level.isClientSide) + return net.minecraft.world.InteractionResult.SUCCESS; + BlockPos pos = new BlockPos( + entity.getX(), + entity.getY(), + entity.getZ()); + if (target.isShearable(stack, entity.level, pos)) { + @SuppressWarnings("deprecation") + java.util.List drops = target.onSheared( + playerIn, + stack, + entity.level, + pos, + net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel( + net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, + stack)); + java.util.Random rand = new java.util.Random(); + drops.forEach(d -> { + net.minecraft.world.entity.item.ItemEntity dropEntity = entity.spawnAtLocation(d, 1.0F); + if (dropEntity == null) + return; - dropEntity.setDeltaMovement( - dropEntity - .getDeltaMovement() - .add( - (double) ((rand.nextFloat() - - rand.nextFloat()) * - 0.1F), - (double) (rand.nextFloat() * 0.05F), - (double) ((rand.nextFloat() - - rand.nextFloat()) * - 0.1F) - ) - ); - }); - stack.hurtAndBreak( - 1, - playerIn, - e -> e.broadcastBreakEvent(hand) - ); - } - return net.minecraft.world.InteractionResult.SUCCESS; - } - return net.minecraft.world.InteractionResult.PASS; - } + dropEntity.setDeltaMovement( + dropEntity + .getDeltaMovement() + .add( + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F), + (double) (rand.nextFloat() * 0.05F), + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F))); + }); + stack.hurtAndBreak( + 1, + playerIn, + e -> e.broadcastBreakEvent(hand)); + } + return net.minecraft.world.InteractionResult.SUCCESS; + } + return net.minecraft.world.InteractionResult.PASS; + } - @Override - public boolean canPerformAction( - ItemStack stack, - net.minecraftforge.common.ToolAction toolAction - ) { - return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains( - toolAction - ); - } + @Override + public boolean canPerformAction( + ItemStack stack, + net.minecraftforge.common.ToolAction toolAction) { + return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains( + toolAction); + } - @Override - public boolean hurtEnemy( - @Nonnull ItemStack stack, - @Nonnull LivingEntity entity, - @Nonnull LivingEntity player - ) { - // entity.setSecondsOnFire(30); - return super.hurtEnemy(stack, entity, player); - } + @Override + public boolean hurtEnemy( + @Nonnull ItemStack stack, + @Nonnull LivingEntity entity, + @Nonnull LivingEntity player) { + // entity.setSecondsOnFire(30); + return super.hurtEnemy(stack, entity, player); + } - @Override - public InteractionResult useOn(@Nonnull UseOnContext context) { - Level world = context.getLevel(); - BlockPos blockPos = context.getClickedPos(); - BlockState blockState = world.getBlockState(blockPos); - if (blockState.getBlock() == Blocks.OBSIDIAN) { - BlockState defaultBlockState = - Blocks.CRYING_OBSIDIAN.defaultBlockState(); - Player playerEntity = context.getPlayer(); - world.playSound( - playerEntity, - blockPos, - SoundEvents.NETHER_ORE_BREAK, - SoundSource.BLOCKS, - 1.0F, - 1.0F - ); - if (!world.isClientSide) { - world.setBlock(blockPos, defaultBlockState, 11); - if (playerEntity != null) { - context - .getItemInHand() - .hurtAndBreak( - 1, - playerEntity, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent( - context.getHand() - ); - } - ); - } - } + @Override + public InteractionResult useOn(@Nonnull UseOnContext context) { + Level world = context.getLevel(); + BlockPos blockPos = context.getClickedPos(); + BlockState blockState = world.getBlockState(blockPos); + if (blockState.getBlock() == Blocks.OBSIDIAN) { + BlockState defaultBlockState = Blocks.CRYING_OBSIDIAN.defaultBlockState(); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.NETHER_ORE_BREAK, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, defaultBlockState, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand()); + }); + } + } - return InteractionResult.sidedSuccess(world.isClientSide); - } - if ( - blockState.getBlock() instanceof - GrowingPlantHeadBlock growingPlantHeadBlock - ) { - if (!growingPlantHeadBlock.isMaxAge(blockState)) { - Player player = context.getPlayer(); + return InteractionResult.sidedSuccess(world.isClientSide); + } + if (blockState.getBlock() instanceof GrowingPlantHeadBlock growingPlantHeadBlock) { + if (!growingPlantHeadBlock.isMaxAge(blockState)) { + Player player = context.getPlayer(); - if (player == null) return InteractionResult.PASS; + if (player == null) + return InteractionResult.PASS; - ItemStack itemStack = context.getItemInHand(); - if (player instanceof ServerPlayer) { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger( - (ServerPlayer) player, - blockPos, - itemStack - ); - } + ItemStack itemStack = context.getItemInHand(); + if (player instanceof ServerPlayer) { + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger( + (ServerPlayer) player, + blockPos, + itemStack); + } - world.playSound( - player, - blockPos, - SoundEvents.GROWING_PLANT_CROP, - SoundSource.BLOCKS, - 1.0F, - 1.0F - ); - world.setBlockAndUpdate( - blockPos, - growingPlantHeadBlock.getMaxAgeState(blockState) - ); - itemStack.hurtAndBreak( - 1, - player, - p_186374_ -> { - p_186374_.broadcastBreakEvent(context.getHand()); - } - ); + world.playSound( + player, + blockPos, + SoundEvents.GROWING_PLANT_CROP, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + world.setBlockAndUpdate( + blockPos, + growingPlantHeadBlock.getMaxAgeState(blockState)); + itemStack.hurtAndBreak( + 1, + player, + p_186374_ -> { + p_186374_.broadcastBreakEvent(context.getHand()); + }); - return InteractionResult.sidedSuccess(world.isClientSide); - } - } - if ((blockState.is(BlockTags.DIRT))) { - Player player = context.getPlayer(); - if (player == null) return InteractionResult.PASS; + return InteractionResult.sidedSuccess(world.isClientSide); + } + } + if ((blockState.is(BlockTags.DIRT))) { + Player player = context.getPlayer(); + if (player == null) + return InteractionResult.PASS; - // tags dirt - boolean isSneaking = player.isCrouching(); - BlockState blockPath = isSneaking - ? Blocks.FARMLAND.defaultBlockState() - : Blocks.DIRT_PATH.defaultBlockState(); + // tags dirt + boolean isSneaking = player.isCrouching(); + BlockState blockPath = isSneaking + ? Blocks.FARMLAND.defaultBlockState() + : Blocks.DIRT_PATH.defaultBlockState(); - world.playSound( - player, - blockPos, - SoundEvents.SHOVEL_FLATTEN, - SoundSource.BLOCKS, - 1.0F, - 1.0F - ); - if (!world.isClientSide) { - world.setBlock(blockPos, blockPath, 11); + world.playSound( + player, + blockPos, + SoundEvents.SHOVEL_FLATTEN, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, blockPath, 11); - context - .getItemInHand() - .hurtAndBreak( - 1, - player, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent(context.getHand()); - } - ); - } + context + .getItemInHand() + .hurtAndBreak( + 1, + player, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent(context.getHand()); + }); + } - return InteractionResult.sidedSuccess(world.isClientSide); - } - if (blockState.is(BlockTags.LOGS)) { - // tags logs - Block check = STRIPPABLES.get(blockState.getBlock()); - if (check != null) { - BlockState block = check.defaultBlockState(); - Player playerEntity = context.getPlayer(); - world.playSound( - playerEntity, - blockPos, - SoundEvents.AXE_STRIP, - SoundSource.BLOCKS, - 1.0F, - 1.0F - ); - if (!world.isClientSide) { - world.setBlock(blockPos, block, 11); - if (playerEntity != null) { - context - .getItemInHand() - .hurtAndBreak( - 1, - playerEntity, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent( - context.getHand() - ); - } - ); - } - } - return InteractionResult.sidedSuccess(world.isClientSide); - } - } - return InteractionResult.PASS; - } + return InteractionResult.sidedSuccess(world.isClientSide); + } + if (blockState.is(BlockTags.LOGS)) { + // tags logs + Block check = STRIPPABLES.get(blockState.getBlock()); + if (check != null) { + BlockState block = check.defaultBlockState(); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.AXE_STRIP, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, block, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand()); + }); + } + } + return InteractionResult.sidedSuccess(world.isClientSide); + } + } + return InteractionResult.PASS; + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if ( - state.is(BlockTags.MINEABLE_WITH_PICKAXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(BlockTags.MINEABLE_WITH_HOE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(BlockTags.MINEABLE_WITH_SHOVEL) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(BlockTags.MINEABLE_WITH_AXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java index c98b6bc0..cb030fd5 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java @@ -20,72 +20,64 @@ public class AlloyPick extends PickaxeItem { - public AlloyPick( - Tier tier, - int damage, - float speed, - Properties properties - ) { - super(tier, damage, speed, properties); - } + public AlloyPick( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if ( - state.is(BlockTags.MINEABLE_WITH_PICKAXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java index b42277c8..7a6a33bc 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java @@ -20,72 +20,64 @@ public class AlloyShovel extends ShovelItem { - public AlloyShovel( - Tier tier, - int damage, - float speed, - Properties properties - ) { - super(tier, damage, speed, properties); - } + public AlloyShovel( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if ( - state.is(BlockTags.MINEABLE_WITH_SHOVEL) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state - ); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java index e59a1258..5105eacb 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java @@ -16,46 +16,42 @@ public class AlloySword extends SwordItem { - public AlloySword( - Tier tier, - int damage, - float speed, - Properties properties - ) { - super(tier, damage, speed, properties); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + public AlloySword( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } } diff --git a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java index 0436b05d..7184447b 100644 --- a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java +++ b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java @@ -14,89 +14,86 @@ @SuppressWarnings("deprecation") // TODO: Determine alternative to LazyLoadedValue public enum AArmorMaterial implements ArmorMaterial { - ALLTHEMODIUM( - "allthemodium", - 42, - new int[] { 4, 7, 9, 4 }, - 85, - SoundEvents.ARMOR_EQUIP_NETHERITE, - 5.0F, - 0.5f, - () -> { - return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); - } - ); + ALLTHEMODIUM( + "allthemodium", + 42, + new int[] { 4, 7, 9, 4 }, + 85, + SoundEvents.ARMOR_EQUIP_NETHERITE, + 5.0F, + 0.5f, + () -> { + return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); + }); - private static final int[] MAX_DAMAGE_ARRAY = new int[] { 25, 45, 45, 25 }; - private final String name; + private static final int[] MAX_DAMAGE_ARRAY = new int[] { 25, 45, 45, 25 }; + private final String name; - private final int maxDamageFactor; - private final int[] damageReductionAmountArray; - private final int enchantability; - private final SoundEvent soundEvent; - private final float toughness; - private final float knockback; + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + private final SoundEvent soundEvent; + private final float toughness; + private final float knockback; - private final LazyLoadedValue repairMaterial; + private final LazyLoadedValue repairMaterial; - AArmorMaterial( - String nameIn, - int maxDamageFactorIn, - int[] damageReductionAmountsIn, - int enchantabilityIn, - SoundEvent equipSoundIn, - float toughness, - float knockback, - Supplier repairMaterialSupplier - ) { - this.name = nameIn; - this.maxDamageFactor = maxDamageFactorIn; - this.damageReductionAmountArray = damageReductionAmountsIn; - this.enchantability = enchantabilityIn; - this.soundEvent = equipSoundIn; - this.toughness = toughness; - this.repairMaterial = - new LazyLoadedValue(repairMaterialSupplier); - this.knockback = knockback; - } + AArmorMaterial( + String nameIn, + int maxDamageFactorIn, + int[] damageReductionAmountsIn, + int enchantabilityIn, + SoundEvent equipSoundIn, + float toughness, + float knockback, + Supplier repairMaterialSupplier) { + this.name = nameIn; + this.maxDamageFactor = maxDamageFactorIn; + this.damageReductionAmountArray = damageReductionAmountsIn; + this.enchantability = enchantabilityIn; + this.soundEvent = equipSoundIn; + this.toughness = toughness; + this.repairMaterial = new LazyLoadedValue(repairMaterialSupplier); + this.knockback = knockback; + } - @Override - public int getDurabilityForSlot(@Nonnull EquipmentSlot slotIn) { - return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; - } + @Override + public int getDurabilityForSlot(@Nonnull EquipmentSlot slotIn) { + return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; + } - @Override - public int getDefenseForSlot(@Nonnull EquipmentSlot slotIn) { - return this.damageReductionAmountArray[slotIn.getIndex()]; - } + @Override + public int getDefenseForSlot(@Nonnull EquipmentSlot slotIn) { + return this.damageReductionAmountArray[slotIn.getIndex()]; + } - @Override - public int getEnchantmentValue() { - return this.enchantability; - } + @Override + public int getEnchantmentValue() { + return this.enchantability; + } - @Override - public SoundEvent getEquipSound() { - return this.soundEvent; - } + @Override + public SoundEvent getEquipSound() { + return this.soundEvent; + } - @Override - public Ingredient getRepairIngredient() { - return this.repairMaterial.get(); - } + @Override + public Ingredient getRepairIngredient() { + return this.repairMaterial.get(); + } - @OnlyIn(Dist.CLIENT) - public String getName() { - return this.name; - } + @OnlyIn(Dist.CLIENT) + public String getName() { + return this.name; + } - @Override - public float getToughness() { - return this.toughness; - } + @Override + public float getToughness() { + return this.toughness; + } - @Override - public float getKnockbackResistance() { - return this.knockback; - } + @Override + public float getKnockbackResistance() { + return this.knockback; + } } diff --git a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java index dc9e5efe..3328591b 100644 --- a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java +++ b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java @@ -16,43 +16,35 @@ public class ToolTiers { - public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create( - new ResourceLocation("mineable/pickaxe") - ); + public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create( + new ResourceLocation("mineable/pickaxe")); - public static final TagKey ALLTHEMODIUM_TIER_TAG = - TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; - public static final TagKey ALLOY_TIER_TAG = - TagRegistry.NEEDS_ALLOY_TOOL; + public static final TagKey ALLTHEMODIUM_TIER_TAG = TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; + public static final TagKey ALLOY_TIER_TAG = TagRegistry.NEEDS_ALLOY_TOOL; - public static final Tier ALLTHEMODIUM_TIER = - TierSortingRegistry.registerTier( - new ForgeTier( - 5, - 15000, - 10, - 11.0F, - 85, - ALLTHEMODIUM_TIER_TAG, - () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()) - ), - new ResourceLocation(Reference.MOD_ID, "allthemodium"), - List.of(Tiers.NETHERITE), - List.of() - ); + public static final Tier ALLTHEMODIUM_TIER = TierSortingRegistry.registerTier( + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLTHEMODIUM_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), + new ResourceLocation(Reference.MOD_ID, "allthemodium"), + List.of(Tiers.NETHERITE), + List.of()); - public static final Tier ALLOY_TIER = TierSortingRegistry.registerTier( - new ForgeTier( - 5, - 15000, - 10, - 11.0F, - 85, - ALLOY_TIER_TAG, - () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()) - ), - new ResourceLocation(Reference.MOD_ID, "allthemodium_alloy"), - List.of(ToolTiers.ALLTHEMODIUM_TIER), - List.of() - ); + public static final Tier ALLOY_TIER = TierSortingRegistry.registerTier( + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLOY_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), + new ResourceLocation(Reference.MOD_ID, "allthemodium_alloy"), + List.of(ToolTiers.ALLTHEMODIUM_TIER), + List.of()); } diff --git a/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java b/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java index deaac90a..4db534c9 100644 --- a/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java +++ b/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java @@ -5,11 +5,11 @@ public class MixinConnector implements IMixinConnector { - /** - * Connect to Mixin - */ - @Override - public void connect() { - Mixins.addConfigurations("allthemodium.mixins.json"); - } + /** + * Connect to Mixin + */ + @Override + public void connect() { + Mixins.addConfigurations("allthemodium.mixins.json"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/reference/Reference.java b/src/main/java/com/thevortex/allthemodium/reference/Reference.java index a4c50ff4..d4ca70f3 100644 --- a/src/main/java/com/thevortex/allthemodium/reference/Reference.java +++ b/src/main/java/com/thevortex/allthemodium/reference/Reference.java @@ -4,90 +4,87 @@ public class Reference { - public static final ResourceLocation ORE_TYPE = location( - "forge:ores/allthemodium" - ); - public static final ResourceLocation ORE_TYPE2 = location( - "forge:ores/vibranium" - ); - public static final ResourceLocation ORE_TYPE3 = location( - "forge:ores/unobtainium" - ); - public static final String MOD_ID = "allthemodium"; - - public static ResourceLocation atm(String path) { - return new ResourceLocation(MOD_ID, path); - } - - public static ResourceLocation mek(String path) { - return new ResourceLocation("mekanism", path); - } - - public static ResourceLocation location(String pathIn) { - return new ResourceLocation(pathIn); - } - - public static ResourceLocation forge(String path) { - return new ResourceLocation("forge", path); - } - - public static ResourceLocation raw_ores(String path) { - return forge("raw_ores/" + path); - } - - public static ResourceLocation material(String path) { - return forge("raw_materials/" + path); - } - - public static ResourceLocation ingot(String path) { - return forge("ingots/" + path); - } - - public static ResourceLocation dust(String path) { - return forge("dusts/" + path); - } - - public static ResourceLocation dirty(String path) { - return mek("dirty_dusts/" + path); - } - - public static ResourceLocation shard(String path) { - return mek("shards/" + path); - } - - public static ResourceLocation clump(String path) { - return mek("clumps/" + path); - } - - public static ResourceLocation crystal(String path) { - return mek("crystals/" + path); - } - - public static ResourceLocation nugget(String path) { - return forge("nuggets/" + path); - } - - public static ResourceLocation ore(String path) { - return forge("ores/" + path); - } - - public static ResourceLocation rod(String path) { - return forge("rods/" + path); - } - - public static ResourceLocation gear(String path) { - return forge("gears/" + path); - } - - public static ResourceLocation plate(String path) { - return forge("plates/" + path); - } - - public static ResourceLocation block(String path) { - return forge("storage_blocks/" + path); - } - - public static ResourceLocation raw_block(String path) { - return forge("raw_blocks/" + path); - } + public static final ResourceLocation ORE_TYPE = location( + "forge:ores/allthemodium"); + public static final ResourceLocation ORE_TYPE2 = location( + "forge:ores/vibranium"); + public static final ResourceLocation ORE_TYPE3 = location( + "forge:ores/unobtainium"); + public static final String MOD_ID = "allthemodium"; + + public static ResourceLocation atm(String path) { + return new ResourceLocation(MOD_ID, path); + } + + public static ResourceLocation mek(String path) { + return new ResourceLocation("mekanism", path); + } + + public static ResourceLocation location(String pathIn) { + return new ResourceLocation(pathIn); + } + + public static ResourceLocation forge(String path) { + return new ResourceLocation("forge", path); + } + + public static ResourceLocation raw_ores(String path) { + return forge("raw_ores/" + path); + } + + public static ResourceLocation material(String path) { + return forge("raw_materials/" + path); + } + + public static ResourceLocation ingot(String path) { + return forge("ingots/" + path); + } + + public static ResourceLocation dust(String path) { + return forge("dusts/" + path); + } + + public static ResourceLocation dirty(String path) { + return mek("dirty_dusts/" + path); + } + + public static ResourceLocation shard(String path) { + return mek("shards/" + path); + } + + public static ResourceLocation clump(String path) { + return mek("clumps/" + path); + } + + public static ResourceLocation crystal(String path) { + return mek("crystals/" + path); + } + + public static ResourceLocation nugget(String path) { + return forge("nuggets/" + path); + } + + public static ResourceLocation ore(String path) { + return forge("ores/" + path); + } + + public static ResourceLocation rod(String path) { + return forge("rods/" + path); + } + + public static ResourceLocation gear(String path) { + return forge("gears/" + path); + } + + public static ResourceLocation plate(String path) { + return forge("plates/" + path); + } + + public static ResourceLocation block(String path) { + return forge("storage_blocks/" + path); + } + + public static ResourceLocation raw_block(String path) { + return forge("raw_blocks/" + path); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java index eaf466a0..6b7613a4 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java @@ -12,67 +12,51 @@ public class BlockRegistry { - public static final DeferredRegister BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA_BLOCK = - BLOCKS.register( - "soul_lava", - () -> - new SoulLava( - FluidRegistry.SOULLAVA, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noOcclusion() - .jumpFactor(0.1F) - .speedFactor(0.01F) - .lightLevel(light -> { - return 15; - }) - .color(MaterialColor.COLOR_BLUE) - .noLootTable() - ) - ); + public static final RegistryObject SOULLAVA_BLOCK = BLOCKS.register( + "soul_lava", + () -> new SoulLava( + FluidRegistry.SOULLAVA, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noOcclusion() + .jumpFactor(0.1F) + .speedFactor(0.01F) + .lightLevel(light -> { + return 15; + }) + .color(MaterialColor.COLOR_BLUE) + .noLootTable())); - public static final RegistryObject MOLTEN_ATM_BLOCK = - BLOCKS.register( - "molten_allthemodium_block", - () -> - new LiquidBlock( - FluidRegistry.ALLTHEMODIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable() - ) - ); - public static final RegistryObject MOLTEN_VIB_BLOCK = - BLOCKS.register( - "molten_vibranium_block", - () -> - new LiquidBlock( - FluidRegistry.VIBRANIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable() - ) - ); - public static final RegistryObject MOLTEN_UNOB_BLOCK = - BLOCKS.register( - "molten_unobtainium_block", - () -> - new LiquidBlock( - FluidRegistry.UNOBTAINIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable() - ) - ); + public static final RegistryObject MOLTEN_ATM_BLOCK = BLOCKS.register( + "molten_allthemodium_block", + () -> new LiquidBlock( + FluidRegistry.ALLTHEMODIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); + public static final RegistryObject MOLTEN_VIB_BLOCK = BLOCKS.register( + "molten_vibranium_block", + () -> new LiquidBlock( + FluidRegistry.VIBRANIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); + public static final RegistryObject MOLTEN_UNOB_BLOCK = BLOCKS.register( + "molten_unobtainium_block", + () -> new LiquidBlock( + FluidRegistry.UNOBTAINIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java index cdaf9f74..d31cf395 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java @@ -9,40 +9,31 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - bus = Mod.EventBusSubscriber.Bus.MOD -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class FluidInteractionsRegistry { - @SubscribeEvent - public static void register(FMLCommonSetupEvent event) { - event.enqueueWork(() -> { - addInteraction(FluidTypeRegistry.SOULLAVA.get()); - }); - } + @SubscribeEvent + public static void register(FMLCommonSetupEvent event) { + event.enqueueWork(() -> { + addInteraction(FluidTypeRegistry.SOULLAVA.get()); + }); + } - // Lava + Water = Obsidian (Source Lava) / Cobblestone (Flowing Lava) - private static void addInteraction(FluidType fluidType) { - FluidInteractionRegistry.addInteraction( - ForgeMod.LAVA_TYPE.get(), - new FluidInteractionRegistry.InteractionInformation( - fluidType, - fluidState -> - fluidState.isSource() - ? Blocks.GILDED_BLACKSTONE.defaultBlockState() - : Blocks.BLACKSTONE.defaultBlockState() - ) - ); - FluidInteractionRegistry.addInteraction( - ForgeMod.WATER_TYPE.get(), - new FluidInteractionRegistry.InteractionInformation( - fluidType, - fluidState -> - fluidState.isSource() - ? Blocks.CRYING_OBSIDIAN.defaultBlockState() - : Blocks.OBSIDIAN.defaultBlockState() - ) - ); - } + // Lava + Water = Obsidian (Source Lava) / Cobblestone (Flowing Lava) + private static void addInteraction(FluidType fluidType) { + FluidInteractionRegistry.addInteraction( + ForgeMod.LAVA_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> fluidState.isSource() + ? Blocks.GILDED_BLACKSTONE.defaultBlockState() + : Blocks.BLACKSTONE.defaultBlockState())); + FluidInteractionRegistry.addInteraction( + ForgeMod.WATER_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> fluidState.isSource() + ? Blocks.CRYING_OBSIDIAN.defaultBlockState() + : Blocks.OBSIDIAN.defaultBlockState())); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java index 4cec7c39..3f0d7ef3 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java @@ -13,28 +13,27 @@ public class FluidRegistry { - public static final DeferredRegister FLUIDS = - DeferredRegister.create(ForgeRegistries.FLUIDS, Reference.MOD_ID); + public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA = FLUIDS.register( - "soul_lava", - FluidSoulLava.Source::new - ); - public static final RegistryObject FLOWING_SOULLAVA = - FLUIDS.register("flowing_soul_lava", FluidSoulLava.Flowing::new); + public static final RegistryObject SOULLAVA = FLUIDS.register( + "soul_lava", + FluidSoulLava.Source::new); + public static final RegistryObject FLOWING_SOULLAVA = FLUIDS.register("flowing_soul_lava", + FluidSoulLava.Flowing::new); - public static final RegistryObject ALLTHEMODIUM = - FLUIDS.register("molten_allthemodium", FluidATM.Source::new); - public static final RegistryObject FLOWING_ALLTHEMODIUM = - FLUIDS.register("flowing_molten_allthemodium", FluidATM.Flowing::new); + public static final RegistryObject ALLTHEMODIUM = FLUIDS.register("molten_allthemodium", + FluidATM.Source::new); + public static final RegistryObject FLOWING_ALLTHEMODIUM = FLUIDS + .register("flowing_molten_allthemodium", FluidATM.Flowing::new); - public static final RegistryObject VIBRANIUM = - FLUIDS.register("molten_vibranium", FluidVIB.Source::new); - public static final RegistryObject FLOWING_VIBRANIUM = - FLUIDS.register("flowing_molten_vibranium", FluidVIB.Flowing::new); + public static final RegistryObject VIBRANIUM = FLUIDS.register("molten_vibranium", + FluidVIB.Source::new); + public static final RegistryObject FLOWING_VIBRANIUM = FLUIDS.register("flowing_molten_vibranium", + FluidVIB.Flowing::new); - public static final RegistryObject UNOBTAINIUM = - FLUIDS.register("molten_unobtainium", FluidUNOB.Source::new); - public static final RegistryObject FLOWING_UNOBTAINIUM = - FLUIDS.register("flowing_molten_unobtainium", FluidUNOB.Flowing::new); + public static final RegistryObject UNOBTAINIUM = FLUIDS.register("molten_unobtainium", + FluidUNOB.Source::new); + public static final RegistryObject FLOWING_UNOBTAINIUM = FLUIDS.register("flowing_molten_unobtainium", + FluidUNOB.Flowing::new); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java index 8323f30f..d07f8e37 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java @@ -14,104 +14,79 @@ public class FluidTypeRegistry { - public static final DeferredRegister FLUID_TYPES = - DeferredRegister.create( - ForgeRegistries.Keys.FLUID_TYPES, - Reference.MOD_ID - ); + public static final DeferredRegister FLUID_TYPES = DeferredRegister.create( + ForgeRegistries.Keys.FLUID_TYPES, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA = - FLUID_TYPES.register( - "soul_lava", - () -> - new SoulLavaType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".soul_lava" - ) - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound( - SoundActions.BUCKET_FILL, - SoundEvents.BUCKET_FILL - ) - .sound( - SoundActions.BUCKET_EMPTY, - SoundEvents.BUCKET_EMPTY - ) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH - ) - .canHydrate(false) - ) - ); + public static final RegistryObject SOULLAVA = FLUID_TYPES.register( + "soul_lava", + () -> new SoulLavaType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".soul_lava") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound( + SoundActions.BUCKET_FILL, + SoundEvents.BUCKET_FILL) + .sound( + SoundActions.BUCKET_EMPTY, + SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject ATM = FLUID_TYPES.register( - "molten_atm", - () -> - new MoltenATMType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_allthemodium" - ) - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH - ) - .canHydrate(false) - ) - ); + public static final RegistryObject ATM = FLUID_TYPES.register( + "molten_atm", + () -> new MoltenATMType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_allthemodium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject VIB = FLUID_TYPES.register( - "molten_vibranium", - () -> - new MoltenVIBType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_vibranium" - ) - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH - ) - .canHydrate(false) - ) - ); + public static final RegistryObject VIB = FLUID_TYPES.register( + "molten_vibranium", + () -> new MoltenVIBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_vibranium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject UNOB = FLUID_TYPES.register( - "molten_unobtainium", - () -> - new MoltenUNOBType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_unobtainium" - ) - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH - ) - .canHydrate(false) - ) - ); + public static final RegistryObject UNOB = FLUID_TYPES.register( + "molten_unobtainium", + () -> new MoltenUNOBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_unobtainium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java index 8863258e..f0ad0a9f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java @@ -11,134 +11,98 @@ public class ItemRegistry { - public static final DeferredRegister ITEMS = DeferredRegister.create( - ForgeRegistries.ITEMS, - Reference.MOD_ID - ); + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID); - public static final RegistryObject SOUL_LAVA_BUCKET = - ITEMS.register( - "soul_lava_bucket", - () -> - new BucketItem( - FluidRegistry.SOULLAVA, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP) - ) - ); + public static final RegistryObject SOUL_LAVA_BUCKET = ITEMS.register( + "soul_lava_bucket", + () -> new BucketItem( + FluidRegistry.SOULLAVA, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_ATM_BUCKET = - ITEMS.register( - "molten_allthemodium_bucket", - () -> - new BucketItem( - FluidRegistry.ALLTHEMODIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject MOLTEN_VIB_BUCKET = - ITEMS.register( - "molten_vibranium_bucket", - () -> - new BucketItem( - FluidRegistry.VIBRANIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject MOLTEN_UNOB_BUCKET = - ITEMS.register( - "molten_unobtainium_bucket", - () -> - new BucketItem( - FluidRegistry.UNOBTAINIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP) - ) - ); + public static final RegistryObject MOLTEN_ATM_BUCKET = ITEMS.register( + "molten_allthemodium_bucket", + () -> new BucketItem( + FluidRegistry.ALLTHEMODIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_VIB_BUCKET = ITEMS.register( + "molten_vibranium_bucket", + () -> new BucketItem( + FluidRegistry.VIBRANIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_UNOB_BUCKET = ITEMS.register( + "molten_unobtainium_bucket", + () -> new BucketItem( + FluidRegistry.UNOBTAINIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_SWORD = - ITEMS.register( - "alloy_sword", - () -> - new AlloySword( - ToolTiers.ALLOY_TIER, - 35, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register( - "alloy_axe", - () -> - new AlloyAxe( - ToolTiers.ALLOY_TIER, - 39, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ATM_ALLOY_PICK = - ITEMS.register( - "alloy_pick", - () -> - new AlloyPick( - ToolTiers.ALLOY_TIER, - 15, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ATM_ALLOY_SHOVEL = - ITEMS.register( - "alloy_shovel", - () -> - new AlloyShovel( - ToolTiers.ALLOY_TIER, - 13, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ATM_ALLOY_PAXEL = - ITEMS.register( - "alloy_paxel", - () -> - new AlloyPaxel( - 33, - 5.0F, - ToolTiers.ALLOY_TIER, - TagRegistry.PAXEL_TARGETS, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP) - ) - ); + public static final RegistryObject ATM_ALLOY_SWORD = ITEMS.register( + "alloy_sword", + () -> new AlloySword( + ToolTiers.ALLOY_TIER, + 35, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register( + "alloy_axe", + () -> new AlloyAxe( + ToolTiers.ALLOY_TIER, + 39, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_PICK = ITEMS.register( + "alloy_pick", + () -> new AlloyPick( + ToolTiers.ALLOY_TIER, + 15, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_SHOVEL = ITEMS.register( + "alloy_shovel", + () -> new AlloyShovel( + ToolTiers.ALLOY_TIER, + 13, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_PAXEL = ITEMS.register( + "alloy_paxel", + () -> new AlloyPaxel( + 33, + 5.0F, + ToolTiers.ALLOY_TIER, + TagRegistry.PAXEL_TARGETS, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java index 788def86..21462e2d 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java @@ -9,13 +9,11 @@ public class LevelRegistry { - public static final ResourceKey Mining = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - MINING_DIM_ID - ); + public static final ResourceKey Mining = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + MINING_DIM_ID); - public static final ResourceKey THE_OTHER = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - THE_OTHER_DIM_ID - ); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java index 4cf2e73e..44572ba9 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java @@ -10,31 +10,25 @@ public class MekRegistry extends WrappedDeferredRegister { - public MekRegistry(String modid) { - super(modid, MekanismAPI.slurryRegistryName()); - } + public MekRegistry(String modid) { + super(modid, MekanismAPI.slurryRegistryName()); + } - public SlurryRegistryObject register(ATMResource resource) { - return register( - resource.getRegistrySuffix(), - builder -> - builder.color(resource.getTint()).ore(resource.getOreTag()) - ); - } + public SlurryRegistryObject register(ATMResource resource) { + return register( + resource.getRegistrySuffix(), + builder -> builder.color(resource.getTint()).ore(resource.getOreTag())); + } - public SlurryRegistryObject register( - String baseName, - UnaryOperator builderModifier - ) { - return new SlurryRegistryObject<>( - internal.register( - "dirty_" + baseName, - () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty())) - ), - internal.register( - "clean_" + baseName, - () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())) - ) - ); - } + public SlurryRegistryObject register( + String baseName, + UnaryOperator builderModifier) { + return new SlurryRegistryObject<>( + internal.register( + "dirty_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty()))), + internal.register( + "clean_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())))); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java index 5b0e49fc..792a84af 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java @@ -51,2511 +51,1687 @@ import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.server.command.TextComponentHelper; -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - bus = Mod.EventBusSubscriber.Bus.MOD -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModRegistry { - public static final DeferredRegister SHAPED_BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister STAIR_BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister WALL_BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister SLAB_BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister PILLAR_BLOCKS = - DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - public static final DeferredRegister BIOMES = - DeferredRegister.create(ForgeRegistries.BIOMES, Reference.MOD_ID); - - public static final DeferredRegister ITEMS = DeferredRegister.create( - ForgeRegistries.ITEMS, - Reference.MOD_ID - ); - - public static final DeferredRegister> ENTITY = - DeferredRegister.create( - ForgeRegistries.BLOCK_ENTITY_TYPES, - Reference.MOD_ID - ); - public static final DeferredRegister> CARVERS = - DeferredRegister.create( - ForgeRegistries.WORLD_CARVERS, - Reference.MOD_ID - ); - public static final DeferredRegister> ENTITIES = - DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, Reference.MOD_ID); - - public static final DeferredRegister> FEATURES = - DeferredRegister.create(ForgeRegistries.FEATURES, Reference.MOD_ID); - - // TODO: Add spawn eggs for mobs - // private static ArrayList SPAWN_EGGS = new ArrayList() - - // BIOMES - - RegistryObject MINING = BIOMES.register( - "mining", - () -> ATMBiomes.mining() - ); - RegistryObject THE_OTHER = BIOMES.register( - "the_other", - () -> ATMBiomes.the_other() - ); - RegistryObject DESERT = BIOMES.register( - "desert", - () -> ATMBiomes.desert() - ); - RegistryObject DESERT_HILLS = BIOMES.register( - "desert_hills", - () -> ATMBiomes.desert_hills() - ); - RegistryObject SOULSAND = BIOMES.register( - "soul_sand_valley", - () -> ATMBiomes.soul_sand_valley() - ); - RegistryObject WARPED_FOREST = BIOMES.register( - "warped_forest", - () -> ATMBiomes.warped_forest() - ); - RegistryObject CRIMSON_FOREST = BIOMES.register( - "crimson_forest", - () -> ATMBiomes.crimson_forest() - ); - RegistryObject BASALT_DELTAS = BIOMES.register( - "basalt_deltas", - () -> ATMBiomes.basalt_deltas() - ); - - // FOOD - - public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register( - "allthemodium_apple", - () -> - new AllthemodiumApple( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - .food(ModFoods.ALLTHEMODIUM_APPLE) - .rarity(Rarity.EPIC) - ) - ); - public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register( - "allthemodium_carrot", - () -> - new AllthemodiumCarrot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - .food(ModFoods.ALLTHEMODIUM_CARROT) - .rarity(Rarity.EPIC) - ) - ); - - // ARMORS - - public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register( - "allthemodium_boots", - () -> - (ArmorItem) new AllthemodiumBoots( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.FEET, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC) - ) - ); - public static RegistryObject ALLTHEMODIUM_LEGGINGS = - ITEMS.register( - "allthemodium_leggings", - () -> - (ArmorItem) new AllthemodiumLeggings( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.LEGS, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC) - ) - ); - public static RegistryObject ALLTHEMODIUM_CHESTPLATE = - ITEMS.register( - "allthemodium_chestplate", - () -> - (ArmorItem) new AllthemodiumChestplate( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.CHEST, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC) - ) - ); - public static RegistryObject ALLTHEMODIUM_HELMET = - ITEMS.register( - "allthemodium_helmet", - () -> - (ArmorItem) new AllthemodiumHelmet( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.HEAD, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC) - ) - ); - - // Volcano - - public static Feature VOLCANO_F = new Volcano( - VolcanoConfig.CODEC - ); - public static RegistryObject> VOLCANO = - FEATURES.register("volcano", () -> VOLCANO_F); - - public static final RegistryObject ANCIENT_CAVEVINES_ = - PILLAR_BLOCKS.register( - "ancient_cavevines", - () -> - new AncientCaveVines( - BlockBehaviour.Properties - .of(Material.PLANT) - .randomTicks() - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES), - Direction.DOWN, - ACaveVines.SHAPE, - false, - 0.1D - ) - ); - - public static final RegistryObject< - AncientCaveVinesPlant - > ANCIENT_CAVEVINES_PLANT_ = PILLAR_BLOCKS.register( - "ancient_cavevines_plant", - () -> - new AncientCaveVinesPlant( - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES), - Direction.DOWN, - ACaveVines.SHAPE, - false - ) - ); - - public static final RegistryObject ANCIENT_HERB = - PILLAR_BLOCKS.register( - "ancient_herb", - () -> - new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission() - ) - ); - - public static final RegistryObject ANCIENT_SMOOTH_STONE = - BLOCKS.register( - "ancient_smooth_stone", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.STONE) - .strength(2.25f) - ) - ); - public static final RegistryObject ANCIENT_STONE = BLOCKS.register( - "ancient_stone", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.STONE) - .strength(1.5f) - ) - ); - public static final RegistryObject ANCIENT_DIRT = BLOCKS.register( - "ancient_dirt", - () -> - new AncientDirt( - BlockBehaviour.Properties - .of(Material.DIRT) - .sound(SoundType.WET_GRASS) - .strength(0.6f) - ) - ); - public static final RegistryObject ANCIENT_GRASS = BLOCKS.register( - "ancient_grass", - () -> - new AncientGrass( - BlockBehaviour.Properties - .of(Material.DIRT) - .sound(SoundType.MOSS) - .strength(0.6f) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE = - BLOCKS.register( - "ancient_mossy_stone", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.MOSS_CARPET) - .strength(1.5f) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICKS = - BLOCKS.register( - "ancient_stone_bricks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.5f) - ) - ); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = - BLOCKS.register( - "ancient_chiseled_stone_bricks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.0f) - ) - ); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = - BLOCKS.register( - "ancient_cracked_stone_bricks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.25f) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE = - BLOCKS.register( - "ancient_polished_stone", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.METAL) - .strength(2.5f) - ) - ); - - public static final RegistryObject ANCIENT_LOG_0 = - PILLAR_BLOCKS.register( - "ancient_log_0", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject ANCIENT_LOG_1 = - PILLAR_BLOCKS.register( - "ancient_log_1", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject ANCIENT_LOG_2 = - PILLAR_BLOCKS.register( - "ancient_log_2", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject ANCIENT_LOG_STRIPPED = - PILLAR_BLOCKS.register( - "stripped_ancient_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register( - "ancient_leaves", - () -> - new AncientLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_PURPLE) - ) - ); - public static final RegistryObject ANCIENT_LEAVES_BOTTOM = - PILLAR_BLOCKS.register( - "ancient_leaves_bottom", - () -> - new AncientLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_PURPLE) - ) - ); - public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register( - "ancient_planks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject ANCIENT_TRAPDOOR = - PILLAR_BLOCKS.register( - "ancient_trap_door", - () -> - new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion() - ) - ); - public static final RegistryObject ANCIENT_WOOD_FENCE = - PILLAR_BLOCKS.register( - "ancient_wooden_fence", - () -> - new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = - PILLAR_BLOCKS.register( - "ancient_wooden_fence_gate", - () -> - new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject ANCIENT_DOOR_ = - PILLAR_BLOCKS.register( - "ancient_door", - () -> - new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD) - ) - ); - - public static final RegistryObject DEMONIC_HERB = - PILLAR_BLOCKS.register( - "demonic_herb", - () -> - new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission() - ) - ); - public static final RegistryObject DEMONIC_LOG = - PILLAR_BLOCKS.register( - "demonic_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject DEMONIC_LOG_STRIPPED = - PILLAR_BLOCKS.register( - "stripped_demonic_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register( - "demonic_leaves", - () -> - new DemonicLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_RED) - ) - ); - public static final RegistryObject DEMONIC_LEAVES_BOTTOM = - PILLAR_BLOCKS.register( - "demonic_leaves_bottom", - () -> - new DemonicLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_RED) - ) - ); - public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register( - "demonic_planks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject DEMONIC_TRAPDOOR = - PILLAR_BLOCKS.register( - "demonic_trap_door", - () -> - new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion() - ) - ); - public static final RegistryObject DEMONIC_WOOD_FENCE = - PILLAR_BLOCKS.register( - "demonic_wooden_fence", - () -> - new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = - PILLAR_BLOCKS.register( - "demonic_wooden_fence_gate", - () -> - new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject DEMONIC_DOOR_ = - PILLAR_BLOCKS.register( - "demonic_door", - () -> - new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD) - ) - ); - - public static final RegistryObject SOUL_HERB = - PILLAR_BLOCKS.register( - "soul_herb", - () -> - new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission() - ) - ); - public static final RegistryObject SOUL_LOG = PILLAR_BLOCKS.register( - "soul_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject SOUL_LOG_0 = - PILLAR_BLOCKS.register( - "soul_log_0", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject SOUL_LOG_1 = - PILLAR_BLOCKS.register( - "soul_log_1", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject SOUL_LOG_2 = - PILLAR_BLOCKS.register( - "soul_log_2", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject SOUL_LOG_STRIPPED = - PILLAR_BLOCKS.register( - "stripped_soul_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD) - ); - public static final RegistryObject SOUL_LEAVES = BLOCKS.register( - "soul_leaves", - () -> - new SoulLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_BLUE) - ) - ); - public static final RegistryObject SOUL_LEAVES_BOTTOM = - PILLAR_BLOCKS.register( - "soul_leaves_bottom", - () -> - new SoulLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_BLUE) - ) - ); - public static final RegistryObject SOUL_PLANKS = BLOCKS.register( - "soul_planks", - () -> - new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject SOUL_TRAPDOOR = - PILLAR_BLOCKS.register( - "soul_trap_door", - () -> - new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion() - ) - ); - public static final RegistryObject SOUL_WOOD_FENCE = - PILLAR_BLOCKS.register( - "soul_wooden_fence", - () -> - new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject SOUL_WOOD_FENCE_GATE = - PILLAR_BLOCKS.register( - "soul_wooden_fence_gate", - () -> - new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject SOUL_DOOR_ = - PILLAR_BLOCKS.register( - "soul_door", - () -> - new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD) - ) - ); - - public static final RegistryObject ANCIENT_STONE_WALL = - WALL_BLOCKS.register( - "ancient_stone_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = - WALL_BLOCKS.register( - "ancient_smooth_stone_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = - WALL_BLOCKS.register( - "ancient_polished_stone_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL = - WALL_BLOCKS.register( - "ancient_stone_brick_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()) - ) - ); - public static final RegistryObject< - WallBlock - > ANCIENT_CHISELED_STONE_BRICK_WALL = WALL_BLOCKS.register( - "ancient_chiseled_stone_brick_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy( - ANCIENT_CHISELED_STONE_BRICKS.get() - ) - ) - ); - public static final RegistryObject< - WallBlock - > ANCIENT_CRACKED_STONE_BRICK_WALL = WALL_BLOCKS.register( - "ancient_cracked_stone_brick_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy( - ANCIENT_CRACKED_STONE_BRICKS.get() - ) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = - WALL_BLOCKS.register( - "ancient_mossy_stone_wall", - () -> - new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - - public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = - ITEMS.register( - "ancient_cavevines_plant", - () -> - new BlockItem( - ANCIENT_CAVEVINES_PLANT_.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register( - "ancient_soulberries", - () -> - new SoulBerries( - ANCIENT_CAVEVINES_.get(), - (new Item.Properties()).food(ModFoods.SOUL_BERRIES) - .tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = - ITEMS.register( - "ancient_trap_door", - () -> - new BlockItem( - ANCIENT_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = - ITEMS.register( - "demonic_trap_door", - () -> - new BlockItem( - DEMONIC_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_TRAP_DOOR_ITEM = - ITEMS.register( - "soul_trap_door", - () -> - new BlockItem( - SOUL_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register( - "ancient_door", - () -> - new BlockItem( - ANCIENT_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register( - "demonic_door", - () -> - new BlockItem( - DEMONIC_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register( - "soul_door", - () -> - new BlockItem( - SOUL_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_STONE_WALL_ITEM = - ITEMS.register( - "ancient_stone_wall", - () -> - new BlockItem( - ANCIENT_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = - ITEMS.register( - "ancient_smooth_stone_wall", - () -> - new BlockItem( - ANCIENT_SMOOTH_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = - ITEMS.register( - "ancient_polished_stone_wall", - () -> - new BlockItem( - ANCIENT_POLISHED_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = - ITEMS.register( - "ancient_stone_brick_wall", - () -> - new BlockItem( - ANCIENT_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject< - Item - > ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register( - "ancient_chiseled_stone_brick_wall", - () -> - new BlockItem( - ANCIENT_CHISELED_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject< - Item - > ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register( - "ancient_cracked_stone_brick_wall", - () -> - new BlockItem( - ANCIENT_CRACKED_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = - ITEMS.register( - "ancient_mossy_stone_wall", - () -> - new BlockItem( - ANCIENT_MOSSY_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_BOOKSHELF = - PILLAR_BLOCKS.register( - "ancient_bookshelf", - () -> - new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject DEMONIC_BOOKSHELF = - PILLAR_BLOCKS.register( - "demonic_bookshelf", - () -> - new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - public static final RegistryObject SOUL_BOOKSHELF = - PILLAR_BLOCKS.register( - "soul_bookshelf", - () -> - new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD) - ) - ); - - public static final RegistryObject ANCIENT_SAPLING = - PILLAR_BLOCKS.register( - "ancient_sapling", - () -> - new SaplingBlock( - new AncientTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS) - ) - ); - public static final RegistryObject DEMONIC_SAPLING = - PILLAR_BLOCKS.register( - "demonic_sapling", - () -> - new SaplingBlock( - new DemonicTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS) - ) - ); - public static final RegistryObject SOUL_SAPLING = - PILLAR_BLOCKS.register( - "soul_sapling", - () -> - new SaplingBlock( - new SoulTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS) - ) - ); - - public static final RegistryObject ANCIENT_WOODEN_STAIRS = - STAIR_BLOCKS.register( - "ancient_wooden_stairs", - () -> - new StairBlock( - () -> ANCIENT_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()) - ) - ); - public static final RegistryObject DEMONIC_WOODEN_STAIRS = - STAIR_BLOCKS.register( - "demonic_wooden_stairs", - () -> - new StairBlock( - () -> DEMONIC_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()) - ) - ); - public static final RegistryObject SOUL_WOODEN_STAIRS = - STAIR_BLOCKS.register( - "soul_wooden_stairs", - () -> - new StairBlock( - () -> SOUL_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(SOUL_PLANKS.get()) - ) - ); - public static final RegistryObject ANCIENT_STONE_STAIRS = - STAIR_BLOCKS.register( - "ancient_stone_stairs", - () -> - new StairBlock( - () -> ANCIENT_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = - STAIR_BLOCKS.register( - "ancient_smooth_stone_stairs", - () -> - new StairBlock( - () -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = - STAIR_BLOCKS.register( - "ancient_stone_brick_stairs", - () -> - new StairBlock( - () -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) - ) - ); - - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = - STAIR_BLOCKS.register( - "ancient_mossy_stone_stairs", - () -> - new StairBlock( - () -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject< - StairBlock - > ANCIENT_CHISELED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_chiseled_stone_brick_stairs", - () -> - new StairBlock( - () -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject< - StairBlock - > ANCIENT_CRACKED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_cracked_stone_brick_stairs", - () -> - new StairBlock( - () -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject< - StairBlock - > ANCIENT_POLISHED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_polished_stone_stairs", - () -> - new StairBlock( - () -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - - public static final RegistryObject ANCIENT_WOODEN_SLABS = - SLAB_BLOCKS.register( - "ancient_wooden_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()) - ) - ); - public static final RegistryObject DEMONIC_WOODEN_SLABS = - SLAB_BLOCKS.register( - "demonic_wooden_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()) - ) - ); - public static final RegistryObject SOUL_WOODEN_SLABS = - SLAB_BLOCKS.register( - "soul_wooden_slabs", - () -> - new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get())) - ); - public static final RegistryObject ANCIENT_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_stone_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_smooth_stone_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = - SLAB_BLOCKS.register( - "ancient_stone_brick_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_mossy_stone_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_chiseled_stone_brick_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_cracked_stone_brick_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = - SLAB_BLOCKS.register( - "ancient_polished_stone_slabs", - () -> - new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()) - ) - ); - - public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = - ITEMS.register( - "ancient_wooden_slabs", - () -> - new BlockItem( - ANCIENT_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = - ITEMS.register( - "demonic_wooden_slabs", - () -> - new BlockItem( - DEMONIC_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = - ITEMS.register( - "soul_wooden_slabs", - () -> - new BlockItem( - SOUL_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_stone_slabs", - () -> - new BlockItem( - ANCIENT_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_smooth_stone_slabs", - () -> - new BlockItem( - ANCIENT_SMOOTH_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = - ITEMS.register( - "ancient_stone_brick_slabs", - () -> - new BlockItem( - ANCIENT_STONE_BRICK_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_mossy_stone_slabs", - () -> - new BlockItem( - ANCIENT_MOSSY_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_chiseled_stone_brick_slabs", - () -> - new BlockItem( - ANCIENT_CHISELED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_cracked_stone_brick_slabs", - () -> - new BlockItem( - ANCIENT_CRACKED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = - ITEMS.register( - "ancient_polished_stone_slabs", - () -> - new BlockItem( - ANCIENT_POLISHED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register( - "ancient_herb", - () -> - new BlockItem( - ANCIENT_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register( - "demonic_herb", - () -> - new BlockItem( - DEMONIC_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register( - "soul_herb", - () -> - new BlockItem( - SOUL_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_LOG_0_ITEM = - ITEMS.register( - "ancient_log_0", - () -> - new BlockItem( - ANCIENT_LOG_0.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_LOG_1_ITEM = - ITEMS.register( - "ancient_log_1", - () -> - new BlockItem( - ANCIENT_LOG_1.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_LOG_2_ITEM = - ITEMS.register( - "ancient_log_2", - () -> - new BlockItem( - ANCIENT_LOG_2.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = - ITEMS.register( - "stripped_ancient_log", - () -> - new BlockItem( - ANCIENT_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_LEAVES_ITEM = - ITEMS.register( - "ancient_leaves", - () -> - new BlockItem( - ANCIENT_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_PLANKS_ITEM = - ITEMS.register( - "ancient_planks", - () -> - new BlockItem( - ANCIENT_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = - ITEMS.register( - "ancient_bookshelf", - () -> - new BlockItem( - ANCIENT_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_SAPLING_ITEM = - ITEMS.register( - "ancient_sapling", - () -> - new BlockItem( - ANCIENT_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register( - "soul_log", - () -> - new BlockItem( - SOUL_LOG.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register( - "soul_log_0", - () -> - new BlockItem( - SOUL_LOG_0.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register( - "soul_log_1", - () -> - new BlockItem( - SOUL_LOG_1.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register( - "soul_log_2", - () -> - new BlockItem( - SOUL_LOG_2.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = - ITEMS.register( - "stripped_soul_log", - () -> - new BlockItem( - SOUL_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register( - "soul_leaves", - () -> - new BlockItem( - SOUL_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register( - "soul_planks", - () -> - new BlockItem( - SOUL_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_BOOKSHELF_ITEM = - ITEMS.register( - "soul_bookshelf", - () -> - new BlockItem( - SOUL_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register( - "soul_sapling", - () -> - new BlockItem( - SOUL_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register( - "demonic_log", - () -> - new BlockItem( - DEMONIC_LOG.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = - ITEMS.register( - "stripped_demonic_log", - () -> - new BlockItem( - DEMONIC_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_LEAVES_ITEM = - ITEMS.register( - "demonic_leaves", - () -> - new BlockItem( - DEMONIC_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_PLANKS_ITEM = - ITEMS.register( - "demonic_planks", - () -> - new BlockItem( - DEMONIC_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = - ITEMS.register( - "demonic_bookshelf", - () -> - new BlockItem( - DEMONIC_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_SAPLING_ITEM = - ITEMS.register( - "demonic_sapling", - () -> - new BlockItem( - DEMONIC_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = - ITEMS.register( - "ancient_wooden_stairs", - () -> - new BlockItem( - ANCIENT_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = - ITEMS.register( - "demonic_wooden_stairs", - () -> - new BlockItem( - DEMONIC_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = - ITEMS.register( - "soul_wooden_stairs", - () -> - new BlockItem( - SOUL_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = - ITEMS.register( - "ancient_stone_stairs", - () -> - new BlockItem( - ANCIENT_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = - ITEMS.register( - "ancient_smooth_stone_stairs", - () -> - new BlockItem( - ANCIENT_SMOOTH_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = - ITEMS.register( - "ancient_stone_brick_stairs", - () -> - new BlockItem( - ANCIENT_STONE_BRICK_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = - ITEMS.register( - "ancient_mossy_stone_stairs", - () -> - new BlockItem( - ANCIENT_MOSSY_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject< - Item - > ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_chiseled_stone_brick_stairs", - () -> - new BlockItem( - ANCIENT_CHISELED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = - ITEMS.register( - "ancient_cracked_stone_brick_stairs", - () -> - new BlockItem( - ANCIENT_CRACKED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject< - Item - > ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_polished_stone_stairs", - () -> - new BlockItem( - ANCIENT_POLISHED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = - ITEMS.register( - "ancient_wooden_fence", - () -> - new BlockItem( - ANCIENT_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = - ITEMS.register( - "ancient_wooden_fence_gate", - () -> - new BlockItem( - ANCIENT_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = - ITEMS.register( - "demonic_wooden_fence", - () -> - new BlockItem( - DEMONIC_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = - ITEMS.register( - "demonic_wooden_fence_gate", - () -> - new BlockItem( - DEMONIC_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_WOOD_FENCE_ITEM = - ITEMS.register( - "soul_wooden_fence", - () -> - new BlockItem( - SOUL_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = - ITEMS.register( - "soul_wooden_fence_gate", - () -> - new BlockItem( - SOUL_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = - ITEMS.register( - "ancient_smooth_stone", - () -> - new BlockItem( - ANCIENT_SMOOTH_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_ITEM = - ITEMS.register( - "ancient_stone", - () -> - new BlockItem( - ANCIENT_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register( - "ancient_dirt", - () -> - new BlockItem( - ANCIENT_DIRT.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_GRASS_ITEM = - ITEMS.register( - "ancient_grass", - () -> - new BlockItem( - ANCIENT_GRASS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = - ITEMS.register( - "ancient_mossy_stone", - () -> - new BlockItem( - ANCIENT_MOSSY_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = - ITEMS.register( - "ancient_stone_bricks", - () -> - new BlockItem( - ANCIENT_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject< - Item - > ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register( - "ancient_chiseled_stone_bricks", - () -> - new BlockItem( - ANCIENT_CHISELED_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = - ITEMS.register( - "ancient_cracked_stone_bricks", - () -> - new BlockItem( - ANCIENT_CRACKED_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = - ITEMS.register( - "ancient_polished_stone", - () -> - new BlockItem( - ANCIENT_POLISHED_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ALLTHEMODIUM_ORE = - BLOCKS.register("allthemodium_ore", AllthemodiumOre::new); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = - BLOCKS.register("allthemodium_slate_ore", AllthemodiumOre::new); - - public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register( - "vibranium_ore", - VibraniumOre::new - ); - public static final RegistryObject OTHER_VIBRANIUM_ORE = - BLOCKS.register("other_vibranium_ore", VibraniumOre::new); - public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register( - "unobtainium_ore", - UnobtainiumOre::new - ); - - public static final RegistryObject ALLTHEMODIUM_BLOCK = - BLOCKS.register("allthemodium_block", AllthemodiumBlock::new); - public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register( - "vibranium_block", - VibraniumBlock::new - ); - public static final RegistryObject UNOBTAINIUM_BLOCK = - BLOCKS.register("unobtainium_block", UnobtainiumBlock::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = - BLOCKS.register("raw_allthemodium_block", RawATM::new); - public static final RegistryObject RAW_VIBRANIUM_BLOCK = - BLOCKS.register("raw_vibranium_block", RawVIB::new); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = - BLOCKS.register("raw_unobtainium_block", RawUNO::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = - ITEMS.register( - "raw_allthemodium_block", - () -> - new BlockItem( - RAW_ALLTHEMODIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = - ITEMS.register( - "raw_vibranium_block", - () -> - new BlockItem( - RAW_VIBRANIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = - ITEMS.register( - "raw_unobtainium_block", - () -> - new BlockItem( - RAW_UNOBTAINIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = - ITEMS.register( - "allthemodium_ore", - () -> - new AllthemodiumOreItem( - ALLTHEMODIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = - ITEMS.register( - "allthemodium_slate_ore", - () -> - new AllthemodiumOreItem( - ALLTHEMODIUM_SLATE_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject VIBRANIUM_ORE_ITEM = - ITEMS.register( - "vibranium_ore", - () -> - new Vibranium_Ore_Item( - VIBRANIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = - ITEMS.register( - "other_vibranium_ore", - () -> - new Vibranium_Ore_Item( - OTHER_VIBRANIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject UNOBTAINIUM_ORE_ITEM = - ITEMS.register( - "unobtainium_ore", - () -> - new UnobtainiumOreItem( - UNOBTAINIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = - ITEMS.register( - "allthemodium_block", - () -> - new BlockItem( - ALLTHEMODIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject VIBRANIUM_BLOCK_ITEM = - ITEMS.register( - "vibranium_block", - () -> - new BlockItem( - VIBRANIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = - ITEMS.register( - "unobtainium_block", - () -> - new BlockItem( - UNOBTAINIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register( - "raw_allthemodium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject RAW_VIBRANIUM = ITEMS.register( - "raw_vibranium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register( - "raw_unobtainium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ALLTHEMODIUM_INGOT = - ITEMS.register( - "allthemodium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register( - "vibranium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register( - "unobtainium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject ATM_PLATE = ITEMS.register( - "allthemodium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_PLATE = ITEMS.register( - "vibranium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_PLATE = ITEMS.register( - "unobtainium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_GEAR = ITEMS.register( - "allthemodium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_GEAR = ITEMS.register( - "vibranium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_GEAR = ITEMS.register( - "unobtainium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_ROD = ITEMS.register( - "allthemodium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_ROD = ITEMS.register( - "vibranium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_ROD = ITEMS.register( - "unobtainium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ALLTHEMODIUM_NUGGET = - ITEMS.register( - "allthemodium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register( - "vibranium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOBTAINIUM_NUGGET = - ITEMS.register( - "unobtainium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register( - "allthemodium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIBRANIUM_DUST = ITEMS.register( - "vibranium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register( - "unobtainium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_CLUMP = ITEMS.register( - "allthemodium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_CLUMP = ITEMS.register( - "vibranium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_CLUMP = ITEMS.register( - "unobtainium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_SHARD = ITEMS.register( - "allthemodium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_SHARD = ITEMS.register( - "vibranium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_SHARD = ITEMS.register( - "unobtainium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_DIRTY = ITEMS.register( - "dirty_allthemodium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_DIRTY = ITEMS.register( - "dirty_vibranium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_DIRTY = ITEMS.register( - "dirty_unobtainium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject ATM_CRYSTAL = ITEMS.register( - "allthemodium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject VIB_CRYSTAL = ITEMS.register( - "vibranium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject UNOB_CRYSTAL = ITEMS.register( - "unobtainium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP)) - ); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = - ITEMS.register( - "unobtainium_allthemodium_alloy_dust", - () -> - new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = - ITEMS.register( - "unobtainium_vibranium_alloy_dust", - () -> - new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = - ITEMS.register( - "vibranium_allthemodium_alloy_dust", - () -> - new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = - ITEMS.register( - "unobtainium_allthemodium_alloy_ingot", - () -> - new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = - ITEMS.register( - "unobtainium_vibranium_alloy_ingot", - () -> - new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = - ITEMS.register( - "vibranium_allthemodium_alloy_ingot", - () -> - new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - ) - ); - - public static final RegistryObject TELEPORT_PAD = - SHAPED_BLOCKS.register( - "teleport_pad", - () -> - new TeleportPad( - Block.Properties - .of(Material.METAL) - .noLootTable() - .noOcclusion() - .strength(20.0F) - ) - ); - public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register( - "teleport_pad", - () -> - new BlockItem( - TELEPORT_PAD.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject ALLTHEMODIUM_SWORD = - ITEMS.register( - "allthemodium_sword", - () -> - new SwordItem( - ToolTiers.ALLTHEMODIUM_TIER, - 4, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC) - ) { - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - } - ); - - public static final RegistryObject ALLTHEMODIUM_PICKAXE = - ITEMS.register( - "allthemodium_pickaxe", - () -> - new PickaxeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 2, - 1.0f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC) - ) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_PICKAXE) - ) return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_PICKAXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - return false; - } - } - ); - - public static final RegistryObject ALLTHEMODIUM_AXE = - ITEMS.register( - "allthemodium_axe", - () -> - new AxeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 6, - 1.0f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC) - ) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_AXE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - return false; - } - } - ); - - public static final RegistryObject ALLTHEMODIUM_SHOVEL = - ITEMS.register( - "allthemodium_shovel", - () -> - new ShovelItem( - ToolTiers.ALLTHEMODIUM_TIER, - 1, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC) - ) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_SHOVEL) - ) return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_SHOVEL) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - return false; - } - } - ); - - public static final RegistryObject ALLTHEMODIUM_HOE = - ITEMS.register( - "allthemodium_hoe", - () -> - new HoeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 0, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC) - ) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state - ) { - if (state.is(BlockTags.MINEABLE_WITH_HOE)) return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn - ) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object() - ) - .withStyle(ChatFormatting.GOLD) - ); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state - ) { - if ( - state.is(BlockTags.MINEABLE_WITH_HOE) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - if ( - state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG) - ) return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state - ); - return false; - } - } - ); - - public static final RegistryObject UA_ALLOY = BLOCKS.register( - "unobtainium_allthemodium_alloy_block", - UAAlloyBlock::new - ); - public static final RegistryObject UV_ALLOY = BLOCKS.register( - "unobtainium_vibranium_alloy_block", - UVAlloyBlock::new - ); - public static final RegistryObject VA_ALLOY = BLOCKS.register( - "vibranium_allthemodium_alloy_block", - VAAlloyBlock::new - ); - - public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register( - "unobtainium_allthemodium_alloy_block", - () -> - new BlockItem( - UA_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register( - "unobtainium_vibranium_alloy_block", - () -> - new BlockItem( - UV_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register( - "vibranium_allthemodium_alloy_block", - () -> - new BlockItem( - VA_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP) - ) - ); - - public static final RegistryObject PIGLICH_HEART = ITEMS.register( - "piglich_heart", - () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP)) - ); - public static final RegistryObject> PIGLICH = - createMonsterEntity( - "piglich", - PiglichEntity::new, - 0.6F, - 3.0F, - 0x000000, - 0xebe834 - ); - - private static RegistryObject< - EntityType - > createMonsterEntity( - String name, - EntityType.EntityFactory factory, - float width, - float height, - int eggPrimary, - int eggSecondary - ) { - ResourceLocation location = new ResourceLocation( - Reference.MOD_ID, - name - ); - - return ENTITIES.register( - name, - () -> - EntityType.Builder - .of(factory, MobCategory.MONSTER) - .sized(width, height) - .setTrackingRange(64) - .setUpdateInterval(1) - .build(location.toString()) - ); - // EntityType entity = EntityType.Builder.of(factory, - // MobCategory.MONSTER).sized(width, - // height) - // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, - // (new Item.Properties()).tab(AllTheModium.GROUP)); - // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + - // "_spawn_egg")); - // SPAWN_EGGS.add(spawnEgg); - - // return ENTITIES.register(name, () -> entity); - } - - // private static RegistryObject> createShulkerEntity(String name, - // EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { - // ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); - // EntityType entity = EntityType.Builder.of(factory, - // MobCategory.MONSTER).sized(width, - // height) - // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, - // (new Item.Properties()).tab(AllTheModium.GROUP)); - // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + - // "_spawn_egg")); - // SPAWN_EGGS.add(spawnEgg); - - // return ENTITIES.register(name, () -> entity); - // } - - @SubscribeEvent - public static void addEntityAttributes(EntityAttributeCreationEvent event) { - event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); - // event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); - } - - private static RotatedPillarBlock log( - MaterialColor color1, - MaterialColor color2 - ) { - return new RotatedPillarBlock( - BlockBehaviour.Properties - .of( - Material.NETHER_WOOD, - woodLog -> { - return ( - woodLog.getValue(RotatedPillarBlock.AXIS) == - Direction.Axis.Y - ) - ? color1 - : color2; - } - ) - .strength(2.0F) - .sound(SoundType.WOOD) - ); - } + public static final DeferredRegister SHAPED_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister STAIR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister WALL_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister SLAB_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister PILLAR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, + Reference.MOD_ID); + + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID); + + public static final DeferredRegister> ENTITY = DeferredRegister.create( + ForgeRegistries.BLOCK_ENTITY_TYPES, + Reference.MOD_ID); + public static final DeferredRegister> CARVERS = DeferredRegister.create( + ForgeRegistries.WORLD_CARVERS, + Reference.MOD_ID); + public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, + Reference.MOD_ID); + + public static final DeferredRegister> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, + Reference.MOD_ID); + + // TODO: Add spawn eggs for mobs + // private static ArrayList SPAWN_EGGS = new ArrayList() + + // BIOMES + + RegistryObject MINING = BIOMES.register( + "mining", + () -> ATMBiomes.mining()); + RegistryObject THE_OTHER = BIOMES.register( + "the_other", + () -> ATMBiomes.the_other()); + RegistryObject DESERT = BIOMES.register( + "desert", + () -> ATMBiomes.desert()); + RegistryObject DESERT_HILLS = BIOMES.register( + "desert_hills", + () -> ATMBiomes.desert_hills()); + RegistryObject SOULSAND = BIOMES.register( + "soul_sand_valley", + () -> ATMBiomes.soul_sand_valley()); + RegistryObject WARPED_FOREST = BIOMES.register( + "warped_forest", + () -> ATMBiomes.warped_forest()); + RegistryObject CRIMSON_FOREST = BIOMES.register( + "crimson_forest", + () -> ATMBiomes.crimson_forest()); + RegistryObject BASALT_DELTAS = BIOMES.register( + "basalt_deltas", + () -> ATMBiomes.basalt_deltas()); + + // FOOD + + public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register( + "allthemodium_apple", + () -> new AllthemodiumApple( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_APPLE) + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register( + "allthemodium_carrot", + () -> new AllthemodiumCarrot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_CARROT) + .rarity(Rarity.EPIC))); + + // ARMORS + + public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register( + "allthemodium_boots", + () -> (ArmorItem) new AllthemodiumBoots( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.FEET, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_LEGGINGS = ITEMS.register( + "allthemodium_leggings", + () -> (ArmorItem) new AllthemodiumLeggings( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.LEGS, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_CHESTPLATE = ITEMS.register( + "allthemodium_chestplate", + () -> (ArmorItem) new AllthemodiumChestplate( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.CHEST, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_HELMET = ITEMS.register( + "allthemodium_helmet", + () -> (ArmorItem) new AllthemodiumHelmet( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.HEAD, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + + // Volcano + + public static Feature VOLCANO_F = new Volcano( + VolcanoConfig.CODEC); + public static RegistryObject> VOLCANO = FEATURES.register("volcano", () -> VOLCANO_F); + + public static final RegistryObject ANCIENT_CAVEVINES_ = PILLAR_BLOCKS.register( + "ancient_cavevines", + () -> new AncientCaveVines( + BlockBehaviour.Properties + .of(Material.PLANT) + .randomTicks() + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false, + 0.1D)); + + public static final RegistryObject ANCIENT_CAVEVINES_PLANT_ = PILLAR_BLOCKS.register( + "ancient_cavevines_plant", + () -> new AncientCaveVinesPlant( + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false)); + + public static final RegistryObject ANCIENT_HERB = PILLAR_BLOCKS.register( + "ancient_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + + public static final RegistryObject ANCIENT_SMOOTH_STONE = BLOCKS.register( + "ancient_smooth_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(2.25f))); + public static final RegistryObject ANCIENT_STONE = BLOCKS.register( + "ancient_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(1.5f))); + public static final RegistryObject ANCIENT_DIRT = BLOCKS.register( + "ancient_dirt", + () -> new AncientDirt( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.WET_GRASS) + .strength(0.6f))); + public static final RegistryObject ANCIENT_GRASS = BLOCKS.register( + "ancient_grass", + () -> new AncientGrass( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.MOSS) + .strength(0.6f))); + public static final RegistryObject ANCIENT_MOSSY_STONE = BLOCKS.register( + "ancient_mossy_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.MOSS_CARPET) + .strength(1.5f))); + public static final RegistryObject ANCIENT_STONE_BRICKS = BLOCKS.register( + "ancient_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.5f))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = BLOCKS.register( + "ancient_chiseled_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.0f))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = BLOCKS.register( + "ancient_cracked_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.25f))); + public static final RegistryObject ANCIENT_POLISHED_STONE = BLOCKS.register( + "ancient_polished_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.METAL) + .strength(2.5f))); + + public static final RegistryObject ANCIENT_LOG_0 = PILLAR_BLOCKS.register( + "ancient_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_1 = PILLAR_BLOCKS.register( + "ancient_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_2 = PILLAR_BLOCKS.register( + "ancient_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_ancient_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register( + "ancient_leaves", + () -> new AncientLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE))); + public static final RegistryObject ANCIENT_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "ancient_leaves_bottom", + () -> new AncientLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE))); + public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register( + "ancient_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_TRAPDOOR = PILLAR_BLOCKS.register( + "ancient_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject ANCIENT_WOOD_FENCE = PILLAR_BLOCKS.register( + "ancient_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "ancient_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_DOOR_ = PILLAR_BLOCKS.register( + "ancient_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject DEMONIC_HERB = PILLAR_BLOCKS.register( + "demonic_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + public static final RegistryObject DEMONIC_LOG = PILLAR_BLOCKS.register( + "demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject DEMONIC_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register( + "demonic_leaves", + () -> new DemonicLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_RED))); + public static final RegistryObject DEMONIC_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "demonic_leaves_bottom", + () -> new DemonicLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_RED))); + public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register( + "demonic_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_TRAPDOOR = PILLAR_BLOCKS.register( + "demonic_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject DEMONIC_WOOD_FENCE = PILLAR_BLOCKS.register( + "demonic_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "demonic_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_DOOR_ = PILLAR_BLOCKS.register( + "demonic_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject SOUL_HERB = PILLAR_BLOCKS.register( + "soul_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + public static final RegistryObject SOUL_LOG = PILLAR_BLOCKS.register( + "soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_0 = PILLAR_BLOCKS.register( + "soul_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_1 = PILLAR_BLOCKS.register( + "soul_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_2 = PILLAR_BLOCKS.register( + "soul_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LEAVES = BLOCKS.register( + "soul_leaves", + () -> new SoulLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_BLUE))); + public static final RegistryObject SOUL_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "soul_leaves_bottom", + () -> new SoulLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_BLUE))); + public static final RegistryObject SOUL_PLANKS = BLOCKS.register( + "soul_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_TRAPDOOR = PILLAR_BLOCKS.register( + "soul_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject SOUL_WOOD_FENCE = PILLAR_BLOCKS.register( + "soul_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "soul_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_DOOR_ = PILLAR_BLOCKS.register( + "soul_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject ANCIENT_STONE_WALL = WALL_BLOCKS.register( + "ancient_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = WALL_BLOCKS.register( + "ancient_smooth_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = WALL_BLOCKS.register( + "ancient_polished_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_chiseled_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CHISELED_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_cracked_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CRACKED_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = WALL_BLOCKS.register( + "ancient_mossy_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = ITEMS.register( + "ancient_cavevines_plant", + () -> new BlockItem( + ANCIENT_CAVEVINES_PLANT_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register( + "ancient_soulberries", + () -> new SoulBerries( + ANCIENT_CAVEVINES_.get(), + (new Item.Properties()).food(ModFoods.SOUL_BERRIES) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = ITEMS.register( + "ancient_trap_door", + () -> new BlockItem( + ANCIENT_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = ITEMS.register( + "demonic_trap_door", + () -> new BlockItem( + DEMONIC_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_TRAP_DOOR_ITEM = ITEMS.register( + "soul_trap_door", + () -> new BlockItem( + SOUL_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register( + "ancient_door", + () -> new BlockItem( + ANCIENT_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register( + "demonic_door", + () -> new BlockItem( + DEMONIC_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register( + "soul_door", + () -> new BlockItem( + SOUL_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_STONE_WALL_ITEM = ITEMS.register( + "ancient_stone_wall", + () -> new BlockItem( + ANCIENT_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = ITEMS.register( + "ancient_smooth_stone_wall", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = ITEMS.register( + "ancient_polished_stone_wall", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_stone_brick_wall", + () -> new BlockItem( + ANCIENT_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_wall", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_wall", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = ITEMS.register( + "ancient_mossy_stone_wall", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_BOOKSHELF = PILLAR_BLOCKS.register( + "ancient_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_BOOKSHELF = PILLAR_BLOCKS.register( + "demonic_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_BOOKSHELF = PILLAR_BLOCKS.register( + "soul_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + + public static final RegistryObject ANCIENT_SAPLING = PILLAR_BLOCKS.register( + "ancient_sapling", + () -> new SaplingBlock( + new AncientTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + public static final RegistryObject DEMONIC_SAPLING = PILLAR_BLOCKS.register( + "demonic_sapling", + () -> new SaplingBlock( + new DemonicTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + public static final RegistryObject SOUL_SAPLING = PILLAR_BLOCKS.register( + "soul_sapling", + () -> new SaplingBlock( + new SoulTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS = STAIR_BLOCKS.register( + "ancient_wooden_stairs", + () -> new StairBlock( + () -> ANCIENT_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); + public static final RegistryObject DEMONIC_WOODEN_STAIRS = STAIR_BLOCKS.register( + "demonic_wooden_stairs", + () -> new StairBlock( + () -> DEMONIC_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); + public static final RegistryObject SOUL_WOODEN_STAIRS = STAIR_BLOCKS.register( + "soul_wooden_stairs", + () -> new StairBlock( + () -> SOUL_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); + public static final RegistryObject ANCIENT_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_smooth_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = STAIR_BLOCKS.register( + "ancient_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_mossy_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_chiseled_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_cracked_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_polished_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_WOODEN_SLABS = SLAB_BLOCKS.register( + "ancient_wooden_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); + public static final RegistryObject DEMONIC_WOODEN_SLABS = SLAB_BLOCKS.register( + "demonic_wooden_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); + public static final RegistryObject SOUL_WOODEN_SLABS = SLAB_BLOCKS.register( + "soul_wooden_slabs", + () -> new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); + public static final RegistryObject ANCIENT_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_smooth_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = SLAB_BLOCKS.register( + "ancient_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_mossy_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_chiseled_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_cracked_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_polished_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = ITEMS.register( + "ancient_wooden_slabs", + () -> new BlockItem( + ANCIENT_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = ITEMS.register( + "demonic_wooden_slabs", + () -> new BlockItem( + DEMONIC_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = ITEMS.register( + "soul_wooden_slabs", + () -> new BlockItem( + SOUL_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = ITEMS.register( + "ancient_stone_slabs", + () -> new BlockItem( + ANCIENT_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = ITEMS.register( + "ancient_smooth_stone_slabs", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = ITEMS.register( + "ancient_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_STONE_BRICK_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = ITEMS.register( + "ancient_mossy_stone_slabs", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_polished_stone_slabs", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register( + "ancient_herb", + () -> new BlockItem( + ANCIENT_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register( + "demonic_herb", + () -> new BlockItem( + DEMONIC_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register( + "soul_herb", + () -> new BlockItem( + SOUL_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_LOG_0_ITEM = ITEMS.register( + "ancient_log_0", + () -> new BlockItem( + ANCIENT_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_1_ITEM = ITEMS.register( + "ancient_log_1", + () -> new BlockItem( + ANCIENT_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_2_ITEM = ITEMS.register( + "ancient_log_2", + () -> new BlockItem( + ANCIENT_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_ancient_log", + () -> new BlockItem( + ANCIENT_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LEAVES_ITEM = ITEMS.register( + "ancient_leaves", + () -> new BlockItem( + ANCIENT_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_PLANKS_ITEM = ITEMS.register( + "ancient_planks", + () -> new BlockItem( + ANCIENT_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = ITEMS.register( + "ancient_bookshelf", + () -> new BlockItem( + ANCIENT_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SAPLING_ITEM = ITEMS.register( + "ancient_sapling", + () -> new BlockItem( + ANCIENT_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register( + "soul_log", + () -> new BlockItem( + SOUL_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register( + "soul_log_0", + () -> new BlockItem( + SOUL_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register( + "soul_log_1", + () -> new BlockItem( + SOUL_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register( + "soul_log_2", + () -> new BlockItem( + SOUL_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_soul_log", + () -> new BlockItem( + SOUL_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register( + "soul_leaves", + () -> new BlockItem( + SOUL_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register( + "soul_planks", + () -> new BlockItem( + SOUL_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_BOOKSHELF_ITEM = ITEMS.register( + "soul_bookshelf", + () -> new BlockItem( + SOUL_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register( + "soul_sapling", + () -> new BlockItem( + SOUL_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register( + "demonic_log", + () -> new BlockItem( + DEMONIC_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_demonic_log", + () -> new BlockItem( + DEMONIC_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_LEAVES_ITEM = ITEMS.register( + "demonic_leaves", + () -> new BlockItem( + DEMONIC_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_PLANKS_ITEM = ITEMS.register( + "demonic_planks", + () -> new BlockItem( + DEMONIC_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = ITEMS.register( + "demonic_bookshelf", + () -> new BlockItem( + DEMONIC_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_SAPLING_ITEM = ITEMS.register( + "demonic_sapling", + () -> new BlockItem( + DEMONIC_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = ITEMS.register( + "ancient_wooden_stairs", + () -> new BlockItem( + ANCIENT_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = ITEMS.register( + "demonic_wooden_stairs", + () -> new BlockItem( + DEMONIC_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = ITEMS.register( + "soul_wooden_stairs", + () -> new BlockItem( + SOUL_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_stone_stairs", + () -> new BlockItem( + ANCIENT_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_smooth_stone_stairs", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = ITEMS.register( + "ancient_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_STONE_BRICK_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_mossy_stone_stairs", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_polished_stone_stairs", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = ITEMS.register( + "ancient_wooden_fence", + () -> new BlockItem( + ANCIENT_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "ancient_wooden_fence_gate", + () -> new BlockItem( + ANCIENT_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = ITEMS.register( + "demonic_wooden_fence", + () -> new BlockItem( + DEMONIC_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "demonic_wooden_fence_gate", + () -> new BlockItem( + DEMONIC_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOOD_FENCE_ITEM = ITEMS.register( + "soul_wooden_fence", + () -> new BlockItem( + SOUL_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "soul_wooden_fence_gate", + () -> new BlockItem( + SOUL_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = ITEMS.register( + "ancient_smooth_stone", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_ITEM = ITEMS.register( + "ancient_stone", + () -> new BlockItem( + ANCIENT_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register( + "ancient_dirt", + () -> new BlockItem( + ANCIENT_DIRT.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_GRASS_ITEM = ITEMS.register( + "ancient_grass", + () -> new BlockItem( + ANCIENT_GRASS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = ITEMS.register( + "ancient_mossy_stone", + () -> new BlockItem( + ANCIENT_MOSSY_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_stone_bricks", + () -> new BlockItem( + ANCIENT_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_chiseled_stone_bricks", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_cracked_stone_bricks", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = ITEMS.register( + "ancient_polished_stone", + () -> new BlockItem( + ANCIENT_POLISHED_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_ORE = BLOCKS.register("allthemodium_ore", + AllthemodiumOre::new); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = BLOCKS + .register("allthemodium_slate_ore", AllthemodiumOre::new); + + public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register( + "vibranium_ore", + VibraniumOre::new); + public static final RegistryObject OTHER_VIBRANIUM_ORE = BLOCKS.register("other_vibranium_ore", + VibraniumOre::new); + public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register( + "unobtainium_ore", + UnobtainiumOre::new); + + public static final RegistryObject ALLTHEMODIUM_BLOCK = BLOCKS.register("allthemodium_block", + AllthemodiumBlock::new); + public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register( + "vibranium_block", + VibraniumBlock::new); + public static final RegistryObject UNOBTAINIUM_BLOCK = BLOCKS.register("unobtainium_block", + UnobtainiumBlock::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = BLOCKS.register("raw_allthemodium_block", + RawATM::new); + public static final RegistryObject RAW_VIBRANIUM_BLOCK = BLOCKS.register("raw_vibranium_block", RawVIB::new); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = BLOCKS.register("raw_unobtainium_block", + RawUNO::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( + "raw_allthemodium_block", + () -> new BlockItem( + RAW_ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = ITEMS.register( + "raw_vibranium_block", + () -> new BlockItem( + RAW_VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( + "raw_unobtainium_block", + () -> new BlockItem( + RAW_UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = ITEMS.register( + "allthemodium_ore", + () -> new AllthemodiumOreItem( + ALLTHEMODIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = ITEMS.register( + "allthemodium_slate_ore", + () -> new AllthemodiumOreItem( + ALLTHEMODIUM_SLATE_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject VIBRANIUM_ORE_ITEM = ITEMS.register( + "vibranium_ore", + () -> new Vibranium_Ore_Item( + VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = ITEMS.register( + "other_vibranium_ore", + () -> new Vibranium_Ore_Item( + OTHER_VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_ORE_ITEM = ITEMS.register( + "unobtainium_ore", + () -> new UnobtainiumOreItem( + UNOBTAINIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( + "allthemodium_block", + () -> new BlockItem( + ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_BLOCK_ITEM = ITEMS.register( + "vibranium_block", + () -> new BlockItem( + VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( + "unobtainium_block", + () -> new BlockItem( + UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register( + "raw_allthemodium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_VIBRANIUM = ITEMS.register( + "raw_vibranium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register( + "raw_unobtainium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_INGOT = ITEMS.register( + "allthemodium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register( + "vibranium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register( + "unobtainium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_PLATE = ITEMS.register( + "allthemodium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_PLATE = ITEMS.register( + "vibranium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_PLATE = ITEMS.register( + "unobtainium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_GEAR = ITEMS.register( + "allthemodium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_GEAR = ITEMS.register( + "vibranium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_GEAR = ITEMS.register( + "unobtainium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_ROD = ITEMS.register( + "allthemodium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_ROD = ITEMS.register( + "vibranium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_ROD = ITEMS.register( + "unobtainium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_NUGGET = ITEMS.register( + "allthemodium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register( + "vibranium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_NUGGET = ITEMS.register( + "unobtainium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register( + "allthemodium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_DUST = ITEMS.register( + "vibranium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register( + "unobtainium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_CLUMP = ITEMS.register( + "allthemodium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_CLUMP = ITEMS.register( + "vibranium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_CLUMP = ITEMS.register( + "unobtainium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_SHARD = ITEMS.register( + "allthemodium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_SHARD = ITEMS.register( + "vibranium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_SHARD = ITEMS.register( + "unobtainium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_DIRTY = ITEMS.register( + "dirty_allthemodium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_DIRTY = ITEMS.register( + "dirty_vibranium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_DIRTY = ITEMS.register( + "dirty_unobtainium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_CRYSTAL = ITEMS.register( + "allthemodium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_CRYSTAL = ITEMS.register( + "vibranium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_CRYSTAL = ITEMS.register( + "unobtainium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = ITEMS.register( + "unobtainium_allthemodium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = ITEMS.register( + "unobtainium_vibranium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = ITEMS.register( + "vibranium_allthemodium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( + "unobtainium_allthemodium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = ITEMS.register( + "unobtainium_vibranium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( + "vibranium_allthemodium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + + public static final RegistryObject TELEPORT_PAD = SHAPED_BLOCKS.register( + "teleport_pad", + () -> new TeleportPad( + Block.Properties + .of(Material.METAL) + .noLootTable() + .noOcclusion() + .strength(20.0F))); + public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register( + "teleport_pad", + () -> new BlockItem( + TELEPORT_PAD.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_SWORD = ITEMS.register( + "allthemodium_sword", + () -> new SwordItem( + ToolTiers.ALLTHEMODIUM_TIER, + 4, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + }); + + public static final RegistryObject ALLTHEMODIUM_PICKAXE = ITEMS.register( + "allthemodium_pickaxe", + () -> new PickaxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 2, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_AXE = ITEMS.register( + "allthemodium_axe", + () -> new AxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 6, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_SHOVEL = ITEMS.register( + "allthemodium_shovel", + () -> new ShovelItem( + ToolTiers.ALLTHEMODIUM_TIER, + 1, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_HOE = ITEMS.register( + "allthemodium_hoe", + () -> new HoeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 0, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject UA_ALLOY = BLOCKS.register( + "unobtainium_allthemodium_alloy_block", + UAAlloyBlock::new); + public static final RegistryObject UV_ALLOY = BLOCKS.register( + "unobtainium_vibranium_alloy_block", + UVAlloyBlock::new); + public static final RegistryObject VA_ALLOY = BLOCKS.register( + "vibranium_allthemodium_alloy_block", + VAAlloyBlock::new); + + public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register( + "unobtainium_allthemodium_alloy_block", + () -> new BlockItem( + UA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register( + "unobtainium_vibranium_alloy_block", + () -> new BlockItem( + UV_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register( + "vibranium_allthemodium_alloy_block", + () -> new BlockItem( + VA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject PIGLICH_HEART = ITEMS.register( + "piglich_heart", + () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject> PIGLICH = createMonsterEntity( + "piglich", + PiglichEntity::new, + 0.6F, + 3.0F, + 0x000000, + 0xebe834); + + private static RegistryObject> createMonsterEntity( + String name, + EntityType.EntityFactory factory, + float width, + float height, + int eggPrimary, + int eggSecondary) { + ResourceLocation location = new ResourceLocation( + Reference.MOD_ID, + name); + + return ENTITIES.register( + name, + () -> EntityType.Builder + .of(factory, MobCategory.MONSTER) + .sized(width, height) + .setTrackingRange(64) + .setUpdateInterval(1) + .build(location.toString())); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + } + + // private static RegistryObject> createShulkerEntity(String name, + // EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { + // ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + // } + + @SubscribeEvent + public static void addEntityAttributes(EntityAttributeCreationEvent event) { + event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); + // event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); + } + + private static RotatedPillarBlock log( + MaterialColor color1, + MaterialColor color2) { + return new RotatedPillarBlock( + BlockBehaviour.Properties + .of( + Material.NETHER_WOOD, + woodLog -> { + return (woodLog.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y) + ? color1 + : color2; + }) + .strength(2.0F) + .sound(SoundType.WOOD)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java index db2e602b..c85b5109 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java @@ -10,342 +10,240 @@ public class TagRegistry { - public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create( - Reference.ore("allthemodium") - ); - public static final TagKey VIBRANIUM_ORE = BlockTags.create( - Reference.ore("vibranium") - ); - public static final TagKey UNOBTAINIUM_ORE = BlockTags.create( - Reference.ore("unobtainium") - ); - - public static final TagKey OTHER_PROTECTION = BlockTags.create( - Reference.atm("blocks/blocklist") - ); - - public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = - BlockTags.create(Reference.forge("needs_allthemodium_tool")); - public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create( - Reference.forge("needs_allthemodiumalloy_tool") - ); - - public static final TagKey FORGE_SWORDS = ItemTags.create( - Reference.forge("tools/swords") - ); - public static final TagKey FORGE_PICKAXES = ItemTags.create( - Reference.forge("tools/pickaxes") - ); - public static final TagKey FORGE_AXES = ItemTags.create( - Reference.forge("tools/axes") - ); - public static final TagKey FORGE_SHOVELS = ItemTags.create( - Reference.forge("tools/shovels") - ); - public static final TagKey FORGE_HOES = ItemTags.create( - Reference.forge("tools/hoes") - ); - public static final TagKey PAXEL_TARGETS = BlockTags.create( - Reference.atm("paxel_effective") - ); - - public static final TagKey PIGLIN_LOVED = ItemTags.create( - Reference.location("minecraft:items/piglin_loved") - ); - public static final TagKey RAW_MATERIALS = ItemTags.create( - Reference.forge("raw_materials") - ); - - public static final TagKey SAPLINGS = ItemTags.create( - Reference.location("saplings") - ); - public static final TagKey DUSTS = ItemTags.create( - Reference.forge("dusts") - ); - public static final TagKey INGOTS = ItemTags.create( - Reference.forge("ingots") - ); - public static final TagKey ORES = ItemTags.create( - Reference.forge("ores") - ); - public static final TagKey BLOCK_ORES = BlockTags.create( - Reference.forge("ores") - ); - - public static final TagKey OTHER_BIOMES = TagKey.create( - Registry.BIOME_REGISTRY, - Reference.location("allthemodium:other_biomes") - ); - - public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create( - Reference.location("allthemodium:other_te_whitelist") - ); - public static final TagKey ANCIENT_DIRT = BlockTags.create( - Reference.location("allthemodium:ancient_dirt") - ); - public static final TagKey ANCIENT_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_stone") - ); - public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_stone") - ); - public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:ancient_planks") - ); - public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = - ItemTags.create(Reference.location("allthemodium:ancient_planks")); - public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:demonic_planks") - ); - public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = - ItemTags.create(Reference.location("allthemodium:demonic_planks")); - public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:soul_planks") - ); - public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create( - Reference.location("allthemodium:soul_planks") - ); - - public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_mossy_stone") - ); - public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_mossy_stone") - ); - public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_smooth_stone") - ); - public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = - ItemTags.create( - Reference.location("allthemodium:ancient_smooth_stone") - ); - public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_polished_stone") - ); - public static final TagKey ANCIENT_POLISHED_STONE_ITEM = - ItemTags.create( - Reference.location("allthemodium:ancient_polished_stone") - ); - public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create( - Reference.location("allthemodium:ancient_stone_bricks") - ); - public static final TagKey ANCIENT_STONE_BRICKS_ITEM = - ItemTags.create( - Reference.location("allthemodium:ancient_stone_bricks") - ); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = - BlockTags.create( - Reference.location("allthemodium:ancient_cracked_stone_bricks") - ); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = - ItemTags.create( - Reference.location("allthemodium:ancient_cracked_stone_bricks") - ); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = - BlockTags.create( - Reference.location("allthemodium:ancient_chiseled_stone_bricks") - ); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = - ItemTags.create( - Reference.location("allthemodium:ancient_chiseled_stone_bricks") - ); - - public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create( - Reference.ore("allthemodium") - ); - public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create( - Reference.ore("vibranium") - ); - public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create( - Reference.ore("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create( - Reference.block("allthemodium") - ); - public static final TagKey VIBRANIUM_BLOCK = BlockTags.create( - Reference.block("vibranium") - ); - public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create( - Reference.block("unobtainium") - ); - - public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create( - Reference.block("raw_allthemodium") - ); - public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create( - Reference.block("raw_vibranium") - ); - public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create( - Reference.block("raw_unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("allthemodium") - ); - public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("vibranium") - ); - public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create( - Reference.ingot("allthemodium") - ); - public static final TagKey VIBRANIUM_INGOT = ItemTags.create( - Reference.ingot("vibranium") - ); - public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create( - Reference.ingot("unobtainium") - ); - public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = - ItemTags.create(Reference.ingot("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = - ItemTags.create(Reference.ingot("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = - ItemTags.create(Reference.ingot("unobtainium_allthemodium_alloy")); - - public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = - ItemTags.create(Reference.block("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = - ItemTags.create(Reference.block("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = - ItemTags.create(Reference.block("unobtainium_allthemodium_alloy")); - - public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create( - Reference.plate("allthemodium") - ); - public static final TagKey VIBRANIUM_PLATE = ItemTags.create( - Reference.plate("vibranium") - ); - public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create( - Reference.plate("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create( - Reference.gear("allthemodium") - ); - public static final TagKey VIBRANIUM_GEAR = ItemTags.create( - Reference.gear("vibranium") - ); - public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create( - Reference.gear("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create( - Reference.rod("allthemodium") - ); - public static final TagKey VIBRANIUM_ROD = ItemTags.create( - Reference.rod("vibranium") - ); - public static final TagKey UNOBTAINIUM_ROD = ItemTags.create( - Reference.rod("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create( - Reference.dust("allthemodium") - ); - public static final TagKey VIBRANIUM_DUST = ItemTags.create( - Reference.dust("vibranium") - ); - public static final TagKey UNOBTAINIUM_DUST = ItemTags.create( - Reference.dust("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create( - Reference.nugget("allthemodium") - ); - public static final TagKey VIBRANIUM_NUGGET = ItemTags.create( - Reference.nugget("vibranium") - ); - public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create( - Reference.nugget("unobtainium") - ); - - public static final TagKey SOUL_LAVA = FluidTags.create( - Reference.forge("soul_lava") - ); - public static final TagKey ALLTHEMODIUM = FluidTags.create( - Reference.forge("molten_allthemodium") - ); - public static final TagKey VIBRANIUM = FluidTags.create( - Reference.forge("molten_vibranium") - ); - public static final TagKey UNOBTAINIUM = FluidTags.create( - Reference.forge("molten_unobtainium") - ); - - public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create( - Reference.raw_ores("allthemodium") - ); - public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create( - Reference.raw_ores("vibranium") - ); - public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create( - Reference.raw_ores("unobtainium") - ); - - public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create( - Reference.material("allthemodium") - ); - public static final TagKey RAW_VIBRANIUM = ItemTags.create( - Reference.material("vibranium") - ); - public static final TagKey RAW_UNOBTAINIUM = ItemTags.create( - Reference.material("unobtainium") - ); - - public static final TagKey DIRTY_DUST = ItemTags.create( - Reference.mek("dirty_dusts") - ); - public static final TagKey CRYSTAL = ItemTags.create( - Reference.mek("crystals") - ); - public static final TagKey CLUMP = ItemTags.create( - Reference.mek("clumps") - ); - public static final TagKey SHARD = ItemTags.create( - Reference.mek("shards") - ); - - public static final TagKey ALLTHEMODIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("allthemodium") - ); - public static final TagKey VIBRANIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("vibranium") - ); - public static final TagKey UNOBTAINIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create( - Reference.crystal("allthemodium") - ); - public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create( - Reference.crystal("vibranium") - ); - public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create( - Reference.crystal("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create( - Reference.clump("allthemodium") - ); - public static final TagKey VIBRANIUM_CLUMP = ItemTags.create( - Reference.clump("vibranium") - ); - public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create( - Reference.clump("unobtainium") - ); - - public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create( - Reference.shard("allthemodium") - ); - public static final TagKey VIBRANIUM_SHARD = ItemTags.create( - Reference.shard("vibranium") - ); - public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create( - Reference.shard("unobtainium") - ); + public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create( + Reference.ore("allthemodium")); + public static final TagKey VIBRANIUM_ORE = BlockTags.create( + Reference.ore("vibranium")); + public static final TagKey UNOBTAINIUM_ORE = BlockTags.create( + Reference.ore("unobtainium")); + + public static final TagKey OTHER_PROTECTION = BlockTags.create( + Reference.atm("blocks/blocklist")); + + public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = BlockTags + .create(Reference.forge("needs_allthemodium_tool")); + public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create( + Reference.forge("needs_allthemodiumalloy_tool")); + + public static final TagKey FORGE_SWORDS = ItemTags.create( + Reference.forge("tools/swords")); + public static final TagKey FORGE_PICKAXES = ItemTags.create( + Reference.forge("tools/pickaxes")); + public static final TagKey FORGE_AXES = ItemTags.create( + Reference.forge("tools/axes")); + public static final TagKey FORGE_SHOVELS = ItemTags.create( + Reference.forge("tools/shovels")); + public static final TagKey FORGE_HOES = ItemTags.create( + Reference.forge("tools/hoes")); + public static final TagKey PAXEL_TARGETS = BlockTags.create( + Reference.atm("paxel_effective")); + + public static final TagKey PIGLIN_LOVED = ItemTags.create( + Reference.location("minecraft:items/piglin_loved")); + public static final TagKey RAW_MATERIALS = ItemTags.create( + Reference.forge("raw_materials")); + + public static final TagKey SAPLINGS = ItemTags.create( + Reference.location("saplings")); + public static final TagKey DUSTS = ItemTags.create( + Reference.forge("dusts")); + public static final TagKey INGOTS = ItemTags.create( + Reference.forge("ingots")); + public static final TagKey ORES = ItemTags.create( + Reference.forge("ores")); + public static final TagKey BLOCK_ORES = BlockTags.create( + Reference.forge("ores")); + + public static final TagKey OTHER_BIOMES = TagKey.create( + Registry.BIOME_REGISTRY, + Reference.location("allthemodium:other_biomes")); + + public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create( + Reference.location("allthemodium:other_te_whitelist")); + public static final TagKey ANCIENT_DIRT = BlockTags.create( + Reference.location("allthemodium:ancient_dirt")); + public static final TagKey ANCIENT_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_stone")); + public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_stone")); + public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:ancient_planks")); + public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = ItemTags + .create(Reference.location("allthemodium:ancient_planks")); + public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:demonic_planks")); + public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = ItemTags + .create(Reference.location("allthemodium:demonic_planks")); + public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:soul_planks")); + public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create( + Reference.location("allthemodium:soul_planks")); + + public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_mossy_stone")); + public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_mossy_stone")); + public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_smooth_stone")); + public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_smooth_stone")); + public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_polished_stone")); + public static final TagKey ANCIENT_POLISHED_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_polished_stone")); + public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_stone_bricks")); + public static final TagKey ANCIENT_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_stone_bricks")); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks")); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks")); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks")); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks")); + + public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create( + Reference.ore("allthemodium")); + public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create( + Reference.ore("vibranium")); + public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create( + Reference.ore("unobtainium")); + + public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create( + Reference.block("allthemodium")); + public static final TagKey VIBRANIUM_BLOCK = BlockTags.create( + Reference.block("vibranium")); + public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create( + Reference.block("unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create( + Reference.block("raw_allthemodium")); + public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create( + Reference.block("raw_vibranium")); + public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create( + Reference.block("raw_unobtainium")); + + public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("allthemodium")); + public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("vibranium")); + public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("unobtainium")); + + public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create( + Reference.ingot("allthemodium")); + public static final TagKey VIBRANIUM_INGOT = ItemTags.create( + Reference.ingot("vibranium")); + public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create( + Reference.ingot("unobtainium")); + public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = ItemTags + .create(Reference.ingot("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = ItemTags + .create(Reference.ingot("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = ItemTags + .create(Reference.ingot("unobtainium_allthemodium_alloy")); + + public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = ItemTags + .create(Reference.block("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = ItemTags + .create(Reference.block("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = ItemTags + .create(Reference.block("unobtainium_allthemodium_alloy")); + + public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create( + Reference.plate("allthemodium")); + public static final TagKey VIBRANIUM_PLATE = ItemTags.create( + Reference.plate("vibranium")); + public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create( + Reference.plate("unobtainium")); + + public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create( + Reference.gear("allthemodium")); + public static final TagKey VIBRANIUM_GEAR = ItemTags.create( + Reference.gear("vibranium")); + public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create( + Reference.gear("unobtainium")); + + public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create( + Reference.rod("allthemodium")); + public static final TagKey VIBRANIUM_ROD = ItemTags.create( + Reference.rod("vibranium")); + public static final TagKey UNOBTAINIUM_ROD = ItemTags.create( + Reference.rod("unobtainium")); + + public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create( + Reference.dust("allthemodium")); + public static final TagKey VIBRANIUM_DUST = ItemTags.create( + Reference.dust("vibranium")); + public static final TagKey UNOBTAINIUM_DUST = ItemTags.create( + Reference.dust("unobtainium")); + + public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create( + Reference.nugget("allthemodium")); + public static final TagKey VIBRANIUM_NUGGET = ItemTags.create( + Reference.nugget("vibranium")); + public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create( + Reference.nugget("unobtainium")); + + public static final TagKey SOUL_LAVA = FluidTags.create( + Reference.forge("soul_lava")); + public static final TagKey ALLTHEMODIUM = FluidTags.create( + Reference.forge("molten_allthemodium")); + public static final TagKey VIBRANIUM = FluidTags.create( + Reference.forge("molten_vibranium")); + public static final TagKey UNOBTAINIUM = FluidTags.create( + Reference.forge("molten_unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create( + Reference.raw_ores("allthemodium")); + public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create( + Reference.raw_ores("vibranium")); + public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create( + Reference.raw_ores("unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create( + Reference.material("allthemodium")); + public static final TagKey RAW_VIBRANIUM = ItemTags.create( + Reference.material("vibranium")); + public static final TagKey RAW_UNOBTAINIUM = ItemTags.create( + Reference.material("unobtainium")); + + public static final TagKey DIRTY_DUST = ItemTags.create( + Reference.mek("dirty_dusts")); + public static final TagKey CRYSTAL = ItemTags.create( + Reference.mek("crystals")); + public static final TagKey CLUMP = ItemTags.create( + Reference.mek("clumps")); + public static final TagKey SHARD = ItemTags.create( + Reference.mek("shards")); + + public static final TagKey ALLTHEMODIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("allthemodium")); + public static final TagKey VIBRANIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("vibranium")); + public static final TagKey UNOBTAINIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("unobtainium")); + + public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create( + Reference.crystal("allthemodium")); + public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create( + Reference.crystal("vibranium")); + public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create( + Reference.crystal("unobtainium")); + + public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create( + Reference.clump("allthemodium")); + public static final TagKey VIBRANIUM_CLUMP = ItemTags.create( + Reference.clump("vibranium")); + public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create( + Reference.clump("unobtainium")); + + public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create( + Reference.shard("allthemodium")); + public static final TagKey VIBRANIUM_SHARD = ItemTags.create( + Reference.shard("vibranium")); + public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create( + Reference.shard("unobtainium")); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java index 11a30ece..8b21d202 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java @@ -9,54 +9,51 @@ public class OtherSky extends DimensionSpecialEffects { - public OtherSky( - float p_108866_, - boolean p_108867_, - SkyType p_108868_, - boolean p_108869_, - boolean p_108870_ - ) { - super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); - } - - @Override - public Vec3 getBrightnessDependentFogColor( - @Nonnull Vec3 p_108878_, - float p_108879_ - ) { - return p_108878_; - } - - @Override - public boolean isFoggyAt(int p_108874_, int p_108875_) { - return true; - } - - @Override - public float getCloudHeight() { - return Float.NaN; - } - - @Override - public boolean renderClouds( - @Nonnull ClientLevel level, - int ticks, - float partialTick, - @Nonnull PoseStack poseStack, - double camX, - double camY, - double camZ, - @Nonnull Matrix4f projectionMatrix - ) { - return false; - } - // @Override - // public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, - // Matrix4f projectionMatrix, - // boolean isFoggy, Runnable setupFog) { - // return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || - // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || - // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); - // } + public OtherSky( + float p_108866_, + boolean p_108867_, + SkyType p_108868_, + boolean p_108869_, + boolean p_108870_) { + super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); + } + + @Override + public Vec3 getBrightnessDependentFogColor( + @Nonnull Vec3 p_108878_, + float p_108879_) { + return p_108878_; + } + + @Override + public boolean isFoggyAt(int p_108874_, int p_108875_) { + return true; + } + + @Override + public float getCloudHeight() { + return Float.NaN; + } + + @Override + public boolean renderClouds( + @Nonnull ClientLevel level, + int ticks, + float partialTick, + @Nonnull PoseStack poseStack, + double camX, + double camY, + double camZ, + @Nonnull Matrix4f projectionMatrix) { + return false; + } + // @Override + // public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, + // Matrix4f projectionMatrix, + // boolean isFoggy, Runnable setupFog) { + // return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); + // } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java index c1c1241e..42a39b80 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java @@ -8,34 +8,26 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - bus = Mod.EventBusSubscriber.Bus.MOD, - value = Dist.CLIENT -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class SkyRegistry { - @SubscribeEvent - public static void register(RegisterDimensionSpecialEffectsEvent event) { - event.register( - new ResourceLocation(Reference.MOD_ID, "the_other"), - new OtherSky( - Float.NaN, - true, - DimensionSpecialEffects.SkyType.NORMAL, - false, - false - ) - ); - event.register( - new ResourceLocation(Reference.MOD_ID, "mining"), - new OtherSky( - Float.NaN, - true, - DimensionSpecialEffects.SkyType.NORMAL, - true, - true - ) - ); - } + @SubscribeEvent + public static void register(RegisterDimensionSpecialEffectsEvent event) { + event.register( + new ResourceLocation(Reference.MOD_ID, "the_other"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + false, + false)); + event.register( + new ResourceLocation(Reference.MOD_ID, "mining"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + true, + true)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java index f8cd9d4b..2e490c5b 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java @@ -10,68 +10,64 @@ import org.jetbrains.annotations.Nullable; public enum ATMResource implements IResource { - ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), - VIBRANIUM("vibranium", 2547336, TagRegistry.VIBRANIUM_ORE_ITEM), - UNOBTAINIUM("unobtainium", 13718243, TagRegistry.UNOBTAINIUM_ORE_ITEM); + ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), VIBRANIUM("vibranium", 2547336, + TagRegistry.VIBRANIUM_ORE_ITEM), UNOBTAINIUM("unobtainium", 13718243, TagRegistry.UNOBTAINIUM_ORE_ITEM); - private final String name; - private final int tint; - // Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource - private final Supplier> oreTag; - private final boolean isVanilla; - private final BlockResourceInfo resourceBlockInfo; - private final BlockResourceInfo rawResourceBlockInfo; + private final String name; + private final int tint; + // Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource + private final Supplier> oreTag; + private final boolean isVanilla; + private final BlockResourceInfo resourceBlockInfo; + private final BlockResourceInfo rawResourceBlockInfo; - ATMResource(String name, int colour, TagKey oreTag) { - this(name, colour, () -> oreTag, true, null, null); - } + ATMResource(String name, int colour, TagKey oreTag) { + this(name, colour, () -> oreTag, true, null, null); + } - ATMResource( - String name, - int tint, - Supplier> oreTag, - boolean isVanilla, - BlockResourceInfo resourceBlockInfo, - BlockResourceInfo rawResourceBlockInfo - ) { - this.name = name; - this.tint = tint; - this.oreTag = oreTag; - this.isVanilla = isVanilla; - this.resourceBlockInfo = resourceBlockInfo; - this.rawResourceBlockInfo = rawResourceBlockInfo; - } + ATMResource( + String name, + int tint, + Supplier> oreTag, + boolean isVanilla, + BlockResourceInfo resourceBlockInfo, + BlockResourceInfo rawResourceBlockInfo) { + this.name = name; + this.tint = tint; + this.oreTag = oreTag; + this.isVanilla = isVanilla; + this.resourceBlockInfo = resourceBlockInfo; + this.rawResourceBlockInfo = rawResourceBlockInfo; + } - @Override - public String getRegistrySuffix() { - return name; - } + @Override + public String getRegistrySuffix() { + return name; + } - public int getTint() { - return tint; - } + public int getTint() { + return tint; + } - public TagKey getOreTag() { - return oreTag.get(); - } + public TagKey getOreTag() { + return oreTag.get(); + } - public boolean has(ResourceType type) { - return ( - type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla()) - ); - } + public boolean has(ResourceType type) { + return (type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla())); + } - public boolean isVanilla() { - return isVanilla; - } + public boolean isVanilla() { + return isVanilla; + } - @Nullable - public BlockResourceInfo getResourceBlockInfo() { - return resourceBlockInfo; - } + @Nullable + public BlockResourceInfo getResourceBlockInfo() { + return resourceBlockInfo; + } - @Nullable - public BlockResourceInfo getRawResourceBlockInfo() { - return rawResourceBlockInfo; - } + @Nullable + public BlockResourceInfo getRawResourceBlockInfo() { + return rawResourceBlockInfo; + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java index e0ce4c5f..3027ff09 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java @@ -9,18 +9,14 @@ public class ATMSlurries { - public static final MekRegistry SLURRIES = new MekRegistry( - Reference.MOD_ID - ); + public static final MekRegistry SLURRIES = new MekRegistry( + Reference.MOD_ID); - public static final Map< - ATMResource, - SlurryRegistryObject - > PROCESSED_RESOURCES = new LinkedHashMap<>(); + public static final Map> PROCESSED_RESOURCES = new LinkedHashMap<>(); - static { - for (ATMResource resource : EnumFunc.PRIMARY_RESOURCES) { - PROCESSED_RESOURCES.put(resource, SLURRIES.register(resource)); - } - } + static { + for (ATMResource resource : EnumFunc.PRIMARY_RESOURCES) { + PROCESSED_RESOURCES.put(resource, SLURRIES.register(resource)); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java index 9604475c..2fa703f6 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java @@ -2,5 +2,5 @@ public class EnumFunc { - public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); + public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java index 06427a32..245ff41a 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java @@ -24,114 +24,100 @@ public class MoltenATMType extends FluidType { - public MoltenATMType(Properties properties) { - super(properties); - } + public MoltenATMType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog - ) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer - ) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = - new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png" - ); - private static final ResourceLocation FLUID_STILL = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_still" - ); - private static final ResourceLocation FLUID_FLOW = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_flow" - ); - private static final ResourceLocation FLUID_OVERLAY = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_still" - ); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor - ) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape - ) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localPlayer = (LocalPlayer) entity; - farDistance *= - Math.max(0.25F, localPlayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localPlayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localPlayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - } - ); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java index 20db49a6..2812395c 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java @@ -24,114 +24,100 @@ public class MoltenUNOBType extends FluidType { - public MoltenUNOBType(Properties properties) { - super(properties); - } + public MoltenUNOBType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog - ) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer - ) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = - new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png" - ); - private static final ResourceLocation FLUID_STILL = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_still" - ); - private static final ResourceLocation FLUID_FLOW = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_flow" - ); - private static final ResourceLocation FLUID_OVERLAY = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_still" - ); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor - ) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape - ) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= - Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - } - ); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java index 3de56a9f..5409ce1f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java @@ -24,114 +24,100 @@ public class MoltenVIBType extends FluidType { - public MoltenVIBType(Properties properties) { - super(properties); - } + public MoltenVIBType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog - ) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer - ) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = - new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png" - ); - private static final ResourceLocation FLUID_STILL = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_still" - ); - private static final ResourceLocation FLUID_FLOW = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_flow" - ); - private static final ResourceLocation FLUID_OVERLAY = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_still" - ); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor - ) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape - ) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= - Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - } - ); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java index 29306dc2..f8867559 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java @@ -24,114 +24,100 @@ public class SoulLavaType extends FluidType { - public SoulLavaType(Properties properties) { - super(properties); - } + public SoulLavaType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog - ) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer - ) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = - new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png" - ); - private static final ResourceLocation FLUID_STILL = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_still" - ); - private static final ResourceLocation FLUID_FLOW = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_flow" - ); - private static final ResourceLocation FLUID_OVERLAY = - new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_still" - ); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor - ) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape - ) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= - Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - } - ); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java index 8cf8e8cd..e386bf31 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java @@ -33,405 +33,282 @@ public class ATMConfiguredFeature { - public static final ImmutableList< - OreConfiguration.TargetBlockState - > ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList.of( - OreConfiguration.target( - OreFeatures.STONE_ORE_REPLACEABLES, - ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState() - ), - OreConfiguration.target( - OreFeatures.DEEPSLATE_ORE_REPLACEABLES, - ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState() - ) - ); - public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = - new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, 4); + public static final ImmutableList ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList + .of( + OreConfiguration.target( + OreFeatures.STONE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState()), + OreConfiguration.target( + OreFeatures.DEEPSLATE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState())); + public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, + 4); - public static Holder< - ConfiguredFeature - > ORE_ALLTHEMODIUM = FeatureUtils.register( - "allthemodium:ore_allthemodium", - Feature.ORE, - ORE_ALLTHEMODIUM_CONFIG - ); + public static Holder> ORE_ALLTHEMODIUM = FeatureUtils.register( + "allthemodium:ore_allthemodium", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG); - public static Holder< - ConfiguredFeature - > ORE_ATM_MINING = FeatureUtils.register( - "allthemodium:ore_atm_mining", - Feature.ORE, - ORE_ALLTHEMODIUM_CONFIG - ); + public static Holder> ORE_ATM_MINING = FeatureUtils.register( + "allthemodium:ore_atm_mining", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG); - public static Holder> ORE_VIBRANIUM = - FeatureUtils.register( - "allthemodium:ore_vibranium", - Feature.ORE, - new OreConfiguration( - OreFeatures.NETHER_ORE_REPLACEABLES, - ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), - 4 - ) - ); + public static Holder> ORE_VIBRANIUM = FeatureUtils.register( + "allthemodium:ore_vibranium", + Feature.ORE, + new OreConfiguration( + OreFeatures.NETHER_ORE_REPLACEABLES, + ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), + 4)); - public static Holder< - ConfiguredFeature - > OTHER_ORE_VIBRANIUM = FeatureUtils.register( - "allthemodium:other_ore_vibranium", - Feature.ORE, - new OreConfiguration( - new TagMatchTest(TagRegistry.ANCIENT_STONE), - ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), - 3 - ) - ); + public static Holder> OTHER_ORE_VIBRANIUM = FeatureUtils.register( + "allthemodium:other_ore_vibranium", + Feature.ORE, + new OreConfiguration( + new TagMatchTest(TagRegistry.ANCIENT_STONE), + ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), + 3)); - public static Holder< - ConfiguredFeature - > ORE_UNOBTAINIUM = FeatureUtils.register( - "allthemodium:ore_unobtainium", - Feature.ORE, - new OreConfiguration( - new BlockMatchTest(Blocks.END_STONE), - ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), - 4 - ) - ); + public static Holder> ORE_UNOBTAINIUM = FeatureUtils.register( + "allthemodium:ore_unobtainium", + Feature.ORE, + new OreConfiguration( + new BlockMatchTest(Blocks.END_STONE), + ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), + 4)); - public static Holder> VOLCANO_CF = - FeatureUtils.register( - "allthemodium:volcano", - ModRegistry.VOLCANO.get(), - VolcanoConfig.INSTANCE - ); + public static Holder> VOLCANO_CF = FeatureUtils.register( + "allthemodium:volcano", + ModRegistry.VOLCANO.get(), + VolcanoConfig.INSTANCE); - public static final Holder< - ConfiguredFeature - > MOD_DELTAS = FeatureUtils.register( - "allthemodium:other_deltas", - Feature.DELTA_FEATURE, - new DeltaFeatureConfiguration( - ModRegistry.ANCIENT_STONE.get().defaultBlockState(), - Blocks.MAGMA_BLOCK.defaultBlockState(), - UniformInt.of(3, 4), - UniformInt.of(0, 2) - ) - ); + public static final Holder> MOD_DELTAS = FeatureUtils.register( + "allthemodium:other_deltas", + Feature.DELTA_FEATURE, + new DeltaFeatureConfiguration( + ModRegistry.ANCIENT_STONE.get().defaultBlockState(), + Blocks.MAGMA_BLOCK.defaultBlockState(), + UniformInt.of(3, 4), + UniformInt.of(0, 2))); - public static final Holder< - ConfiguredFeature - > ANCIENT_TREE_GIANT = FeatureUtils.register( - "allthemodium:ancient_tree_giant", - Feature.TREE, - createAncientGiantTree().build() - ); - public static final Holder< - ConfiguredFeature - > ANCIENT_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:ancient_tree_medium", - Feature.TREE, - createAncientMediumTree().build() - ); - public static final Holder< - ConfiguredFeature - > ANCIENT_TREE = FeatureUtils.register( - "allthemodium:ancient_tree", - Feature.TREE, - createAncientTree().build() - ); + public static final Holder> ANCIENT_TREE_GIANT = FeatureUtils.register( + "allthemodium:ancient_tree_giant", + Feature.TREE, + createAncientGiantTree().build()); + public static final Holder> ANCIENT_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:ancient_tree_medium", + Feature.TREE, + createAncientMediumTree().build()); + public static final Holder> ANCIENT_TREE = FeatureUtils.register( + "allthemodium:ancient_tree", + Feature.TREE, + createAncientTree().build()); - public static final Holder< - ConfiguredFeature - > DEMONIC_TREE_GIANT = FeatureUtils.register( - "allthemodium:demonic_tree_giant", - Feature.TREE, - createDemonicGiantTree().build() - ); - public static final Holder< - ConfiguredFeature - > DEMONIC_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:demonic_tree_medium", - Feature.TREE, - createDemonicMediumTree().build() - ); - public static final Holder< - ConfiguredFeature - > DEMONIC_TREE = FeatureUtils.register( - "allthemodium:demonic_tree", - Feature.TREE, - createDemonicTree().build() - ); + public static final Holder> DEMONIC_TREE_GIANT = FeatureUtils.register( + "allthemodium:demonic_tree_giant", + Feature.TREE, + createDemonicGiantTree().build()); + public static final Holder> DEMONIC_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:demonic_tree_medium", + Feature.TREE, + createDemonicMediumTree().build()); + public static final Holder> DEMONIC_TREE = FeatureUtils.register( + "allthemodium:demonic_tree", + Feature.TREE, + createDemonicTree().build()); - public static final Holder< - ConfiguredFeature - > SOUL_TREE_GIANT = FeatureUtils.register( - "allthemodium:soul_tree_giant", - Feature.TREE, - createSoulGiantTree().build() - ); - public static final Holder< - ConfiguredFeature - > SOUL_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:soul_tree_medium", - Feature.TREE, - createSoulMediumTree().build() - ); - public static final Holder< - ConfiguredFeature - > SOUL_TREE = FeatureUtils.register( - "allthemodium:soul_tree", - Feature.TREE, - createSoulTree().build() - ); + public static final Holder> SOUL_TREE_GIANT = FeatureUtils.register( + "allthemodium:soul_tree_giant", + Feature.TREE, + createSoulGiantTree().build()); + public static final Holder> SOUL_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:soul_tree_medium", + Feature.TREE, + createSoulMediumTree().build()); + public static final Holder> SOUL_TREE = FeatureUtils.register( + "allthemodium:soul_tree", + Feature.TREE, + createSoulTree().build()); - private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = - new WeightedStateProvider( - SimpleWeightedRandomList - .builder() - .add( - ModRegistry.ANCIENT_CAVEVINES_PLANT_ - .get() - .defaultBlockState(), - 4 - ) - .add( - ModRegistry.ANCIENT_CAVEVINES_PLANT_ - .get() - .defaultBlockState() - .setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), - 1 - ) - ); - private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = - new RandomizedIntStateProvider( - new WeightedStateProvider( - SimpleWeightedRandomList - .builder() - .add( - ModRegistry.ANCIENT_CAVEVINES_ - .get() - .defaultBlockState(), - 4 - ) - .add( - ModRegistry.ANCIENT_CAVEVINES_ - .get() - .defaultBlockState() - .setValue( - ACaveVines.BERRIES, - Boolean.valueOf(true) - ), - 1 - ) - ), - AncientCaveVines.AGE, - UniformInt.of(23, 25) - ); - public static final Holder< - ConfiguredFeature - > CAVE_VINE = FeatureUtils.register( - "allthemodium:cave_vine", - Feature.BLOCK_COLUMN, - new BlockColumnConfiguration( - List.of( - BlockColumnConfiguration.layer( - new WeightedListInt( - SimpleWeightedRandomList - .builder() - .add(UniformInt.of(0, 19), 2) - .add(UniformInt.of(0, 2), 3) - .add(UniformInt.of(0, 6), 10) - .build() - ), - CAVE_VINES_BODY_PROVIDER - ), - BlockColumnConfiguration.layer( - ConstantInt.of(1), - CAVE_VINES_HEAD_PROVIDER - ) - ), - Direction.DOWN, - BlockPredicate.ONLY_IN_AIR_PREDICATE, - true - ) - ); + private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState(), + 4) + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState() + .setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), + 1)); + private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = new RandomizedIntStateProvider( + new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState(), + 4) + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState() + .setValue( + ACaveVines.BERRIES, + Boolean.valueOf(true)), + 1)), + AncientCaveVines.AGE, + UniformInt.of(23, 25)); + public static final Holder> CAVE_VINE = FeatureUtils.register( + "allthemodium:cave_vine", + Feature.BLOCK_COLUMN, + new BlockColumnConfiguration( + List.of( + BlockColumnConfiguration.layer( + new WeightedListInt( + SimpleWeightedRandomList + .builder() + .add(UniformInt.of(0, 19), 2) + .add(UniformInt.of(0, 2), 3) + .add(UniformInt.of(0, 6), 10) + .build()), + CAVE_VINES_BODY_PROVIDER), + BlockColumnConfiguration.layer( + ConstantInt.of(1), + CAVE_VINES_HEAD_PROVIDER)), + Direction.DOWN, + BlockPredicate.ONLY_IN_AIR_PREDICATE, + true)); - public static final Holder< - ConfiguredFeature - > PATCH_ANCIENT_HERB = FeatureUtils.register( - "allthemodium:patch_ancient_herb", - Feature.RANDOM_PATCH, - FeatureUtils.simplePatchConfiguration( - Feature.SIMPLE_BLOCK, - new SimpleBlockConfiguration( - BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get()) - ) - ) - ); + public static final Holder> PATCH_ANCIENT_HERB = FeatureUtils + .register( + "allthemodium:patch_ancient_herb", + Feature.RANDOM_PATCH, + FeatureUtils.simplePatchConfiguration( + Feature.SIMPLE_BLOCK, + new SimpleBlockConfiguration( + BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get())))); - private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_1.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_1.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_2.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_2.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { - return ( - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)) - ) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_0.get().defaultBlockState() - ) - ) - ); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_0.get().defaultBlockState()))); + } - public static ConfiguredFeature newConfiguredFeature( - String registryName, - ConfiguredFeature configuredFeature - ) { - Registry.register( - BuiltinRegistries.CONFIGURED_FEATURE, - new ResourceLocation(Reference.MOD_ID, registryName), - configuredFeature - ); - return configuredFeature; - } + public static ConfiguredFeature newConfiguredFeature( + String registryName, + ConfiguredFeature configuredFeature) { + Registry.register( + BuiltinRegistries.CONFIGURED_FEATURE, + new ResourceLocation(Reference.MOD_ID, registryName), + configuredFeature); + return configuredFeature; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java index 7117c6ee..b7a3dabd 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java @@ -15,238 +15,176 @@ public class ATMPlacedFeature { - public static final Holder ORE_ALLTHEMODIUM = - PlacementUtils.register( - "allthemodium:ore_allthemodium", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(15), - VerticalAnchor.absolute(20) - ) - ) - ); - public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = - PlacementUtils.register( - "allthemodium:ore_allthemodium_mountain", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - commonOrePlacement( - 10, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(170), - VerticalAnchor.belowTop(20) - ) - ) - ); - public static final Holder ORE_ATM_MINING = - PlacementUtils.register( - "allthemodium:ore_atm_mining", - ATMConfiguredFeature.ORE_ATM_MINING, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(5), - VerticalAnchor.absolute(20) - ) - ) - ); - public static final Holder ORE_VIBRANIUM = - PlacementUtils.register( - "allthemodium:ore_vibranium", - ATMConfiguredFeature.ORE_VIBRANIUM, - rareOrePlacement( - 7, - HeightRangePlacement.uniform( - VerticalAnchor.belowTop(28), - VerticalAnchor.belowTop(5) - ) - ) - ); - public static final Holder ORE_VIBRANIUM_OTHER = - PlacementUtils.register( - "allthemodium:other_vibranium_ore", - ATMConfiguredFeature.OTHER_ORE_VIBRANIUM, - commonOrePlacement( - 2, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(1), - VerticalAnchor.absolute(20) - ) - ) - ); + public static final Holder ORE_ALLTHEMODIUM = PlacementUtils.register( + "allthemodium:ore_allthemodium", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(20)))); + public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = PlacementUtils.register( + "allthemodium:ore_allthemodium_mountain", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + commonOrePlacement( + 10, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(170), + VerticalAnchor.belowTop(20)))); + public static final Holder ORE_ATM_MINING = PlacementUtils.register( + "allthemodium:ore_atm_mining", + ATMConfiguredFeature.ORE_ATM_MINING, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(5), + VerticalAnchor.absolute(20)))); + public static final Holder ORE_VIBRANIUM = PlacementUtils.register( + "allthemodium:ore_vibranium", + ATMConfiguredFeature.ORE_VIBRANIUM, + rareOrePlacement( + 7, + HeightRangePlacement.uniform( + VerticalAnchor.belowTop(28), + VerticalAnchor.belowTop(5)))); + public static final Holder ORE_VIBRANIUM_OTHER = PlacementUtils.register( + "allthemodium:other_vibranium_ore", + ATMConfiguredFeature.OTHER_ORE_VIBRANIUM, + commonOrePlacement( + 2, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(1), + VerticalAnchor.absolute(20)))); - public static final Holder ORE_UNOBTAINIUM = - PlacementUtils.register( - "allthemodium:ore_unobtainium", - ATMConfiguredFeature.ORE_UNOBTAINIUM, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(15), - VerticalAnchor.absolute(78) - ) - ) - ); + public static final Holder ORE_UNOBTAINIUM = PlacementUtils.register( + "allthemodium:ore_unobtainium", + ATMConfiguredFeature.ORE_UNOBTAINIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(78)))); - public static final Holder VOLCANO_CF = - PlacementUtils.register( - "allthemodium:volcano", - ATMConfiguredFeature.VOLCANO_CF - ); - public static final Holder MOD_DELTAS = - PlacementUtils.register( - "allthemodium:other_deltas", - ATMConfiguredFeature.MOD_DELTAS - ); - public static final Holder ANCIENT_TREE = - PlacementUtils.register( - "allthemodium:ancient_tree", - ATMConfiguredFeature.ANCIENT_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder ANCIENT_TREE_MEDIUM = - PlacementUtils.register( - "allthemodium:ancient_tree_medium", - ATMConfiguredFeature.ANCIENT_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder ANCIENT_TREE_GIANT = - PlacementUtils.register( - "allthemodium:ancient_tree_giant", - ATMConfiguredFeature.ANCIENT_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); + public static final Holder VOLCANO_CF = PlacementUtils.register( + "allthemodium:volcano", + ATMConfiguredFeature.VOLCANO_CF); + public static final Holder MOD_DELTAS = PlacementUtils.register( + "allthemodium:other_deltas", + ATMConfiguredFeature.MOD_DELTAS); + public static final Holder ANCIENT_TREE = PlacementUtils.register( + "allthemodium:ancient_tree", + ATMConfiguredFeature.ANCIENT_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder ANCIENT_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:ancient_tree_medium", + ATMConfiguredFeature.ANCIENT_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder ANCIENT_TREE_GIANT = PlacementUtils.register( + "allthemodium:ancient_tree_giant", + ATMConfiguredFeature.ANCIENT_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE = - PlacementUtils.register( - "allthemodium:demonic_tree", - ATMConfiguredFeature.DEMONIC_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder DEMONIC_TREE_MEDIUM = - PlacementUtils.register( - "allthemodium:demonic_tree_medium", - ATMConfiguredFeature.DEMONIC_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder DEMONIC_TREE_GIANT = - PlacementUtils.register( - "allthemodium:demonic_tree_giant", - ATMConfiguredFeature.DEMONIC_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); + public static final Holder DEMONIC_TREE = PlacementUtils.register( + "allthemodium:demonic_tree", + ATMConfiguredFeature.DEMONIC_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder DEMONIC_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:demonic_tree_medium", + ATMConfiguredFeature.DEMONIC_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder DEMONIC_TREE_GIANT = PlacementUtils.register( + "allthemodium:demonic_tree_giant", + ATMConfiguredFeature.DEMONIC_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE = - PlacementUtils.register( - "allthemodium:soul_tree", - ATMConfiguredFeature.SOUL_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder SOUL_TREE_MEDIUM = - PlacementUtils.register( - "allthemodium:soul_tree_medium", - ATMConfiguredFeature.SOUL_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); - public static final Holder SOUL_TREE_GIANT = - PlacementUtils.register( - "allthemodium:soul_tree_giant", - ATMConfiguredFeature.SOUL_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)) - ); + public static final Holder SOUL_TREE = PlacementUtils.register( + "allthemodium:soul_tree", + ATMConfiguredFeature.SOUL_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder SOUL_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:soul_tree_medium", + ATMConfiguredFeature.SOUL_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder SOUL_TREE_GIANT = PlacementUtils.register( + "allthemodium:soul_tree_giant", + ATMConfiguredFeature.SOUL_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder CAVE_VINES = - PlacementUtils.register( - "allthemodium:cave_vines", - ATMConfiguredFeature.CAVE_VINE, - CountPlacement.of(188), - InSquarePlacement.spread(), - PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, - EnvironmentScanPlacement.scanningFor( - Direction.UP, - BlockPredicate.hasSturdyFace(Direction.DOWN), - BlockPredicate.ONLY_IN_AIR_PREDICATE, - 12 - ), - RandomOffsetPlacement.vertical(ConstantInt.of(-1)), - BiomeFilter.biome() - ); + public static final Holder CAVE_VINES = PlacementUtils.register( + "allthemodium:cave_vines", + ATMConfiguredFeature.CAVE_VINE, + CountPlacement.of(188), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome()); - public static final Holder CAVE_ATM = - PlacementUtils.register( - "allthemodium:cave_ore", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - CountPlacement.of(50), - InSquarePlacement.spread(), - PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, - EnvironmentScanPlacement.scanningFor( - Direction.UP, - BlockPredicate.hasSturdyFace(Direction.DOWN), - BlockPredicate.ONLY_IN_AIR_PREDICATE, - 12 - ), - RandomOffsetPlacement.vertical(ConstantInt.of(-1)), - BiomeFilter.biome() - ); + public static final Holder CAVE_ATM = PlacementUtils.register( + "allthemodium:cave_ore", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + CountPlacement.of(50), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome()); - private static List orePlacement( - PlacementModifier placement, - PlacementModifier placement2 - ) { - return List.of( - placement, - InSquarePlacement.spread(), - placement2, - BiomeFilter.biome() - ); - } + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome()); + } - private static List commonOrePlacement( - int count, - PlacementModifier pm - ) { - return orePlacement(CountPlacement.of(count), pm); - } + private static List commonOrePlacement( + int count, + PlacementModifier pm) { + return orePlacement(CountPlacement.of(count), pm); + } - private static List rareOrePlacement( - int rarity, - PlacementModifier pm - ) { - return orePlacement(RarityFilter.onAverageOnceEvery(rarity), pm); - } + private static List rareOrePlacement( + int rarity, + PlacementModifier pm) { + return orePlacement(RarityFilter.onAverageOnceEvery(rarity), pm); + } - private static ImmutableList.Builder treePlacementBase( - PlacementModifier p_195485_ - ) { - return ImmutableList - .builder() - .add(p_195485_) - .add(InSquarePlacement.spread()) - .add(VegetationPlacements.TREE_THRESHOLD) - .add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE) - .add(BiomeFilter.biome()); - } + private static ImmutableList.Builder treePlacementBase( + PlacementModifier p_195485_) { + return ImmutableList + .builder() + .add(p_195485_) + .add(InSquarePlacement.spread()) + .add(VegetationPlacements.TREE_THRESHOLD) + .add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE) + .add(BiomeFilter.biome()); + } - public static List treePlacement( - PlacementModifier p_195480_ - ) { - return treePlacementBase(p_195480_).build(); - } + public static List treePlacement( + PlacementModifier p_195480_) { + return treePlacementBase(p_195480_).build(); + } - public static List treePlacement( - PlacementModifier p_195482_, - Block p_195483_ - ) { - return treePlacementBase(p_195482_) - .add( - BlockPredicateFilter.forPredicate( - BlockPredicate.wouldSurvive( - p_195483_.defaultBlockState(), - BlockPos.ZERO - ) - ) - ) - .build(); - } + public static List treePlacement( + PlacementModifier p_195482_, + Block p_195483_) { + return treePlacementBase(p_195482_) + .add( + BlockPredicateFilter.forPredicate( + BlockPredicate.wouldSurvive( + p_195483_.defaultBlockState(), + BlockPos.ZERO))) + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java index 0d7d9486..71b71c21 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java @@ -9,119 +9,84 @@ public class ATOtherPlacedFeatures { - public static final Holder OTHER_ORE_COAL = - PlacementUtils.register( - "allthemodium:ore_coal", - ATOOtherFeatures.OTHER_ORE_COAL, - commonOrePlacement( - 30, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(136), - VerticalAnchor.top() - ) - ) - ); - public static final Holder OTHER_ORE_COPPER = - PlacementUtils.register( - "allthemodium:ore_copper", - ATOOtherFeatures.OTHER_ORE_COPPER, - commonOrePlacement( - 16, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-16), - VerticalAnchor.absolute(112) - ) - ) - ); - public static final Holder OTHER_ORE_DIAMOND = - PlacementUtils.register( - "allthemodium:ore_diamond", - ATOOtherFeatures.OTHER_ORE_DIAMOND, - commonOrePlacement( - 14, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-10), - VerticalAnchor.absolute(129) - ) - ) - ); - public static final Holder OTHER_ORE_EMERALD = - PlacementUtils.register( - "allthemodium:ore_emerald", - ATOOtherFeatures.OTHER_ORE_EMERALD, - commonOrePlacement( - 20, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-16), - VerticalAnchor.absolute(480) - ) - ) - ); - public static final Holder OTHER_ORE_GOLD = - PlacementUtils.register( - "allthemodium:ore_gold", - ATOOtherFeatures.OTHER_ORE_GOLD, - commonOrePlacement(20, PlacementUtils.RANGE_10_10) - ); - public static final Holder OTHER_ORE_IRON = - PlacementUtils.register( - "allthemodium:ore_iron", - ATOOtherFeatures.OTHER_ORE_IRON, - commonOrePlacement( - 50, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-24), - VerticalAnchor.absolute(384) - ) - ) - ); - public static final Holder OTHER_ORE_LAPIS = - PlacementUtils.register( - "allthemodium:ore_lapis", - ATOOtherFeatures.OTHER_ORE_LAPIS, - commonOrePlacement( - 4, - HeightRangePlacement.uniform( - VerticalAnchor.bottom(), - VerticalAnchor.absolute(64) - ) - ) - ); - public static final Holder OTHER_ORE_QUARTZ = - PlacementUtils.register( - "allthemodium:ore_quartz", - ATOOtherFeatures.OTHER_ORE_QUARTZ, - commonOrePlacement(16, PlacementUtils.RANGE_10_10) - ); - public static final Holder OTHER_ORE_REDSTONE = - PlacementUtils.register( - "allthemodium:ore_redstone", - ATOOtherFeatures.OTHER_ORE_REDSTONE, - commonOrePlacement( - 14, - HeightRangePlacement.uniform( - VerticalAnchor.bottom(), - VerticalAnchor.absolute(15) - ) - ) - ); + public static final Holder OTHER_ORE_COAL = PlacementUtils.register( + "allthemodium:ore_coal", + ATOOtherFeatures.OTHER_ORE_COAL, + commonOrePlacement( + 30, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(136), + VerticalAnchor.top()))); + public static final Holder OTHER_ORE_COPPER = PlacementUtils.register( + "allthemodium:ore_copper", + ATOOtherFeatures.OTHER_ORE_COPPER, + commonOrePlacement( + 16, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(112)))); + public static final Holder OTHER_ORE_DIAMOND = PlacementUtils.register( + "allthemodium:ore_diamond", + ATOOtherFeatures.OTHER_ORE_DIAMOND, + commonOrePlacement( + 14, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-10), + VerticalAnchor.absolute(129)))); + public static final Holder OTHER_ORE_EMERALD = PlacementUtils.register( + "allthemodium:ore_emerald", + ATOOtherFeatures.OTHER_ORE_EMERALD, + commonOrePlacement( + 20, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(480)))); + public static final Holder OTHER_ORE_GOLD = PlacementUtils.register( + "allthemodium:ore_gold", + ATOOtherFeatures.OTHER_ORE_GOLD, + commonOrePlacement(20, PlacementUtils.RANGE_10_10)); + public static final Holder OTHER_ORE_IRON = PlacementUtils.register( + "allthemodium:ore_iron", + ATOOtherFeatures.OTHER_ORE_IRON, + commonOrePlacement( + 50, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-24), + VerticalAnchor.absolute(384)))); + public static final Holder OTHER_ORE_LAPIS = PlacementUtils.register( + "allthemodium:ore_lapis", + ATOOtherFeatures.OTHER_ORE_LAPIS, + commonOrePlacement( + 4, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(64)))); + public static final Holder OTHER_ORE_QUARTZ = PlacementUtils.register( + "allthemodium:ore_quartz", + ATOOtherFeatures.OTHER_ORE_QUARTZ, + commonOrePlacement(16, PlacementUtils.RANGE_10_10)); + public static final Holder OTHER_ORE_REDSTONE = PlacementUtils.register( + "allthemodium:ore_redstone", + ATOOtherFeatures.OTHER_ORE_REDSTONE, + commonOrePlacement( + 14, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(15)))); - private static List orePlacement( - PlacementModifier placement, - PlacementModifier placement2 - ) { - return List.of( - placement, - InSquarePlacement.spread(), - placement2, - BiomeFilter.biome() - ); - } + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome()); + } - private static List commonOrePlacement( - int count, - PlacementModifier pm - ) { - return orePlacement(CountPlacement.of(count), pm); - } + private static List commonOrePlacement( + int count, + PlacementModifier pm) { + return orePlacement(CountPlacement.of(count), pm); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java index 18c0ba00..5db16ba0 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java @@ -10,37 +10,34 @@ public class MiningDimSource extends FlatLevelSource { - public static final Codec CODEC = - RecordCodecBuilder.create(p_204551_ -> { - return commonCodec(p_204551_) - .and( - FlatLevelGeneratorSettings.CODEC - .fieldOf("settings") - .forGetter(FlatLevelSource::settings) - ) - .apply(p_204551_, p_204551_.stable(MiningDimSource::new)); - }); - private final FlatLevelGeneratorSettings settings; + public static final Codec CODEC = RecordCodecBuilder.create(p_204551_ -> { + return commonCodec(p_204551_) + .and( + FlatLevelGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(FlatLevelSource::settings)) + .apply(p_204551_, p_204551_.stable(MiningDimSource::new)); + }); + private final FlatLevelGeneratorSettings settings; - public MiningDimSource( - Registry structureSetRegistry, - FlatLevelGeneratorSettings settings - ) { - super(structureSetRegistry, settings); - this.settings = settings; - } + public MiningDimSource( + Registry structureSetRegistry, + FlatLevelGeneratorSettings settings) { + super(structureSetRegistry, settings); + this.settings = settings; + } - @Override - protected Codec codec() { - return CODEC; - } + @Override + protected Codec codec() { + return CODEC; + } - @Override - public FlatLevelGeneratorSettings settings() { - return this.settings; - } + @Override + public FlatLevelGeneratorSettings settings() { + return this.settings; + } - public int getMinY() { - return -64; - } + public int getMinY() { + return -64; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java index d4d011ec..6f70ed53 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java @@ -12,37 +12,33 @@ public class TheOtherDimSource extends NoiseBasedChunkGenerator { - public static final Codec CODEC = - RecordCodecBuilder.create(p_188643_ -> { - return commonCodec(p_188643_) - .and( - p_188643_.group( - RegistryOps - .retrieveRegistry(Registry.NOISE_REGISTRY) - .forGetter(p_188716_ -> { - return p_188716_.noises; - }), - BiomeSource.CODEC - .fieldOf("biome_source") - .forGetter(p_188711_ -> { - return p_188711_.biomeSource; - }), - NoiseGeneratorSettings.CODEC - .fieldOf("settings") - .forGetter(p_204585_ -> { - return p_204585_.settings; - }) - ) - ) - .apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); - }); + public static final Codec CODEC = RecordCodecBuilder.create(p_188643_ -> { + return commonCodec(p_188643_) + .and( + p_188643_.group( + RegistryOps + .retrieveRegistry(Registry.NOISE_REGISTRY) + .forGetter(p_188716_ -> { + return p_188716_.noises; + }), + BiomeSource.CODEC + .fieldOf("biome_source") + .forGetter(p_188711_ -> { + return p_188711_.biomeSource; + }), + NoiseGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(p_204585_ -> { + return p_204585_.settings; + }))) + .apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); + }); - public TheOtherDimSource( - Registry p_224206_, - Registry p_224207_, - BiomeSource p_224208_, - Holder p_224209_ - ) { - super(p_224206_, p_224207_, p_224208_, p_224209_); - } + public TheOtherDimSource( + Registry p_224206_, + Registry p_224207_, + BiomeSource p_224208_, + Holder p_224209_) { + super(p_224206_, p_224207_, p_224208_, p_224209_); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java index fe5d784e..63a86099 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java @@ -13,437 +13,372 @@ import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraftforge.fml.common.Mod; -@Mod.EventBusSubscriber( - modid = Reference.MOD_ID, - bus = Mod.EventBusSubscriber.Bus.MOD -) +@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ATMBiomes { - public static Biome The_Other = the_other(); - public static Biome Basalt_Deltas = basalt_deltas(); - public static Biome Crimson_Forest = crimson_forest(); - public static Biome Desert = desert(); - public static Biome Desert_Hills = desert_hills(); - public static Biome Soul_Sand_Valley = soul_sand_valley(); - public static Biome Warped_Forest = warped_forest(); + public static Biome The_Other = the_other(); + public static Biome Basalt_Deltas = basalt_deltas(); + public static Biome Crimson_Forest = crimson_forest(); + public static Biome Desert = desert(); + public static Biome Desert_Hills = desert_hills(); + public static Biome Soul_Sand_Valley = soul_sand_valley(); + public static Biome Warped_Forest = warped_forest(); - public static void addDefaultCarvers( - BiomeGenerationSettings.Builder builder - ) { - builder.addCarver(GenerationStep.Carving.AIR, Carvers.NETHER_CAVE); - builder.addCarver(GenerationStep.Carving.AIR, Carvers.CAVE); - builder.addCarver(GenerationStep.Carving.AIR, Carvers.CANYON); - } + public static void addDefaultCarvers( + BiomeGenerationSettings.Builder builder) { + builder.addCarver(GenerationStep.Carving.AIR, Carvers.NETHER_CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CANYON); + } - public static Biome mining() { - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(new MobSpawnSettings.Builder().build()) - .temperature(1.0f) - .downfall(0f) - .specialEffects( - new BiomeSpecialEffects.Builder() - .fogColor(12341234) - .waterColor(4159204) - .waterFogColor(329011) - .skyColor(7254527) - .foliageColorOverride(1787717) - .grassColorOverride(9470000) - .build() - ) - .generationSettings(new BiomeGenerationSettings.Builder().build()) - .build(); - } + public static Biome mining() { + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(new MobSpawnSettings.Builder().build()) + .temperature(1.0f) + .downfall(0f) + .specialEffects( + new BiomeSpecialEffects.Builder() + .fogColor(12341234) + .waterColor(4159204) + .waterFogColor(329011) + .skyColor(7254527) + .foliageColorOverride(1787717) + .grassColorOverride(9470000) + .build()) + .generationSettings(new BiomeGenerationSettings.Builder().build()) + .build(); + } - public static Biome the_other() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome the_other() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.5f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.5f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome basalt_deltas() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(6840176) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addLushCavesVegetationFeatures( - biomeGenerationSettings - ); - addDefaultCarvers(biomeGenerationSettings); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.BASALT_BLOBS - ); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.SMALL_BASALT_COLUMNS - ); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.LARGE_BASALT_COLUMNS - ); + public static Biome basalt_deltas() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(6840176) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addLushCavesVegetationFeatures( + biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.BASALT_BLOBS); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.SMALL_BASALT_COLUMNS); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.LARGE_BASALT_COLUMNS); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.MAGMA_CUBE, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.MAGMA_CUBE, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(2.0f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(2.0f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome crimson_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome crimson_forest() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.3f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.3f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome desert() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome desert() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.CREATURE, - new MobSpawnSettings.SpawnerData( - EntityType.RABBIT, - 120, - 3, - 5 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.8f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.8f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome desert_hills() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome desert_hills() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.CREATURE, - new MobSpawnSettings.SpawnerData( - EntityType.RABBIT, - 120, - 3, - 5 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.7f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.7f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome soul_sand_valley() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome soul_sand_valley() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.GHAST, - 120, - 3, - 3 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.GHAST, + 120, + 3, + 3)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.1f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.1f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome warped_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(1705242) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(1705242) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = - new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome warped_forest() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(1705242) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(1705242) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = - (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.ENDERMAN, - 160, - 3, - 7 - ) - ) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN_BRUTE, - 140, - 8, - 12 - ) - ) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.ENDERMAN, + 160, + 3, + 7)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN_BRUTE, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.2f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.2f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java index 6ccdd730..ddf7ca68 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java @@ -11,18 +11,17 @@ public class AncientTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder< - ConfiguredFeature - > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.ANCIENT_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.ANCIENT_TREE; - } - return ATMConfiguredFeature.ANCIENT_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.ANCIENT_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.ANCIENT_TREE; + } + return ATMConfiguredFeature.ANCIENT_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java index 628c436f..3e761a5e 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java @@ -11,18 +11,17 @@ public class DemonicTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder< - ConfiguredFeature - > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.DEMONIC_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.DEMONIC_TREE; - } - return ATMConfiguredFeature.DEMONIC_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.DEMONIC_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.DEMONIC_TREE; + } + return ATMConfiguredFeature.DEMONIC_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java index 29dcbf4b..5e01af31 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java @@ -55,4949 +55,4744 @@ public class FastNoiseLite { - public enum NoiseType { - OpenSimplex2, - OpenSimplex2S, - Cellular, - Perlin, - ValueCubic, - Value, - } - - public enum RotationType3D { - None, - ImproveXYPlanes, - ImproveXZPlanes, - } - - public enum FractalType { - None, - FBm, - Ridged, - PingPong, - DomainWarpProgressive, - DomainWarpIndependent, - } - - public enum CellularDistanceFunction { - Euclidean, - EuclideanSq, - Manhattan, - Hybrid, - } - - public enum CellularReturnType { - CellValue, - Distance, - Distance2, - Distance2Add, - Distance2Sub, - Distance2Mul, - Distance2Div, - } - - public enum DomainWarpType { - OpenSimplex2, - OpenSimplex2Reduced, - BasicGrid, - } - - private enum TransformType3D { - None, - ImproveXYPlanes, - ImproveXZPlanes, - DefaultOpenSimplex2, - } - - private int mSeed = 1337; - private float mFrequency = 0.01f; - private NoiseType mNoiseType = NoiseType.OpenSimplex2; - private RotationType3D mRotationType3D = RotationType3D.None; - private TransformType3D mTransformType3D = - TransformType3D.DefaultOpenSimplex2; - - private FractalType mFractalType = FractalType.None; - private int mOctaves = 3; - private float mLacunarity = 2.0f; - private float mGain = 0.5f; - private float mWeightedStrength = 0.0f; - private float mPingPongStength = 2.0f; - - private float mFractalBounding = 1 / 1.75f; - - private CellularDistanceFunction mCellularDistanceFunction = - CellularDistanceFunction.EuclideanSq; - private CellularReturnType mCellularReturnType = - CellularReturnType.Distance; - private float mCellularJitterModifier = 1.0f; - - private DomainWarpType mDomainWarpType = DomainWarpType.OpenSimplex2; - private TransformType3D mWarpTransformType3D = - TransformType3D.DefaultOpenSimplex2; - private float mDomainWarpAmp = 1.0f; - - /// - /// Create new FastNoise object with default seed - /// - public FastNoiseLite() {} - - /// - /// Create new FastNoise object with specified seed - /// - public FastNoiseLite(int seed) { - SetSeed(seed); - } - - /// - /// Sets seed used for all noise types - /// - /// - /// Default: 1337 - /// - public void SetSeed(int seed) { - mSeed = seed; - } - - /// - /// Sets frequency for all noise types - /// - /// - /// Default: 0.01 - /// - public void SetFrequency(float frequency) { - mFrequency = frequency; - } - - /// - /// Sets noise algorithm used for GetNoise(...) - /// - /// - /// Default: OpenSimplex2 - /// - public void SetNoiseType(NoiseType noiseType) { - mNoiseType = noiseType; - UpdateTransformType3D(); - } - - /// - /// Sets domain rotation type for 3D Noise and 3D DomainWarp. - /// Can aid in reducing directional artifacts when sampling a 2D plane in 3D - /// - /// - /// Default: None - /// - public void SetRotationType3D(RotationType3D rotationType3D) { - mRotationType3D = rotationType3D; - UpdateTransformType3D(); - UpdateWarpTransformType3D(); - } - - /// - /// Sets method for combining octaves in all fractal noise types - /// - /// - /// Default: None - /// Note: FractalType.DomainWarp... only affects DomainWarp(...) - /// - public void SetFractalType(FractalType fractalType) { - mFractalType = fractalType; - } - - /// - /// Sets octave count for all fractal noise types - /// - /// - /// Default: 3 - /// - public void SetFractalOctaves(int octaves) { - mOctaves = octaves; - CalculateFractalBounding(); - } - - /// - /// Sets octave lacunarity for all fractal noise types - /// - /// - /// Default: 2.0 - /// - public void SetFractalLacunarity(float lacunarity) { - mLacunarity = lacunarity; - } - - /// - /// Sets octave gain for all fractal noise types - /// - /// - /// Default: 0.5 - /// - public void SetFractalGain(float gain) { - mGain = gain; - CalculateFractalBounding(); - } - - /// - /// Sets octave weighting for all none DomainWarp fratal types - /// - /// - /// Default: 0.0 - /// Note: Keep between 0...1 to maintain -1...1 output bounding - /// - public void SetFractalWeightedStrength(float weightedStrength) { - mWeightedStrength = weightedStrength; - } - - /// - /// Sets strength of the fractal ping pong effect - /// - /// - /// Default: 2.0 - /// - public void SetFractalPingPongStrength(float pingPongStrength) { - mPingPongStength = pingPongStrength; - } - - /// - /// Sets distance function used in cellular noise calculations - /// - /// - /// Default: Distance - /// - public void SetCellularDistanceFunction( - CellularDistanceFunction cellularDistanceFunction - ) { - mCellularDistanceFunction = cellularDistanceFunction; - } - - /// - /// Sets return type from cellular noise calculations - /// - /// - /// Default: EuclideanSq - /// - public void SetCellularReturnType(CellularReturnType cellularReturnType) { - mCellularReturnType = cellularReturnType; - } - - /// - /// Sets the maximum distance a cellular point can move from it's grid position - /// - /// - /// Default: 1.0 - /// Note: Setting this higher than 1 will cause artifacts - /// - public void SetCellularJitter(float cellularJitter) { - mCellularJitterModifier = cellularJitter; - } - - /// - /// Sets the warp algorithm when using DomainWarp(...) - /// - /// - /// Default: OpenSimplex2 - /// - public void SetDomainWarpType(DomainWarpType domainWarpType) { - mDomainWarpType = domainWarpType; - UpdateWarpTransformType3D(); - } - - /// - /// Sets the maximum warp distance from original position when using DomainWarp(...) - /// - /// - /// Default: 1.0 - /// - public void SetDomainWarpAmp(float domainWarpAmp) { - mDomainWarpAmp = domainWarpAmp; - } - - /// - /// 2D noise at given position using current settings - /// - /// - /// Noise output bounded between -1...1 - /// - public float GetNoise(/*FMLdouble*/double x, /*FMLdouble*/double y) { - x *= mFrequency; - y *= mFrequency; - - switch (mNoiseType) { - case OpenSimplex2: - case OpenSimplex2S: - { - final /*FMLdouble*/double SQRT3 = - (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (x + y) * F2; - x += t; - y += t; - } - break; - default: - break; - } - - switch (mFractalType) { - default: - return GenNoiseSingle(mSeed, x, y); - case FBm: - return GenFractalFBm(x, y); - case Ridged: - return GenFractalRidged(x, y); - case PingPong: - return GenFractalPingPong(x, y); - } - } - - /// - /// 3D noise at given position using current settings - /// - /// - /// Noise output bounded between -1...1 - /// - public float GetNoise( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - x *= mFrequency; - y *= mFrequency; - z *= mFrequency; - - switch (mTransformType3D) { - case ImproveXYPlanes: - { - /*FMLdouble*/double xy = x + y; - /*FMLdouble*/double s2 = - xy * -(/*FMLdouble*/double) 0.211324865405187; - z *= (/*FMLdouble*/double) 0.577350269189626; - x += s2 - z; - y = y + s2 - z; - z += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: - { - /*FMLdouble*/double xz = x + z; - /*FMLdouble*/double s2 = - xz * -(/*FMLdouble*/double) 0.211324865405187; - y *= (/*FMLdouble*/double) 0.577350269189626; - x += s2 - y; - z += s2 - y; - y += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: - { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (x + y + z) * R3; // Rotation, not skew - x = r - x; - y = r - y; - z = r - z; - } - break; - default: - break; - } - - switch (mFractalType) { - default: - return GenNoiseSingle(mSeed, x, y, z); - case FBm: - return GenFractalFBm(x, y, z); - case Ridged: - return GenFractalRidged(x, y, z); - case PingPong: - return GenFractalPingPong(x, y, z); - } - } - - /// - /// 2D warps the input position using current domain warp settings - /// - /// - /// Example usage with GetNoise - /// DomainWarp(coord) - /// noise = GetNoise(x, y) - /// - public void DomainWarp(Vector2 coord) { - switch (mFractalType) { - default: - DomainWarpSingle(coord); - break; - case DomainWarpProgressive: - DomainWarpFractalProgressive(coord); - break; - case DomainWarpIndependent: - DomainWarpFractalIndependent(coord); - break; - } - } - - /// - /// 3D warps the input position using current domain warp settings - /// - /// - /// Example usage with GetNoise - /// DomainWarp(coord) - /// noise = GetNoise(x, y, z) - /// - public void DomainWarp(Vector3 coord) { - switch (mFractalType) { - default: - DomainWarpSingle(coord); - break; - case DomainWarpProgressive: - DomainWarpFractalProgressive(coord); - break; - case DomainWarpIndependent: - DomainWarpFractalIndependent(coord); - break; - } - } - - private static final float[] Gradients2D = { - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.923879532511287f, - 0.38268343236509f, - 0.923879532511287f, - -0.38268343236509f, - 0.38268343236509f, - -0.923879532511287f, - -0.38268343236509f, - -0.923879532511287f, - -0.923879532511287f, - -0.38268343236509f, - -0.923879532511287f, - 0.38268343236509f, - -0.38268343236509f, - 0.923879532511287f, - }; - - private static final float[] RandVecs2D = { - -0.2700222198f, - -0.9628540911f, - 0.3863092627f, - -0.9223693152f, - 0.04444859006f, - -0.999011673f, - -0.5992523158f, - -0.8005602176f, - -0.7819280288f, - 0.6233687174f, - 0.9464672271f, - 0.3227999196f, - -0.6514146797f, - -0.7587218957f, - 0.9378472289f, - 0.347048376f, - -0.8497875957f, - -0.5271252623f, - -0.879042592f, - 0.4767432447f, - -0.892300288f, - -0.4514423508f, - -0.379844434f, - -0.9250503802f, - -0.9951650832f, - 0.0982163789f, - 0.7724397808f, - -0.6350880136f, - 0.7573283322f, - -0.6530343002f, - -0.9928004525f, - -0.119780055f, - -0.0532665713f, - 0.9985803285f, - 0.9754253726f, - -0.2203300762f, - -0.7665018163f, - 0.6422421394f, - 0.991636706f, - 0.1290606184f, - -0.994696838f, - 0.1028503788f, - -0.5379205513f, - -0.84299554f, - 0.5022815471f, - -0.8647041387f, - 0.4559821461f, - -0.8899889226f, - -0.8659131224f, - -0.5001944266f, - 0.0879458407f, - -0.9961252577f, - -0.5051684983f, - 0.8630207346f, - 0.7753185226f, - -0.6315704146f, - -0.6921944612f, - 0.7217110418f, - -0.5191659449f, - -0.8546734591f, - 0.8978622882f, - -0.4402764035f, - -0.1706774107f, - 0.9853269617f, - -0.9353430106f, - -0.3537420705f, - -0.9992404798f, - 0.03896746794f, - -0.2882064021f, - -0.9575683108f, - -0.9663811329f, - 0.2571137995f, - -0.8759714238f, - -0.4823630009f, - -0.8303123018f, - -0.5572983775f, - 0.05110133755f, - -0.9986934731f, - -0.8558373281f, - -0.5172450752f, - 0.09887025282f, - 0.9951003332f, - 0.9189016087f, - 0.3944867976f, - -0.2439375892f, - -0.9697909324f, - -0.8121409387f, - -0.5834613061f, - -0.9910431363f, - 0.1335421355f, - 0.8492423985f, - -0.5280031709f, - -0.9717838994f, - -0.2358729591f, - 0.9949457207f, - 0.1004142068f, - 0.6241065508f, - -0.7813392434f, - 0.662910307f, - 0.7486988212f, - -0.7197418176f, - 0.6942418282f, - -0.8143370775f, - -0.5803922158f, - 0.104521054f, - -0.9945226741f, - -0.1065926113f, - -0.9943027784f, - 0.445799684f, - -0.8951327509f, - 0.105547406f, - 0.9944142724f, - -0.992790267f, - 0.1198644477f, - -0.8334366408f, - 0.552615025f, - 0.9115561563f, - -0.4111755999f, - 0.8285544909f, - -0.5599084351f, - 0.7217097654f, - -0.6921957921f, - 0.4940492677f, - -0.8694339084f, - -0.3652321272f, - -0.9309164803f, - -0.9696606758f, - 0.2444548501f, - 0.08925509731f, - -0.996008799f, - 0.5354071276f, - -0.8445941083f, - -0.1053576186f, - 0.9944343981f, - -0.9890284586f, - 0.1477251101f, - 0.004856104961f, - 0.9999882091f, - 0.9885598478f, - 0.1508291331f, - 0.9286129562f, - -0.3710498316f, - -0.5832393863f, - -0.8123003252f, - 0.3015207509f, - 0.9534596146f, - -0.9575110528f, - 0.2883965738f, - 0.9715802154f, - -0.2367105511f, - 0.229981792f, - 0.9731949318f, - 0.955763816f, - -0.2941352207f, - 0.740956116f, - 0.6715534485f, - -0.9971513787f, - -0.07542630764f, - 0.6905710663f, - -0.7232645452f, - -0.290713703f, - -0.9568100872f, - 0.5912777791f, - -0.8064679708f, - -0.9454592212f, - -0.325740481f, - 0.6664455681f, - 0.74555369f, - 0.6236134912f, - 0.7817328275f, - 0.9126993851f, - -0.4086316587f, - -0.8191762011f, - 0.5735419353f, - -0.8812745759f, - -0.4726046147f, - 0.9953313627f, - 0.09651672651f, - 0.9855650846f, - -0.1692969699f, - -0.8495980887f, - 0.5274306472f, - 0.6174853946f, - -0.7865823463f, - 0.8508156371f, - 0.52546432f, - 0.9985032451f, - -0.05469249926f, - 0.1971371563f, - -0.9803759185f, - 0.6607855748f, - -0.7505747292f, - -0.03097494063f, - 0.9995201614f, - -0.6731660801f, - 0.739491331f, - -0.7195018362f, - -0.6944905383f, - 0.9727511689f, - 0.2318515979f, - 0.9997059088f, - -0.0242506907f, - 0.4421787429f, - -0.8969269532f, - 0.9981350961f, - -0.061043673f, - -0.9173660799f, - -0.3980445648f, - -0.8150056635f, - -0.5794529907f, - -0.8789331304f, - 0.4769450202f, - 0.0158605829f, - 0.999874213f, - -0.8095464474f, - 0.5870558317f, - -0.9165898907f, - -0.3998286786f, - -0.8023542565f, - 0.5968480938f, - -0.5176737917f, - 0.8555780767f, - -0.8154407307f, - -0.5788405779f, - 0.4022010347f, - -0.9155513791f, - -0.9052556868f, - -0.4248672045f, - 0.7317445619f, - 0.6815789728f, - -0.5647632201f, - -0.8252529947f, - -0.8403276335f, - -0.5420788397f, - -0.9314281527f, - 0.363925262f, - 0.5238198472f, - 0.8518290719f, - 0.7432803869f, - -0.6689800195f, - -0.985371561f, - -0.1704197369f, - 0.4601468731f, - 0.88784281f, - 0.825855404f, - 0.5638819483f, - 0.6182366099f, - 0.7859920446f, - 0.8331502863f, - -0.553046653f, - 0.1500307506f, - 0.9886813308f, - -0.662330369f, - -0.7492119075f, - -0.668598664f, - 0.743623444f, - 0.7025606278f, - 0.7116238924f, - -0.5419389763f, - -0.8404178401f, - -0.3388616456f, - 0.9408362159f, - 0.8331530315f, - 0.5530425174f, - -0.2989720662f, - -0.9542618632f, - 0.2638522993f, - 0.9645630949f, - 0.124108739f, - -0.9922686234f, - -0.7282649308f, - -0.6852956957f, - 0.6962500149f, - 0.7177993569f, - -0.9183535368f, - 0.3957610156f, - -0.6326102274f, - -0.7744703352f, - -0.9331891859f, - -0.359385508f, - -0.1153779357f, - -0.9933216659f, - 0.9514974788f, - -0.3076565421f, - -0.08987977445f, - -0.9959526224f, - 0.6678496916f, - 0.7442961705f, - 0.7952400393f, - -0.6062947138f, - -0.6462007402f, - -0.7631674805f, - -0.2733598753f, - 0.9619118351f, - 0.9669590226f, - -0.254931851f, - -0.9792894595f, - 0.2024651934f, - -0.5369502995f, - -0.8436138784f, - -0.270036471f, - -0.9628500944f, - -0.6400277131f, - 0.7683518247f, - -0.7854537493f, - -0.6189203566f, - 0.06005905383f, - -0.9981948257f, - -0.02455770378f, - 0.9996984141f, - -0.65983623f, - 0.751409442f, - -0.6253894466f, - -0.7803127835f, - -0.6210408851f, - -0.7837781695f, - 0.8348888491f, - 0.5504185768f, - -0.1592275245f, - 0.9872419133f, - 0.8367622488f, - 0.5475663786f, - -0.8675753916f, - -0.4973056806f, - -0.2022662628f, - -0.9793305667f, - 0.9399189937f, - 0.3413975472f, - 0.9877404807f, - -0.1561049093f, - -0.9034455656f, - 0.4287028224f, - 0.1269804218f, - -0.9919052235f, - -0.3819600854f, - 0.924178821f, - 0.9754625894f, - 0.2201652486f, - -0.3204015856f, - -0.9472818081f, - -0.9874760884f, - 0.1577687387f, - 0.02535348474f, - -0.9996785487f, - 0.4835130794f, - -0.8753371362f, - -0.2850799925f, - -0.9585037287f, - -0.06805516006f, - -0.99768156f, - -0.7885244045f, - -0.6150034663f, - 0.3185392127f, - -0.9479096845f, - 0.8880043089f, - 0.4598351306f, - 0.6476921488f, - -0.7619021462f, - 0.9820241299f, - 0.1887554194f, - 0.9357275128f, - -0.3527237187f, - -0.8894895414f, - 0.4569555293f, - 0.7922791302f, - 0.6101588153f, - 0.7483818261f, - 0.6632681526f, - -0.7288929755f, - -0.6846276581f, - 0.8729032783f, - -0.4878932944f, - 0.8288345784f, - 0.5594937369f, - 0.08074567077f, - 0.9967347374f, - 0.9799148216f, - -0.1994165048f, - -0.580730673f, - -0.8140957471f, - -0.4700049791f, - -0.8826637636f, - 0.2409492979f, - 0.9705377045f, - 0.9437816757f, - -0.3305694308f, - -0.8927998638f, - -0.4504535528f, - -0.8069622304f, - 0.5906030467f, - 0.06258973166f, - 0.9980393407f, - -0.9312597469f, - 0.3643559849f, - 0.5777449785f, - 0.8162173362f, - -0.3360095855f, - -0.941858566f, - 0.697932075f, - -0.7161639607f, - -0.002008157227f, - -0.9999979837f, - -0.1827294312f, - -0.9831632392f, - -0.6523911722f, - 0.7578824173f, - -0.4302626911f, - -0.9027037258f, - -0.9985126289f, - -0.05452091251f, - -0.01028102172f, - -0.9999471489f, - -0.4946071129f, - 0.8691166802f, - -0.2999350194f, - 0.9539596344f, - 0.8165471961f, - 0.5772786819f, - 0.2697460475f, - 0.962931498f, - -0.7306287391f, - -0.6827749597f, - -0.7590952064f, - -0.6509796216f, - -0.907053853f, - 0.4210146171f, - -0.5104861064f, - -0.8598860013f, - 0.8613350597f, - 0.5080373165f, - 0.5007881595f, - -0.8655698812f, - -0.654158152f, - 0.7563577938f, - -0.8382755311f, - -0.545246856f, - 0.6940070834f, - 0.7199681717f, - 0.06950936031f, - 0.9975812994f, - 0.1702942185f, - -0.9853932612f, - 0.2695973274f, - 0.9629731466f, - 0.5519612192f, - -0.8338697815f, - 0.225657487f, - -0.9742067022f, - 0.4215262855f, - -0.9068161835f, - 0.4881873305f, - -0.8727388672f, - -0.3683854996f, - -0.9296731273f, - -0.9825390578f, - 0.1860564427f, - 0.81256471f, - 0.5828709909f, - 0.3196460933f, - -0.9475370046f, - 0.9570913859f, - 0.2897862643f, - -0.6876655497f, - -0.7260276109f, - -0.9988770922f, - -0.047376731f, - -0.1250179027f, - 0.992154486f, - -0.8280133617f, - 0.560708367f, - 0.9324863769f, - -0.3612051451f, - 0.6394653183f, - 0.7688199442f, - -0.01623847064f, - -0.9998681473f, - -0.9955014666f, - -0.09474613458f, - -0.81453315f, - 0.580117012f, - 0.4037327978f, - -0.9148769469f, - 0.9944263371f, - 0.1054336766f, - -0.1624711654f, - 0.9867132919f, - -0.9949487814f, - -0.100383875f, - -0.6995302564f, - 0.7146029809f, - 0.5263414922f, - -0.85027327f, - -0.5395221479f, - 0.841971408f, - 0.6579370318f, - 0.7530729462f, - 0.01426758847f, - -0.9998982128f, - -0.6734383991f, - 0.7392433447f, - 0.639412098f, - -0.7688642071f, - 0.9211571421f, - 0.3891908523f, - -0.146637214f, - -0.9891903394f, - -0.782318098f, - 0.6228791163f, - -0.5039610839f, - -0.8637263605f, - -0.7743120191f, - -0.6328039957f, - }; - - private static final float[] Gradients3D = { - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - -1, - 1, - 0, - -1, - 1, - 0, - 0, - 0, - -1, - -1, - 0, - }; - - private static final float[] RandVecs3D = { - -0.7292736885f, - -0.6618439697f, - 0.1735581948f, - 0, - 0.790292081f, - -0.5480887466f, - -0.2739291014f, - 0, - 0.7217578935f, - 0.6226212466f, - -0.3023380997f, - 0, - 0.565683137f, - -0.8208298145f, - -0.0790000257f, - 0, - 0.760049034f, - -0.5555979497f, - -0.3370999617f, - 0, - 0.3713945616f, - 0.5011264475f, - 0.7816254623f, - 0, - -0.1277062463f, - -0.4254438999f, - -0.8959289049f, - 0, - -0.2881560924f, - -0.5815838982f, - 0.7607405838f, - 0, - 0.5849561111f, - -0.662820239f, - -0.4674352136f, - 0, - 0.3307171178f, - 0.0391653737f, - 0.94291689f, - 0, - 0.8712121778f, - -0.4113374369f, - -0.2679381538f, - 0, - 0.580981015f, - 0.7021915846f, - 0.4115677815f, - 0, - 0.503756873f, - 0.6330056931f, - -0.5878203852f, - 0, - 0.4493712205f, - 0.601390195f, - 0.6606022552f, - 0, - -0.6878403724f, - 0.09018890807f, - -0.7202371714f, - 0, - -0.5958956522f, - -0.6469350577f, - 0.475797649f, - 0, - -0.5127052122f, - 0.1946921978f, - -0.8361987284f, - 0, - -0.9911507142f, - -0.05410276466f, - -0.1212153153f, - 0, - -0.2149721042f, - 0.9720882117f, - -0.09397607749f, - 0, - -0.7518650936f, - -0.5428057603f, - 0.3742469607f, - 0, - 0.5237068895f, - 0.8516377189f, - -0.02107817834f, - 0, - 0.6333504779f, - 0.1926167129f, - -0.7495104896f, - 0, - -0.06788241606f, - 0.3998305789f, - 0.9140719259f, - 0, - -0.5538628599f, - -0.4729896695f, - -0.6852128902f, - 0, - -0.7261455366f, - -0.5911990757f, - 0.3509933228f, - 0, - -0.9229274737f, - -0.1782808786f, - 0.3412049336f, - 0, - -0.6968815002f, - 0.6511274338f, - 0.3006480328f, - 0, - 0.9608044783f, - -0.2098363234f, - -0.1811724921f, - 0, - 0.06817146062f, - -0.9743405129f, - 0.2145069156f, - 0, - -0.3577285196f, - -0.6697087264f, - -0.6507845481f, - 0, - -0.1868621131f, - 0.7648617052f, - -0.6164974636f, - 0, - -0.6541697588f, - 0.3967914832f, - 0.6439087246f, - 0, - 0.6993340405f, - -0.6164538506f, - 0.3618239211f, - 0, - -0.1546665739f, - 0.6291283928f, - 0.7617583057f, - 0, - -0.6841612949f, - -0.2580482182f, - -0.6821542638f, - 0, - 0.5383980957f, - 0.4258654885f, - 0.7271630328f, - 0, - -0.5026987823f, - -0.7939832935f, - -0.3418836993f, - 0, - 0.3202971715f, - 0.2834415347f, - 0.9039195862f, - 0, - 0.8683227101f, - -0.0003762656404f, - -0.4959995258f, - 0, - 0.791120031f, - -0.08511045745f, - 0.6057105799f, - 0, - -0.04011016052f, - -0.4397248749f, - 0.8972364289f, - 0, - 0.9145119872f, - 0.3579346169f, - -0.1885487608f, - 0, - -0.9612039066f, - -0.2756484276f, - 0.01024666929f, - 0, - 0.6510361721f, - -0.2877799159f, - -0.7023778346f, - 0, - -0.2041786351f, - 0.7365237271f, - 0.644859585f, - 0, - -0.7718263711f, - 0.3790626912f, - 0.5104855816f, - 0, - -0.3060082741f, - -0.7692987727f, - 0.5608371729f, - 0, - 0.454007341f, - -0.5024843065f, - 0.7357899537f, - 0, - 0.4816795475f, - 0.6021208291f, - -0.6367380315f, - 0, - 0.6961980369f, - -0.3222197429f, - 0.641469197f, - 0, - -0.6532160499f, - -0.6781148932f, - 0.3368515753f, - 0, - 0.5089301236f, - -0.6154662304f, - -0.6018234363f, - 0, - -0.1635919754f, - -0.9133604627f, - -0.372840892f, - 0, - 0.52408019f, - -0.8437664109f, - 0.1157505864f, - 0, - 0.5902587356f, - 0.4983817807f, - -0.6349883666f, - 0, - 0.5863227872f, - 0.494764745f, - 0.6414307729f, - 0, - 0.6779335087f, - 0.2341345225f, - 0.6968408593f, - 0, - 0.7177054546f, - -0.6858979348f, - 0.120178631f, - 0, - -0.5328819713f, - -0.5205125012f, - 0.6671608058f, - 0, - -0.8654874251f, - -0.0700727088f, - -0.4960053754f, - 0, - -0.2861810166f, - 0.7952089234f, - 0.5345495242f, - 0, - -0.04849529634f, - 0.9810836427f, - -0.1874115585f, - 0, - -0.6358521667f, - 0.6058348682f, - 0.4781800233f, - 0, - 0.6254794696f, - -0.2861619734f, - 0.7258696564f, - 0, - -0.2585259868f, - 0.5061949264f, - -0.8227581726f, - 0, - 0.02136306781f, - 0.5064016808f, - -0.8620330371f, - 0, - 0.200111773f, - 0.8599263484f, - 0.4695550591f, - 0, - 0.4743561372f, - 0.6014985084f, - -0.6427953014f, - 0, - 0.6622993731f, - -0.5202474575f, - -0.5391679918f, - 0, - 0.08084972818f, - -0.6532720452f, - 0.7527940996f, - 0, - -0.6893687501f, - 0.0592860349f, - 0.7219805347f, - 0, - -0.1121887082f, - -0.9673185067f, - 0.2273952515f, - 0, - 0.7344116094f, - 0.5979668656f, - -0.3210532909f, - 0, - 0.5789393465f, - -0.2488849713f, - 0.7764570201f, - 0, - 0.6988182827f, - 0.3557169806f, - -0.6205791146f, - 0, - -0.8636845529f, - -0.2748771249f, - -0.4224826141f, - 0, - -0.4247027957f, - -0.4640880967f, - 0.777335046f, - 0, - 0.5257722489f, - -0.8427017621f, - 0.1158329937f, - 0, - 0.9343830603f, - 0.316302472f, - -0.1639543925f, - 0, - -0.1016836419f, - -0.8057303073f, - -0.5834887393f, - 0, - -0.6529238969f, - 0.50602126f, - -0.5635892736f, - 0, - -0.2465286165f, - -0.9668205684f, - -0.06694497494f, - 0, - -0.9776897119f, - -0.2099250524f, - -0.007368825344f, - 0, - 0.7736893337f, - 0.5734244712f, - 0.2694238123f, - 0, - -0.6095087895f, - 0.4995678998f, - 0.6155736747f, - 0, - 0.5794535482f, - 0.7434546771f, - 0.3339292269f, - 0, - -0.8226211154f, - 0.08142581855f, - 0.5627293636f, - 0, - -0.510385483f, - 0.4703667658f, - 0.7199039967f, - 0, - -0.5764971849f, - -0.07231656274f, - -0.8138926898f, - 0, - 0.7250628871f, - 0.3949971505f, - -0.5641463116f, - 0, - -0.1525424005f, - 0.4860840828f, - -0.8604958341f, - 0, - -0.5550976208f, - -0.4957820792f, - 0.667882296f, - 0, - -0.1883614327f, - 0.9145869398f, - 0.357841725f, - 0, - 0.7625556724f, - -0.5414408243f, - -0.3540489801f, - 0, - -0.5870231946f, - -0.3226498013f, - -0.7424963803f, - 0, - 0.3051124198f, - 0.2262544068f, - -0.9250488391f, - 0, - 0.6379576059f, - 0.577242424f, - -0.5097070502f, - 0, - -0.5966775796f, - 0.1454852398f, - -0.7891830656f, - 0, - -0.658330573f, - 0.6555487542f, - -0.3699414651f, - 0, - 0.7434892426f, - 0.2351084581f, - 0.6260573129f, - 0, - 0.5562114096f, - 0.8264360377f, - -0.0873632843f, - 0, - -0.3028940016f, - -0.8251527185f, - 0.4768419182f, - 0, - 0.1129343818f, - -0.985888439f, - -0.1235710781f, - 0, - 0.5937652891f, - -0.5896813806f, - 0.5474656618f, - 0, - 0.6757964092f, - -0.5835758614f, - -0.4502648413f, - 0, - 0.7242302609f, - -0.1152719764f, - 0.6798550586f, - 0, - -0.9511914166f, - 0.0753623979f, - -0.2992580792f, - 0, - 0.2539470961f, - -0.1886339355f, - 0.9486454084f, - 0, - 0.571433621f, - -0.1679450851f, - -0.8032795685f, - 0, - -0.06778234979f, - 0.3978269256f, - 0.9149531629f, - 0, - 0.6074972649f, - 0.733060024f, - -0.3058922593f, - 0, - -0.5435478392f, - 0.1675822484f, - 0.8224791405f, - 0, - -0.5876678086f, - -0.3380045064f, - -0.7351186982f, - 0, - -0.7967562402f, - 0.04097822706f, - -0.6029098428f, - 0, - -0.1996350917f, - 0.8706294745f, - 0.4496111079f, - 0, - -0.02787660336f, - -0.9106232682f, - -0.4122962022f, - 0, - -0.7797625996f, - -0.6257634692f, - 0.01975775581f, - 0, - -0.5211232846f, - 0.7401644346f, - -0.4249554471f, - 0, - 0.8575424857f, - 0.4053272873f, - -0.3167501783f, - 0, - 0.1045223322f, - 0.8390195772f, - -0.5339674439f, - 0, - 0.3501822831f, - 0.9242524096f, - -0.1520850155f, - 0, - 0.1987849858f, - 0.07647613266f, - 0.9770547224f, - 0, - 0.7845996363f, - 0.6066256811f, - -0.1280964233f, - 0, - 0.09006737436f, - -0.9750989929f, - -0.2026569073f, - 0, - -0.8274343547f, - -0.542299559f, - 0.1458203587f, - 0, - -0.3485797732f, - -0.415802277f, - 0.840000362f, - 0, - -0.2471778936f, - -0.7304819962f, - -0.6366310879f, - 0, - -0.3700154943f, - 0.8577948156f, - 0.3567584454f, - 0, - 0.5913394901f, - -0.548311967f, - -0.5913303597f, - 0, - 0.1204873514f, - -0.7626472379f, - -0.6354935001f, - 0, - 0.616959265f, - 0.03079647928f, - 0.7863922953f, - 0, - 0.1258156836f, - -0.6640829889f, - -0.7369967419f, - 0, - -0.6477565124f, - -0.1740147258f, - -0.7417077429f, - 0, - 0.6217889313f, - -0.7804430448f, - -0.06547655076f, - 0, - 0.6589943422f, - -0.6096987708f, - 0.4404473475f, - 0, - -0.2689837504f, - -0.6732403169f, - -0.6887635427f, - 0, - -0.3849775103f, - 0.5676542638f, - 0.7277093879f, - 0, - 0.5754444408f, - 0.8110471154f, - -0.1051963504f, - 0, - 0.9141593684f, - 0.3832947817f, - 0.131900567f, - 0, - -0.107925319f, - 0.9245493968f, - 0.3654593525f, - 0, - 0.377977089f, - 0.3043148782f, - 0.8743716458f, - 0, - -0.2142885215f, - -0.8259286236f, - 0.5214617324f, - 0, - 0.5802544474f, - 0.4148098596f, - -0.7008834116f, - 0, - -0.1982660881f, - 0.8567161266f, - -0.4761596756f, - 0, - -0.03381553704f, - 0.3773180787f, - -0.9254661404f, - 0, - -0.6867922841f, - -0.6656597827f, - 0.2919133642f, - 0, - 0.7731742607f, - -0.2875793547f, - -0.5652430251f, - 0, - -0.09655941928f, - 0.9193708367f, - -0.3813575004f, - 0, - 0.2715702457f, - -0.9577909544f, - -0.09426605581f, - 0, - 0.2451015704f, - -0.6917998565f, - -0.6792188003f, - 0, - 0.977700782f, - -0.1753855374f, - 0.1155036542f, - 0, - -0.5224739938f, - 0.8521606816f, - 0.02903615945f, - 0, - -0.7734880599f, - -0.5261292347f, - 0.3534179531f, - 0, - -0.7134492443f, - -0.269547243f, - 0.6467878011f, - 0, - 0.1644037271f, - 0.5105846203f, - -0.8439637196f, - 0, - 0.6494635788f, - 0.05585611296f, - 0.7583384168f, - 0, - -0.4711970882f, - 0.5017280509f, - -0.7254255765f, - 0, - -0.6335764307f, - -0.2381686273f, - -0.7361091029f, - 0, - -0.9021533097f, - -0.270947803f, - -0.3357181763f, - 0, - -0.3793711033f, - 0.872258117f, - 0.3086152025f, - 0, - -0.6855598966f, - -0.3250143309f, - 0.6514394162f, - 0, - 0.2900942212f, - -0.7799057743f, - -0.5546100667f, - 0, - -0.2098319339f, - 0.85037073f, - 0.4825351604f, - 0, - -0.4592603758f, - 0.6598504336f, - -0.5947077538f, - 0, - 0.8715945488f, - 0.09616365406f, - -0.4807031248f, - 0, - -0.6776666319f, - 0.7118504878f, - -0.1844907016f, - 0, - 0.7044377633f, - 0.312427597f, - 0.637304036f, - 0, - -0.7052318886f, - -0.2401093292f, - -0.6670798253f, - 0, - 0.081921007f, - -0.7207336136f, - -0.6883545647f, - 0, - -0.6993680906f, - -0.5875763221f, - -0.4069869034f, - 0, - -0.1281454481f, - 0.6419895885f, - 0.7559286424f, - 0, - -0.6337388239f, - -0.6785471501f, - -0.3714146849f, - 0, - 0.5565051903f, - -0.2168887573f, - -0.8020356851f, - 0, - -0.5791554484f, - 0.7244372011f, - -0.3738578718f, - 0, - 0.1175779076f, - -0.7096451073f, - 0.6946792478f, - 0, - -0.6134619607f, - 0.1323631078f, - 0.7785527795f, - 0, - 0.6984635305f, - -0.02980516237f, - -0.715024719f, - 0, - 0.8318082963f, - -0.3930171956f, - 0.3919597455f, - 0, - 0.1469576422f, - 0.05541651717f, - -0.9875892167f, - 0, - 0.708868575f, - -0.2690503865f, - 0.6520101478f, - 0, - 0.2726053183f, - 0.67369766f, - -0.68688995f, - 0, - -0.6591295371f, - 0.3035458599f, - -0.6880466294f, - 0, - 0.4815131379f, - -0.7528270071f, - 0.4487723203f, - 0, - 0.9430009463f, - 0.1675647412f, - -0.2875261255f, - 0, - 0.434802957f, - 0.7695304522f, - -0.4677277752f, - 0, - 0.3931996188f, - 0.594473625f, - 0.7014236729f, - 0, - 0.7254336655f, - -0.603925654f, - 0.3301814672f, - 0, - 0.7590235227f, - -0.6506083235f, - 0.02433313207f, - 0, - -0.8552768592f, - -0.3430042733f, - 0.3883935666f, - 0, - -0.6139746835f, - 0.6981725247f, - 0.3682257648f, - 0, - -0.7465905486f, - -0.5752009504f, - 0.3342849376f, - 0, - 0.5730065677f, - 0.810555537f, - -0.1210916791f, - 0, - -0.9225877367f, - -0.3475211012f, - -0.167514036f, - 0, - -0.7105816789f, - -0.4719692027f, - -0.5218416899f, - 0, - -0.08564609717f, - 0.3583001386f, - 0.929669703f, - 0, - -0.8279697606f, - -0.2043157126f, - 0.5222271202f, - 0, - 0.427944023f, - 0.278165994f, - 0.8599346446f, - 0, - 0.5399079671f, - -0.7857120652f, - -0.3019204161f, - 0, - 0.5678404253f, - -0.5495413974f, - -0.6128307303f, - 0, - -0.9896071041f, - 0.1365639107f, - -0.04503418428f, - 0, - -0.6154342638f, - -0.6440875597f, - 0.4543037336f, - 0, - 0.1074204368f, - -0.7946340692f, - 0.5975094525f, - 0, - -0.3595449969f, - -0.8885529948f, - 0.28495784f, - 0, - -0.2180405296f, - 0.1529888965f, - 0.9638738118f, - 0, - -0.7277432317f, - -0.6164050508f, - -0.3007234646f, - 0, - 0.7249729114f, - -0.00669719484f, - 0.6887448187f, - 0, - -0.5553659455f, - -0.5336586252f, - 0.6377908264f, - 0, - 0.5137558015f, - 0.7976208196f, - -0.3160000073f, - 0, - -0.3794024848f, - 0.9245608561f, - -0.03522751494f, - 0, - 0.8229248658f, - 0.2745365933f, - -0.4974176556f, - 0, - -0.5404114394f, - 0.6091141441f, - 0.5804613989f, - 0, - 0.8036581901f, - -0.2703029469f, - 0.5301601931f, - 0, - 0.6044318879f, - 0.6832968393f, - 0.4095943388f, - 0, - 0.06389988817f, - 0.9658208605f, - -0.2512108074f, - 0, - 0.1087113286f, - 0.7402471173f, - -0.6634877936f, - 0, - -0.713427712f, - -0.6926784018f, - 0.1059128479f, - 0, - 0.6458897819f, - -0.5724548511f, - -0.5050958653f, - 0, - -0.6553931414f, - 0.7381471625f, - 0.159995615f, - 0, - 0.3910961323f, - 0.9188871375f, - -0.05186755998f, - 0, - -0.4879022471f, - -0.5904376907f, - 0.6429111375f, - 0, - 0.6014790094f, - 0.7707441366f, - -0.2101820095f, - 0, - -0.5677173047f, - 0.7511360995f, - 0.3368851762f, - 0, - 0.7858573506f, - 0.226674665f, - 0.5753666838f, - 0, - -0.4520345543f, - -0.604222686f, - -0.6561857263f, - 0, - 0.002272116345f, - 0.4132844051f, - -0.9105991643f, - 0, - -0.5815751419f, - -0.5162925989f, - 0.6286591339f, - 0, - -0.03703704785f, - 0.8273785755f, - 0.5604221175f, - 0, - -0.5119692504f, - 0.7953543429f, - -0.3244980058f, - 0, - -0.2682417366f, - -0.9572290247f, - -0.1084387619f, - 0, - -0.2322482736f, - -0.9679131102f, - -0.09594243324f, - 0, - 0.3554328906f, - -0.8881505545f, - 0.2913006227f, - 0, - 0.7346520519f, - -0.4371373164f, - 0.5188422971f, - 0, - 0.9985120116f, - 0.04659011161f, - -0.02833944577f, - 0, - -0.3727687496f, - -0.9082481361f, - 0.1900757285f, - 0, - 0.91737377f, - -0.3483642108f, - 0.1925298489f, - 0, - 0.2714911074f, - 0.4147529736f, - -0.8684886582f, - 0, - 0.5131763485f, - -0.7116334161f, - 0.4798207128f, - 0, - -0.8737353606f, - 0.18886992f, - -0.4482350644f, - 0, - 0.8460043821f, - -0.3725217914f, - 0.3814499973f, - 0, - 0.8978727456f, - -0.1780209141f, - -0.4026575304f, - 0, - 0.2178065647f, - -0.9698322841f, - -0.1094789531f, - 0, - -0.1518031304f, - -0.7788918132f, - -0.6085091231f, - 0, - -0.2600384876f, - -0.4755398075f, - -0.8403819825f, - 0, - 0.572313509f, - -0.7474340931f, - -0.3373418503f, - 0, - -0.7174141009f, - 0.1699017182f, - -0.6756111411f, - 0, - -0.684180784f, - 0.02145707593f, - -0.7289967412f, - 0, - -0.2007447902f, - 0.06555605789f, - -0.9774476623f, - 0, - -0.1148803697f, - -0.8044887315f, - 0.5827524187f, - 0, - -0.7870349638f, - 0.03447489231f, - 0.6159443543f, - 0, - -0.2015596421f, - 0.6859872284f, - 0.6991389226f, - 0, - -0.08581082512f, - -0.10920836f, - -0.9903080513f, - 0, - 0.5532693395f, - 0.7325250401f, - -0.396610771f, - 0, - -0.1842489331f, - -0.9777375055f, - -0.1004076743f, - 0, - 0.0775473789f, - -0.9111505856f, - 0.4047110257f, - 0, - 0.1399838409f, - 0.7601631212f, - -0.6344734459f, - 0, - 0.4484419361f, - -0.845289248f, - 0.2904925424f, - 0, - }; - - private static float FastMin(float a, float b) { - return a < b ? a : b; - } - - private static float FastMax(float a, float b) { - return a > b ? a : b; - } - - private static float FastAbs(float f) { - return f < 0 ? -f : f; - } - - private static float FastSqrt(float f) { - return (float) Math.sqrt(f); - } - - private static int FastFloor(/*FMLdouble*/double f) { - return f >= 0 ? (int) f : (int) f - 1; - } - - private static int FastRound(/*FMLdouble*/double f) { - return f >= 0 ? (int) (f + 0.5f) : (int) (f - 0.5f); - } - - private static float Lerp(float a, float b, float t) { - return a + t * (b - a); - } - - private static float InterpHermite(float t) { - return t * t * (3 - 2 * t); - } - - private static float InterpQuintic(float t) { - return t * t * t * (t * (t * 6 - 15) + 10); - } - - private static float CubicLerp( - float a, - float b, - float c, - float d, - float t - ) { - float p = (d - c) - (a - b); - return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; - } - - private static float PingPong(float t) { - t -= (int) (t * 0.5f) * 2; - return t < 1 ? t : 2 - t; - } - - private void CalculateFractalBounding() { - float gain = FastAbs(mGain); - float amp = gain; - float ampFractal = 1.0f; - for (int i = 1; i < mOctaves; i++) { - ampFractal += amp; - amp *= gain; - } - mFractalBounding = 1 / ampFractal; - } - - // Hashing - private static final int PrimeX = 501125321; - private static final int PrimeY = 1136930381; - private static final int PrimeZ = 1720413743; - - private static int Hash(int seed, int xPrimed, int yPrimed) { - int hash = seed ^ xPrimed ^ yPrimed; - - hash *= 0x27d4eb2d; - return hash; - } - - private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { - int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed; - - hash *= 0x27d4eb2d; - return hash; - } - - private static float ValCoord(int seed, int xPrimed, int yPrimed) { - int hash = Hash(seed, xPrimed, yPrimed); - - hash *= hash; - hash ^= hash << 19; - return hash * (1 / 2147483648.0f); - } - - private static float ValCoord( - int seed, - int xPrimed, - int yPrimed, - int zPrimed - ) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - - hash *= hash; - hash ^= hash << 19; - return hash * (1 / 2147483648.0f); - } - - private static float GradCoord( - int seed, - int xPrimed, - int yPrimed, - float xd, - float yd - ) { - int hash = Hash(seed, xPrimed, yPrimed); - hash ^= hash >> 15; - hash &= 127 << 1; - - float xg = Gradients2D[hash]; - float yg = Gradients2D[hash | 1]; - - return xd * xg + yd * yg; - } - - private static float GradCoord( - int seed, - int xPrimed, - int yPrimed, - int zPrimed, - float xd, - float yd, - float zd - ) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - hash ^= hash >> 15; - hash &= 63 << 2; - - float xg = Gradients3D[hash]; - float yg = Gradients3D[hash | 1]; - float zg = Gradients3D[hash | 2]; - - return xd * xg + yd * yg + zd * zg; - } - - // Generic noise gen - - private float GenNoiseSingle( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - switch (mNoiseType) { - case OpenSimplex2: - return SingleSimplex(seed, x, y); - case OpenSimplex2S: - return SingleOpenSimplex2S(seed, x, y); - case Cellular: - return SingleCellular(seed, x, y); - case Perlin: - return SinglePerlin(seed, x, y); - case ValueCubic: - return SingleValueCubic(seed, x, y); - case Value: - return SingleValue(seed, x, y); - default: - return 0; - } - } - - private float GenNoiseSingle( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - switch (mNoiseType) { - case OpenSimplex2: - return SingleOpenSimplex2(seed, x, y, z); - case OpenSimplex2S: - return SingleOpenSimplex2S(seed, x, y, z); - case Cellular: - return SingleCellular(seed, x, y, z); - case Perlin: - return SinglePerlin(seed, x, y, z); - case ValueCubic: - return SingleValueCubic(seed, x, y, z); - case Value: - return SingleValue(seed, x, y, z); - default: - return 0; - } - } - - // Noise Coordinate Transforms (frequency, and possible skew or rotation) - - private void UpdateTransformType3D() { - switch (mRotationType3D) { - case ImproveXYPlanes: - mTransformType3D = TransformType3D.ImproveXYPlanes; - break; - case ImproveXZPlanes: - mTransformType3D = TransformType3D.ImproveXZPlanes; - break; - default: - switch (mNoiseType) { - case OpenSimplex2: - case OpenSimplex2S: - mTransformType3D = TransformType3D.DefaultOpenSimplex2; - break; - default: - mTransformType3D = TransformType3D.None; - break; - } - break; - } - } - - private void UpdateWarpTransformType3D() { - switch (mRotationType3D) { - case ImproveXYPlanes: - mWarpTransformType3D = TransformType3D.ImproveXYPlanes; - break; - case ImproveXZPlanes: - mWarpTransformType3D = TransformType3D.ImproveXZPlanes; - break; - default: - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: - mWarpTransformType3D = - TransformType3D.DefaultOpenSimplex2; - break; - default: - mWarpTransformType3D = TransformType3D.None; - break; - } - break; - } - } - - // Fractal FBm - - private float GenFractalFBm(/*FMLdouble*/double x, /*FMLdouble*/double y) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = GenNoiseSingle(seed++, x, y); - sum += noise * amp; - amp *= Lerp(1.0f, FastMin(noise + 1, 2) * 0.5f, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalFBm( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = GenNoiseSingle(seed++, x, y, z); - sum += noise * amp; - amp *= Lerp(1.0f, (noise + 1) * 0.5f, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Fractal Ridged - - private float GenFractalRidged( - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = FastAbs(GenNoiseSingle(seed++, x, y)); - sum += (noise * -2 + 1) * amp; - amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalRidged( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = FastAbs(GenNoiseSingle(seed++, x, y, z)); - sum += (noise * -2 + 1) * amp; - amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Fractal PingPong - - private float GenFractalPingPong( - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = PingPong( - (GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength - ); - sum += (noise - 0.5f) * 2 * amp; - amp *= Lerp(1.0f, noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalPingPong( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = PingPong( - (GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength - ); - sum += (noise - 0.5f) * 2 * amp; - amp *= Lerp(1.0f, noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Simplex/OpenSimplex2 Noise - - private float SingleSimplex( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. - - final float SQRT3 = 1.7320508075688772935274463415059f; - final float G2 = (3 - SQRT3) / 6; - - /* - * --- Skew moved to switch statements before fractal evaluation --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - float t = (xi + yi) * G2; - float x0 = (float) (xi - t); - float y0 = (float) (yi - t); - - i *= PrimeX; - j *= PrimeY; - - float n0, n1, n2; - - float a = 0.5f - x0 * x0 - y0 * y0; - if (a <= 0) n0 = 0; else { - n0 = (a * a) * (a * a) * GradCoord(seed, i, j, x0, y0); - } - - float c = - (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c <= 0) n2 = 0; else { - float x2 = x0 + (2 * (float) G2 - 1); - float y2 = y0 + (2 * (float) G2 - 1); - n2 = - (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); - } - - if (y0 > x0) { - float x1 = x0 + (float) G2; - float y1 = y0 + ((float) G2 - 1); - float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) n1 = 0; else { - n1 = (b * b) * (b * b) * GradCoord(seed, i, j + PrimeY, x1, y1); - } - } else { - float x1 = x0 + ((float) G2 - 1); - float y1 = y0 + (float) G2; - float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) n1 = 0; else { - n1 = (b * b) * (b * b) * GradCoord(seed, i + PrimeX, j, x1, y1); - } - } - - return (n0 + n1 + n2) * 99.83685446303647f; - } - - private float SingleOpenSimplex2( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - // 3D OpenSimplex2 case uses two offset rotated cube grids. - - /* - * --- Rotation moved to switch statements before fractal evaluation --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastRound(x); - int j = FastRound(y); - int k = FastRound(z); - float x0 = (float) (x - i); - float y0 = (float) (y - j); - float z0 = (float) (z - k); - - int xNSign = (int) (-1.0f - x0) | 1; - int yNSign = (int) (-1.0f - y0) | 1; - int zNSign = (int) (-1.0f - z0) | 1; - - float ax0 = xNSign * -x0; - float ay0 = yNSign * -y0; - float az0 = zNSign * -z0; - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - - float value = 0; - float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - - for (int l = 0;; l++) { - if (a > 0) { - value += - (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); - } - - if (ax0 >= ay0 && ax0 >= az0) { - float b = a + ax0 + ax0; - if (b > 1) { - b -= 1; - value += - (b * b) * - (b * b) * - GradCoord( - seed, - i - xNSign * PrimeX, - j, - k, - x0 + xNSign, - y0, - z0 - ); - } - } else if (ay0 > ax0 && ay0 >= az0) { - float b = a + ay0 + ay0; - if (b > 1) { - b -= 1; - value += - (b * b) * - (b * b) * - GradCoord( - seed, - i, - j - yNSign * PrimeY, - k, - x0, - y0 + yNSign, - z0 - ); - } - } else { - float b = a + az0 + az0; - if (b > 1) { - b -= 1; - value += - (b * b) * - (b * b) * - GradCoord( - seed, - i, - j, - k - zNSign * PrimeZ, - x0, - y0, - z0 + zNSign - ); - } - } - - if (l == 1) break; - - ax0 = 0.5f - ax0; - ay0 = 0.5f - ay0; - az0 = 0.5f - az0; - - x0 = xNSign * ax0; - y0 = yNSign * ay0; - z0 = zNSign * az0; - - a += (0.75f - ax0) - (ay0 + az0); - - i += (xNSign >> 1) & PrimeX; - j += (yNSign >> 1) & PrimeY; - k += (zNSign >> 1) & PrimeZ; - - xNSign = -xNSign; - yNSign = -yNSign; - zNSign = -zNSign; - - seed = ~seed; - } - - return value * 32.69428253173828125f; - } - - // OpenSimplex2S Noise - - private float SingleOpenSimplex2S( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - // 2D OpenSimplex2S case is a modified 2D simplex noise. - - final /*FMLdouble*/double SQRT3 = - (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double G2 = (3 - SQRT3) / 6; - - /* - * --- Skew moved to TransformNoiseCoordinate method --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - i *= PrimeX; - j *= PrimeY; - int i1 = i + PrimeX; - int j1 = j + PrimeY; - - float t = (xi + yi) * (float) G2; - float x0 = xi - t; - float y0 = yi - t; - - float a0 = (2.0f / 3.0f) - x0 * x0 - y0 * y0; - float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, i, j, x0, y0); - - float a1 = - (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); - float x1 = x0 - (float) (1 - 2 * G2); - float y1 = y0 - (float) (1 - 2 * G2); - value += (a1 * a1) * (a1 * a1) * GradCoord(seed, i1, j1, x1, y1); - - // Nested conditionals were faster than compact bit logic/arithmetic. - float xmyi = xi - yi; - if (t > G2) { - if (xi + xmyi > 1) { - float x2 = x0 + (float) (3 * G2 - 2); - float y2 = y0 + (float) (3 * G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); - } - } else { - float x2 = x0 + (float) G2; - float y2 = y0 + (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j + PrimeY, x2, y2); - } - } - - if (yi - xmyi > 1) { - float x3 = x0 + (float) (3 * G2 - 1); - float y3 = y0 + (float) (3 * G2 - 2); - float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) { - value += - (a3 * a3) * - (a3 * a3) * - GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); - } - } else { - float x3 = x0 + (float) (G2 - 1); - float y3 = y0 + (float) G2; - float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) { - value += - (a3 * a3) * - (a3 * a3) * - GradCoord(seed, i + PrimeX, j, x3, y3); - } - } - } else { - if (xi + xmyi < 0) { - float x2 = x0 + (float) (1 - G2); - float y2 = y0 - (float) G2; - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i - PrimeX, j, x2, y2); - } - } else { - float x2 = x0 + (float) (G2 - 1); - float y2 = y0 + (float) G2; - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i + PrimeX, j, x2, y2); - } - } - - if (yi < xmyi) { - float x2 = x0 - (float) G2; - float y2 = y0 - (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j - PrimeY, x2, y2); - } - } else { - float x2 = x0 + (float) G2; - float y2 = y0 + (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += - (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j + PrimeY, x2, y2); - } - } - } - - return value * 18.24196194486065f; - } - - private float SingleOpenSimplex2S( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - // 3D OpenSimplex2S case uses two offset rotated cube grids. - - /* - * --- Rotation moved to TransformNoiseCoordinate method --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - int k = FastFloor(z); - float xi = (float) (x - i); - float yi = (float) (y - j); - float zi = (float) (z - k); - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - int seed2 = seed + 1293373; - - int xNMask = (int) (-0.5f - xi); - int yNMask = (int) (-0.5f - yi); - int zNMask = (int) (-0.5f - zi); - - float x0 = xi + xNMask; - float y0 = yi + yNMask; - float z0 = zi + zNMask; - float a0 = 0.75f - x0 * x0 - y0 * y0 - z0 * z0; - float value = - (a0 * a0) * - (a0 * a0) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (zNMask & PrimeZ), - x0, - y0, - z0 - ); - - float x1 = xi - 0.5f; - float y1 = yi - 0.5f; - float z1 = zi - 0.5f; - float a1 = 0.75f - x1 * x1 - y1 * y1 - z1 * z1; - value += - (a1 * a1) * - (a1 * a1) * - GradCoord(seed2, i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); - - float xAFlipMask0 = ((xNMask | 1) << 1) * x1; - float yAFlipMask0 = ((yNMask | 1) << 1) * y1; - float zAFlipMask0 = ((zNMask | 1) << 1) * z1; - float xAFlipMask1 = (-2 - (xNMask << 2)) * x1 - 1.0f; - float yAFlipMask1 = (-2 - (yNMask << 2)) * y1 - 1.0f; - float zAFlipMask1 = (-2 - (zNMask << 2)) * z1 - 1.0f; - - boolean skip5 = false; - float a2 = xAFlipMask0 + a0; - if (a2 > 0) { - float x2 = x0 - (xNMask | 1); - float y2 = y0; - float z2 = z0; - value += - (a2 * a2) * - (a2 * a2) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (zNMask & PrimeZ), - x2, - y2, - z2 - ); - } else { - float a3 = yAFlipMask0 + zAFlipMask0 + a0; - if (a3 > 0) { - float x3 = x0; - float y3 = y0 - (yNMask | 1); - float z3 = z0 - (zNMask | 1); - value += - (a3 * a3) * - (a3 * a3) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (~zNMask & PrimeZ), - x3, - y3, - z3 - ); - } - - float a4 = xAFlipMask1 + a1; - if (a4 > 0) { - float x4 = (xNMask | 1) + x1; - float y4 = y1; - float z4 = z1; - value += - (a4 * a4) * - (a4 * a4) * - GradCoord( - seed2, - i + (xNMask & (PrimeX * 2)), - j + PrimeY, - k + PrimeZ, - x4, - y4, - z4 - ); - skip5 = true; - } - } - - boolean skip9 = false; - float a6 = yAFlipMask0 + a0; - if (a6 > 0) { - float x6 = x0; - float y6 = y0 - (yNMask | 1); - float z6 = z0; - value += - (a6 * a6) * - (a6 * a6) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (zNMask & PrimeZ), - x6, - y6, - z6 - ); - } else { - float a7 = xAFlipMask0 + zAFlipMask0 + a0; - if (a7 > 0) { - float x7 = x0 - (xNMask | 1); - float y7 = y0; - float z7 = z0 - (zNMask | 1); - value += - (a7 * a7) * - (a7 * a7) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (~zNMask & PrimeZ), - x7, - y7, - z7 - ); - } - - float a8 = yAFlipMask1 + a1; - if (a8 > 0) { - float x8 = x1; - float y8 = (yNMask | 1) + y1; - float z8 = z1; - value += - (a8 * a8) * - (a8 * a8) * - GradCoord( - seed2, - i + PrimeX, - j + (yNMask & (PrimeY << 1)), - k + PrimeZ, - x8, - y8, - z8 - ); - skip9 = true; - } - } - - boolean skipD = false; - float aA = zAFlipMask0 + a0; - if (aA > 0) { - float xA = x0; - float yA = y0; - float zA = z0 - (zNMask | 1); - value += - (aA * aA) * - (aA * aA) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (~zNMask & PrimeZ), - xA, - yA, - zA - ); - } else { - float aB = xAFlipMask0 + yAFlipMask0 + a0; - if (aB > 0) { - float xB = x0 - (xNMask | 1); - float yB = y0 - (yNMask | 1); - float zB = z0; - value += - (aB * aB) * - (aB * aB) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (zNMask & PrimeZ), - xB, - yB, - zB - ); - } - - float aC = zAFlipMask1 + a1; - if (aC > 0) { - float xC = x1; - float yC = y1; - float zC = (zNMask | 1) + z1; - value += - (aC * aC) * - (aC * aC) * - GradCoord( - seed2, - i + PrimeX, - j + PrimeY, - k + (zNMask & (PrimeZ << 1)), - xC, - yC, - zC - ); - skipD = true; - } - } - - if (!skip5) { - float a5 = yAFlipMask1 + zAFlipMask1 + a1; - if (a5 > 0) { - float x5 = x1; - float y5 = (yNMask | 1) + y1; - float z5 = (zNMask | 1) + z1; - value += - (a5 * a5) * - (a5 * a5) * - GradCoord( - seed2, - i + PrimeX, - j + (yNMask & (PrimeY << 1)), - k + (zNMask & (PrimeZ << 1)), - x5, - y5, - z5 - ); - } - } - - if (!skip9) { - float a9 = xAFlipMask1 + zAFlipMask1 + a1; - if (a9 > 0) { - float x9 = (xNMask | 1) + x1; - float y9 = y1; - float z9 = (zNMask | 1) + z1; - value += - (a9 * a9) * - (a9 * a9) * - GradCoord( - seed2, - i + (xNMask & (PrimeX * 2)), - j + PrimeY, - k + (zNMask & (PrimeZ << 1)), - x9, - y9, - z9 - ); - } - } - - if (!skipD) { - float aD = xAFlipMask1 + yAFlipMask1 + a1; - if (aD > 0) { - float xD = (xNMask | 1) + x1; - float yD = (yNMask | 1) + y1; - float zD = z1; - value += - (aD * aD) * - (aD * aD) * - GradCoord( - seed2, - i + (xNMask & (PrimeX << 1)), - j + (yNMask & (PrimeY << 1)), - k + PrimeZ, - xD, - yD, - zD - ); - } - } - - return value * 9.046026385208288f; - } - - // Cellular Noise - - private float SingleCellular( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int xr = FastRound(x); - int yr = FastRound(y); - - float distance0 = Float.MAX_VALUE; - float distance1 = Float.MAX_VALUE; - int closestHash = 0; - - float cellularJitter = 0.43701595f * mCellularJitterModifier; - - int xPrimed = (xr - 1) * PrimeX; - int yPrimedBase = (yr - 1) * PrimeY; - - switch (mCellularDistanceFunction) { - default: - case Euclidean: - case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = - (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = vecX * vecX + vecY * vecY; - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = - (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = FastAbs(vecX) + FastAbs(vecY); - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = - (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = - (FastAbs(vecX) + FastAbs(vecY)) + - (vecX * vecX + vecY * vecY); - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - } - - if ( - mCellularDistanceFunction == CellularDistanceFunction.Euclidean && - mCellularReturnType != CellularReturnType.CellValue - ) { - distance0 = FastSqrt(distance0); - - if (mCellularReturnType != CellularReturnType.CellValue) { - distance1 = FastSqrt(distance1); - } - } - - switch (mCellularReturnType) { - case CellValue: - return closestHash * (1 / 2147483648.0f); - case Distance: - return distance0 - 1; - case Distance2: - return distance1 - 1; - case Distance2Add: - return (distance1 + distance0) * 0.5f - 1; - case Distance2Sub: - return distance1 - distance0 - 1; - case Distance2Mul: - return distance1 * distance0 * 0.5f - 1; - case Distance2Div: - return distance0 / distance1 - 1; - default: - return 0; - } - } - - private float SingleCellular( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int xr = FastRound(x); - int yr = FastRound(y); - int zr = FastRound(z); - - float distance0 = Float.MAX_VALUE; - float distance1 = Float.MAX_VALUE; - int closestHash = 0; - - float cellularJitter = 0.39614353f * mCellularJitterModifier; - - int xPrimed = (xr - 1) * PrimeX; - int yPrimedBase = (yr - 1) * PrimeY; - int zPrimedBase = (zr - 1) * PrimeZ; - - switch (mCellularDistanceFunction) { - case Euclidean: - case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = - (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = - (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = - vecX * vecX + vecY * vecY + vecZ * vecZ; - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = - (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = - (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = - FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = - (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = - (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = - (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = - (FastAbs(vecX) + - FastAbs(vecY) + - FastAbs(vecZ)) + - (vecX * vecX + vecY * vecY + vecZ * vecZ); - - distance1 = - FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - default: - break; - } - - if ( - mCellularDistanceFunction == CellularDistanceFunction.Euclidean && - mCellularReturnType != CellularReturnType.CellValue - ) { - distance0 = FastSqrt(distance0); - - if (mCellularReturnType != CellularReturnType.CellValue) { - distance1 = FastSqrt(distance1); - } - } - - switch (mCellularReturnType) { - case CellValue: - return closestHash * (1 / 2147483648.0f); - case Distance: - return distance0 - 1; - case Distance2: - return distance1 - 1; - case Distance2Add: - return (distance1 + distance0) * 0.5f - 1; - case Distance2Sub: - return distance1 - distance0 - 1; - case Distance2Mul: - return distance1 * distance0 * 0.5f - 1; - case Distance2Div: - return distance0 / distance1 - 1; - default: - return 0; - } - } - - // Perlin Noise - - private float SinglePerlin( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - - float xd0 = (float) (x - x0); - float yd0 = (float) (y - y0); - float xd1 = xd0 - 1; - float yd1 = yd0 - 1; - - float xs = InterpQuintic(xd0); - float ys = InterpQuintic(yd0); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - float xf0 = Lerp( - GradCoord(seed, x0, y0, xd0, yd0), - GradCoord(seed, x1, y0, xd1, yd0), - xs - ); - float xf1 = Lerp( - GradCoord(seed, x0, y1, xd0, yd1), - GradCoord(seed, x1, y1, xd1, yd1), - xs - ); - - return Lerp(xf0, xf1, ys) * 1.4247691104677813f; - } - - private float SinglePerlin( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - int z0 = FastFloor(z); - - float xd0 = (float) (x - x0); - float yd0 = (float) (y - y0); - float zd0 = (float) (z - z0); - float xd1 = xd0 - 1; - float yd1 = yd0 - 1; - float zd1 = zd0 - 1; - - float xs = InterpQuintic(xd0); - float ys = InterpQuintic(yd0); - float zs = InterpQuintic(zd0); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - float xf00 = Lerp( - GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), - GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), - xs - ); - float xf10 = Lerp( - GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), - GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), - xs - ); - float xf01 = Lerp( - GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), - GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), - xs - ); - float xf11 = Lerp( - GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), - GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), - xs - ); - - float yf0 = Lerp(xf00, xf10, ys); - float yf1 = Lerp(xf01, xf11, ys); - - return Lerp(yf0, yf1, zs) * 0.964921414852142333984375f; - } - - // Value Cubic Noise - - private float SingleValueCubic( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int x1 = FastFloor(x); - int y1 = FastFloor(y); - - float xs = (float) (x - x1); - float ys = (float) (y - y1); - - x1 *= PrimeX; - y1 *= PrimeY; - int x0 = x1 - PrimeX; - int y0 = y1 - PrimeY; - int x2 = x1 + PrimeX; - int y2 = y1 + PrimeY; - int x3 = x1 + (PrimeX << 1); - int y3 = y1 + (PrimeY << 1); - - return ( - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0), - ValCoord(seed, x1, y0), - ValCoord(seed, x2, y0), - ValCoord(seed, x3, y0), - xs - ), - CubicLerp( - ValCoord(seed, x0, y1), - ValCoord(seed, x1, y1), - ValCoord(seed, x2, y1), - ValCoord(seed, x3, y1), - xs - ), - CubicLerp( - ValCoord(seed, x0, y2), - ValCoord(seed, x1, y2), - ValCoord(seed, x2, y2), - ValCoord(seed, x3, y2), - xs - ), - CubicLerp( - ValCoord(seed, x0, y3), - ValCoord(seed, x1, y3), - ValCoord(seed, x2, y3), - ValCoord(seed, x3, y3), - xs - ), - ys - ) * - (1 / (1.5f * 1.5f)) - ); - } - - private float SingleValueCubic( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int x1 = FastFloor(x); - int y1 = FastFloor(y); - int z1 = FastFloor(z); - - float xs = (float) (x - x1); - float ys = (float) (y - y1); - float zs = (float) (z - z1); - - x1 *= PrimeX; - y1 *= PrimeY; - z1 *= PrimeZ; - - int x0 = x1 - PrimeX; - int y0 = y1 - PrimeY; - int z0 = z1 - PrimeZ; - int x2 = x1 + PrimeX; - int y2 = y1 + PrimeY; - int z2 = z1 + PrimeZ; - int x3 = x1 + (PrimeX << 1); - int y3 = y1 + (PrimeY << 1); - int z3 = z1 + (PrimeZ << 1); - - return ( - CubicLerp( - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z0), - ValCoord(seed, x1, y0, z0), - ValCoord(seed, x2, y0, z0), - ValCoord(seed, x3, y0, z0), - xs - ), - CubicLerp( - ValCoord(seed, x0, y1, z0), - ValCoord(seed, x1, y1, z0), - ValCoord(seed, x2, y1, z0), - ValCoord(seed, x3, y1, z0), - xs - ), - CubicLerp( - ValCoord(seed, x0, y2, z0), - ValCoord(seed, x1, y2, z0), - ValCoord(seed, x2, y2, z0), - ValCoord(seed, x3, y2, z0), - xs - ), - CubicLerp( - ValCoord(seed, x0, y3, z0), - ValCoord(seed, x1, y3, z0), - ValCoord(seed, x2, y3, z0), - ValCoord(seed, x3, y3, z0), - xs - ), - ys - ), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z1), - ValCoord(seed, x1, y0, z1), - ValCoord(seed, x2, y0, z1), - ValCoord(seed, x3, y0, z1), - xs - ), - CubicLerp( - ValCoord(seed, x0, y1, z1), - ValCoord(seed, x1, y1, z1), - ValCoord(seed, x2, y1, z1), - ValCoord(seed, x3, y1, z1), - xs - ), - CubicLerp( - ValCoord(seed, x0, y2, z1), - ValCoord(seed, x1, y2, z1), - ValCoord(seed, x2, y2, z1), - ValCoord(seed, x3, y2, z1), - xs - ), - CubicLerp( - ValCoord(seed, x0, y3, z1), - ValCoord(seed, x1, y3, z1), - ValCoord(seed, x2, y3, z1), - ValCoord(seed, x3, y3, z1), - xs - ), - ys - ), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z2), - ValCoord(seed, x1, y0, z2), - ValCoord(seed, x2, y0, z2), - ValCoord(seed, x3, y0, z2), - xs - ), - CubicLerp( - ValCoord(seed, x0, y1, z2), - ValCoord(seed, x1, y1, z2), - ValCoord(seed, x2, y1, z2), - ValCoord(seed, x3, y1, z2), - xs - ), - CubicLerp( - ValCoord(seed, x0, y2, z2), - ValCoord(seed, x1, y2, z2), - ValCoord(seed, x2, y2, z2), - ValCoord(seed, x3, y2, z2), - xs - ), - CubicLerp( - ValCoord(seed, x0, y3, z2), - ValCoord(seed, x1, y3, z2), - ValCoord(seed, x2, y3, z2), - ValCoord(seed, x3, y3, z2), - xs - ), - ys - ), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z3), - ValCoord(seed, x1, y0, z3), - ValCoord(seed, x2, y0, z3), - ValCoord(seed, x3, y0, z3), - xs - ), - CubicLerp( - ValCoord(seed, x0, y1, z3), - ValCoord(seed, x1, y1, z3), - ValCoord(seed, x2, y1, z3), - ValCoord(seed, x3, y1, z3), - xs - ), - CubicLerp( - ValCoord(seed, x0, y2, z3), - ValCoord(seed, x1, y2, z3), - ValCoord(seed, x2, y2, z3), - ValCoord(seed, x3, y2, z3), - xs - ), - CubicLerp( - ValCoord(seed, x0, y3, z3), - ValCoord(seed, x1, y3, z3), - ValCoord(seed, x2, y3, z3), - ValCoord(seed, x3, y3, z3), - xs - ), - ys - ), - zs - ) * - (1 / (1.5f * 1.5f * 1.5f)) - ); - } - - // Value Noise - - private float SingleValue( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y - ) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - - float xs = InterpHermite((float) (x - x0)); - float ys = InterpHermite((float) (y - y0)); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - float xf0 = Lerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), xs); - float xf1 = Lerp(ValCoord(seed, x0, y1), ValCoord(seed, x1, y1), xs); - - return Lerp(xf0, xf1, ys); - } - - private float SingleValue( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - int z0 = FastFloor(z); - - float xs = InterpHermite((float) (x - x0)); - float ys = InterpHermite((float) (y - y0)); - float zs = InterpHermite((float) (z - z0)); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - float xf00 = Lerp( - ValCoord(seed, x0, y0, z0), - ValCoord(seed, x1, y0, z0), - xs - ); - float xf10 = Lerp( - ValCoord(seed, x0, y1, z0), - ValCoord(seed, x1, y1, z0), - xs - ); - float xf01 = Lerp( - ValCoord(seed, x0, y0, z1), - ValCoord(seed, x1, y0, z1), - xs - ); - float xf11 = Lerp( - ValCoord(seed, x0, y1, z1), - ValCoord(seed, x1, y1, z1), - xs - ); - - float yf0 = Lerp(xf00, xf10, ys); - float yf1 = Lerp(xf01, xf11, ys); - - return Lerp(yf0, yf1, zs); - } - - // Domain Warp - - private void DoSingleDomainWarp( - int seed, - float amp, - float freq, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord - ) { - switch (mDomainWarpType) { - case OpenSimplex2: - SingleDomainWarpSimplexGradient( - seed, - amp * 38.283687591552734375f, - freq, - x, - y, - coord, - false - ); - break; - case OpenSimplex2Reduced: - SingleDomainWarpSimplexGradient( - seed, - amp * 16.0f, - freq, - x, - y, - coord, - true - ); - break; - case BasicGrid: - SingleDomainWarpBasicGrid(seed, amp, freq, x, y, coord); - break; - } - } - - private void DoSingleDomainWarp( - int seed, - float amp, - float freq, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord - ) { - switch (mDomainWarpType) { - case OpenSimplex2: - SingleDomainWarpOpenSimplex2Gradient( - seed, - amp * 32.69428253173828125f, - freq, - x, - y, - z, - coord, - false - ); - break; - case OpenSimplex2Reduced: - SingleDomainWarpOpenSimplex2Gradient( - seed, - amp * 7.71604938271605f, - freq, - x, - y, - z, - coord, - true - ); - break; - case BasicGrid: - SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, coord); - break; - } - } - - // Domain Warp Single Wrapper - - private void DomainWarpSingle(Vector2 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: - { - final /*FMLdouble*/double SQRT3 = - (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - } - - private void DomainWarpSingle(Vector3 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: - { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = - xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: - { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = - xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: - { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - } - - // Domain Warp Fractal Progressive - - private void DomainWarpFractalProgressive(Vector2 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: - { - final /*FMLdouble*/double SQRT3 = - (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - private void DomainWarpFractalProgressive(Vector3 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: - { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = - xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: - { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = - xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: - { - final /*FMLdouble*/double R3 = - (/*FMLdouble*/double) (2.0 / 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - // Domain Warp Fractal Independant - private void DomainWarpFractalIndependent(Vector2 coord) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: - { - final /*FMLdouble*/double SQRT3 = - (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - private void DomainWarpFractalIndependent(Vector3 coord) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: - { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = - xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: - { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = - xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: - { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - // Domain Warp Basic Grid - - private void SingleDomainWarpBasicGrid( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord - ) { - /*FMLdouble*/double xf = x * frequency; - /*FMLdouble*/double yf = y * frequency; - - int x0 = FastFloor(xf); - int y0 = FastFloor(yf); - - float xs = InterpHermite((float) (xf - x0)); - float ys = InterpHermite((float) (yf - y0)); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - int hash0 = Hash(seed, x0, y0) & (255 << 1); - int hash1 = Hash(seed, x1, y0) & (255 << 1); - - float lx0x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); - float ly0x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); - - hash0 = Hash(seed, x0, y1) & (255 << 1); - hash1 = Hash(seed, x1, y1) & (255 << 1); - - float lx1x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); - float ly1x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); - - coord.x += Lerp(lx0x, lx1x, ys) * warpAmp; - coord.y += Lerp(ly0x, ly1x, ys) * warpAmp; - } - - private void SingleDomainWarpBasicGrid( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord - ) { - /*FMLdouble*/double xf = x * frequency; - /*FMLdouble*/double yf = y * frequency; - /*FMLdouble*/double zf = z * frequency; - - int x0 = FastFloor(xf); - int y0 = FastFloor(yf); - int z0 = FastFloor(zf); - - float xs = InterpHermite((float) (xf - x0)); - float ys = InterpHermite((float) (yf - y0)); - float zs = InterpHermite((float) (zf - z0)); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - int hash0 = Hash(seed, x0, y0, z0) & (255 << 2); - int hash1 = Hash(seed, x1, y0, z0) & (255 << 2); - - float lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - float ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - float lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - hash0 = Hash(seed, x0, y1, z0) & (255 << 2); - hash1 = Hash(seed, x1, y1, z0) & (255 << 2); - - float lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - float ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - float lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - float lx0y = Lerp(lx0x, lx1x, ys); - float ly0y = Lerp(ly0x, ly1x, ys); - float lz0y = Lerp(lz0x, lz1x, ys); - - hash0 = Hash(seed, x0, y0, z1) & (255 << 2); - hash1 = Hash(seed, x1, y0, z1) & (255 << 2); - - lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - hash0 = Hash(seed, x0, y1, z1) & (255 << 2); - hash1 = Hash(seed, x1, y1, z1) & (255 << 2); - - lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - coord.x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * warpAmp; - coord.y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * warpAmp; - coord.z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; - } - - // Domain Warp Simplex/OpenSimplex2 - private void SingleDomainWarpSimplexGradient( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord, - boolean outGradOnly - ) { - final float SQRT3 = 1.7320508075688772935274463415059f; - final float G2 = (3 - SQRT3) / 6; - - x *= frequency; - y *= frequency; - - /* - * --- Skew moved to switch statements before fractal evaluation --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - float t = (xi + yi) * G2; - float x0 = (float) (xi - t); - float y0 = (float) (yi - t); - - i *= PrimeX; - j *= PrimeY; - - float vx, vy; - vx = vy = 0; - - float a = 0.5f - x0 * x0 - y0 * y0; - if (a > 0) { - float aaaa = (a * a) * (a * a); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i, j) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i, j); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x0 * xg + y0 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += aaaa * xo; - vy += aaaa * yo; - } - - float c = - (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c > 0) { - float x2 = x0 + (2 * (float) G2 - 1); - float y2 = y0 + (2 * (float) G2 - 1); - float cccc = (c * c) * (c * c); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i + PrimeX, j + PrimeY) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i + PrimeX, j + PrimeY); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x2 * xg + y2 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += cccc * xo; - vy += cccc * yo; - } - - if (y0 > x0) { - float x1 = x0 + (float) G2; - float y1 = y0 + ((float) G2 - 1); - float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) { - float bbbb = (b * b) * (b * b); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i, j + PrimeY) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i, j + PrimeY); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x1 * xg + y1 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += bbbb * xo; - vy += bbbb * yo; - } - } else { - float x1 = x0 + ((float) G2 - 1); - float y1 = y0 + (float) G2; - float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) { - float bbbb = (b * b) * (b * b); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i + PrimeX, j) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i + PrimeX, j); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x1 * xg + y1 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += bbbb * xo; - vy += bbbb * yo; - } - } - - coord.x += vx * warpAmp; - coord.y += vy * warpAmp; - } - - private void SingleDomainWarpOpenSimplex2Gradient( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord, - boolean outGradOnly - ) { - x *= frequency; - y *= frequency; - z *= frequency; - - /* - * --- Rotation moved to switch statements before fractal evaluation --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastRound(x); - int j = FastRound(y); - int k = FastRound(z); - float x0 = (float) x - i; - float y0 = (float) y - j; - float z0 = (float) z - k; - - int xNSign = (int) (-x0 - 1.0f) | 1; - int yNSign = (int) (-y0 - 1.0f) | 1; - int zNSign = (int) (-z0 - 1.0f) | 1; - - float ax0 = xNSign * -x0; - float ay0 = yNSign * -y0; - float az0 = zNSign * -z0; - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - - float vx, vy, vz; - vx = vy = vz = 0; - - float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - for (int l = 0;; l++) { - if (a > 0) { - float aaaa = (a * a) * (a * a); - float xo, yo, zo; - if (outGradOnly) { - int hash = Hash(seed, i, j, k) & (255 << 2); - xo = RandVecs3D[hash]; - yo = RandVecs3D[hash | 1]; - zo = RandVecs3D[hash | 2]; - } else { - int hash = Hash(seed, i, j, k); - int index1 = hash & (63 << 2); - int index2 = (hash >> 6) & (255 << 2); - float xg = Gradients3D[index1]; - float yg = Gradients3D[index1 | 1]; - float zg = Gradients3D[index1 | 2]; - float value = x0 * xg + y0 * yg + z0 * zg; - float xgo = RandVecs3D[index2]; - float ygo = RandVecs3D[index2 | 1]; - float zgo = RandVecs3D[index2 | 2]; - xo = value * xgo; - yo = value * ygo; - zo = value * zgo; - } - vx += aaaa * xo; - vy += aaaa * yo; - vz += aaaa * zo; - } - - float b = a; - int i1 = i; - int j1 = j; - int k1 = k; - float x1 = x0; - float y1 = y0; - float z1 = z0; - - if (ax0 >= ay0 && ax0 >= az0) { - x1 += xNSign; - b = b + ax0 + ax0; - i1 -= xNSign * PrimeX; - } else if (ay0 > ax0 && ay0 >= az0) { - y1 += yNSign; - b = b + ay0 + ay0; - j1 -= yNSign * PrimeY; - } else { - z1 += zNSign; - b = b + az0 + az0; - k1 -= zNSign * PrimeZ; - } - - if (b > 1) { - b -= 1; - float bbbb = (b * b) * (b * b); - float xo, yo, zo; - if (outGradOnly) { - int hash = Hash(seed, i1, j1, k1) & (255 << 2); - xo = RandVecs3D[hash]; - yo = RandVecs3D[hash | 1]; - zo = RandVecs3D[hash | 2]; - } else { - int hash = Hash(seed, i1, j1, k1); - int index1 = hash & (63 << 2); - int index2 = (hash >> 6) & (255 << 2); - float xg = Gradients3D[index1]; - float yg = Gradients3D[index1 | 1]; - float zg = Gradients3D[index1 | 2]; - float value = x1 * xg + y1 * yg + z1 * zg; - float xgo = RandVecs3D[index2]; - float ygo = RandVecs3D[index2 | 1]; - float zgo = RandVecs3D[index2 | 2]; - xo = value * xgo; - yo = value * ygo; - zo = value * zgo; - } - vx += bbbb * xo; - vy += bbbb * yo; - vz += bbbb * zo; - } - - if (l == 1) break; - - ax0 = 0.5f - ax0; - ay0 = 0.5f - ay0; - az0 = 0.5f - az0; - - x0 = xNSign * ax0; - y0 = yNSign * ay0; - z0 = zNSign * az0; - - a += (0.75f - ax0) - (ay0 + az0); - - i += (xNSign >> 1) & PrimeX; - j += (yNSign >> 1) & PrimeY; - k += (zNSign >> 1) & PrimeZ; - - xNSign = -xNSign; - yNSign = -yNSign; - zNSign = -zNSign; - - seed += 1293373; - } - - coord.x += vx * warpAmp; - coord.y += vy * warpAmp; - coord.z += vz * warpAmp; - } - - public static class Vector2 { - - public /*FMLdouble*/double x; - public /*FMLdouble*/double y; - - public Vector2(/*FMLdouble*/double x, /*FMLdouble*/double y) { - this.x = x; - this.y = y; - } - } - - public static class Vector3 { - - public /*FMLdouble*/double x; - public /*FMLdouble*/double y; - public /*FMLdouble*/double z; - - public Vector3( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z - ) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public static FastNoiseLite createSpongePerlin(int seed) { - FastNoiseLite fnlNoise = new FastNoiseLite(seed); - fnlNoise.SetNoiseType(FastNoiseLite.NoiseType.Perlin); // We will use 3D with a domain rotation to improve the look. - fnlNoise.SetRotationType3D( - FastNoiseLite.RotationType3D.ImproveXZPlanes - ); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. - fnlNoise.SetFractalType(FastNoiseLite.FractalType.FBm); - fnlNoise.SetFractalOctaves(6); - return fnlNoise; - } - - private static final double SPONGE_COMPATIBILITY_RATIO = - (2 * Math.sqrt(3.0)) / 1.7252359327388492; - - public static float getSpongePerlinValue(float noise3) { - noise3 = noise3 * 0.5f + 0.5f; // Rescale to 0 to 1 to match new Sponge - noise3 *= (1.0f + 0.5f + 0.25f + 0.125f + 0.0625 + 0.03125); // Counter FastNoiseLite fractal range rescale. - noise3 *= SPONGE_COMPATIBILITY_RATIO; // Now make it match old Sponge. - return noise3; - } + public enum NoiseType { + OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, Value, + } + + public enum RotationType3D { + None, ImproveXYPlanes, ImproveXZPlanes, + } + + public enum FractalType { + None, FBm, Ridged, PingPong, DomainWarpProgressive, DomainWarpIndependent, + } + + public enum CellularDistanceFunction { + Euclidean, EuclideanSq, Manhattan, Hybrid, + } + + public enum CellularReturnType { + CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div, + } + + public enum DomainWarpType { + OpenSimplex2, OpenSimplex2Reduced, BasicGrid, + } + + private enum TransformType3D { + None, ImproveXYPlanes, ImproveXZPlanes, DefaultOpenSimplex2, + } + + private int mSeed = 1337; + private float mFrequency = 0.01f; + private NoiseType mNoiseType = NoiseType.OpenSimplex2; + private RotationType3D mRotationType3D = RotationType3D.None; + private TransformType3D mTransformType3D = TransformType3D.DefaultOpenSimplex2; + + private FractalType mFractalType = FractalType.None; + private int mOctaves = 3; + private float mLacunarity = 2.0f; + private float mGain = 0.5f; + private float mWeightedStrength = 0.0f; + private float mPingPongStength = 2.0f; + + private float mFractalBounding = 1 / 1.75f; + + private CellularDistanceFunction mCellularDistanceFunction = CellularDistanceFunction.EuclideanSq; + private CellularReturnType mCellularReturnType = CellularReturnType.Distance; + private float mCellularJitterModifier = 1.0f; + + private DomainWarpType mDomainWarpType = DomainWarpType.OpenSimplex2; + private TransformType3D mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + private float mDomainWarpAmp = 1.0f; + + /// + /// Create new FastNoise object with default seed + /// + public FastNoiseLite() { + } + + /// + /// Create new FastNoise object with specified seed + /// + public FastNoiseLite(int seed) { + SetSeed(seed); + } + + /// + /// Sets seed used for all noise types + /// + /// + /// Default: 1337 + /// + public void SetSeed(int seed) { + mSeed = seed; + } + + /// + /// Sets frequency for all noise types + /// + /// + /// Default: 0.01 + /// + public void SetFrequency(float frequency) { + mFrequency = frequency; + } + + /// + /// Sets noise algorithm used for GetNoise(...) + /// + /// + /// Default: OpenSimplex2 + /// + public void SetNoiseType(NoiseType noiseType) { + mNoiseType = noiseType; + UpdateTransformType3D(); + } + + /// + /// Sets domain rotation type for 3D Noise and 3D DomainWarp. + /// Can aid in reducing directional artifacts when sampling a 2D plane in 3D + /// + /// + /// Default: None + /// + public void SetRotationType3D(RotationType3D rotationType3D) { + mRotationType3D = rotationType3D; + UpdateTransformType3D(); + UpdateWarpTransformType3D(); + } + + /// + /// Sets method for combining octaves in all fractal noise types + /// + /// + /// Default: None + /// Note: FractalType.DomainWarp... only affects DomainWarp(...) + /// + public void SetFractalType(FractalType fractalType) { + mFractalType = fractalType; + } + + /// + /// Sets octave count for all fractal noise types + /// + /// + /// Default: 3 + /// + public void SetFractalOctaves(int octaves) { + mOctaves = octaves; + CalculateFractalBounding(); + } + + /// + /// Sets octave lacunarity for all fractal noise types + /// + /// + /// Default: 2.0 + /// + public void SetFractalLacunarity(float lacunarity) { + mLacunarity = lacunarity; + } + + /// + /// Sets octave gain for all fractal noise types + /// + /// + /// Default: 0.5 + /// + public void SetFractalGain(float gain) { + mGain = gain; + CalculateFractalBounding(); + } + + /// + /// Sets octave weighting for all none DomainWarp fratal types + /// + /// + /// Default: 0.0 + /// Note: Keep between 0...1 to maintain -1...1 output bounding + /// + public void SetFractalWeightedStrength(float weightedStrength) { + mWeightedStrength = weightedStrength; + } + + /// + /// Sets strength of the fractal ping pong effect + /// + /// + /// Default: 2.0 + /// + public void SetFractalPingPongStrength(float pingPongStrength) { + mPingPongStength = pingPongStrength; + } + + /// + /// Sets distance function used in cellular noise calculations + /// + /// + /// Default: Distance + /// + public void SetCellularDistanceFunction( + CellularDistanceFunction cellularDistanceFunction) { + mCellularDistanceFunction = cellularDistanceFunction; + } + + /// + /// Sets return type from cellular noise calculations + /// + /// + /// Default: EuclideanSq + /// + public void SetCellularReturnType(CellularReturnType cellularReturnType) { + mCellularReturnType = cellularReturnType; + } + + /// + /// Sets the maximum distance a cellular point can move from it's grid position + /// + /// + /// Default: 1.0 + /// Note: Setting this higher than 1 will cause artifacts + /// + public void SetCellularJitter(float cellularJitter) { + mCellularJitterModifier = cellularJitter; + } + + /// + /// Sets the warp algorithm when using DomainWarp(...) + /// + /// + /// Default: OpenSimplex2 + /// + public void SetDomainWarpType(DomainWarpType domainWarpType) { + mDomainWarpType = domainWarpType; + UpdateWarpTransformType3D(); + } + + /// + /// Sets the maximum warp distance from original position when using DomainWarp(...) + /// + /// + /// Default: 1.0 + /// + public void SetDomainWarpAmp(float domainWarpAmp) { + mDomainWarpAmp = domainWarpAmp; + } + + /// + /// 2D noise at given position using current settings + /// + /// + /// Noise output bounded between -1...1 + /// + public float GetNoise(/*FMLdouble*/double x, /*FMLdouble*/double y) { + x *= mFrequency; + y *= mFrequency; + + switch (mNoiseType) { + case OpenSimplex2: + case OpenSimplex2S: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (x + y) * F2; + x += t; + y += t; + } + break; + default: + break; + } + + switch (mFractalType) { + default: + return GenNoiseSingle(mSeed, x, y); + case FBm: + return GenFractalFBm(x, y); + case Ridged: + return GenFractalRidged(x, y); + case PingPong: + return GenFractalPingPong(x, y); + } + } + + /// + /// 3D noise at given position using current settings + /// + /// + /// Noise output bounded between -1...1 + /// + public float GetNoise( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + x *= mFrequency; + y *= mFrequency; + z *= mFrequency; + + switch (mTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = x + y; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + z *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - z; + y = y + s2 - z; + z += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = x + z; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + y *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - y; + z += s2 - y; + y += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + } + break; + default: + break; + } + + switch (mFractalType) { + default: + return GenNoiseSingle(mSeed, x, y, z); + case FBm: + return GenFractalFBm(x, y, z); + case Ridged: + return GenFractalRidged(x, y, z); + case PingPong: + return GenFractalPingPong(x, y, z); + } + } + + /// + /// 2D warps the input position using current domain warp settings + /// + /// + /// Example usage with GetNoise + /// DomainWarp(coord) + /// noise = GetNoise(x, y) + /// + public void DomainWarp(Vector2 coord) { + switch (mFractalType) { + default: + DomainWarpSingle(coord); + break; + case DomainWarpProgressive: + DomainWarpFractalProgressive(coord); + break; + case DomainWarpIndependent: + DomainWarpFractalIndependent(coord); + break; + } + } + + /// + /// 3D warps the input position using current domain warp settings + /// + /// + /// Example usage with GetNoise + /// DomainWarp(coord) + /// noise = GetNoise(x, y, z) + /// + public void DomainWarp(Vector3 coord) { + switch (mFractalType) { + default: + DomainWarpSingle(coord); + break; + case DomainWarpProgressive: + DomainWarpFractalProgressive(coord); + break; + case DomainWarpIndependent: + DomainWarpFractalIndependent(coord); + break; + } + } + + private static final float[] Gradients2D = { + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.923879532511287f, + 0.38268343236509f, + 0.923879532511287f, + -0.38268343236509f, + 0.38268343236509f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + 0.38268343236509f, + -0.38268343236509f, + 0.923879532511287f, + }; + + private static final float[] RandVecs2D = { + -0.2700222198f, + -0.9628540911f, + 0.3863092627f, + -0.9223693152f, + 0.04444859006f, + -0.999011673f, + -0.5992523158f, + -0.8005602176f, + -0.7819280288f, + 0.6233687174f, + 0.9464672271f, + 0.3227999196f, + -0.6514146797f, + -0.7587218957f, + 0.9378472289f, + 0.347048376f, + -0.8497875957f, + -0.5271252623f, + -0.879042592f, + 0.4767432447f, + -0.892300288f, + -0.4514423508f, + -0.379844434f, + -0.9250503802f, + -0.9951650832f, + 0.0982163789f, + 0.7724397808f, + -0.6350880136f, + 0.7573283322f, + -0.6530343002f, + -0.9928004525f, + -0.119780055f, + -0.0532665713f, + 0.9985803285f, + 0.9754253726f, + -0.2203300762f, + -0.7665018163f, + 0.6422421394f, + 0.991636706f, + 0.1290606184f, + -0.994696838f, + 0.1028503788f, + -0.5379205513f, + -0.84299554f, + 0.5022815471f, + -0.8647041387f, + 0.4559821461f, + -0.8899889226f, + -0.8659131224f, + -0.5001944266f, + 0.0879458407f, + -0.9961252577f, + -0.5051684983f, + 0.8630207346f, + 0.7753185226f, + -0.6315704146f, + -0.6921944612f, + 0.7217110418f, + -0.5191659449f, + -0.8546734591f, + 0.8978622882f, + -0.4402764035f, + -0.1706774107f, + 0.9853269617f, + -0.9353430106f, + -0.3537420705f, + -0.9992404798f, + 0.03896746794f, + -0.2882064021f, + -0.9575683108f, + -0.9663811329f, + 0.2571137995f, + -0.8759714238f, + -0.4823630009f, + -0.8303123018f, + -0.5572983775f, + 0.05110133755f, + -0.9986934731f, + -0.8558373281f, + -0.5172450752f, + 0.09887025282f, + 0.9951003332f, + 0.9189016087f, + 0.3944867976f, + -0.2439375892f, + -0.9697909324f, + -0.8121409387f, + -0.5834613061f, + -0.9910431363f, + 0.1335421355f, + 0.8492423985f, + -0.5280031709f, + -0.9717838994f, + -0.2358729591f, + 0.9949457207f, + 0.1004142068f, + 0.6241065508f, + -0.7813392434f, + 0.662910307f, + 0.7486988212f, + -0.7197418176f, + 0.6942418282f, + -0.8143370775f, + -0.5803922158f, + 0.104521054f, + -0.9945226741f, + -0.1065926113f, + -0.9943027784f, + 0.445799684f, + -0.8951327509f, + 0.105547406f, + 0.9944142724f, + -0.992790267f, + 0.1198644477f, + -0.8334366408f, + 0.552615025f, + 0.9115561563f, + -0.4111755999f, + 0.8285544909f, + -0.5599084351f, + 0.7217097654f, + -0.6921957921f, + 0.4940492677f, + -0.8694339084f, + -0.3652321272f, + -0.9309164803f, + -0.9696606758f, + 0.2444548501f, + 0.08925509731f, + -0.996008799f, + 0.5354071276f, + -0.8445941083f, + -0.1053576186f, + 0.9944343981f, + -0.9890284586f, + 0.1477251101f, + 0.004856104961f, + 0.9999882091f, + 0.9885598478f, + 0.1508291331f, + 0.9286129562f, + -0.3710498316f, + -0.5832393863f, + -0.8123003252f, + 0.3015207509f, + 0.9534596146f, + -0.9575110528f, + 0.2883965738f, + 0.9715802154f, + -0.2367105511f, + 0.229981792f, + 0.9731949318f, + 0.955763816f, + -0.2941352207f, + 0.740956116f, + 0.6715534485f, + -0.9971513787f, + -0.07542630764f, + 0.6905710663f, + -0.7232645452f, + -0.290713703f, + -0.9568100872f, + 0.5912777791f, + -0.8064679708f, + -0.9454592212f, + -0.325740481f, + 0.6664455681f, + 0.74555369f, + 0.6236134912f, + 0.7817328275f, + 0.9126993851f, + -0.4086316587f, + -0.8191762011f, + 0.5735419353f, + -0.8812745759f, + -0.4726046147f, + 0.9953313627f, + 0.09651672651f, + 0.9855650846f, + -0.1692969699f, + -0.8495980887f, + 0.5274306472f, + 0.6174853946f, + -0.7865823463f, + 0.8508156371f, + 0.52546432f, + 0.9985032451f, + -0.05469249926f, + 0.1971371563f, + -0.9803759185f, + 0.6607855748f, + -0.7505747292f, + -0.03097494063f, + 0.9995201614f, + -0.6731660801f, + 0.739491331f, + -0.7195018362f, + -0.6944905383f, + 0.9727511689f, + 0.2318515979f, + 0.9997059088f, + -0.0242506907f, + 0.4421787429f, + -0.8969269532f, + 0.9981350961f, + -0.061043673f, + -0.9173660799f, + -0.3980445648f, + -0.8150056635f, + -0.5794529907f, + -0.8789331304f, + 0.4769450202f, + 0.0158605829f, + 0.999874213f, + -0.8095464474f, + 0.5870558317f, + -0.9165898907f, + -0.3998286786f, + -0.8023542565f, + 0.5968480938f, + -0.5176737917f, + 0.8555780767f, + -0.8154407307f, + -0.5788405779f, + 0.4022010347f, + -0.9155513791f, + -0.9052556868f, + -0.4248672045f, + 0.7317445619f, + 0.6815789728f, + -0.5647632201f, + -0.8252529947f, + -0.8403276335f, + -0.5420788397f, + -0.9314281527f, + 0.363925262f, + 0.5238198472f, + 0.8518290719f, + 0.7432803869f, + -0.6689800195f, + -0.985371561f, + -0.1704197369f, + 0.4601468731f, + 0.88784281f, + 0.825855404f, + 0.5638819483f, + 0.6182366099f, + 0.7859920446f, + 0.8331502863f, + -0.553046653f, + 0.1500307506f, + 0.9886813308f, + -0.662330369f, + -0.7492119075f, + -0.668598664f, + 0.743623444f, + 0.7025606278f, + 0.7116238924f, + -0.5419389763f, + -0.8404178401f, + -0.3388616456f, + 0.9408362159f, + 0.8331530315f, + 0.5530425174f, + -0.2989720662f, + -0.9542618632f, + 0.2638522993f, + 0.9645630949f, + 0.124108739f, + -0.9922686234f, + -0.7282649308f, + -0.6852956957f, + 0.6962500149f, + 0.7177993569f, + -0.9183535368f, + 0.3957610156f, + -0.6326102274f, + -0.7744703352f, + -0.9331891859f, + -0.359385508f, + -0.1153779357f, + -0.9933216659f, + 0.9514974788f, + -0.3076565421f, + -0.08987977445f, + -0.9959526224f, + 0.6678496916f, + 0.7442961705f, + 0.7952400393f, + -0.6062947138f, + -0.6462007402f, + -0.7631674805f, + -0.2733598753f, + 0.9619118351f, + 0.9669590226f, + -0.254931851f, + -0.9792894595f, + 0.2024651934f, + -0.5369502995f, + -0.8436138784f, + -0.270036471f, + -0.9628500944f, + -0.6400277131f, + 0.7683518247f, + -0.7854537493f, + -0.6189203566f, + 0.06005905383f, + -0.9981948257f, + -0.02455770378f, + 0.9996984141f, + -0.65983623f, + 0.751409442f, + -0.6253894466f, + -0.7803127835f, + -0.6210408851f, + -0.7837781695f, + 0.8348888491f, + 0.5504185768f, + -0.1592275245f, + 0.9872419133f, + 0.8367622488f, + 0.5475663786f, + -0.8675753916f, + -0.4973056806f, + -0.2022662628f, + -0.9793305667f, + 0.9399189937f, + 0.3413975472f, + 0.9877404807f, + -0.1561049093f, + -0.9034455656f, + 0.4287028224f, + 0.1269804218f, + -0.9919052235f, + -0.3819600854f, + 0.924178821f, + 0.9754625894f, + 0.2201652486f, + -0.3204015856f, + -0.9472818081f, + -0.9874760884f, + 0.1577687387f, + 0.02535348474f, + -0.9996785487f, + 0.4835130794f, + -0.8753371362f, + -0.2850799925f, + -0.9585037287f, + -0.06805516006f, + -0.99768156f, + -0.7885244045f, + -0.6150034663f, + 0.3185392127f, + -0.9479096845f, + 0.8880043089f, + 0.4598351306f, + 0.6476921488f, + -0.7619021462f, + 0.9820241299f, + 0.1887554194f, + 0.9357275128f, + -0.3527237187f, + -0.8894895414f, + 0.4569555293f, + 0.7922791302f, + 0.6101588153f, + 0.7483818261f, + 0.6632681526f, + -0.7288929755f, + -0.6846276581f, + 0.8729032783f, + -0.4878932944f, + 0.8288345784f, + 0.5594937369f, + 0.08074567077f, + 0.9967347374f, + 0.9799148216f, + -0.1994165048f, + -0.580730673f, + -0.8140957471f, + -0.4700049791f, + -0.8826637636f, + 0.2409492979f, + 0.9705377045f, + 0.9437816757f, + -0.3305694308f, + -0.8927998638f, + -0.4504535528f, + -0.8069622304f, + 0.5906030467f, + 0.06258973166f, + 0.9980393407f, + -0.9312597469f, + 0.3643559849f, + 0.5777449785f, + 0.8162173362f, + -0.3360095855f, + -0.941858566f, + 0.697932075f, + -0.7161639607f, + -0.002008157227f, + -0.9999979837f, + -0.1827294312f, + -0.9831632392f, + -0.6523911722f, + 0.7578824173f, + -0.4302626911f, + -0.9027037258f, + -0.9985126289f, + -0.05452091251f, + -0.01028102172f, + -0.9999471489f, + -0.4946071129f, + 0.8691166802f, + -0.2999350194f, + 0.9539596344f, + 0.8165471961f, + 0.5772786819f, + 0.2697460475f, + 0.962931498f, + -0.7306287391f, + -0.6827749597f, + -0.7590952064f, + -0.6509796216f, + -0.907053853f, + 0.4210146171f, + -0.5104861064f, + -0.8598860013f, + 0.8613350597f, + 0.5080373165f, + 0.5007881595f, + -0.8655698812f, + -0.654158152f, + 0.7563577938f, + -0.8382755311f, + -0.545246856f, + 0.6940070834f, + 0.7199681717f, + 0.06950936031f, + 0.9975812994f, + 0.1702942185f, + -0.9853932612f, + 0.2695973274f, + 0.9629731466f, + 0.5519612192f, + -0.8338697815f, + 0.225657487f, + -0.9742067022f, + 0.4215262855f, + -0.9068161835f, + 0.4881873305f, + -0.8727388672f, + -0.3683854996f, + -0.9296731273f, + -0.9825390578f, + 0.1860564427f, + 0.81256471f, + 0.5828709909f, + 0.3196460933f, + -0.9475370046f, + 0.9570913859f, + 0.2897862643f, + -0.6876655497f, + -0.7260276109f, + -0.9988770922f, + -0.047376731f, + -0.1250179027f, + 0.992154486f, + -0.8280133617f, + 0.560708367f, + 0.9324863769f, + -0.3612051451f, + 0.6394653183f, + 0.7688199442f, + -0.01623847064f, + -0.9998681473f, + -0.9955014666f, + -0.09474613458f, + -0.81453315f, + 0.580117012f, + 0.4037327978f, + -0.9148769469f, + 0.9944263371f, + 0.1054336766f, + -0.1624711654f, + 0.9867132919f, + -0.9949487814f, + -0.100383875f, + -0.6995302564f, + 0.7146029809f, + 0.5263414922f, + -0.85027327f, + -0.5395221479f, + 0.841971408f, + 0.6579370318f, + 0.7530729462f, + 0.01426758847f, + -0.9998982128f, + -0.6734383991f, + 0.7392433447f, + 0.639412098f, + -0.7688642071f, + 0.9211571421f, + 0.3891908523f, + -0.146637214f, + -0.9891903394f, + -0.782318098f, + 0.6228791163f, + -0.5039610839f, + -0.8637263605f, + -0.7743120191f, + -0.6328039957f, + }; + + private static final float[] Gradients3D = { + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + -1, + 1, + 0, + -1, + 1, + 0, + 0, + 0, + -1, + -1, + 0, + }; + + private static final float[] RandVecs3D = { + -0.7292736885f, + -0.6618439697f, + 0.1735581948f, + 0, + 0.790292081f, + -0.5480887466f, + -0.2739291014f, + 0, + 0.7217578935f, + 0.6226212466f, + -0.3023380997f, + 0, + 0.565683137f, + -0.8208298145f, + -0.0790000257f, + 0, + 0.760049034f, + -0.5555979497f, + -0.3370999617f, + 0, + 0.3713945616f, + 0.5011264475f, + 0.7816254623f, + 0, + -0.1277062463f, + -0.4254438999f, + -0.8959289049f, + 0, + -0.2881560924f, + -0.5815838982f, + 0.7607405838f, + 0, + 0.5849561111f, + -0.662820239f, + -0.4674352136f, + 0, + 0.3307171178f, + 0.0391653737f, + 0.94291689f, + 0, + 0.8712121778f, + -0.4113374369f, + -0.2679381538f, + 0, + 0.580981015f, + 0.7021915846f, + 0.4115677815f, + 0, + 0.503756873f, + 0.6330056931f, + -0.5878203852f, + 0, + 0.4493712205f, + 0.601390195f, + 0.6606022552f, + 0, + -0.6878403724f, + 0.09018890807f, + -0.7202371714f, + 0, + -0.5958956522f, + -0.6469350577f, + 0.475797649f, + 0, + -0.5127052122f, + 0.1946921978f, + -0.8361987284f, + 0, + -0.9911507142f, + -0.05410276466f, + -0.1212153153f, + 0, + -0.2149721042f, + 0.9720882117f, + -0.09397607749f, + 0, + -0.7518650936f, + -0.5428057603f, + 0.3742469607f, + 0, + 0.5237068895f, + 0.8516377189f, + -0.02107817834f, + 0, + 0.6333504779f, + 0.1926167129f, + -0.7495104896f, + 0, + -0.06788241606f, + 0.3998305789f, + 0.9140719259f, + 0, + -0.5538628599f, + -0.4729896695f, + -0.6852128902f, + 0, + -0.7261455366f, + -0.5911990757f, + 0.3509933228f, + 0, + -0.9229274737f, + -0.1782808786f, + 0.3412049336f, + 0, + -0.6968815002f, + 0.6511274338f, + 0.3006480328f, + 0, + 0.9608044783f, + -0.2098363234f, + -0.1811724921f, + 0, + 0.06817146062f, + -0.9743405129f, + 0.2145069156f, + 0, + -0.3577285196f, + -0.6697087264f, + -0.6507845481f, + 0, + -0.1868621131f, + 0.7648617052f, + -0.6164974636f, + 0, + -0.6541697588f, + 0.3967914832f, + 0.6439087246f, + 0, + 0.6993340405f, + -0.6164538506f, + 0.3618239211f, + 0, + -0.1546665739f, + 0.6291283928f, + 0.7617583057f, + 0, + -0.6841612949f, + -0.2580482182f, + -0.6821542638f, + 0, + 0.5383980957f, + 0.4258654885f, + 0.7271630328f, + 0, + -0.5026987823f, + -0.7939832935f, + -0.3418836993f, + 0, + 0.3202971715f, + 0.2834415347f, + 0.9039195862f, + 0, + 0.8683227101f, + -0.0003762656404f, + -0.4959995258f, + 0, + 0.791120031f, + -0.08511045745f, + 0.6057105799f, + 0, + -0.04011016052f, + -0.4397248749f, + 0.8972364289f, + 0, + 0.9145119872f, + 0.3579346169f, + -0.1885487608f, + 0, + -0.9612039066f, + -0.2756484276f, + 0.01024666929f, + 0, + 0.6510361721f, + -0.2877799159f, + -0.7023778346f, + 0, + -0.2041786351f, + 0.7365237271f, + 0.644859585f, + 0, + -0.7718263711f, + 0.3790626912f, + 0.5104855816f, + 0, + -0.3060082741f, + -0.7692987727f, + 0.5608371729f, + 0, + 0.454007341f, + -0.5024843065f, + 0.7357899537f, + 0, + 0.4816795475f, + 0.6021208291f, + -0.6367380315f, + 0, + 0.6961980369f, + -0.3222197429f, + 0.641469197f, + 0, + -0.6532160499f, + -0.6781148932f, + 0.3368515753f, + 0, + 0.5089301236f, + -0.6154662304f, + -0.6018234363f, + 0, + -0.1635919754f, + -0.9133604627f, + -0.372840892f, + 0, + 0.52408019f, + -0.8437664109f, + 0.1157505864f, + 0, + 0.5902587356f, + 0.4983817807f, + -0.6349883666f, + 0, + 0.5863227872f, + 0.494764745f, + 0.6414307729f, + 0, + 0.6779335087f, + 0.2341345225f, + 0.6968408593f, + 0, + 0.7177054546f, + -0.6858979348f, + 0.120178631f, + 0, + -0.5328819713f, + -0.5205125012f, + 0.6671608058f, + 0, + -0.8654874251f, + -0.0700727088f, + -0.4960053754f, + 0, + -0.2861810166f, + 0.7952089234f, + 0.5345495242f, + 0, + -0.04849529634f, + 0.9810836427f, + -0.1874115585f, + 0, + -0.6358521667f, + 0.6058348682f, + 0.4781800233f, + 0, + 0.6254794696f, + -0.2861619734f, + 0.7258696564f, + 0, + -0.2585259868f, + 0.5061949264f, + -0.8227581726f, + 0, + 0.02136306781f, + 0.5064016808f, + -0.8620330371f, + 0, + 0.200111773f, + 0.8599263484f, + 0.4695550591f, + 0, + 0.4743561372f, + 0.6014985084f, + -0.6427953014f, + 0, + 0.6622993731f, + -0.5202474575f, + -0.5391679918f, + 0, + 0.08084972818f, + -0.6532720452f, + 0.7527940996f, + 0, + -0.6893687501f, + 0.0592860349f, + 0.7219805347f, + 0, + -0.1121887082f, + -0.9673185067f, + 0.2273952515f, + 0, + 0.7344116094f, + 0.5979668656f, + -0.3210532909f, + 0, + 0.5789393465f, + -0.2488849713f, + 0.7764570201f, + 0, + 0.6988182827f, + 0.3557169806f, + -0.6205791146f, + 0, + -0.8636845529f, + -0.2748771249f, + -0.4224826141f, + 0, + -0.4247027957f, + -0.4640880967f, + 0.777335046f, + 0, + 0.5257722489f, + -0.8427017621f, + 0.1158329937f, + 0, + 0.9343830603f, + 0.316302472f, + -0.1639543925f, + 0, + -0.1016836419f, + -0.8057303073f, + -0.5834887393f, + 0, + -0.6529238969f, + 0.50602126f, + -0.5635892736f, + 0, + -0.2465286165f, + -0.9668205684f, + -0.06694497494f, + 0, + -0.9776897119f, + -0.2099250524f, + -0.007368825344f, + 0, + 0.7736893337f, + 0.5734244712f, + 0.2694238123f, + 0, + -0.6095087895f, + 0.4995678998f, + 0.6155736747f, + 0, + 0.5794535482f, + 0.7434546771f, + 0.3339292269f, + 0, + -0.8226211154f, + 0.08142581855f, + 0.5627293636f, + 0, + -0.510385483f, + 0.4703667658f, + 0.7199039967f, + 0, + -0.5764971849f, + -0.07231656274f, + -0.8138926898f, + 0, + 0.7250628871f, + 0.3949971505f, + -0.5641463116f, + 0, + -0.1525424005f, + 0.4860840828f, + -0.8604958341f, + 0, + -0.5550976208f, + -0.4957820792f, + 0.667882296f, + 0, + -0.1883614327f, + 0.9145869398f, + 0.357841725f, + 0, + 0.7625556724f, + -0.5414408243f, + -0.3540489801f, + 0, + -0.5870231946f, + -0.3226498013f, + -0.7424963803f, + 0, + 0.3051124198f, + 0.2262544068f, + -0.9250488391f, + 0, + 0.6379576059f, + 0.577242424f, + -0.5097070502f, + 0, + -0.5966775796f, + 0.1454852398f, + -0.7891830656f, + 0, + -0.658330573f, + 0.6555487542f, + -0.3699414651f, + 0, + 0.7434892426f, + 0.2351084581f, + 0.6260573129f, + 0, + 0.5562114096f, + 0.8264360377f, + -0.0873632843f, + 0, + -0.3028940016f, + -0.8251527185f, + 0.4768419182f, + 0, + 0.1129343818f, + -0.985888439f, + -0.1235710781f, + 0, + 0.5937652891f, + -0.5896813806f, + 0.5474656618f, + 0, + 0.6757964092f, + -0.5835758614f, + -0.4502648413f, + 0, + 0.7242302609f, + -0.1152719764f, + 0.6798550586f, + 0, + -0.9511914166f, + 0.0753623979f, + -0.2992580792f, + 0, + 0.2539470961f, + -0.1886339355f, + 0.9486454084f, + 0, + 0.571433621f, + -0.1679450851f, + -0.8032795685f, + 0, + -0.06778234979f, + 0.3978269256f, + 0.9149531629f, + 0, + 0.6074972649f, + 0.733060024f, + -0.3058922593f, + 0, + -0.5435478392f, + 0.1675822484f, + 0.8224791405f, + 0, + -0.5876678086f, + -0.3380045064f, + -0.7351186982f, + 0, + -0.7967562402f, + 0.04097822706f, + -0.6029098428f, + 0, + -0.1996350917f, + 0.8706294745f, + 0.4496111079f, + 0, + -0.02787660336f, + -0.9106232682f, + -0.4122962022f, + 0, + -0.7797625996f, + -0.6257634692f, + 0.01975775581f, + 0, + -0.5211232846f, + 0.7401644346f, + -0.4249554471f, + 0, + 0.8575424857f, + 0.4053272873f, + -0.3167501783f, + 0, + 0.1045223322f, + 0.8390195772f, + -0.5339674439f, + 0, + 0.3501822831f, + 0.9242524096f, + -0.1520850155f, + 0, + 0.1987849858f, + 0.07647613266f, + 0.9770547224f, + 0, + 0.7845996363f, + 0.6066256811f, + -0.1280964233f, + 0, + 0.09006737436f, + -0.9750989929f, + -0.2026569073f, + 0, + -0.8274343547f, + -0.542299559f, + 0.1458203587f, + 0, + -0.3485797732f, + -0.415802277f, + 0.840000362f, + 0, + -0.2471778936f, + -0.7304819962f, + -0.6366310879f, + 0, + -0.3700154943f, + 0.8577948156f, + 0.3567584454f, + 0, + 0.5913394901f, + -0.548311967f, + -0.5913303597f, + 0, + 0.1204873514f, + -0.7626472379f, + -0.6354935001f, + 0, + 0.616959265f, + 0.03079647928f, + 0.7863922953f, + 0, + 0.1258156836f, + -0.6640829889f, + -0.7369967419f, + 0, + -0.6477565124f, + -0.1740147258f, + -0.7417077429f, + 0, + 0.6217889313f, + -0.7804430448f, + -0.06547655076f, + 0, + 0.6589943422f, + -0.6096987708f, + 0.4404473475f, + 0, + -0.2689837504f, + -0.6732403169f, + -0.6887635427f, + 0, + -0.3849775103f, + 0.5676542638f, + 0.7277093879f, + 0, + 0.5754444408f, + 0.8110471154f, + -0.1051963504f, + 0, + 0.9141593684f, + 0.3832947817f, + 0.131900567f, + 0, + -0.107925319f, + 0.9245493968f, + 0.3654593525f, + 0, + 0.377977089f, + 0.3043148782f, + 0.8743716458f, + 0, + -0.2142885215f, + -0.8259286236f, + 0.5214617324f, + 0, + 0.5802544474f, + 0.4148098596f, + -0.7008834116f, + 0, + -0.1982660881f, + 0.8567161266f, + -0.4761596756f, + 0, + -0.03381553704f, + 0.3773180787f, + -0.9254661404f, + 0, + -0.6867922841f, + -0.6656597827f, + 0.2919133642f, + 0, + 0.7731742607f, + -0.2875793547f, + -0.5652430251f, + 0, + -0.09655941928f, + 0.9193708367f, + -0.3813575004f, + 0, + 0.2715702457f, + -0.9577909544f, + -0.09426605581f, + 0, + 0.2451015704f, + -0.6917998565f, + -0.6792188003f, + 0, + 0.977700782f, + -0.1753855374f, + 0.1155036542f, + 0, + -0.5224739938f, + 0.8521606816f, + 0.02903615945f, + 0, + -0.7734880599f, + -0.5261292347f, + 0.3534179531f, + 0, + -0.7134492443f, + -0.269547243f, + 0.6467878011f, + 0, + 0.1644037271f, + 0.5105846203f, + -0.8439637196f, + 0, + 0.6494635788f, + 0.05585611296f, + 0.7583384168f, + 0, + -0.4711970882f, + 0.5017280509f, + -0.7254255765f, + 0, + -0.6335764307f, + -0.2381686273f, + -0.7361091029f, + 0, + -0.9021533097f, + -0.270947803f, + -0.3357181763f, + 0, + -0.3793711033f, + 0.872258117f, + 0.3086152025f, + 0, + -0.6855598966f, + -0.3250143309f, + 0.6514394162f, + 0, + 0.2900942212f, + -0.7799057743f, + -0.5546100667f, + 0, + -0.2098319339f, + 0.85037073f, + 0.4825351604f, + 0, + -0.4592603758f, + 0.6598504336f, + -0.5947077538f, + 0, + 0.8715945488f, + 0.09616365406f, + -0.4807031248f, + 0, + -0.6776666319f, + 0.7118504878f, + -0.1844907016f, + 0, + 0.7044377633f, + 0.312427597f, + 0.637304036f, + 0, + -0.7052318886f, + -0.2401093292f, + -0.6670798253f, + 0, + 0.081921007f, + -0.7207336136f, + -0.6883545647f, + 0, + -0.6993680906f, + -0.5875763221f, + -0.4069869034f, + 0, + -0.1281454481f, + 0.6419895885f, + 0.7559286424f, + 0, + -0.6337388239f, + -0.6785471501f, + -0.3714146849f, + 0, + 0.5565051903f, + -0.2168887573f, + -0.8020356851f, + 0, + -0.5791554484f, + 0.7244372011f, + -0.3738578718f, + 0, + 0.1175779076f, + -0.7096451073f, + 0.6946792478f, + 0, + -0.6134619607f, + 0.1323631078f, + 0.7785527795f, + 0, + 0.6984635305f, + -0.02980516237f, + -0.715024719f, + 0, + 0.8318082963f, + -0.3930171956f, + 0.3919597455f, + 0, + 0.1469576422f, + 0.05541651717f, + -0.9875892167f, + 0, + 0.708868575f, + -0.2690503865f, + 0.6520101478f, + 0, + 0.2726053183f, + 0.67369766f, + -0.68688995f, + 0, + -0.6591295371f, + 0.3035458599f, + -0.6880466294f, + 0, + 0.4815131379f, + -0.7528270071f, + 0.4487723203f, + 0, + 0.9430009463f, + 0.1675647412f, + -0.2875261255f, + 0, + 0.434802957f, + 0.7695304522f, + -0.4677277752f, + 0, + 0.3931996188f, + 0.594473625f, + 0.7014236729f, + 0, + 0.7254336655f, + -0.603925654f, + 0.3301814672f, + 0, + 0.7590235227f, + -0.6506083235f, + 0.02433313207f, + 0, + -0.8552768592f, + -0.3430042733f, + 0.3883935666f, + 0, + -0.6139746835f, + 0.6981725247f, + 0.3682257648f, + 0, + -0.7465905486f, + -0.5752009504f, + 0.3342849376f, + 0, + 0.5730065677f, + 0.810555537f, + -0.1210916791f, + 0, + -0.9225877367f, + -0.3475211012f, + -0.167514036f, + 0, + -0.7105816789f, + -0.4719692027f, + -0.5218416899f, + 0, + -0.08564609717f, + 0.3583001386f, + 0.929669703f, + 0, + -0.8279697606f, + -0.2043157126f, + 0.5222271202f, + 0, + 0.427944023f, + 0.278165994f, + 0.8599346446f, + 0, + 0.5399079671f, + -0.7857120652f, + -0.3019204161f, + 0, + 0.5678404253f, + -0.5495413974f, + -0.6128307303f, + 0, + -0.9896071041f, + 0.1365639107f, + -0.04503418428f, + 0, + -0.6154342638f, + -0.6440875597f, + 0.4543037336f, + 0, + 0.1074204368f, + -0.7946340692f, + 0.5975094525f, + 0, + -0.3595449969f, + -0.8885529948f, + 0.28495784f, + 0, + -0.2180405296f, + 0.1529888965f, + 0.9638738118f, + 0, + -0.7277432317f, + -0.6164050508f, + -0.3007234646f, + 0, + 0.7249729114f, + -0.00669719484f, + 0.6887448187f, + 0, + -0.5553659455f, + -0.5336586252f, + 0.6377908264f, + 0, + 0.5137558015f, + 0.7976208196f, + -0.3160000073f, + 0, + -0.3794024848f, + 0.9245608561f, + -0.03522751494f, + 0, + 0.8229248658f, + 0.2745365933f, + -0.4974176556f, + 0, + -0.5404114394f, + 0.6091141441f, + 0.5804613989f, + 0, + 0.8036581901f, + -0.2703029469f, + 0.5301601931f, + 0, + 0.6044318879f, + 0.6832968393f, + 0.4095943388f, + 0, + 0.06389988817f, + 0.9658208605f, + -0.2512108074f, + 0, + 0.1087113286f, + 0.7402471173f, + -0.6634877936f, + 0, + -0.713427712f, + -0.6926784018f, + 0.1059128479f, + 0, + 0.6458897819f, + -0.5724548511f, + -0.5050958653f, + 0, + -0.6553931414f, + 0.7381471625f, + 0.159995615f, + 0, + 0.3910961323f, + 0.9188871375f, + -0.05186755998f, + 0, + -0.4879022471f, + -0.5904376907f, + 0.6429111375f, + 0, + 0.6014790094f, + 0.7707441366f, + -0.2101820095f, + 0, + -0.5677173047f, + 0.7511360995f, + 0.3368851762f, + 0, + 0.7858573506f, + 0.226674665f, + 0.5753666838f, + 0, + -0.4520345543f, + -0.604222686f, + -0.6561857263f, + 0, + 0.002272116345f, + 0.4132844051f, + -0.9105991643f, + 0, + -0.5815751419f, + -0.5162925989f, + 0.6286591339f, + 0, + -0.03703704785f, + 0.8273785755f, + 0.5604221175f, + 0, + -0.5119692504f, + 0.7953543429f, + -0.3244980058f, + 0, + -0.2682417366f, + -0.9572290247f, + -0.1084387619f, + 0, + -0.2322482736f, + -0.9679131102f, + -0.09594243324f, + 0, + 0.3554328906f, + -0.8881505545f, + 0.2913006227f, + 0, + 0.7346520519f, + -0.4371373164f, + 0.5188422971f, + 0, + 0.9985120116f, + 0.04659011161f, + -0.02833944577f, + 0, + -0.3727687496f, + -0.9082481361f, + 0.1900757285f, + 0, + 0.91737377f, + -0.3483642108f, + 0.1925298489f, + 0, + 0.2714911074f, + 0.4147529736f, + -0.8684886582f, + 0, + 0.5131763485f, + -0.7116334161f, + 0.4798207128f, + 0, + -0.8737353606f, + 0.18886992f, + -0.4482350644f, + 0, + 0.8460043821f, + -0.3725217914f, + 0.3814499973f, + 0, + 0.8978727456f, + -0.1780209141f, + -0.4026575304f, + 0, + 0.2178065647f, + -0.9698322841f, + -0.1094789531f, + 0, + -0.1518031304f, + -0.7788918132f, + -0.6085091231f, + 0, + -0.2600384876f, + -0.4755398075f, + -0.8403819825f, + 0, + 0.572313509f, + -0.7474340931f, + -0.3373418503f, + 0, + -0.7174141009f, + 0.1699017182f, + -0.6756111411f, + 0, + -0.684180784f, + 0.02145707593f, + -0.7289967412f, + 0, + -0.2007447902f, + 0.06555605789f, + -0.9774476623f, + 0, + -0.1148803697f, + -0.8044887315f, + 0.5827524187f, + 0, + -0.7870349638f, + 0.03447489231f, + 0.6159443543f, + 0, + -0.2015596421f, + 0.6859872284f, + 0.6991389226f, + 0, + -0.08581082512f, + -0.10920836f, + -0.9903080513f, + 0, + 0.5532693395f, + 0.7325250401f, + -0.396610771f, + 0, + -0.1842489331f, + -0.9777375055f, + -0.1004076743f, + 0, + 0.0775473789f, + -0.9111505856f, + 0.4047110257f, + 0, + 0.1399838409f, + 0.7601631212f, + -0.6344734459f, + 0, + 0.4484419361f, + -0.845289248f, + 0.2904925424f, + 0, + }; + + private static float FastMin(float a, float b) { + return a < b ? a : b; + } + + private static float FastMax(float a, float b) { + return a > b ? a : b; + } + + private static float FastAbs(float f) { + return f < 0 ? -f : f; + } + + private static float FastSqrt(float f) { + return (float) Math.sqrt(f); + } + + private static int FastFloor(/*FMLdouble*/double f) { + return f >= 0 ? (int) f : (int) f - 1; + } + + private static int FastRound(/*FMLdouble*/double f) { + return f >= 0 ? (int) (f + 0.5f) : (int) (f - 0.5f); + } + + private static float Lerp(float a, float b, float t) { + return a + t * (b - a); + } + + private static float InterpHermite(float t) { + return t * t * (3 - 2 * t); + } + + private static float InterpQuintic(float t) { + return t * t * t * (t * (t * 6 - 15) + 10); + } + + private static float CubicLerp( + float a, + float b, + float c, + float d, + float t) { + float p = (d - c) - (a - b); + return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; + } + + private static float PingPong(float t) { + t -= (int) (t * 0.5f) * 2; + return t < 1 ? t : 2 - t; + } + + private void CalculateFractalBounding() { + float gain = FastAbs(mGain); + float amp = gain; + float ampFractal = 1.0f; + for (int i = 1; i < mOctaves; i++) { + ampFractal += amp; + amp *= gain; + } + mFractalBounding = 1 / ampFractal; + } + + // Hashing + private static final int PrimeX = 501125321; + private static final int PrimeY = 1136930381; + private static final int PrimeZ = 1720413743; + + private static int Hash(int seed, int xPrimed, int yPrimed) { + int hash = seed ^ xPrimed ^ yPrimed; + + hash *= 0x27d4eb2d; + return hash; + } + + private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { + int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed; + + hash *= 0x27d4eb2d; + return hash; + } + + private static float ValCoord(int seed, int xPrimed, int yPrimed) { + int hash = Hash(seed, xPrimed, yPrimed); + + hash *= hash; + hash ^= hash << 19; + return hash * (1 / 2147483648.0f); + } + + private static float ValCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + + hash *= hash; + hash ^= hash << 19; + return hash * (1 / 2147483648.0f); + } + + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + float xd, + float yd) { + int hash = Hash(seed, xPrimed, yPrimed); + hash ^= hash >> 15; + hash &= 127 << 1; + + float xg = Gradients2D[hash]; + float yg = Gradients2D[hash | 1]; + + return xd * xg + yd * yg; + } + + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed, + float xd, + float yd, + float zd) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + hash ^= hash >> 15; + hash &= 63 << 2; + + float xg = Gradients3D[hash]; + float yg = Gradients3D[hash | 1]; + float zg = Gradients3D[hash | 2]; + + return xd * xg + yd * yg + zd * zg; + } + + // Generic noise gen + + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + switch (mNoiseType) { + case OpenSimplex2: + return SingleSimplex(seed, x, y); + case OpenSimplex2S: + return SingleOpenSimplex2S(seed, x, y); + case Cellular: + return SingleCellular(seed, x, y); + case Perlin: + return SinglePerlin(seed, x, y); + case ValueCubic: + return SingleValueCubic(seed, x, y); + case Value: + return SingleValue(seed, x, y); + default: + return 0; + } + } + + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + switch (mNoiseType) { + case OpenSimplex2: + return SingleOpenSimplex2(seed, x, y, z); + case OpenSimplex2S: + return SingleOpenSimplex2S(seed, x, y, z); + case Cellular: + return SingleCellular(seed, x, y, z); + case Perlin: + return SinglePerlin(seed, x, y, z); + case ValueCubic: + return SingleValueCubic(seed, x, y, z); + case Value: + return SingleValue(seed, x, y, z); + default: + return 0; + } + } + + // Noise Coordinate Transforms (frequency, and possible skew or rotation) + + private void UpdateTransformType3D() { + switch (mRotationType3D) { + case ImproveXYPlanes: + mTransformType3D = TransformType3D.ImproveXYPlanes; + break; + case ImproveXZPlanes: + mTransformType3D = TransformType3D.ImproveXZPlanes; + break; + default: + switch (mNoiseType) { + case OpenSimplex2: + case OpenSimplex2S: + mTransformType3D = TransformType3D.DefaultOpenSimplex2; + break; + default: + mTransformType3D = TransformType3D.None; + break; + } + break; + } + } + + private void UpdateWarpTransformType3D() { + switch (mRotationType3D) { + case ImproveXYPlanes: + mWarpTransformType3D = TransformType3D.ImproveXYPlanes; + break; + case ImproveXZPlanes: + mWarpTransformType3D = TransformType3D.ImproveXZPlanes; + break; + default: + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: + mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + break; + default: + mWarpTransformType3D = TransformType3D.None; + break; + } + break; + } + } + + // Fractal FBm + + private float GenFractalFBm(/*FMLdouble*/double x, /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = GenNoiseSingle(seed++, x, y); + sum += noise * amp; + amp *= Lerp(1.0f, FastMin(noise + 1, 2) * 0.5f, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalFBm( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = GenNoiseSingle(seed++, x, y, z); + sum += noise * amp; + amp *= Lerp(1.0f, (noise + 1) * 0.5f, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Fractal Ridged + + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = FastAbs(GenNoiseSingle(seed++, x, y)); + sum += (noise * -2 + 1) * amp; + amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = FastAbs(GenNoiseSingle(seed++, x, y, z)); + sum += (noise * -2 + 1) * amp; + amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Fractal PingPong + + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength); + sum += (noise - 0.5f) * 2 * amp; + amp *= Lerp(1.0f, noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength); + sum += (noise - 0.5f) * 2 * amp; + amp *= Lerp(1.0f, noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Simplex/OpenSimplex2 Noise + + private float SingleSimplex( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. + + final float SQRT3 = 1.7320508075688772935274463415059f; + final float G2 = (3 - SQRT3) / 6; + + /* + * --- Skew moved to switch statements before fractal evaluation --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + float t = (xi + yi) * G2; + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); + + i *= PrimeX; + j *= PrimeY; + + float n0, n1, n2; + + float a = 0.5f - x0 * x0 - y0 * y0; + if (a <= 0) + n0 = 0; + else { + n0 = (a * a) * (a * a) * GradCoord(seed, i, j, x0, y0); + } + + float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c <= 0) + n2 = 0; + else { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); + n2 = (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); + } + + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); + float b = 0.5f - x1 * x1 - y1 * y1; + if (b <= 0) + n1 = 0; + else { + n1 = (b * b) * (b * b) * GradCoord(seed, i, j + PrimeY, x1, y1); + } + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; + float b = 0.5f - x1 * x1 - y1 * y1; + if (b <= 0) + n1 = 0; + else { + n1 = (b * b) * (b * b) * GradCoord(seed, i + PrimeX, j, x1, y1); + } + } + + return (n0 + n1 + n2) * 99.83685446303647f; + } + + private float SingleOpenSimplex2( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + // 3D OpenSimplex2 case uses two offset rotated cube grids. + + /* + * --- Rotation moved to switch statements before fractal evaluation --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastRound(x); + int j = FastRound(y); + int k = FastRound(z); + float x0 = (float) (x - i); + float y0 = (float) (y - j); + float z0 = (float) (z - k); + + int xNSign = (int) (-1.0f - x0) | 1; + int yNSign = (int) (-1.0f - y0) | 1; + int zNSign = (int) (-1.0f - z0) | 1; + + float ax0 = xNSign * -x0; + float ay0 = yNSign * -y0; + float az0 = zNSign * -z0; + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + + float value = 0; + float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + + for (int l = 0;; l++) { + if (a > 0) { + value += (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); + } + + if (ax0 >= ay0 && ax0 >= az0) { + float b = a + ax0 + ax0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i - xNSign * PrimeX, + j, + k, + x0 + xNSign, + y0, + z0); + } + } else if (ay0 > ax0 && ay0 >= az0) { + float b = a + ay0 + ay0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i, + j - yNSign * PrimeY, + k, + x0, + y0 + yNSign, + z0); + } + } else { + float b = a + az0 + az0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i, + j, + k - zNSign * PrimeZ, + x0, + y0, + z0 + zNSign); + } + } + + if (l == 1) + break; + + ax0 = 0.5f - ax0; + ay0 = 0.5f - ay0; + az0 = 0.5f - az0; + + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; + + a += (0.75f - ax0) - (ay0 + az0); + + i += (xNSign >> 1) & PrimeX; + j += (yNSign >> 1) & PrimeY; + k += (zNSign >> 1) & PrimeZ; + + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; + + seed = ~seed; + } + + return value * 32.69428253173828125f; + } + + // OpenSimplex2S Noise + + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + // 2D OpenSimplex2S case is a modified 2D simplex noise. + + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double G2 = (3 - SQRT3) / 6; + + /* + * --- Skew moved to TransformNoiseCoordinate method --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + i *= PrimeX; + j *= PrimeY; + int i1 = i + PrimeX; + int j1 = j + PrimeY; + + float t = (xi + yi) * (float) G2; + float x0 = xi - t; + float y0 = yi - t; + + float a0 = (2.0f / 3.0f) - x0 * x0 - y0 * y0; + float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, i, j, x0, y0); + + float a1 = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); + float x1 = x0 - (float) (1 - 2 * G2); + float y1 = y0 - (float) (1 - 2 * G2); + value += (a1 * a1) * (a1 * a1) * GradCoord(seed, i1, j1, x1, y1); + + // Nested conditionals were faster than compact bit logic/arithmetic. + float xmyi = xi - yi; + if (t > G2) { + if (xi + xmyi > 1) { + float x2 = x0 + (float) (3 * G2 - 2); + float y2 = y0 + (float) (3 * G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); + } + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); + } + } + + if (yi - xmyi > 1) { + float x3 = x0 + (float) (3 * G2 - 1); + float y3 = y0 + (float) (3 * G2 - 2); + float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; + if (a3 > 0) { + value += (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); + } + } else { + float x3 = x0 + (float) (G2 - 1); + float y3 = y0 + (float) G2; + float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; + if (a3 > 0) { + value += (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j, x3, y3); + } + } + } else { + if (xi + xmyi < 0) { + float x2 = x0 + (float) (1 - G2); + float y2 = y0 - (float) G2; + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i - PrimeX, j, x2, y2); + } + } else { + float x2 = x0 + (float) (G2 - 1); + float y2 = y0 + (float) G2; + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + PrimeX, j, x2, y2); + } + } + + if (yi < xmyi) { + float x2 = x0 - (float) G2; + float y2 = y0 - (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j - PrimeY, x2, y2); + } + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); + } + } + } + + return value * 18.24196194486065f; + } + + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + // 3D OpenSimplex2S case uses two offset rotated cube grids. + + /* + * --- Rotation moved to TransformNoiseCoordinate method --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + int k = FastFloor(z); + float xi = (float) (x - i); + float yi = (float) (y - j); + float zi = (float) (z - k); + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + int seed2 = seed + 1293373; + + int xNMask = (int) (-0.5f - xi); + int yNMask = (int) (-0.5f - yi); + int zNMask = (int) (-0.5f - zi); + + float x0 = xi + xNMask; + float y0 = yi + yNMask; + float z0 = zi + zNMask; + float a0 = 0.75f - x0 * x0 - y0 * y0 - z0 * z0; + float value = (a0 * a0) * + (a0 * a0) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x0, + y0, + z0); + + float x1 = xi - 0.5f; + float y1 = yi - 0.5f; + float z1 = zi - 0.5f; + float a1 = 0.75f - x1 * x1 - y1 * y1 - z1 * z1; + value += (a1 * a1) * + (a1 * a1) * + GradCoord(seed2, i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); + + float xAFlipMask0 = ((xNMask | 1) << 1) * x1; + float yAFlipMask0 = ((yNMask | 1) << 1) * y1; + float zAFlipMask0 = ((zNMask | 1) << 1) * z1; + float xAFlipMask1 = (-2 - (xNMask << 2)) * x1 - 1.0f; + float yAFlipMask1 = (-2 - (yNMask << 2)) * y1 - 1.0f; + float zAFlipMask1 = (-2 - (zNMask << 2)) * z1 - 1.0f; + + boolean skip5 = false; + float a2 = xAFlipMask0 + a0; + if (a2 > 0) { + float x2 = x0 - (xNMask | 1); + float y2 = y0; + float z2 = z0; + value += (a2 * a2) * + (a2 * a2) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x2, + y2, + z2); + } else { + float a3 = yAFlipMask0 + zAFlipMask0 + a0; + if (a3 > 0) { + float x3 = x0; + float y3 = y0 - (yNMask | 1); + float z3 = z0 - (zNMask | 1); + value += (a3 * a3) * + (a3 * a3) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x3, + y3, + z3); + } + + float a4 = xAFlipMask1 + a1; + if (a4 > 0) { + float x4 = (xNMask | 1) + x1; + float y4 = y1; + float z4 = z1; + value += (a4 * a4) * + (a4 * a4) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + PrimeZ, + x4, + y4, + z4); + skip5 = true; + } + } + + boolean skip9 = false; + float a6 = yAFlipMask0 + a0; + if (a6 > 0) { + float x6 = x0; + float y6 = y0 - (yNMask | 1); + float z6 = z0; + value += (a6 * a6) * + (a6 * a6) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + x6, + y6, + z6); + } else { + float a7 = xAFlipMask0 + zAFlipMask0 + a0; + if (a7 > 0) { + float x7 = x0 - (xNMask | 1); + float y7 = y0; + float z7 = z0 - (zNMask | 1); + value += (a7 * a7) * + (a7 * a7) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x7, + y7, + z7); + } + + float a8 = yAFlipMask1 + a1; + if (a8 > 0) { + float x8 = x1; + float y8 = (yNMask | 1) + y1; + float z8 = z1; + value += (a8 * a8) * + (a8 * a8) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + x8, + y8, + z8); + skip9 = true; + } + } + + boolean skipD = false; + float aA = zAFlipMask0 + a0; + if (aA > 0) { + float xA = x0; + float yA = y0; + float zA = z0 - (zNMask | 1); + value += (aA * aA) * + (aA * aA) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + xA, + yA, + zA); + } else { + float aB = xAFlipMask0 + yAFlipMask0 + a0; + if (aB > 0) { + float xB = x0 - (xNMask | 1); + float yB = y0 - (yNMask | 1); + float zB = z0; + value += (aB * aB) * + (aB * aB) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + xB, + yB, + zB); + } + + float aC = zAFlipMask1 + a1; + if (aC > 0) { + float xC = x1; + float yC = y1; + float zC = (zNMask | 1) + z1; + value += (aC * aC) * + (aC * aC) * + GradCoord( + seed2, + i + PrimeX, + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + xC, + yC, + zC); + skipD = true; + } + } + + if (!skip5) { + float a5 = yAFlipMask1 + zAFlipMask1 + a1; + if (a5 > 0) { + float x5 = x1; + float y5 = (yNMask | 1) + y1; + float z5 = (zNMask | 1) + z1; + value += (a5 * a5) * + (a5 * a5) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + (zNMask & (PrimeZ << 1)), + x5, + y5, + z5); + } + } + + if (!skip9) { + float a9 = xAFlipMask1 + zAFlipMask1 + a1; + if (a9 > 0) { + float x9 = (xNMask | 1) + x1; + float y9 = y1; + float z9 = (zNMask | 1) + z1; + value += (a9 * a9) * + (a9 * a9) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + x9, + y9, + z9); + } + } + + if (!skipD) { + float aD = xAFlipMask1 + yAFlipMask1 + a1; + if (aD > 0) { + float xD = (xNMask | 1) + x1; + float yD = (yNMask | 1) + y1; + float zD = z1; + value += (aD * aD) * + (aD * aD) * + GradCoord( + seed2, + i + (xNMask & (PrimeX << 1)), + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + xD, + yD, + zD); + } + } + + return value * 9.046026385208288f; + } + + // Cellular Noise + + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int xr = FastRound(x); + int yr = FastRound(y); + + float distance0 = Float.MAX_VALUE; + float distance1 = Float.MAX_VALUE; + int closestHash = 0; + + float cellularJitter = 0.43701595f * mCellularJitterModifier; + + int xPrimed = (xr - 1) * PrimeX; + int yPrimedBase = (yr - 1) * PrimeY; + + switch (mCellularDistanceFunction) { + default: + case Euclidean: + case EuclideanSq: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = vecX * vecX + vecY * vecY; + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = FastAbs(vecX) + FastAbs(vecY); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Hybrid: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = (FastAbs(vecX) + FastAbs(vecY)) + + (vecX * vecX + vecY * vecY); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + } + + if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue) { + distance0 = FastSqrt(distance0); + + if (mCellularReturnType != CellularReturnType.CellValue) { + distance1 = FastSqrt(distance1); + } + } + + switch (mCellularReturnType) { + case CellValue: + return closestHash * (1 / 2147483648.0f); + case Distance: + return distance0 - 1; + case Distance2: + return distance1 - 1; + case Distance2Add: + return (distance1 + distance0) * 0.5f - 1; + case Distance2Sub: + return distance1 - distance0 - 1; + case Distance2Mul: + return distance1 * distance0 * 0.5f - 1; + case Distance2Div: + return distance0 / distance1 - 1; + default: + return 0; + } + } + + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int xr = FastRound(x); + int yr = FastRound(y); + int zr = FastRound(z); + + float distance0 = Float.MAX_VALUE; + float distance1 = Float.MAX_VALUE; + int closestHash = 0; + + float cellularJitter = 0.39614353f * mCellularJitterModifier; + + int xPrimed = (xr - 1) * PrimeX; + int yPrimedBase = (yr - 1) * PrimeY; + int zPrimedBase = (zr - 1) * PrimeZ; + + switch (mCellularDistanceFunction) { + case Euclidean: + case EuclideanSq: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Hybrid: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = (FastAbs(vecX) + + FastAbs(vecY) + + FastAbs(vecZ)) + + (vecX * vecX + vecY * vecY + vecZ * vecZ); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + default: + break; + } + + if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue) { + distance0 = FastSqrt(distance0); + + if (mCellularReturnType != CellularReturnType.CellValue) { + distance1 = FastSqrt(distance1); + } + } + + switch (mCellularReturnType) { + case CellValue: + return closestHash * (1 / 2147483648.0f); + case Distance: + return distance0 - 1; + case Distance2: + return distance1 - 1; + case Distance2Add: + return (distance1 + distance0) * 0.5f - 1; + case Distance2Sub: + return distance1 - distance0 - 1; + case Distance2Mul: + return distance1 * distance0 * 0.5f - 1; + case Distance2Div: + return distance0 / distance1 - 1; + default: + return 0; + } + } + + // Perlin Noise + + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); + float xd1 = xd0 - 1; + float yd1 = yd0 - 1; + + float xs = InterpQuintic(xd0); + float ys = InterpQuintic(yd0); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + float xf0 = Lerp( + GradCoord(seed, x0, y0, xd0, yd0), + GradCoord(seed, x1, y0, xd1, yd0), + xs); + float xf1 = Lerp( + GradCoord(seed, x0, y1, xd0, yd1), + GradCoord(seed, x1, y1, xd1, yd1), + xs); + + return Lerp(xf0, xf1, ys) * 1.4247691104677813f; + } + + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); + float zd0 = (float) (z - z0); + float xd1 = xd0 - 1; + float yd1 = yd0 - 1; + float zd1 = zd0 - 1; + + float xs = InterpQuintic(xd0); + float ys = InterpQuintic(yd0); + float zs = InterpQuintic(zd0); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + float xf00 = Lerp( + GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), + GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), + xs); + float xf10 = Lerp( + GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), + GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), + xs); + float xf01 = Lerp( + GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), + GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), + xs); + float xf11 = Lerp( + GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), + GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), + xs); + + float yf0 = Lerp(xf00, xf10, ys); + float yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs) * 0.964921414852142333984375f; + } + + // Value Cubic Noise + + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x1 = FastFloor(x); + int y1 = FastFloor(y); + + float xs = (float) (x - x1); + float ys = (float) (y - y1); + + x1 *= PrimeX; + y1 *= PrimeY; + int x0 = x1 - PrimeX; + int y0 = y1 - PrimeY; + int x2 = x1 + PrimeX; + int y2 = y1 + PrimeY; + int x3 = x1 + (PrimeX << 1); + int y3 = y1 + (PrimeY << 1); + + return (CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0), + ValCoord(seed, x1, y0), + ValCoord(seed, x2, y0), + ValCoord(seed, x3, y0), + xs), + CubicLerp( + ValCoord(seed, x0, y1), + ValCoord(seed, x1, y1), + ValCoord(seed, x2, y1), + ValCoord(seed, x3, y1), + xs), + CubicLerp( + ValCoord(seed, x0, y2), + ValCoord(seed, x1, y2), + ValCoord(seed, x2, y2), + ValCoord(seed, x3, y2), + xs), + CubicLerp( + ValCoord(seed, x0, y3), + ValCoord(seed, x1, y3), + ValCoord(seed, x2, y3), + ValCoord(seed, x3, y3), + xs), + ys) * + (1 / (1.5f * 1.5f))); + } + + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x1 = FastFloor(x); + int y1 = FastFloor(y); + int z1 = FastFloor(z); + + float xs = (float) (x - x1); + float ys = (float) (y - y1); + float zs = (float) (z - z1); + + x1 *= PrimeX; + y1 *= PrimeY; + z1 *= PrimeZ; + + int x0 = x1 - PrimeX; + int y0 = y1 - PrimeY; + int z0 = z1 - PrimeZ; + int x2 = x1 + PrimeX; + int y2 = y1 + PrimeY; + int z2 = z1 + PrimeZ; + int x3 = x1 + (PrimeX << 1); + int y3 = y1 + (PrimeY << 1); + int z3 = z1 + (PrimeZ << 1); + + return (CubicLerp( + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + ValCoord(seed, x2, y0, z0), + ValCoord(seed, x3, y0, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + ValCoord(seed, x2, y1, z0), + ValCoord(seed, x3, y1, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z0), + ValCoord(seed, x1, y2, z0), + ValCoord(seed, x2, y2, z0), + ValCoord(seed, x3, y2, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z0), + ValCoord(seed, x1, y3, z0), + ValCoord(seed, x2, y3, z0), + ValCoord(seed, x3, y3, z0), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + ValCoord(seed, x2, y0, z1), + ValCoord(seed, x3, y0, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + ValCoord(seed, x2, y1, z1), + ValCoord(seed, x3, y1, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z1), + ValCoord(seed, x1, y2, z1), + ValCoord(seed, x2, y2, z1), + ValCoord(seed, x3, y2, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z1), + ValCoord(seed, x1, y3, z1), + ValCoord(seed, x2, y3, z1), + ValCoord(seed, x3, y3, z1), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z2), + ValCoord(seed, x1, y0, z2), + ValCoord(seed, x2, y0, z2), + ValCoord(seed, x3, y0, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z2), + ValCoord(seed, x1, y1, z2), + ValCoord(seed, x2, y1, z2), + ValCoord(seed, x3, y1, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z2), + ValCoord(seed, x1, y2, z2), + ValCoord(seed, x2, y2, z2), + ValCoord(seed, x3, y2, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z2), + ValCoord(seed, x1, y3, z2), + ValCoord(seed, x2, y3, z2), + ValCoord(seed, x3, y3, z2), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z3), + ValCoord(seed, x1, y0, z3), + ValCoord(seed, x2, y0, z3), + ValCoord(seed, x3, y0, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z3), + ValCoord(seed, x1, y1, z3), + ValCoord(seed, x2, y1, z3), + ValCoord(seed, x3, y1, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z3), + ValCoord(seed, x1, y2, z3), + ValCoord(seed, x2, y2, z3), + ValCoord(seed, x3, y2, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z3), + ValCoord(seed, x1, y3, z3), + ValCoord(seed, x2, y3, z3), + ValCoord(seed, x3, y3, z3), + xs), + ys), + zs) * + (1 / (1.5f * 1.5f * 1.5f))); + } + + // Value Noise + + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + float xf0 = Lerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), xs); + float xf1 = Lerp(ValCoord(seed, x0, y1), ValCoord(seed, x1, y1), xs); + + return Lerp(xf0, xf1, ys); + } + + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); + float zs = InterpHermite((float) (z - z0)); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + float xf00 = Lerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + xs); + float xf10 = Lerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + xs); + float xf01 = Lerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + xs); + float xf11 = Lerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + xs); + + float yf0 = Lerp(xf00, xf10, ys); + float yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs); + } + + // Domain Warp + + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord) { + switch (mDomainWarpType) { + case OpenSimplex2: + SingleDomainWarpSimplexGradient( + seed, + amp * 38.283687591552734375f, + freq, + x, + y, + coord, + false); + break; + case OpenSimplex2Reduced: + SingleDomainWarpSimplexGradient( + seed, + amp * 16.0f, + freq, + x, + y, + coord, + true); + break; + case BasicGrid: + SingleDomainWarpBasicGrid(seed, amp, freq, x, y, coord); + break; + } + } + + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord) { + switch (mDomainWarpType) { + case OpenSimplex2: + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 32.69428253173828125f, + freq, + x, + y, + z, + coord, + false); + break; + case OpenSimplex2Reduced: + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 7.71604938271605f, + freq, + x, + y, + z, + coord, + true); + break; + case BasicGrid: + SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, coord); + break; + } + } + + // Domain Warp Single Wrapper + + private void DomainWarpSingle(Vector2 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + } + + private void DomainWarpSingle(Vector3 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + } + + // Domain Warp Fractal Progressive + + private void DomainWarpFractalProgressive(Vector2 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + private void DomainWarpFractalProgressive(Vector3 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + // Domain Warp Fractal Independant + private void DomainWarpFractalIndependent(Vector2 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + private void DomainWarpFractalIndependent(Vector3 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + // Domain Warp Basic Grid + + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + int hash0 = Hash(seed, x0, y0) & (255 << 1); + int hash1 = Hash(seed, x1, y0) & (255 << 1); + + float lx0x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); + float ly0x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); + + hash0 = Hash(seed, x0, y1) & (255 << 1); + hash1 = Hash(seed, x1, y1) & (255 << 1); + + float lx1x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); + float ly1x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); + + coord.x += Lerp(lx0x, lx1x, ys) * warpAmp; + coord.y += Lerp(ly0x, ly1x, ys) * warpAmp; + } + + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; + /*FMLdouble*/double zf = z * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + int z0 = FastFloor(zf); + + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); + float zs = InterpHermite((float) (zf - z0)); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + int hash0 = Hash(seed, x0, y0, z0) & (255 << 2); + int hash1 = Hash(seed, x1, y0, z0) & (255 << 2); + + float lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + float ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + float lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + hash0 = Hash(seed, x0, y1, z0) & (255 << 2); + hash1 = Hash(seed, x1, y1, z0) & (255 << 2); + + float lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + float ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + float lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + float lx0y = Lerp(lx0x, lx1x, ys); + float ly0y = Lerp(ly0x, ly1x, ys); + float lz0y = Lerp(lz0x, lz1x, ys); + + hash0 = Hash(seed, x0, y0, z1) & (255 << 2); + hash1 = Hash(seed, x1, y0, z1) & (255 << 2); + + lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + hash0 = Hash(seed, x0, y1, z1) & (255 << 2); + hash1 = Hash(seed, x1, y1, z1) & (255 << 2); + + lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + coord.x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * warpAmp; + coord.y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * warpAmp; + coord.z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; + } + + // Domain Warp Simplex/OpenSimplex2 + private void SingleDomainWarpSimplexGradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord, + boolean outGradOnly) { + final float SQRT3 = 1.7320508075688772935274463415059f; + final float G2 = (3 - SQRT3) / 6; + + x *= frequency; + y *= frequency; + + /* + * --- Skew moved to switch statements before fractal evaluation --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + float t = (xi + yi) * G2; + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); + + i *= PrimeX; + j *= PrimeY; + + float vx, vy; + vx = vy = 0; + + float a = 0.5f - x0 * x0 - y0 * y0; + if (a > 0) { + float aaaa = (a * a) * (a * a); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i, j) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i, j); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x0 * xg + y0 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += aaaa * xo; + vy += aaaa * yo; + } + + float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c > 0) { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); + float cccc = (c * c) * (c * c); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i + PrimeX, j + PrimeY) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i + PrimeX, j + PrimeY); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x2 * xg + y2 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += cccc * xo; + vy += cccc * yo; + } + + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); + float b = 0.5f - x1 * x1 - y1 * y1; + if (b > 0) { + float bbbb = (b * b) * (b * b); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i, j + PrimeY) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i, j + PrimeY); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x1 * xg + y1 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += bbbb * xo; + vy += bbbb * yo; + } + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; + float b = 0.5f - x1 * x1 - y1 * y1; + if (b > 0) { + float bbbb = (b * b) * (b * b); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i + PrimeX, j) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i + PrimeX, j); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x1 * xg + y1 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += bbbb * xo; + vy += bbbb * yo; + } + } + + coord.x += vx * warpAmp; + coord.y += vy * warpAmp; + } + + private void SingleDomainWarpOpenSimplex2Gradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord, + boolean outGradOnly) { + x *= frequency; + y *= frequency; + z *= frequency; + + /* + * --- Rotation moved to switch statements before fractal evaluation --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastRound(x); + int j = FastRound(y); + int k = FastRound(z); + float x0 = (float) x - i; + float y0 = (float) y - j; + float z0 = (float) z - k; + + int xNSign = (int) (-x0 - 1.0f) | 1; + int yNSign = (int) (-y0 - 1.0f) | 1; + int zNSign = (int) (-z0 - 1.0f) | 1; + + float ax0 = xNSign * -x0; + float ay0 = yNSign * -y0; + float az0 = zNSign * -z0; + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + + float vx, vy, vz; + vx = vy = vz = 0; + + float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + for (int l = 0;; l++) { + if (a > 0) { + float aaaa = (a * a) * (a * a); + float xo, yo, zo; + if (outGradOnly) { + int hash = Hash(seed, i, j, k) & (255 << 2); + xo = RandVecs3D[hash]; + yo = RandVecs3D[hash | 1]; + zo = RandVecs3D[hash | 2]; + } else { + int hash = Hash(seed, i, j, k); + int index1 = hash & (63 << 2); + int index2 = (hash >> 6) & (255 << 2); + float xg = Gradients3D[index1]; + float yg = Gradients3D[index1 | 1]; + float zg = Gradients3D[index1 | 2]; + float value = x0 * xg + y0 * yg + z0 * zg; + float xgo = RandVecs3D[index2]; + float ygo = RandVecs3D[index2 | 1]; + float zgo = RandVecs3D[index2 | 2]; + xo = value * xgo; + yo = value * ygo; + zo = value * zgo; + } + vx += aaaa * xo; + vy += aaaa * yo; + vz += aaaa * zo; + } + + float b = a; + int i1 = i; + int j1 = j; + int k1 = k; + float x1 = x0; + float y1 = y0; + float z1 = z0; + + if (ax0 >= ay0 && ax0 >= az0) { + x1 += xNSign; + b = b + ax0 + ax0; + i1 -= xNSign * PrimeX; + } else if (ay0 > ax0 && ay0 >= az0) { + y1 += yNSign; + b = b + ay0 + ay0; + j1 -= yNSign * PrimeY; + } else { + z1 += zNSign; + b = b + az0 + az0; + k1 -= zNSign * PrimeZ; + } + + if (b > 1) { + b -= 1; + float bbbb = (b * b) * (b * b); + float xo, yo, zo; + if (outGradOnly) { + int hash = Hash(seed, i1, j1, k1) & (255 << 2); + xo = RandVecs3D[hash]; + yo = RandVecs3D[hash | 1]; + zo = RandVecs3D[hash | 2]; + } else { + int hash = Hash(seed, i1, j1, k1); + int index1 = hash & (63 << 2); + int index2 = (hash >> 6) & (255 << 2); + float xg = Gradients3D[index1]; + float yg = Gradients3D[index1 | 1]; + float zg = Gradients3D[index1 | 2]; + float value = x1 * xg + y1 * yg + z1 * zg; + float xgo = RandVecs3D[index2]; + float ygo = RandVecs3D[index2 | 1]; + float zgo = RandVecs3D[index2 | 2]; + xo = value * xgo; + yo = value * ygo; + zo = value * zgo; + } + vx += bbbb * xo; + vy += bbbb * yo; + vz += bbbb * zo; + } + + if (l == 1) + break; + + ax0 = 0.5f - ax0; + ay0 = 0.5f - ay0; + az0 = 0.5f - az0; + + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; + + a += (0.75f - ax0) - (ay0 + az0); + + i += (xNSign >> 1) & PrimeX; + j += (yNSign >> 1) & PrimeY; + k += (zNSign >> 1) & PrimeZ; + + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; + + seed += 1293373; + } + + coord.x += vx * warpAmp; + coord.y += vy * warpAmp; + coord.z += vz * warpAmp; + } + + public static class Vector2 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + + public Vector2(/*FMLdouble*/double x, /*FMLdouble*/double y) { + this.x = x; + this.y = y; + } + } + + public static class Vector3 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + public /*FMLdouble*/double z; + + public Vector3( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + this.x = x; + this.y = y; + this.z = z; + } + } + + public static FastNoiseLite createSpongePerlin(int seed) { + FastNoiseLite fnlNoise = new FastNoiseLite(seed); + fnlNoise.SetNoiseType(FastNoiseLite.NoiseType.Perlin); // We will use 3D with a domain rotation to improve the look. + fnlNoise.SetRotationType3D( + FastNoiseLite.RotationType3D.ImproveXZPlanes); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. + fnlNoise.SetFractalType(FastNoiseLite.FractalType.FBm); + fnlNoise.SetFractalOctaves(6); + return fnlNoise; + } + + private static final double SPONGE_COMPATIBILITY_RATIO = (2 * Math.sqrt(3.0)) / 1.7252359327388492; + + public static float getSpongePerlinValue(float noise3) { + noise3 = noise3 * 0.5f + 0.5f; // Rescale to 0 to 1 to match new Sponge + noise3 *= (1.0f + 0.5f + 0.25f + 0.125f + 0.0625 + 0.03125); // Counter FastNoiseLite fractal range rescale. + noise3 *= SPONGE_COMPATIBILITY_RATIO; // Now make it match old Sponge. + return noise3; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java index c6d07b04..7ef0c8d2 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java @@ -11,18 +11,17 @@ public class SoulTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder< - ConfiguredFeature - > getConfiguredFeature(@Nonnull RandomSource random, boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.SOUL_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.SOUL_TREE; - } - return ATMConfiguredFeature.SOUL_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.SOUL_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.SOUL_TREE; + } + return ATMConfiguredFeature.SOUL_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java index ef5bd162..87d208db 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java @@ -15,106 +15,90 @@ public class Volcano extends Feature { - FastNoiseLite fnlPerlin = null; - BlockPos lastPos = new BlockPos(0, 0, 0); + FastNoiseLite fnlPerlin = null; + BlockPos lastPos = new BlockPos(0, 0, 0); - public Volcano(Codec codec) { - super(codec); - } + public Volcano(Codec codec) { + super(codec); + } - @Override - public boolean place( - @Nonnull FeaturePlaceContext p_159749_ - ) { - return place( - p_159749_.level(), - p_159749_.chunkGenerator(), - p_159749_.random(), - p_159749_.origin(), - FeatureConfiguration.NONE - ); - } + @Override + public boolean place( + @Nonnull FeaturePlaceContext p_159749_) { + return place( + p_159749_.level(), + p_159749_.chunkGenerator(), + p_159749_.random(), + p_159749_.origin(), + FeatureConfiguration.NONE); + } - private boolean place( - WorldGenLevel world, - ChunkGenerator generator, - RandomSource rand, - BlockPos pos, - FeatureConfiguration config - ) { - setSeed(world.getSeed()); - int landHeight = generator.getSpawnHeight( - world.getChunk(pos).getHeightAccessorForGeneration() - ); - if (rand.nextFloat() < 0.0005F) { - // pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); + private boolean place( + WorldGenLevel world, + ChunkGenerator generator, + RandomSource rand, + BlockPos pos, + FeatureConfiguration config) { + setSeed(world.getSeed()); + int landHeight = generator.getSpawnHeight( + world.getChunk(pos).getHeightAccessorForGeneration()); + if (rand.nextFloat() < 0.0005F) { + // pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); - pos = new BlockPos(pos.getX(), landHeight, pos.getZ()); - BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); + pos = new BlockPos(pos.getX(), landHeight, pos.getZ()); + BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); - double baseRadius = 16; - double lavaLeakage = 0.7; - int volcanoConeSize = 75; - int volcanoStartHeight = volcanoConeSize - 5; - double threshold = 0.5; + double baseRadius = 16; + double lavaLeakage = 0.7; + int volcanoConeSize = 75; + int volcanoStartHeight = volcanoConeSize - 5; + double threshold = 0.5; - for (double x = -volcanoConeSize; x <= volcanoConeSize; x++) { - for (double y = -volcanoConeSize; y <= -15; y++) { - for ( - double z = -volcanoConeSize; - z <= volcanoConeSize; - z++ - ) { - mutable - .set(pos) - .move( - (int) x, - (int) y + volcanoStartHeight, - (int) z - ); - float noise3 = FastNoiseLite.getSpongePerlinValue( - fnlPerlin.GetNoise(mutable.getX(), mutable.getZ()) - ); + for (double x = -volcanoConeSize; x <= volcanoConeSize; x++) { + for (double y = -volcanoConeSize; y <= -15; y++) { + for (double z = -volcanoConeSize; z <= volcanoConeSize; z++) { + mutable + .set(pos) + .move( + (int) x, + (int) y + volcanoStartHeight, + (int) z); + float noise3 = FastNoiseLite.getSpongePerlinValue( + fnlPerlin.GetNoise(mutable.getX(), mutable.getZ())); - double scaledNoise = - (noise3 / 11) * - (-(y * baseRadius) / ((x * x) + (z * z))); - if (scaledNoise - lavaLeakage >= threshold) { - if ( - mutable.getY() <= - pos.getY() + (volcanoStartHeight - 19) - ) { - world.setBlock( - mutable, - BlockRegistry.SOULLAVA_BLOCK - .get() - .defaultBlockState(), - 2 - ); - } - } else if (scaledNoise >= threshold) { - world.setBlock( - mutable, - rand.nextBoolean() - ? Blocks.BASALT.defaultBlockState() - : ModRegistry.ANCIENT_STONE - .get() - .defaultBlockState(), - 2 - ); - } - } - } - } - } + double scaledNoise = (noise3 / 11) * + (-(y * baseRadius) / ((x * x) + (z * z))); + if (scaledNoise - lavaLeakage >= threshold) { + if (mutable.getY() <= pos.getY() + (volcanoStartHeight - 19)) { + world.setBlock( + mutable, + BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState(), + 2); + } + } else if (scaledNoise >= threshold) { + world.setBlock( + mutable, + rand.nextBoolean() + ? Blocks.BASALT.defaultBlockState() + : ModRegistry.ANCIENT_STONE + .get() + .defaultBlockState(), + 2); + } + } + } + } + } - return true; - } + return true; + } - public void setSeed(long seed) { - if (fnlPerlin == null) { - fnlPerlin = FastNoiseLite.createSpongePerlin((int) seed); - fnlPerlin.SetFrequency(0.2F); - } - } + public void setSeed(long seed) { + if (fnlPerlin == null) { + fnlPerlin = FastNoiseLite.createSpongePerlin((int) seed); + fnlPerlin.SetFrequency(0.2F); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java index 61f7b768..0e0dceeb 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java @@ -5,13 +5,12 @@ public class VolcanoConfig implements FeatureConfiguration { - public static final Codec CODEC; - public static final VolcanoConfig INSTANCE = new VolcanoConfig(); + public static final Codec CODEC; + public static final VolcanoConfig INSTANCE = new VolcanoConfig(); - static { - CODEC = - Codec.unit(() -> { - return INSTANCE; - }); - } + static { + CODEC = Codec.unit(() -> { + return INSTANCE; + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java index 69cbcf96..67887384 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java @@ -18,177 +18,159 @@ public class APStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> - instance - .group( - APStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> - structure.projectStartToHeightmap - ), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter) - ) - .apply(instance, APStructure::new) - ) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + APStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, APStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public APStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter - ) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public APStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can - * spawn here. This only needs to be overridden if you're adding additional - * spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are - * passed in which allows you to spawn structures only at certain coordinates in - * the world. - * - * Basically, this method is used for determining if the land is at a suitable - * height, if certain other structures are too close or not, or some other - * restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn - * within 10 chunk of a Village. (Bedrock Edition seems to not have the same - * check) - * - * If you are doing Nether structures, you'll probably want to spawn your - * structure on top of ledges. Best way to do that is to use getBaseColumn to - * grab a column of blocks at the structure's x/z position. Then loop through it - * and look for land with air above it and set block pos's Y value to it. Make - * sure to set the final boolean in JigsawPlacement.addPieces to false so that - * the structure spawns at block pos's y value instead of placing the structure - * on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. If you - * do and another mod's dimension is trying to spawn your structure, the locate - * command will make minecraft hang forever and break the game. Use the biome - * tags for where to spawn the structure and users can datapack it to spawn in - * specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context - ) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. + * + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) + * + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return ( - context - .chunkGenerator() - .getFirstOccupiedHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState() - ) < - 150 - ); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 150); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context - ) { - // Check if the spot is valid for our structure. This is just as another method for cleanness. - // Returning an empty optional tells the game to skip this spot as it will not generate the structure. - if (!APStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + // Check if the spot is valid for our structure. This is just as another method for cleanness. + // Returning an empty optional tells the game to skip this spot as it will not generate the structure. + if (!APStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - // Set's our spawning block pos's y offset to be 60 blocks up. - // Since we are going to have heightmap/terrain height spawning set to true further down, this will make it so we spawn 60 blocks above terrain. - // If we wanted to spawn on ocean floor, we would set heightmap/terrain height spawning to false and the grab the y value of the terrain with OCEAN_FLOOR_WG heightmap. - int startY = - this.startHeight.sample( - context.random(), - new WorldGenerationContext( - context.chunkGenerator(), - context.heightAccessor() - ) - ); + // Set's our spawning block pos's y offset to be 60 blocks up. + // Since we are going to have heightmap/terrain height spawning set to true further down, this will make it so we spawn 60 blocks above terrain. + // If we wanted to spawn on ocean floor, we would set heightmap/terrain height spawning to false and the grab the y value of the terrain with OCEAN_FLOOR_WG heightmap. + int startY = this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor())); - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner - // of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - startY, - chunkPos.getMinBlockZ() - ); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner + // of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in block pos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter - ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and - * implementation of how the structure should generate. It is tricky but - * extremely powerful if you are doing something that vanilla's jigsaw system - * cannot do. Such as for example, forcing 3 pieces to always spawn every time, - * limiting how often a piece spawns, or remove the intersection limitation of - * pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.ANCIENT_PYRAMID.get(); - } + @Override + public StructureType type() { + return ATMStructures.ANCIENT_PYRAMID.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java index ec6aae90..ec1b2b30 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java @@ -8,28 +8,17 @@ public class ATMStructures { - public static final DeferredRegister> STRUCTURES = - DeferredRegister.create( - Registry.STRUCTURE_TYPE_REGISTRY, - Reference.MOD_ID - ); + public static final DeferredRegister> STRUCTURES = DeferredRegister.create( + Registry.STRUCTURE_TYPE_REGISTRY, + Reference.MOD_ID); - public static final RegistryObject< - StructureType - > ANCIENT_PYRAMID = STRUCTURES.register( - "ancient_pyramid", - () -> () -> APStructure.CODEC - ); - public static final RegistryObject< - StructureType - > PIGLIN_VILLAGE = STRUCTURES.register( - "piglin_village", - () -> () -> PVStructure.CODEC - ); - public static final RegistryObject< - StructureType - > ANCIENT_DUNGEON = STRUCTURES.register( - "dungeon", - () -> () -> DungeonStructure.CODEC - ); + public static final RegistryObject> ANCIENT_PYRAMID = STRUCTURES.register( + "ancient_pyramid", + () -> () -> APStructure.CODEC); + public static final RegistryObject> PIGLIN_VILLAGE = STRUCTURES.register( + "piglin_village", + () -> () -> PVStructure.CODEC); + public static final RegistryObject> ANCIENT_DUNGEON = STRUCTURES.register( + "dungeon", + () -> () -> DungeonStructure.CODEC); } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java index b6158ed9..f05c66ff 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java @@ -18,171 +18,153 @@ public class DungeonStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> - instance - .group( - DungeonStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> - structure.projectStartToHeightmap - ), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter) - ) - .apply(instance, DungeonStructure::new) - ) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + DungeonStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, DungeonStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public DungeonStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter - ) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public DungeonStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can - * spawn here. This only needs to be overridden if you're adding additional - * spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are - * passed in which allows you to spawn structures only at certain coordinates in - * the world. - * - * Basically, this method is used for determining if the land is at a suitable - * height, if certain other structures are too close or not, or some other - * restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn - * within 10 chunk of a Village. (Bedrock Edition seems to not have the same - * check) - * - * If you are doing Nether structures, you'll probably want to spawn your - * structure on top of ledges. Best way to do that is to use getBaseColumn to - * grab a column of blocks at the structure's x/z position. Then loop through it - * and look for land with air above it and set block pos's Y value to it. Make - * sure to set the final boolean in JigsawPlacement.addPieces to false so that - * the structure spawns at block pos's y value instead of placing the structure - * on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. If you - * do and another mod's dimension is trying to spawn your structure, the locate - * command will make minecraft hang forever and break the game. Use the biome - * tags for where to spawn the structure and users can datapack it to spawn in - * specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context - ) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. + * + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) + * + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return ( - context - .chunkGenerator() - .getFirstFreeHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState() - ) < - 150 - ); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstFreeHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 150); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context - ) { - if (!DungeonStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + if (!DungeonStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - int startY = - this.startHeight.sample( - context.random(), - new WorldGenerationContext( - context.chunkGenerator(), - context.heightAccessor() - ) - ); + int startY = this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor())); - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - startY, - chunkPos.getMinBlockZ() - ); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in block pos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter - ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and - * implementation of how the structure should generate. It is tricky but - * extremely powerful if you are doing something that vanilla's jigsaw system - * cannot do. Such as for example, forcing 3 pieces to always spawn every time, - * limiting how often a piece spawns, or remove the intersection limitation of - * pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.ANCIENT_DUNGEON.get(); - } + @Override + public StructureType type() { + return ATMStructures.ANCIENT_DUNGEON.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java index 2a8bef26..24f68dd1 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java @@ -17,155 +17,140 @@ public class PVStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> - instance - .group( - PVStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> - structure.projectStartToHeightmap - ), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter) - ) - .apply(instance, PVStructure::new) - ) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + PVStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, PVStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public PVStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter - ) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public PVStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can spawn here. - * This only needs to be overridden if you're adding additional spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are passed in - * which allows you to spawn structures only at certain coordinates in the world. - * - * Basically, this method is used for determining if the land is at a suitable height, - * if certain other structures are too close or not, or some other restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. - * (Bedrock Edition seems to not have the same check) - * - * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. - * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. - * Then loop through it and look for land with air above it and set block pos's Y value to it. - * Make sure to set the final boolean in JigsawPlacement.addPieces to false so - * that the structure spawns at block pos's y value instead of placing the structure on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. - * If you do and another mod's dimension is trying to spawn your structure, - * the locate command will make minecraft hang forever and break the game. - * Use the biome tags for where to spawn the structure and users can datapack - * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context - ) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can spawn here. + * This only needs to be overridden if you're adding additional spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are passed in + * which allows you to spawn structures only at certain coordinates in the world. + * + * Basically, this method is used for determining if the land is at a suitable height, + * if certain other structures are too close or not, or some other restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. + * (Bedrock Edition seems to not have the same check) + * + * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. + * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. + * Then loop through it and look for land with air above it and set block pos's Y value to it. + * Make sure to set the final boolean in JigsawPlacement.addPieces to false so + * that the structure spawns at block pos's y value instead of placing the structure on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. + * If you do and another mod's dimension is trying to spawn your structure, + * the locate command will make minecraft hang forever and break the game. + * Use the biome tags for where to spawn the structure and users can datapack + * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return ( - context - .chunkGenerator() - .getFirstOccupiedHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState() - ) < - 100 - ); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 100); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context - ) { - // Check if the spot is valid for our structure. This is just as another method for cleanness. - // Returning an empty optional tells the game to skip this spot as it will not generate the structure. - if (!PVStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + // Check if the spot is valid for our structure. This is just as another method for cleanness. + // Returning an empty optional tells the game to skip this spot as it will not generate the structure. + if (!PVStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - 0, - chunkPos.getMinBlockZ() - ); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + 0, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = - JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in blockpos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter - ); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in blockpos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure - * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. - * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure + * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. + * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.PIGLIN_VILLAGE.get(); - } + @Override + public StructureType type() { + return ATMStructures.PIGLIN_VILLAGE.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java index 14a2d25b..2258f51a 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java @@ -12,22 +12,18 @@ public class VillagePieces { - public static final Holder START = Pools.register( - new StructureTemplatePool( - new ResourceLocation(Reference.MOD_ID, "village/start_pool"), - new ResourceLocation(Reference.MOD_ID, "village/start_pool"), - ImmutableList.of( - Pair.of( - StructurePoolElement.legacy( - Reference.MOD_ID + ":illager_keep", - ProcessorLists.EMPTY - ), - 1 - ) - ), - StructureTemplatePool.Projection.RIGID - ) - ); + public static final Holder START = Pools.register( + new StructureTemplatePool( + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + ImmutableList.of( + Pair.of( + StructurePoolElement.legacy( + Reference.MOD_ID + ":illager_keep", + ProcessorLists.EMPTY), + 1)), + StructureTemplatePool.Projection.RIGID)); - public static void bootstrap() {} + public static void bootstrap() { + } } From c1a7fdd46606541e0f3e5dbd7aa8245b2c81ec72 Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:47:28 -0600 Subject: [PATCH 14/17] Switched to using spaces instead of tabs --- eclipse-formatter.xml | 2 +- .../thevortex/allthemodium/AllTheModium.java | 234 +- .../allthemodium/blocks/ACaveVines.java | 76 +- .../blocks/AllthemodiumBlock.java | 26 +- .../allthemodium/blocks/AllthemodiumOre.java | 182 +- .../allthemodium/blocks/AncientBookShelf.java | 20 +- .../allthemodium/blocks/AncientCaveVines.java | 162 +- .../blocks/AncientCaveVinesPlant.java | 136 +- .../allthemodium/blocks/AncientDirt.java | 24 +- .../blocks/AncientFenceBlock.java | 316 +- .../allthemodium/blocks/AncientGrass.java | 50 +- .../allthemodium/blocks/AncientHerb.java | 52 +- .../allthemodium/blocks/AncientLeaves.java | 334 +- .../blocks/AncientLeavesBottom.java | 306 +- .../allthemodium/blocks/AncientLog.java | 6 +- .../blocks/AncientSaplingBlock.java | 222 +- .../allthemodium/blocks/DemonicLeaves.java | 370 +- .../blocks/DemonicLeavesBottom.java | 306 +- .../allthemodium/blocks/SoulLava.java | 358 +- .../allthemodium/blocks/SoulLeaves.java | 372 +- .../allthemodium/blocks/SoulLeavesBottom.java | 306 +- .../allthemodium/blocks/TeleportPad.java | 538 +- .../allthemodium/blocks/UAAlloyBlock.java | 26 +- .../allthemodium/blocks/UVAlloyBlock.java | 26 +- .../allthemodium/blocks/UnobtainiumBlock.java | 26 +- .../allthemodium/blocks/UnobtainiumOre.java | 100 +- .../allthemodium/blocks/VAAlloyBlock.java | 26 +- .../allthemodium/blocks/VibraniumBlock.java | 26 +- .../allthemodium/blocks/VibraniumOre.java | 100 +- .../config/AllthemodiumServerConfigs.java | 66 +- .../crafting/ATMCraftingSetup.java | 18 +- .../crafting/ATMRecipeSerializer.java | 60 +- .../crafting/ATMShapedRecipe.java | 194 +- .../crafting/ATMShapelessRecipe.java | 132 +- .../ATMShapelessRecipeSerializer.java | 74 +- .../crafting/IATMShapedRecipe.java | 6 +- .../crafting/IATMShapelessRecipe.java | 6 +- .../allthemodium/datagen/DataGenerators.java | 56 +- .../allthemodium/datagen/RecipeException.java | 6 +- .../datagen/builder/ShapedAncientStones.java | 392 +- .../datagen/builder/ShapedArmorBuilder.java | 216 +- .../datagen/builder/ShapedBlockBuilder.java | 226 +- .../datagen/builder/ShapedIngotBuilder.java | 128 +- .../datagen/client/BlockStates.java | 492 +- .../datagen/client/ItemModels.java | 452 +- .../datagen/server/BlastingRecipes.java | 164 +- .../datagen/server/BlockTags.java | 860 +- .../datagen/server/CraftingRecipes.java | 604 +- .../datagen/server/FluidTags.java | 36 +- .../allthemodium/datagen/server/ItemTags.java | 500 +- .../datagen/server/LootTables.java | 238 +- .../datagen/server/ShapelessCrafting.java | 528 +- .../datagen/server/SmeltingRecipes.java | 164 +- .../allthemodium/entity/PiglichEntity.java | 796 +- .../allthemodium/entity/PiglichModel.java | 664 +- .../allthemodium/entity/PiglichModelOld.java | 372 +- .../allthemodium/entity/PiglichRenderer.java | 58 +- .../entity/shulkers/atm/ATMShulkerEntity.java | 28 +- .../entity/shulkers/atm/ATMShulkerModel.java | 146 +- .../shulkers/atm/ATMShulkerRenderer.java | 64 +- .../shulkers/unob/UNOBShulkerEntity.java | 28 +- .../shulkers/unob/UNOBShulkerModel.java | 146 +- .../shulkers/unob/UNOBShulkerRenderer.java | 64 +- .../entity/shulkers/vib/VIBShulkerEntity.java | 28 +- .../entity/shulkers/vib/VIBShulkerModel.java | 146 +- .../shulkers/vib/VIBShulkerRenderer.java | 64 +- .../allthemodium/events/ArmorEvents.java | 94 +- .../allthemodium/events/BlockBreak.java | 82 +- .../allthemodium/events/ClientEvents.java | 186 +- .../allthemodium/events/PlayerHarvest.java | 36 +- .../allthemodium/fluid/FluidATM.java | 324 +- .../allthemodium/fluid/FluidSoulLava.java | 324 +- .../allthemodium/fluid/FluidUNOB.java | 324 +- .../allthemodium/fluid/FluidVIB.java | 324 +- .../thevortex/allthemodium/init/ModFoods.java | 46 +- .../allthemodium/items/AlloyDust.java | 6 +- .../allthemodium/items/AlloyIngot.java | 6 +- .../allthemodium/items/AllthemodiumApple.java | 74 +- .../allthemodium/items/AllthemodiumBlock.java | 6 +- .../items/AllthemodiumCarrot.java | 74 +- .../items/AllthemodiumOreItem.java | 52 +- .../thevortex/allthemodium/items/Clump.java | 6 +- .../thevortex/allthemodium/items/Crystal.java | 6 +- .../allthemodium/items/DirtyDust.java | 6 +- .../thevortex/allthemodium/items/Dust.java | 6 +- .../thevortex/allthemodium/items/Gear.java | 6 +- .../thevortex/allthemodium/items/Ingot.java | 6 +- .../thevortex/allthemodium/items/Nugget.java | 6 +- .../allthemodium/items/PiglichHeart.java | 6 +- .../thevortex/allthemodium/items/Plate.java | 6 +- .../thevortex/allthemodium/items/RawOre.java | 6 +- .../com/thevortex/allthemodium/items/Rod.java | 6 +- .../thevortex/allthemodium/items/Shard.java | 6 +- .../allthemodium/items/SoulBerries.java | 42 +- .../allthemodium/items/SoulBucket.java | 26 +- .../allthemodium/items/TeleportPad.java | 6 +- .../allthemodium/items/UnobtainiumBlock.java | 6 +- .../items/UnobtainiumOreItem.java | 52 +- .../allthemodium/items/VibraniumBlock.java | 6 +- .../items/Vibranium_Ore_Item.java | 52 +- .../toolitems/armor/AllthemodiumBoots.java | 44 +- .../armor/AllthemodiumChestplate.java | 36 +- .../toolitems/armor/AllthemodiumHelmet.java | 56 +- .../toolitems/armor/AllthemodiumLeggings.java | 36 +- .../armor/models/AllthemodiumHelmetModel.java | 284 +- .../items/toolitems/tools/AlloyAxe.java | 98 +- .../items/toolitems/tools/AlloyPaxel.java | 524 +- .../items/toolitems/tools/AlloyPick.java | 106 +- .../items/toolitems/tools/AlloyShovel.java | 106 +- .../items/toolitems/tools/AlloySword.java | 76 +- .../allthemodium/material/AArmorMaterial.java | 140 +- .../allthemodium/material/ToolTiers.java | 56 +- .../allthemodium/mixins/MixinConnector.java | 14 +- .../allthemodium/reference/Reference.java | 166 +- .../allthemodium/registry/BlockRegistry.java | 90 +- .../registry/FluidInteractionsRegistry.java | 46 +- .../allthemodium/registry/FluidRegistry.java | 38 +- .../registry/FluidTypeRegistry.java | 142 +- .../allthemodium/registry/ItemRegistry.java | 182 +- .../allthemodium/registry/LevelRegistry.java | 12 +- .../allthemodium/registry/MekRegistry.java | 38 +- .../allthemodium/registry/ModRegistry.java | 3360 +++--- .../allthemodium/registry/TagRegistry.java | 472 +- .../registry/client/OtherSky.java | 92 +- .../registry/client/SkyRegistry.java | 38 +- .../registry/resource/ATMResource.java | 100 +- .../registry/resource/ATMSlurries.java | 16 +- .../registry/resource/EnumFunc.java | 2 +- .../registry/resource/MoltenATMType.java | 168 +- .../registry/resource/MoltenUNOBType.java | 168 +- .../registry/resource/MoltenVIBType.java | 168 +- .../registry/resource/SoulLavaType.java | 168 +- .../worldgen/ATMConfiguredFeature.java | 512 +- .../worldgen/ATMPlacedFeature.java | 320 +- .../worldgen/ATOtherPlacedFeatures.java | 156 +- .../worldgen/MiningDimSource.java | 52 +- .../worldgen/TheOtherDimSource.java | 56 +- .../worldgen/biomes/ATMBiomes.java | 684 +- .../worldgen/features/AncientTreeGrower.java | 26 +- .../worldgen/features/DemonicTreeGrower.java | 26 +- .../worldgen/features/FastNoiseLite.java | 9480 ++++++++--------- .../worldgen/features/SoulTreeGrower.java | 26 +- .../worldgen/features/Volcano.java | 154 +- .../worldgen/features/VolcanoConfig.java | 14 +- .../worldgen/structures/APStructure.java | 290 +- .../worldgen/structures/ATMStructures.java | 24 +- .../worldgen/structures/DungeonStructure.java | 278 +- .../worldgen/structures/PVStructure.java | 254 +- .../worldgen/structures/VillagePieces.java | 26 +- 149 files changed, 17295 insertions(+), 17295 deletions(-) diff --git a/eclipse-formatter.xml b/eclipse-formatter.xml index ecc327e3..e027c297 100644 --- a/eclipse-formatter.xml +++ b/eclipse-formatter.xml @@ -302,7 +302,7 @@ - + diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java index 21effacf..0134a7da 100644 --- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java +++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java @@ -38,121 +38,121 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class AllTheModium { - public static final ResourceKey OverWorld = Level.OVERWORLD; - public static final ResourceKey Nether = Level.NETHER; - public static final ResourceKey The_End = Level.END; - public static final ResourceLocation MINING_DIM_ID = new ResourceLocation( - MOD_ID, - "mining"); - public static final ResourceLocation THE_OTHER_DIM_ID = new ResourceLocation(MOD_ID, "the_other"); - public static final ResourceKey THE_OTHER = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - THE_OTHER_DIM_ID); - // public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); - // public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); - // public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); - public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - public static boolean ALLOW_TELEPORT_MINING = true; - public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { - public ItemStack makeIcon() { - return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - } - }; - - public AllTheModium() { - // Register the setup method for mod loading - - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); - - FluidTypeRegistry.FLUID_TYPES.register(modEventBus); - FluidRegistry.FLUIDS.register(modEventBus); - BlockRegistry.BLOCKS.register(modEventBus); - ModRegistry.BLOCKS.register(modEventBus); - ModRegistry.SHAPED_BLOCKS.register(modEventBus); - ModRegistry.STAIR_BLOCKS.register(modEventBus); - ModRegistry.SLAB_BLOCKS.register(modEventBus); - ModRegistry.WALL_BLOCKS.register(modEventBus); - ModRegistry.PILLAR_BLOCKS.register(modEventBus); - - ItemRegistry.ITEMS.register(modEventBus); - ModRegistry.ITEMS.register(modEventBus); - ModRegistry.ENTITIES.register(modEventBus); - - ModRegistry.CARVERS.register(modEventBus); - ModRegistry.BIOMES.register(modEventBus); - ATMCraftingSetup.REGISTRY.register(modEventBus); - ATMStructures.STRUCTURES.register(modEventBus); - ModRegistry.FEATURES.register(modEventBus); - - modEventBus.register(ModRegistry.class); - modEventBus.addListener(this::setup); - - GeckoLib.initialize(); - - // load configs - ModLoadingContext - .get() - .registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); - - if (ModList.get().isLoaded("mekanism")) { - ATMSlurries.SLURRIES.register(modEventBus); - } - - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); - // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); - - // Register ourselves for server and other game events we are interested in - MinecraftForge.EVENT_BUS.register(this); - MinecraftForge.EVENT_BUS.register(BlockBreak.class); - MinecraftForge.EVENT_BUS.register(ArmorEvents.class); - } - - public void setup(final FMLCommonSetupEvent event) { - event.enqueueWork(() -> { - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG.get(), - ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_0.get(), - ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_1.get(), - ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.SOUL_LOG_2.get(), - ModRegistry.SOUL_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.DEMONIC_LOG.get(), - ModRegistry.DEMONIC_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_0.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_1.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get()); - AxeItem.STRIPPABLES.put( - ModRegistry.ANCIENT_LOG_2.get(), - ModRegistry.ANCIENT_LOG_STRIPPED.get()); - // ATMConfiguredStructures.registerConfiguredStructures(); - Registry.register( - Registry.CHUNK_GENERATOR, - MINING_DIM_ID, - MiningDimSource.CODEC); - Registry.register( - Registry.CHUNK_GENERATOR, - THE_OTHER_DIM_ID, - TheOtherDimSource.CODEC); - if (ModList.get().isLoaded("allthetweaks")) { - if (5 == Configuration.COMMON.mainmode.get()) { - ALLOW_TELEPORT_MINING = false; - } - } - }); - } - - public void setupClient(final FMLClientSetupEvent event) { - event.enqueueWork(() -> { - }); - } + public static final ResourceKey OverWorld = Level.OVERWORLD; + public static final ResourceKey Nether = Level.NETHER; + public static final ResourceKey The_End = Level.END; + public static final ResourceLocation MINING_DIM_ID = new ResourceLocation( + MOD_ID, + "mining"); + public static final ResourceLocation THE_OTHER_DIM_ID = new ResourceLocation(MOD_ID, "the_other"); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID); + // public static final ResourceKey Mining_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, MINING_DIM_ID); + // public static final ResourceKey THE_OTHER_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, THE_OTHER_DIM_ID); + // public static final RegistryKey THE_BEYOND = RegistryKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(Reference.MOD_ID,"the_beyond")); + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + public static boolean ALLOW_TELEPORT_MINING = true; + public static final CreativeModeTab GROUP = new CreativeModeTab(MOD_ID) { + public ItemStack makeIcon() { + return new ItemStack(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + } + }; + + public AllTheModium() { + // Register the setup method for mod loading + + IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); + + FluidTypeRegistry.FLUID_TYPES.register(modEventBus); + FluidRegistry.FLUIDS.register(modEventBus); + BlockRegistry.BLOCKS.register(modEventBus); + ModRegistry.BLOCKS.register(modEventBus); + ModRegistry.SHAPED_BLOCKS.register(modEventBus); + ModRegistry.STAIR_BLOCKS.register(modEventBus); + ModRegistry.SLAB_BLOCKS.register(modEventBus); + ModRegistry.WALL_BLOCKS.register(modEventBus); + ModRegistry.PILLAR_BLOCKS.register(modEventBus); + + ItemRegistry.ITEMS.register(modEventBus); + ModRegistry.ITEMS.register(modEventBus); + ModRegistry.ENTITIES.register(modEventBus); + + ModRegistry.CARVERS.register(modEventBus); + ModRegistry.BIOMES.register(modEventBus); + ATMCraftingSetup.REGISTRY.register(modEventBus); + ATMStructures.STRUCTURES.register(modEventBus); + ModRegistry.FEATURES.register(modEventBus); + + modEventBus.register(ModRegistry.class); + modEventBus.addListener(this::setup); + + GeckoLib.initialize(); + + // load configs + ModLoadingContext + .get() + .registerConfig(Type.SERVER, AllthemodiumServerConfigs.SPEC); + + if (ModList.get().isLoaded("mekanism")) { + ATMSlurries.SLURRIES.register(modEventBus); + } + + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, APStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, DungeonStructure::setupStructureSpawns); + // MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, PVStructure::setupStructureSpawns); + + // Register ourselves for server and other game events we are interested in + MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(BlockBreak.class); + MinecraftForge.EVENT_BUS.register(ArmorEvents.class); + } + + public void setup(final FMLCommonSetupEvent event) { + event.enqueueWork(() -> { + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_0.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_1.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.SOUL_LOG_2.get(), + ModRegistry.SOUL_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.DEMONIC_LOG.get(), + ModRegistry.DEMONIC_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_0.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_1.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + AxeItem.STRIPPABLES.put( + ModRegistry.ANCIENT_LOG_2.get(), + ModRegistry.ANCIENT_LOG_STRIPPED.get()); + // ATMConfiguredStructures.registerConfiguredStructures(); + Registry.register( + Registry.CHUNK_GENERATOR, + MINING_DIM_ID, + MiningDimSource.CODEC); + Registry.register( + Registry.CHUNK_GENERATOR, + THE_OTHER_DIM_ID, + TheOtherDimSource.CODEC); + if (ModList.get().isLoaded("allthetweaks")) { + if (5 == Configuration.COMMON.mainmode.get()) { + ALLOW_TELEPORT_MINING = false; + } + } + }); + } + + public void setupClient(final FMLClientSetupEvent event) { + event.enqueueWork(() -> { + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java index f2331b4d..97dbf297 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/ACaveVines.java @@ -18,45 +18,45 @@ import net.minecraft.world.phys.shapes.VoxelShape; public interface ACaveVines extends CaveVines { - VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); - BooleanProperty BERRIES = BlockStateProperties.BERRIES; + VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); + BooleanProperty BERRIES = BlockStateProperties.BERRIES; - static InteractionResult use( - BlockState p_152954_, - Level p_152955_, - BlockPos p_152956_) { - if (p_152954_.getValue(BERRIES)) { - Block.popResource( - p_152955_, - p_152956_, - new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1)); - float f = Mth.randomBetween(p_152955_.random, 0.8F, 1.2F); - p_152955_.playSound( - (Player) null, - p_152956_, - SoundEvents.CAVE_VINES_PICK_BERRIES, - SoundSource.BLOCKS, - 1.0F, - f); - p_152955_.setBlock( - p_152956_, - p_152954_.setValue(BERRIES, Boolean.valueOf(false)), - 2); - return InteractionResult.sidedSuccess(p_152955_.isClientSide); - } else { - return InteractionResult.PASS; - } - } + static InteractionResult use( + BlockState p_152954_, + Level p_152955_, + BlockPos p_152956_) { + if (p_152954_.getValue(BERRIES)) { + Block.popResource( + p_152955_, + p_152956_, + new ItemStack(ModRegistry.ANCIENT_SOULBERRY.get(), 1)); + float f = Mth.randomBetween(p_152955_.random, 0.8F, 1.2F); + p_152955_.playSound( + (Player) null, + p_152956_, + SoundEvents.CAVE_VINES_PICK_BERRIES, + SoundSource.BLOCKS, + 1.0F, + f); + p_152955_.setBlock( + p_152956_, + p_152954_.setValue(BERRIES, Boolean.valueOf(false)), + 2); + return InteractionResult.sidedSuccess(p_152955_.isClientSide); + } else { + return InteractionResult.PASS; + } + } - static boolean hasGlowBerries(BlockState p_152952_) { - return p_152952_.hasProperty(BERRIES) && p_152952_.getValue(BERRIES); - } + static boolean hasGlowBerries(BlockState p_152952_) { + return p_152952_.hasProperty(BERRIES) && p_152952_.getValue(BERRIES); + } - static ToIntFunction emission(int p_181218_) { - return p_181216_ -> { - return p_181216_.getValue(BlockStateProperties.BERRIES) - ? p_181218_ - : 0; - }; - } + static ToIntFunction emission(int p_181218_) { + return p_181216_ -> { + return p_181216_.getValue(BlockStateProperties.BERRIES) + ? p_181218_ + : 0; + }; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java index b24c7290..c296f32f 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java @@ -13,18 +13,18 @@ public class AllthemodiumBlock extends Block { - public AllthemodiumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } + public AllthemodiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.ALLTHEMODIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java index 8aade7f7..bf26b4cb 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java @@ -22,105 +22,105 @@ public class AllthemodiumOre extends RedStoneOreBlock { - // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; - public AllthemodiumOre() { // func_235861_h_ = setRequiresTool - super( - BlockBehaviour.Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.ANCIENT_DEBRIS) - .lightLevel(state -> { - return 15; - }) - .strength(80.0f, 1500.0f)); - } + // public static final BooleanProperty LIT = RedstoneTorchBlock.LIT; + public AllthemodiumOre() { // func_235861_h_ = setRequiresTool + super( + BlockBehaviour.Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.ANCIENT_DEBRIS) + .lightLevel(state -> { + return 15; + }) + .strength(80.0f, 1500.0f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if (AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player) - ? 250 - : 1500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 250 + : 1500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player) { - if ((player instanceof FakePlayer) && - (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { - return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + (state.is(TagRegistry.ALLTHEMODIUM_ORE))) { + return AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get(); + } - return (super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F)); - } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2)); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } - @OnlyIn(Dist.CLIENT) - private static void activate( - BlockState p_196500_0_, - Level worldIn, - BlockPos p_196500_2_) { - spawnParticles(worldIn, p_196500_2_); - } + @OnlyIn(Dist.CLIENT) + private static void activate( + BlockState p_196500_0_, + Level worldIn, + BlockPos p_196500_2_) { + spawnParticles(worldIn, p_196500_2_); + } - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick( - @Nonnull BlockState stateIn, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - spawnParticles(worldIn, pos); - } + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + spawnParticles(worldIn, pos); + } - @SuppressWarnings("unused") // TODO Remove unused suppression - @OnlyIn(Dist.CLIENT) - private static void spawnParticles(Level world, BlockPos worldIn) { - RandomSource random = world.random; + @SuppressWarnings("unused") // TODO Remove unused suppression + @OnlyIn(Dist.CLIENT) + private static void spawnParticles(Level world, BlockPos worldIn) { + RandomSource random = world.random; - for (Direction direction : Direction.values()) { - BlockPos blockPos = worldIn.offset(direction.getNormal()); - if (!world.getBlockState(blockPos).isSolidRender(world, blockPos)) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X - ? 0.5D + 0.5625D * (double) direction.getStepX() - : (double) random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y - ? 0.5D + 0.5625D * (double) direction.getStepY() - : (double) random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z - ? 0.5D + 0.5625D * (double) direction.getStepZ() - : (double) random.nextFloat(); - // TODO spawn particles - } - } - } + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if (!world.getBlockState(blockPos).isSolidRender(world, blockPos)) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + // TODO spawn particles + } + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java index aaf43db7..256b84ec 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientBookShelf.java @@ -7,15 +7,15 @@ public class AncientBookShelf extends RotatedPillarBlock { - public AncientBookShelf(Properties p_49795_) { - super(p_49795_); - } + public AncientBookShelf(Properties p_49795_) { + super(p_49795_); + } - @Override - public float getEnchantPowerBonus( - BlockState state, - LevelReader world, - BlockPos pos) { - return 2.0f; - } + @Override + public float getEnchantPowerBonus( + BlockState state, + LevelReader world, + BlockPos pos) { + return 2.0f; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java index e1a7b469..c0268818 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVines.java @@ -19,98 +19,98 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class AncientCaveVines - extends GrowingPlantHeadBlock - implements ACaveVines { + extends GrowingPlantHeadBlock + implements ACaveVines { - // private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; + // private static final float CHANCE_OF_BERRIES_ON_GROWTH = 0.11F; - public AncientCaveVines( - Properties p_53928_, - Direction p_53929_, - VoxelShape p_53930_, - boolean p_53931_, - double p_53932_) { - super(p_53928_, Direction.DOWN, SHAPE, false, 0.1D); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(AGE, Integer.valueOf(0)) - .setValue(BERRIES, Boolean.valueOf(false))); - } + public AncientCaveVines( + Properties p_53928_, + Direction p_53929_, + VoxelShape p_53930_, + boolean p_53931_, + double p_53932_) { + super(p_53928_, Direction.DOWN, SHAPE, false, 0.1D); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(AGE, Integer.valueOf(0)) + .setValue(BERRIES, Boolean.valueOf(false))); + } - protected int getBlocksToGrowWhenBonemealed( - @Nonnull RandomSource p_152995_) { - return 1; - } + protected int getBlocksToGrowWhenBonemealed( + @Nonnull RandomSource p_152995_) { + return 1; + } - protected boolean canGrowInto(@Nonnull BlockState p_152998_) { - return p_152998_.isAir(); - } + protected boolean canGrowInto(@Nonnull BlockState p_152998_) { + return p_152998_.isAir(); + } - protected BlockState updateBodyAfterConvertedFromHead( - @Nonnull BlockState p_152987_, - @Nonnull BlockState p_152988_) { - return p_152988_.setValue(BERRIES, Boolean.FALSE); - } + protected BlockState updateBodyAfterConvertedFromHead( + @Nonnull BlockState p_152987_, + @Nonnull BlockState p_152988_) { + return p_152988_.setValue(BERRIES, Boolean.FALSE); + } - protected BlockState getGrowIntoState( - @Nonnull BlockState p_152990_, - @Nonnull RandomSource p_152991_) { - return super.getGrowIntoState(p_152990_, p_152991_) - .setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); - } + protected BlockState getGrowIntoState( + @Nonnull BlockState p_152990_, + @Nonnull RandomSource p_152991_) { + return super.getGrowIntoState(p_152990_, p_152991_) + .setValue(BERRIES, Boolean.valueOf(p_152991_.nextFloat() < 0.11F)); + } - public ItemStack getCloneItemStack( - @Nonnull BlockGetter p_152966_, - @Nonnull BlockPos p_152967_, - @Nonnull BlockState p_152968_) { - return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_.get()); - } + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_152966_, + @Nonnull BlockPos p_152967_, + @Nonnull BlockState p_152968_) { + return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_.get()); + } - public InteractionResult use( - @Nonnull BlockState p_152980_, - @Nonnull Level p_152981_, - @Nonnull BlockPos p_152982_, - @Nonnull Player p_152983_, - @Nonnull InteractionHand p_152984_, - @Nonnull BlockHitResult p_152985_) { - return ACaveVines.use(p_152980_, p_152981_, p_152982_); - } + public InteractionResult use( + @Nonnull BlockState p_152980_, + @Nonnull Level p_152981_, + @Nonnull BlockPos p_152982_, + @Nonnull Player p_152983_, + @Nonnull InteractionHand p_152984_, + @Nonnull BlockHitResult p_152985_) { + return ACaveVines.use(p_152980_, p_152981_, p_152982_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_152993_) { - super.createBlockStateDefinition(p_152993_); - p_152993_.add(BERRIES); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_152993_) { + super.createBlockStateDefinition(p_152993_); + p_152993_.add(BERRIES); + } - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_152970_, - @Nonnull BlockPos p_152971_, - @Nonnull BlockState p_152972_, - boolean p_152973_) { - return !p_152972_.getValue(BERRIES); - } + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_152970_, + @Nonnull BlockPos p_152971_, + @Nonnull BlockState p_152972_, + boolean p_152973_) { + return !p_152972_.getValue(BERRIES); + } - public boolean isBonemealSuccess( - @Nonnull Level p_152975_, - @Nonnull RandomSource p_152976_, - @Nonnull BlockPos p_152977_, - @Nonnull BlockState p_152978_) { - return true; - } + public boolean isBonemealSuccess( + @Nonnull Level p_152975_, + @Nonnull RandomSource p_152976_, + @Nonnull BlockPos p_152977_, + @Nonnull BlockState p_152978_) { + return true; + } - public void performBonemeal( - @Nonnull ServerLevel p_152961_, - @Nonnull RandomSource p_152962_, - @Nonnull BlockPos p_152963_, - @Nonnull BlockState p_152964_) { - p_152961_.setBlock( - p_152963_, - p_152964_.setValue(BERRIES, Boolean.valueOf(true)), - 2); - } + public void performBonemeal( + @Nonnull ServerLevel p_152961_, + @Nonnull RandomSource p_152962_, + @Nonnull BlockPos p_152963_, + @Nonnull BlockState p_152964_) { + p_152961_.setBlock( + p_152963_, + p_152964_.setValue(BERRIES, Boolean.valueOf(true)), + 2); + } - @Override - protected GrowingPlantBodyBlock getBodyBlock() { - return ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(); - } + @Override + protected GrowingPlantBodyBlock getBodyBlock() { + return ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java index 7963aba7..0f3023c0 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientCaveVinesPlant.java @@ -19,81 +19,81 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class AncientCaveVinesPlant - extends GrowingPlantBodyBlock - implements ACaveVines { + extends GrowingPlantBodyBlock + implements ACaveVines { - public AncientCaveVinesPlant( - Properties p_53886_, - Direction p_53887_, - VoxelShape p_53888_, - boolean p_53889_) { - super(p_53886_, Direction.DOWN, SHAPE, false); - } + public AncientCaveVinesPlant( + Properties p_53886_, + Direction p_53887_, + VoxelShape p_53888_, + boolean p_53889_) { + super(p_53886_, Direction.DOWN, SHAPE, false); + } - @Override - protected BlockState updateHeadAfterConvertedFromBody( - @Nonnull BlockState p_153028_, - @Nonnull BlockState p_153029_) { - return p_153029_.setValue(BERRIES, Boolean.FALSE); - } + @Override + protected BlockState updateHeadAfterConvertedFromBody( + @Nonnull BlockState p_153028_, + @Nonnull BlockState p_153029_) { + return p_153029_.setValue(BERRIES, Boolean.FALSE); + } - @Override - public ItemStack getCloneItemStack( - @Nonnull BlockGetter p_153007_, - @Nonnull BlockPos p_153008_, - @Nonnull BlockState p_153009_) { - return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); - } + @Override + public ItemStack getCloneItemStack( + @Nonnull BlockGetter p_153007_, + @Nonnull BlockPos p_153008_, + @Nonnull BlockState p_153009_) { + return new ItemStack(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); + } - @Override - public InteractionResult use( - @Nonnull BlockState p_153021_, - @Nonnull Level p_153022_, - @Nonnull BlockPos p_153023_, - @Nonnull Player p_153024_, - @Nonnull InteractionHand p_153025_, - @Nonnull BlockHitResult p_153026_) { - return ACaveVines.use(p_153021_, p_153022_, p_153023_); - } + @Override + public InteractionResult use( + @Nonnull BlockState p_153021_, + @Nonnull Level p_153022_, + @Nonnull BlockPos p_153023_, + @Nonnull Player p_153024_, + @Nonnull InteractionHand p_153025_, + @Nonnull BlockHitResult p_153026_) { + return ACaveVines.use(p_153021_, p_153022_, p_153023_); + } - @Override - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_153031_) { - p_153031_.add(BERRIES); - } + @Override + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_153031_) { + p_153031_.add(BERRIES); + } - @Override - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_153011_, - @Nonnull BlockPos p_153012_, - @Nonnull BlockState p_153013_, - boolean p_153014_) { - return !p_153013_.getValue(BERRIES); - } + @Override + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_153011_, + @Nonnull BlockPos p_153012_, + @Nonnull BlockState p_153013_, + boolean p_153014_) { + return !p_153013_.getValue(BERRIES); + } - @Override - public boolean isBonemealSuccess( - @Nonnull Level p_153016_, - @Nonnull RandomSource p_153017_, - @Nonnull BlockPos p_153018_, - @Nonnull BlockState p_153019_) { - return true; - } + @Override + public boolean isBonemealSuccess( + @Nonnull Level p_153016_, + @Nonnull RandomSource p_153017_, + @Nonnull BlockPos p_153018_, + @Nonnull BlockState p_153019_) { + return true; + } - @Override - public void performBonemeal( - @Nonnull ServerLevel p_153002_, - @Nonnull RandomSource p_153003_, - @Nonnull BlockPos p_153004_, - @Nonnull BlockState p_153005_) { - p_153002_.setBlock( - p_153004_, - p_153005_.setValue(BERRIES, Boolean.valueOf(true)), - 2); - } + @Override + public void performBonemeal( + @Nonnull ServerLevel p_153002_, + @Nonnull RandomSource p_153003_, + @Nonnull BlockPos p_153004_, + @Nonnull BlockState p_153005_) { + p_153002_.setBlock( + p_153004_, + p_153005_.setValue(BERRIES, Boolean.valueOf(true)), + 2); + } - @Override - protected GrowingPlantHeadBlock getHeadBlock() { - return ModRegistry.ANCIENT_CAVEVINES_.get(); - } + @Override + protected GrowingPlantHeadBlock getHeadBlock() { + return ModRegistry.ANCIENT_CAVEVINES_.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java index 02d1caaa..ada87ff3 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java @@ -9,17 +9,17 @@ public class AncientDirt extends Block { - public AncientDirt(Properties p_49795_) { - super(p_49795_); - } + public AncientDirt(Properties p_49795_) { + super(p_49795_); + } - @Override - public boolean canSustainPlant( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction facing, - IPlantable plantable) { - return true; - } + @Override + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java index ccb48e8e..666055d4 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientFenceBlock.java @@ -28,173 +28,173 @@ public class AncientFenceBlock extends FenceBlock { - private final VoxelShape[] occlusionByIndex; + private final VoxelShape[] occlusionByIndex; - public AncientFenceBlock(Properties props) { - super(props); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(NORTH, Boolean.valueOf(false)) - .setValue(EAST, Boolean.valueOf(false)) - .setValue(SOUTH, Boolean.valueOf(false)) - .setValue(WEST, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - this.occlusionByIndex = this.makeShapes(2.0F, 1.0F, 16.0F, 6.0F, 15.0F); - } + public AncientFenceBlock(Properties props) { + super(props); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(NORTH, Boolean.valueOf(false)) + .setValue(EAST, Boolean.valueOf(false)) + .setValue(SOUTH, Boolean.valueOf(false)) + .setValue(WEST, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + this.occlusionByIndex = this.makeShapes(2.0F, 1.0F, 16.0F, 6.0F, 15.0F); + } - public VoxelShape getOcclusionShape( - @Nonnull BlockState p_53338_, - @Nonnull BlockGetter p_53339_, - @Nonnull BlockPos p_53340_) { - return this.occlusionByIndex[this.getAABBIndex(p_53338_)]; - } + public VoxelShape getOcclusionShape( + @Nonnull BlockState p_53338_, + @Nonnull BlockGetter p_53339_, + @Nonnull BlockPos p_53340_) { + return this.occlusionByIndex[this.getAABBIndex(p_53338_)]; + } - public VoxelShape getVisualShape( - @Nonnull BlockState p_53311_, - @Nonnull BlockGetter p_53312_, - @Nonnull BlockPos p_53313_, - @Nonnull CollisionContext p_53314_) { - return this.getShape(p_53311_, p_53312_, p_53313_, p_53314_); - } + public VoxelShape getVisualShape( + @Nonnull BlockState p_53311_, + @Nonnull BlockGetter p_53312_, + @Nonnull BlockPos p_53313_, + @Nonnull CollisionContext p_53314_) { + return this.getShape(p_53311_, p_53312_, p_53313_, p_53314_); + } - public boolean isPathfindable( - @Nonnull BlockState p_53306_, - @Nonnull BlockGetter p_53307_, - @Nonnull BlockPos p_53308_, - @Nonnull PathComputationType p_53309_) { - return false; - } + public boolean isPathfindable( + @Nonnull BlockState p_53306_, + @Nonnull BlockGetter p_53307_, + @Nonnull BlockPos p_53308_, + @Nonnull PathComputationType p_53309_) { + return false; + } - public boolean connectsTo( - @Nonnull BlockState p_53330_, - boolean p_53331_, - @Nonnull Direction p_53332_) { - Block block = p_53330_.getBlock(); - boolean flag = this.isSameFence(p_53330_); - boolean flag1 = block instanceof FenceGateBlock && - FenceGateBlock.connectsToDirection(p_53330_, p_53332_); - return ((!isExceptionForConnection(p_53330_) && p_53331_) || flag || flag1); - } + public boolean connectsTo( + @Nonnull BlockState p_53330_, + boolean p_53331_, + @Nonnull Direction p_53332_) { + Block block = p_53330_.getBlock(); + boolean flag = this.isSameFence(p_53330_); + boolean flag1 = block instanceof FenceGateBlock && + FenceGateBlock.connectsToDirection(p_53330_, p_53332_); + return ((!isExceptionForConnection(p_53330_) && p_53331_) || flag || flag1); + } - private boolean isSameFence(BlockState p_153255_) { - return (p_153255_.is(BlockTags.FENCES) && - p_153255_.is(BlockTags.WOODEN_FENCES) == this.defaultBlockState().is(BlockTags.WOODEN_FENCES)); - } + private boolean isSameFence(BlockState p_153255_) { + return (p_153255_.is(BlockTags.FENCES) && + p_153255_.is(BlockTags.WOODEN_FENCES) == this.defaultBlockState().is(BlockTags.WOODEN_FENCES)); + } - public InteractionResult use( - @Nonnull BlockState p_53316_, - @Nonnull Level p_53317_, - @Nonnull BlockPos p_53318_, - @Nonnull Player p_53319_, - @Nonnull InteractionHand p_53320_, - @Nonnull BlockHitResult p_53321_) { - if (p_53317_.isClientSide) { - ItemStack itemStack = p_53319_.getItemInHand(p_53320_); - return itemStack.is(Items.LEAD) - ? InteractionResult.SUCCESS - : InteractionResult.PASS; - } else { - return LeadItem.bindPlayerMobs(p_53319_, p_53317_, p_53318_); - } - } + public InteractionResult use( + @Nonnull BlockState p_53316_, + @Nonnull Level p_53317_, + @Nonnull BlockPos p_53318_, + @Nonnull Player p_53319_, + @Nonnull InteractionHand p_53320_, + @Nonnull BlockHitResult p_53321_) { + if (p_53317_.isClientSide) { + ItemStack itemStack = p_53319_.getItemInHand(p_53320_); + return itemStack.is(Items.LEAD) + ? InteractionResult.SUCCESS + : InteractionResult.PASS; + } else { + return LeadItem.bindPlayerMobs(p_53319_, p_53317_, p_53318_); + } + } - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_53304_) { - BlockGetter blockGetter = p_53304_.getLevel(); - BlockPos blockPos = p_53304_.getClickedPos(); - FluidState fluidState = p_53304_ - .getLevel() - .getFluidState(p_53304_.getClickedPos()); - BlockPos blockPos1 = blockPos.north(); - BlockPos blockPos2 = blockPos.east(); - BlockPos blockPos3 = blockPos.south(); - BlockPos blockPos4 = blockPos.west(); - BlockState blockState = blockGetter.getBlockState(blockPos1); - BlockState blockState1 = blockGetter.getBlockState(blockPos2); - BlockState blockState2 = blockGetter.getBlockState(blockPos3); - BlockState blockState3 = blockGetter.getBlockState(blockPos4); - return super.getStateForPlacement(p_53304_) - .setValue( - NORTH, - Boolean.valueOf( - this.connectsTo( - blockState, - blockState.isFaceSturdy( - blockGetter, - blockPos1, - Direction.SOUTH), - Direction.SOUTH))) - .setValue( - EAST, - Boolean.valueOf( - this.connectsTo( - blockState1, - blockState1.isFaceSturdy( - blockGetter, - blockPos2, - Direction.WEST), - Direction.WEST))) - .setValue( - SOUTH, - Boolean.valueOf( - this.connectsTo( - blockState2, - blockState2.isFaceSturdy( - blockGetter, - blockPos3, - Direction.NORTH), - Direction.NORTH))) - .setValue( - WEST, - Boolean.valueOf( - this.connectsTo( - blockState3, - blockState3.isFaceSturdy( - blockGetter, - blockPos4, - Direction.EAST), - Direction.EAST))) - .setValue( - WATERLOGGED, - Boolean.valueOf(fluidState.getType() == Fluids.WATER)); - } + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_53304_) { + BlockGetter blockGetter = p_53304_.getLevel(); + BlockPos blockPos = p_53304_.getClickedPos(); + FluidState fluidState = p_53304_ + .getLevel() + .getFluidState(p_53304_.getClickedPos()); + BlockPos blockPos1 = blockPos.north(); + BlockPos blockPos2 = blockPos.east(); + BlockPos blockPos3 = blockPos.south(); + BlockPos blockPos4 = blockPos.west(); + BlockState blockState = blockGetter.getBlockState(blockPos1); + BlockState blockState1 = blockGetter.getBlockState(blockPos2); + BlockState blockState2 = blockGetter.getBlockState(blockPos3); + BlockState blockState3 = blockGetter.getBlockState(blockPos4); + return super.getStateForPlacement(p_53304_) + .setValue( + NORTH, + Boolean.valueOf( + this.connectsTo( + blockState, + blockState.isFaceSturdy( + blockGetter, + blockPos1, + Direction.SOUTH), + Direction.SOUTH))) + .setValue( + EAST, + Boolean.valueOf( + this.connectsTo( + blockState1, + blockState1.isFaceSturdy( + blockGetter, + blockPos2, + Direction.WEST), + Direction.WEST))) + .setValue( + SOUTH, + Boolean.valueOf( + this.connectsTo( + blockState2, + blockState2.isFaceSturdy( + blockGetter, + blockPos3, + Direction.NORTH), + Direction.NORTH))) + .setValue( + WEST, + Boolean.valueOf( + this.connectsTo( + blockState3, + blockState3.isFaceSturdy( + blockGetter, + blockPos4, + Direction.EAST), + Direction.EAST))) + .setValue( + WATERLOGGED, + Boolean.valueOf(fluidState.getType() == Fluids.WATER)); + } - public BlockState updateShape( - @Nonnull BlockState p_53323_, - @Nonnull Direction p_53324_, - @Nonnull BlockState p_53325_, - @Nonnull LevelAccessor p_53326_, - @Nonnull BlockPos p_53327_, - @Nonnull BlockPos p_53328_) { - if (p_53323_.getValue(WATERLOGGED)) { - p_53326_.scheduleTick( - p_53327_, - Fluids.WATER, - Fluids.WATER.getTickDelay(p_53326_)); - } + public BlockState updateShape( + @Nonnull BlockState p_53323_, + @Nonnull Direction p_53324_, + @Nonnull BlockState p_53325_, + @Nonnull LevelAccessor p_53326_, + @Nonnull BlockPos p_53327_, + @Nonnull BlockPos p_53328_) { + if (p_53323_.getValue(WATERLOGGED)) { + p_53326_.scheduleTick( + p_53327_, + Fluids.WATER, + Fluids.WATER.getTickDelay(p_53326_)); + } - return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL - ? p_53323_.setValue( - PROPERTY_BY_DIRECTION.get(p_53324_), - Boolean.valueOf( - this.connectsTo( - p_53325_, - p_53325_.isFaceSturdy( - p_53326_, - p_53328_, - p_53324_.getOpposite()), - p_53324_.getOpposite()))) - : super.updateShape( - p_53323_, - p_53324_, - p_53325_, - p_53326_, - p_53327_, - p_53328_); - } + return p_53324_.getAxis().getPlane() == Direction.Plane.HORIZONTAL + ? p_53323_.setValue( + PROPERTY_BY_DIRECTION.get(p_53324_), + Boolean.valueOf( + this.connectsTo( + p_53325_, + p_53325_.isFaceSturdy( + p_53326_, + p_53328_, + p_53324_.getOpposite()), + p_53324_.getOpposite()))) + : super.updateShape( + p_53323_, + p_53324_, + p_53325_, + p_53326_, + p_53327_, + p_53328_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_53334_) { - p_53334_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_53334_) { + p_53334_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java index 0ff67b66..5655377c 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java @@ -13,31 +13,31 @@ public class AncientGrass extends GrassBlock { - public AncientGrass(Properties p_49795_) { - super(p_49795_); - } + public AncientGrass(Properties p_49795_) { + super(p_49795_); + } - @Override - public boolean canSustainPlant( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction facing, - IPlantable plantable) { - return true; - } + @Override + public boolean canSustainPlant( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction facing, + IPlantable plantable) { + return true; + } - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource random) { - if (!level.getBlockState(pos.above()).isAir()) { - level.setBlock( - pos, - ModRegistry.ANCIENT_DIRT.get().defaultBlockState(), - 1); - } - } + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random) { + if (!level.getBlockState(pos.above()).isAir()) { + level.setBlock( + pos, + ModRegistry.ANCIENT_DIRT.get().defaultBlockState(), + 1); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java index b2655351..73e37263 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientHerb.java @@ -11,32 +11,32 @@ public class AncientHerb extends Block { - public AncientHerb(Properties props) { - super(props); - } + public AncientHerb(Properties props) { + super(props); + } - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random random) { - if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - } + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random random) { + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + } - @SuppressWarnings("deprecation") - @Override - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - super.tick(state, level, pos, rand); - if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - } + @SuppressWarnings("deprecation") + @Override + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + super.tick(state, level, pos, rand); + if (!level.getBlockState(pos.below()).is(BlockTags.DIRT)) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java index f54f85c7..ebfacff6 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeaves.java @@ -24,171 +24,171 @@ public class AncientLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - - private static final int TICK_DELAY = 800; - private static int TICK_COUNT; - - public AncientLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - AncientLeaves.TICK_COUNT++; - if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - } - } - - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource p_54429_) { - AncientLeaves.TICK_COUNT++; - if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - AncientLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final int TICK_DELAY = 800; + private static int TICK_COUNT; + + public AncientLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + } + + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_) { + AncientLeaves.TICK_COUNT++; + if (AncientLeaves.TICK_COUNT >= AncientLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.ANCIENT_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + AncientLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java index 7d107205..63c10e66 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLeavesBottom.java @@ -24,157 +24,157 @@ public class AncientLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public AncientLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - public void randomTick( - @Nonnull BlockState state, - ServerLevel level, - BlockPos pos, - Random rand) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if (level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public AncientLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + @Nonnull BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java index e44b1f81..a44318c5 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientLog.java @@ -4,7 +4,7 @@ public class AncientLog extends RotatedPillarBlock { - public AncientLog(Properties prop) { - super(prop); - } + public AncientLog(Properties prop) { + super(prop); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java index 6c873ad6..860e9ba4 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientSaplingBlock.java @@ -22,126 +22,126 @@ public class AncientSaplingBlock extends SaplingBlock { - public static final IntegerProperty STAGE = BlockStateProperties.STAGE; - protected static final float AABB_OFFSET = 6.0F; - protected static final VoxelShape SHAPE = Block.box( - 2.0D, - 0.0D, - 2.0D, - 14.0D, - 12.0D, - 14.0D); - private final AbstractTreeGrower treeGrower; + public static final IntegerProperty STAGE = BlockStateProperties.STAGE; + protected static final float AABB_OFFSET = 6.0F; + protected static final VoxelShape SHAPE = Block.box( + 2.0D, + 0.0D, + 2.0D, + 14.0D, + 12.0D, + 14.0D); + private final AbstractTreeGrower treeGrower; - public AncientSaplingBlock( - AbstractTreeGrower p_55978_, - BlockBehaviour.Properties p_55979_) { - super(p_55978_, p_55979_); - this.treeGrower = p_55978_; - this.registerDefaultState( - this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0))); - } + public AncientSaplingBlock( + AbstractTreeGrower p_55978_, + BlockBehaviour.Properties p_55979_) { + super(p_55978_, p_55979_); + this.treeGrower = p_55978_; + this.registerDefaultState( + this.stateDefinition.any().setValue(STAGE, Integer.valueOf(0))); + } - public VoxelShape getShape( - @Nonnull BlockState p_56008_, - @Nonnull BlockGetter p_56009_, - @Nonnull BlockPos p_56010_, - @Nonnull CollisionContext p_56011_) { - return SHAPE; - } + public VoxelShape getShape( + @Nonnull BlockState p_56008_, + @Nonnull BlockGetter p_56009_, + @Nonnull BlockPos p_56010_, + @Nonnull CollisionContext p_56011_) { + return SHAPE; + } - @Override - protected boolean mayPlaceOn( - @Nonnull BlockState state, - @Nonnull BlockGetter p_51043_, - @Nonnull BlockPos p_51044_) { - return (state.is(TagRegistry.ANCIENT_DIRT) || - state.is(Blocks.WARPED_NYLIUM) || - state.is(Blocks.CRIMSON_NYLIUM) || - state.is(ModRegistry.ANCIENT_GRASS.get())); - } + @Override + protected boolean mayPlaceOn( + @Nonnull BlockState state, + @Nonnull BlockGetter p_51043_, + @Nonnull BlockPos p_51044_) { + return (state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get())); + } - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_60581_, - @Nonnull BlockGetter p_60582_, - @Nonnull BlockPos p_60583_) { - return Shapes.empty(); - } + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_60581_, + @Nonnull BlockGetter p_60582_, + @Nonnull BlockPos p_60583_) { + return Shapes.empty(); + } - @Override - public boolean canSurvive( - @Nonnull BlockState state, - @Nonnull LevelReader reader, - @Nonnull BlockPos pos) { - return (state.is(TagRegistry.ANCIENT_DIRT) || - state.is(Blocks.WARPED_NYLIUM) || - state.is(Blocks.CRIMSON_NYLIUM) || - state.is(ModRegistry.ANCIENT_GRASS.get())); - } + @Override + public boolean canSurvive( + @Nonnull BlockState state, + @Nonnull LevelReader reader, + @Nonnull BlockPos pos) { + return (state.is(TagRegistry.ANCIENT_DIRT) || + state.is(Blocks.WARPED_NYLIUM) || + state.is(Blocks.CRIMSON_NYLIUM) || + state.is(ModRegistry.ANCIENT_GRASS.get())); + } - @SuppressWarnings("deprecation") - public void randomTick( - @Nonnull BlockState p_56003_, - @Nonnull ServerLevel p_56004_, - @Nonnull BlockPos p_56005_, - @Nonnull RandomSource p_56006_) { - if (p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && - p_56006_.nextInt(7) == 0) { - if (!p_56004_.isAreaLoaded(p_56005_, 1)) - return; // Forge: prevent loading unloaded chunks when checking neighbor's light - this.advanceTree(p_56004_, p_56005_, p_56003_, p_56006_); - } - } + @SuppressWarnings("deprecation") + public void randomTick( + @Nonnull BlockState p_56003_, + @Nonnull ServerLevel p_56004_, + @Nonnull BlockPos p_56005_, + @Nonnull RandomSource p_56006_) { + if (p_56004_.getMaxLocalRawBrightness(p_56005_.above()) >= 9 && + p_56006_.nextInt(7) == 0) { + if (!p_56004_.isAreaLoaded(p_56005_, 1)) + return; // Forge: prevent loading unloaded chunks when checking neighbor's light + this.advanceTree(p_56004_, p_56005_, p_56003_, p_56006_); + } + } - public void advanceTree( - @Nonnull ServerLevel p_55981_, - @Nonnull BlockPos p_55982_, - @Nonnull BlockState p_55983_, - @Nonnull RandomSource p_55984_) { - if (p_55983_.getValue(STAGE) == 0) { - p_55981_.setBlock(p_55982_, p_55983_.cycle(STAGE), 4); - } else { - if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree( - p_55981_, - p_55984_, - p_55982_)) - return; - this.treeGrower.growTree( - p_55981_, - p_55981_.getChunkSource().getGenerator(), - p_55982_, - p_55983_, - p_55984_); - } - } + public void advanceTree( + @Nonnull ServerLevel p_55981_, + @Nonnull BlockPos p_55982_, + @Nonnull BlockState p_55983_, + @Nonnull RandomSource p_55984_) { + if (p_55983_.getValue(STAGE) == 0) { + p_55981_.setBlock(p_55982_, p_55983_.cycle(STAGE), 4); + } else { + if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree( + p_55981_, + p_55984_, + p_55982_)) + return; + this.treeGrower.growTree( + p_55981_, + p_55981_.getChunkSource().getGenerator(), + p_55982_, + p_55983_, + p_55984_); + } + } - public boolean isValidBonemealTarget( - @Nonnull BlockGetter p_55991_, - @Nonnull BlockPos p_55992_, - @Nonnull BlockState p_55993_, - boolean p_55994_) { - return true; - } + public boolean isValidBonemealTarget( + @Nonnull BlockGetter p_55991_, + @Nonnull BlockPos p_55992_, + @Nonnull BlockState p_55993_, + boolean p_55994_) { + return true; + } - public boolean isBonemealSuccess( - @Nonnull Level p_55996_, - @Nonnull RandomSource p_55997_, - @Nonnull BlockPos p_55998_, - @Nonnull BlockState p_55999_) { - return (double) p_55996_.random.nextFloat() < 0.45D; - } + public boolean isBonemealSuccess( + @Nonnull Level p_55996_, + @Nonnull RandomSource p_55997_, + @Nonnull BlockPos p_55998_, + @Nonnull BlockState p_55999_) { + return (double) p_55996_.random.nextFloat() < 0.45D; + } - public void performBonemeal( - @Nonnull ServerLevel p_55986_, - @Nonnull RandomSource p_55987_, - @Nonnull BlockPos p_55988_, - @Nonnull BlockState p_55989_) { - this.advanceTree(p_55986_, p_55988_, p_55989_, p_55987_); - } + public void performBonemeal( + @Nonnull ServerLevel p_55986_, + @Nonnull RandomSource p_55987_, + @Nonnull BlockPos p_55988_, + @Nonnull BlockState p_55989_) { + this.advanceTree(p_55986_, p_55988_, p_55989_, p_55987_); + } - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_56001_) { - p_56001_.add(STAGE); - } + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_56001_) { + p_56001_.add(STAGE); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java index eaec1e95..adcc3cd1 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeaves.java @@ -27,189 +27,189 @@ public class DemonicLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - private static final int TICK_DELAY = 80; - private static int TICK_COUNT; - - public DemonicLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - } - - @Override - public boolean onDestroyedByPlayer( - BlockState state, - Level world, - BlockPos pos, - Player player, - boolean willHarvest, - FluidState fluid) { - if (world.getBlockState(pos.below()).getBlock() instanceof DemonicLeavesBottom) { - world.setBlockAndUpdate( - pos.below(), - Blocks.AIR.defaultBlockState()); - } - return super.onDestroyedByPlayer( - state, - world, - pos, - player, - willHarvest, - fluid); - } - - public void tick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource p_54429_) { - DemonicLeaves.TICK_COUNT++; - if (DemonicLeaves.TICK_COUNT >= DemonicLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - DemonicLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + private static final int TICK_DELAY = 80; + private static int TICK_COUNT; + + public DemonicLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + + @Override + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid) { + if (world.getBlockState(pos.below()).getBlock() instanceof DemonicLeavesBottom) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState()); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid); + } + + public void tick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource p_54429_) { + DemonicLeaves.TICK_COUNT++; + if (DemonicLeaves.TICK_COUNT >= DemonicLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.DEMONIC_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + DemonicLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java index a7aed122..ed9efec7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/DemonicLeavesBottom.java @@ -24,157 +24,157 @@ public class DemonicLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public DemonicLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random rand) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level - .getBlockState(pos.above()) - .is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if (level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public DemonicLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.DEMONIC_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java index f53b2cce..8c98d11a 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java @@ -23,183 +23,183 @@ public class SoulLava extends LiquidBlock { - public int tickCount = 0; - protected FlowingFluid fluid; - - public SoulLava( - Supplier supplier, - Properties p_i48368_1_) { - super(supplier, p_i48368_1_); - } - - @Override - public boolean isBurning( - BlockState state, - BlockGetter world, - BlockPos pos) { - return true; - } - - @Override - public boolean isFireSource( - BlockState state, - LevelReader world, - BlockPos pos, - Direction side) { - return true; - } - - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity entity) { - return false; - } - - @Override - public boolean canBeReplaced( - @Nonnull BlockState state, - @Nonnull BlockPlaceContext context) { - return false; - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource random) { - if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { - int i = random.nextInt(10); - if (i > 0) { - BlockPos blockPos = pos; - - for (int j = 0; j < i; ++j) { - blockPos = blockPos.offset( - random.nextInt(10) - 1, - 1, - random.nextInt(10) - 1); - if (!level.isEmptyBlock(blockPos)) { - return; - } - - BlockState blockState = level.getBlockState(blockPos); - @SuppressWarnings("unused") - BlockState FIRE = SoulFireBlock.canSurviveOnBlock( - blockState) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - } - } else { - for (int k = 0; k < 10; ++k) { - BlockPos blockPos1 = pos.offset( - random.nextInt(10) - 1, - 0, - random.nextInt(10) - 1); - BlockState FIRE = SoulFireBlock.canSurviveOnBlock( - level.getBlockState(blockPos1)) - ? Blocks.SOUL_FIRE.defaultBlockState() - : ((FireBlock) Blocks.FIRE).defaultBlockState(); - - if (!level.isEmptyBlock(blockPos1)) { - return; - } - - level.setBlockAndUpdate( - blockPos1.above(), - ForgeEventFactory.fireFluidPlaceBlockEvent( - level, - blockPos1.above(), - pos, - FIRE)); - } - } - } - } - - @OnlyIn(Dist.CLIENT) - @Override - public void animateTick( - @Nonnull BlockState stateIn, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - this.tickCount++; - - if (stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && - this.tickCount >= 40) { - spawnParticles(worldIn, pos); - this.tickCount = 0; - } - super.animateTick(stateIn, worldIn, pos, rand); - } - - private static void spawnParticles(Level world, BlockPos worldIn) { - // double d0 = 0.5625D; - RandomSource random = world.random; - - if (world.getFluidState(worldIn).isSource() && - (random.nextBoolean() == true)) { - for (Direction direction : Direction.values()) { - BlockPos blockPos = worldIn.offset(direction.getNormal()); - if (!world - .getBlockState(blockPos) - .isSolidRender(world, blockPos)) { - Direction.Axis direction$axis = direction.getAxis(); - double d1 = direction$axis == Direction.Axis.X - ? 0.5D + 0.5625D * (double) direction.getStepX() - : (double) random.nextFloat(); - double d2 = direction$axis == Direction.Axis.Y - ? 0.5D + 0.5625D * (double) direction.getStepY() - : (double) random.nextFloat(); - double d3 = direction$axis == Direction.Axis.Z - ? 0.5D + 0.5625D * (double) direction.getStepZ() - : (double) random.nextFloat(); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - random.nextFloat(), - random.nextFloat(), - random.nextFloat()); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - random.nextFloat(), - -random.nextFloat(), - -random.nextFloat()); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - -random.nextFloat(), - random.nextFloat(), - -random.nextFloat()); - world.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - (double) worldIn.getX() + d1, - (double) worldIn.getY() + d2, - (double) worldIn.getZ() + d3, - -random.nextFloat(), - -random.nextFloat(), - random.nextFloat()); - } - } - } - } - - @Override - public int getFireSpreadSpeed( - BlockState state, - BlockGetter world, - BlockPos pos, - Direction face) { - return 1000; - } + public int tickCount = 0; + protected FlowingFluid fluid; + + public SoulLava( + Supplier supplier, + Properties p_i48368_1_) { + super(supplier, p_i48368_1_); + } + + @Override + public boolean isBurning( + BlockState state, + BlockGetter world, + BlockPos pos) { + return true; + } + + @Override + public boolean isFireSource( + BlockState state, + LevelReader world, + BlockPos pos, + Direction side) { + return true; + } + + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity entity) { + return false; + } + + @Override + public boolean canBeReplaced( + @Nonnull BlockState state, + @Nonnull BlockPlaceContext context) { + return false; + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource random) { + if (level.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { + int i = random.nextInt(10); + if (i > 0) { + BlockPos blockPos = pos; + + for (int j = 0; j < i; ++j) { + blockPos = blockPos.offset( + random.nextInt(10) - 1, + 1, + random.nextInt(10) - 1); + if (!level.isEmptyBlock(blockPos)) { + return; + } + + BlockState blockState = level.getBlockState(blockPos); + @SuppressWarnings("unused") + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + blockState) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + } + } else { + for (int k = 0; k < 10; ++k) { + BlockPos blockPos1 = pos.offset( + random.nextInt(10) - 1, + 0, + random.nextInt(10) - 1); + BlockState FIRE = SoulFireBlock.canSurviveOnBlock( + level.getBlockState(blockPos1)) + ? Blocks.SOUL_FIRE.defaultBlockState() + : ((FireBlock) Blocks.FIRE).defaultBlockState(); + + if (!level.isEmptyBlock(blockPos1)) { + return; + } + + level.setBlockAndUpdate( + blockPos1.above(), + ForgeEventFactory.fireFluidPlaceBlockEvent( + level, + blockPos1.above(), + pos, + FIRE)); + } + } + } + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick( + @Nonnull BlockState stateIn, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + this.tickCount++; + + if (stateIn.is(BlockRegistry.SOULLAVA_BLOCK.get()) && + this.tickCount >= 40) { + spawnParticles(worldIn, pos); + this.tickCount = 0; + } + super.animateTick(stateIn, worldIn, pos, rand); + } + + private static void spawnParticles(Level world, BlockPos worldIn) { + // double d0 = 0.5625D; + RandomSource random = world.random; + + if (world.getFluidState(worldIn).isSource() && + (random.nextBoolean() == true)) { + for (Direction direction : Direction.values()) { + BlockPos blockPos = worldIn.offset(direction.getNormal()); + if (!world + .getBlockState(blockPos) + .isSolidRender(world, blockPos)) { + Direction.Axis direction$axis = direction.getAxis(); + double d1 = direction$axis == Direction.Axis.X + ? 0.5D + 0.5625D * (double) direction.getStepX() + : (double) random.nextFloat(); + double d2 = direction$axis == Direction.Axis.Y + ? 0.5D + 0.5625D * (double) direction.getStepY() + : (double) random.nextFloat(); + double d3 = direction$axis == Direction.Axis.Z + ? 0.5D + 0.5625D * (double) direction.getStepZ() + : (double) random.nextFloat(); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + random.nextFloat(), + random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + random.nextFloat(), + -random.nextFloat(), + -random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + random.nextFloat(), + -random.nextFloat()); + world.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + (double) worldIn.getX() + d1, + (double) worldIn.getY() + d2, + (double) worldIn.getZ() + d3, + -random.nextFloat(), + -random.nextFloat(), + random.nextFloat()); + } + } + } + } + + @Override + public int getFireSpreadSpeed( + BlockState state, + BlockGetter world, + BlockPos pos, + Direction face) { + return 1000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java index 5d8cc9cb..b02c8cf5 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeaves.java @@ -28,190 +28,190 @@ public class SoulLeaves extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - - private static final int TICK_DELAY = 80; - private static int TICK_COUNT; - - public SoulLeaves(Properties p_54422_) { - super(p_54422_.randomTicks()); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - @Override - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - @Override - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - @Override - public void randomTick( - @Nonnull BlockState state, - @Nonnull ServerLevel level, - @Nonnull BlockPos pos, - @Nonnull RandomSource rand) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - } - - @Override - public boolean onDestroyedByPlayer( - BlockState state, - Level world, - BlockPos pos, - Player player, - boolean willHarvest, - FluidState fluid) { - if (world.getBlockState(pos.below()).getBlock() instanceof SoulLeavesBottom) { - world.setBlockAndUpdate( - pos.below(), - Blocks.AIR.defaultBlockState()); - } - return super.onDestroyedByPlayer( - state, - world, - pos, - player, - willHarvest, - fluid); - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_) { - SoulLeaves.TICK_COUNT++; - if (SoulLeaves.TICK_COUNT >= SoulLeaves.TICK_DELAY) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - if (level.getBlockState(pos.below()).isAir()) { - level.setBlock( - pos.below(), - ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), - 3); - } - SoulLeaves.TICK_COUNT = 0; - } - } - - @Override - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - @Override - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - @Override - public void animateTick( - @Nonnull BlockState p_54431_, - @Nonnull Level p_54432_, - @Nonnull BlockPos p_54433_, - @Nonnull RandomSource p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - @Override - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final int TICK_DELAY = 80; + private static int TICK_COUNT; + + public SoulLeaves(Properties p_54422_) { + super(p_54422_.randomTicks()); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + @Override + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + @Override + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + @Override + public void randomTick( + @Nonnull BlockState state, + @Nonnull ServerLevel level, + @Nonnull BlockPos pos, + @Nonnull RandomSource rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + } + + @Override + public boolean onDestroyedByPlayer( + BlockState state, + Level world, + BlockPos pos, + Player player, + boolean willHarvest, + FluidState fluid) { + if (world.getBlockState(pos.below()).getBlock() instanceof SoulLeavesBottom) { + world.setBlockAndUpdate( + pos.below(), + Blocks.AIR.defaultBlockState()); + } + return super.onDestroyedByPlayer( + state, + world, + pos, + player, + willHarvest, + fluid); + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + SoulLeaves.TICK_COUNT++; + if (SoulLeaves.TICK_COUNT >= SoulLeaves.TICK_DELAY) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + if (level.getBlockState(pos.below()).isAir()) { + level.setBlock( + pos.below(), + ModRegistry.SOUL_LEAVES_BOTTOM.get().defaultBlockState(), + 3); + } + SoulLeaves.TICK_COUNT = 0; + } + } + + @Override + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + @Override + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + @Override + public void animateTick( + @Nonnull BlockState p_54431_, + @Nonnull Level p_54432_, + @Nonnull BlockPos p_54433_, + @Nonnull RandomSource p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java index 4cb0ba2c..8dbb6660 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/SoulLeavesBottom.java @@ -24,157 +24,157 @@ public class SoulLeavesBottom extends LeavesBlock { - public static final int DECAY_DISTANCE = 7; - public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; - public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - - // private static final int TICK_DELAY = 1; - - public SoulLeavesBottom(Properties p_54422_) { - super(p_54422_); - this.registerDefaultState( - this.stateDefinition.any() - .setValue(DISTANCE, Integer.valueOf(7)) - .setValue(PERSISTENT, Boolean.valueOf(false)) - .setValue(WATERLOGGED, Boolean.valueOf(false))); - } - - public VoxelShape getBlockSupportShape( - @Nonnull BlockState p_54456_, - @Nonnull BlockGetter p_54457_, - @Nonnull BlockPos p_54458_) { - return Shapes.empty(); - } - - public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { - return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); - } - - public void randomTick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random rand) { - if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { - dropResources(state, level, pos); - level.removeBlock(pos, false); - } - if (level - .getBlockState(pos.above()) - .is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public void tick( - BlockState state, - ServerLevel level, - BlockPos pos, - Random p_54429_) { - level.setBlock(pos, updateDistance(state, level, pos), 3); - - if (level - .getBlockState(pos.above()) - .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || - level.getBlockState(pos.above()).isAir()) { - level.removeBlock(pos, false); - } - } - - public int getLightBlock( - @Nonnull BlockState p_54460_, - @Nonnull BlockGetter p_54461_, - @Nonnull BlockPos p_54462_) { - return 1; - } - - public BlockState updateShape( - @Nonnull BlockState p_54440_, - @Nonnull Direction p_54441_, - @Nonnull BlockState p_54442_, - @Nonnull LevelAccessor p_54443_, - @Nonnull BlockPos p_54444_, - @Nonnull BlockPos p_54445_) { - int i = getDistanceAt(p_54442_) + 1; - if (i != 1 || p_54440_.getValue(DISTANCE) != i) { - p_54443_.scheduleTick(p_54444_, this, 1); - } - - return p_54440_; - } - - private static BlockState updateDistance( - BlockState p_54436_, - LevelAccessor p_54437_, - BlockPos p_54438_) { - int i = 7; - BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); - - for (Direction direction : Direction.values()) { - blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); - i = Math.min( - i, - getDistanceAt( - p_54437_.getBlockState(blockPos$mutableBlockPos)) + - 1); - if (i == 1) { - break; - } - } - - return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); - } - - private static int getDistanceAt(BlockState p_54464_) { - if (p_54464_.is(BlockTags.LOGS)) { - return 0; - } else { - return p_54464_.getBlock() instanceof LeavesBlock - ? p_54464_.getValue(DISTANCE) - : 7; - } - } - - public void animateTick( - BlockState p_54431_, - Level p_54432_, - BlockPos p_54433_, - Random p_54434_) { - if (p_54432_.isRainingAt(p_54433_.above())) { - if (p_54434_.nextInt(15) == 1) { - BlockPos blockPos = p_54433_.below(); - BlockState blockState = p_54432_.getBlockState(blockPos); - if (!blockState.canOcclude() || - !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { - double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); - double d1 = (double) p_54433_.getY() - 0.05D; - double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); - p_54432_.addParticle( - ParticleTypes.DRIPPING_WATER, - d0, - d1, - d2, - 0.0D, - 0.0D, - 0.0D); - } - } - } - } - - protected void createBlockStateDefinition( - @Nonnull StateDefinition.Builder p_54447_) { - p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); - } - - public BlockState getStateForPlacement( - @Nonnull BlockPlaceContext p_54424_) { - return updateDistance( - this.defaultBlockState() - .setValue(PERSISTENT, Boolean.valueOf(true)), - p_54424_.getLevel(), - p_54424_.getClickedPos()); - } + public static final int DECAY_DISTANCE = 7; + public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + // private static final int TICK_DELAY = 1; + + public SoulLeavesBottom(Properties p_54422_) { + super(p_54422_); + this.registerDefaultState( + this.stateDefinition.any() + .setValue(DISTANCE, Integer.valueOf(7)) + .setValue(PERSISTENT, Boolean.valueOf(false)) + .setValue(WATERLOGGED, Boolean.valueOf(false))); + } + + public VoxelShape getBlockSupportShape( + @Nonnull BlockState p_54456_, + @Nonnull BlockGetter p_54457_, + @Nonnull BlockPos p_54458_) { + return Shapes.empty(); + } + + public boolean isRandomlyTicking(@Nonnull BlockState p_54449_) { + return (p_54449_.getValue(DISTANCE) == 7 && !p_54449_.getValue(PERSISTENT)); + } + + public void randomTick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random rand) { + if (!state.getValue(PERSISTENT) && state.getValue(DISTANCE) == 7) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + if (level + .getBlockState(pos.above()) + .is(ModRegistry.SOUL_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public void tick( + BlockState state, + ServerLevel level, + BlockPos pos, + Random p_54429_) { + level.setBlock(pos, updateDistance(state, level, pos), 3); + + if (level + .getBlockState(pos.above()) + .is(ModRegistry.ANCIENT_LEAVES_BOTTOM.get()) || + level.getBlockState(pos.above()).isAir()) { + level.removeBlock(pos, false); + } + } + + public int getLightBlock( + @Nonnull BlockState p_54460_, + @Nonnull BlockGetter p_54461_, + @Nonnull BlockPos p_54462_) { + return 1; + } + + public BlockState updateShape( + @Nonnull BlockState p_54440_, + @Nonnull Direction p_54441_, + @Nonnull BlockState p_54442_, + @Nonnull LevelAccessor p_54443_, + @Nonnull BlockPos p_54444_, + @Nonnull BlockPos p_54445_) { + int i = getDistanceAt(p_54442_) + 1; + if (i != 1 || p_54440_.getValue(DISTANCE) != i) { + p_54443_.scheduleTick(p_54444_, this, 1); + } + + return p_54440_; + } + + private static BlockState updateDistance( + BlockState p_54436_, + LevelAccessor p_54437_, + BlockPos p_54438_) { + int i = 7; + BlockPos.MutableBlockPos blockPos$mutableBlockPos = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + blockPos$mutableBlockPos.setWithOffset(p_54438_, direction); + i = Math.min( + i, + getDistanceAt( + p_54437_.getBlockState(blockPos$mutableBlockPos)) + + 1); + if (i == 1) { + break; + } + } + + return p_54436_.setValue(DISTANCE, Integer.valueOf(i)); + } + + private static int getDistanceAt(BlockState p_54464_) { + if (p_54464_.is(BlockTags.LOGS)) { + return 0; + } else { + return p_54464_.getBlock() instanceof LeavesBlock + ? p_54464_.getValue(DISTANCE) + : 7; + } + } + + public void animateTick( + BlockState p_54431_, + Level p_54432_, + BlockPos p_54433_, + Random p_54434_) { + if (p_54432_.isRainingAt(p_54433_.above())) { + if (p_54434_.nextInt(15) == 1) { + BlockPos blockPos = p_54433_.below(); + BlockState blockState = p_54432_.getBlockState(blockPos); + if (!blockState.canOcclude() || + !blockState.isFaceSturdy(p_54432_, blockPos, Direction.UP)) { + double d0 = (double) p_54433_.getX() + p_54434_.nextDouble(); + double d1 = (double) p_54433_.getY() - 0.05D; + double d2 = (double) p_54433_.getZ() + p_54434_.nextDouble(); + p_54432_.addParticle( + ParticleTypes.DRIPPING_WATER, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D); + } + } + } + } + + protected void createBlockStateDefinition( + @Nonnull StateDefinition.Builder p_54447_) { + p_54447_.add(DISTANCE, PERSISTENT, WATERLOGGED); + } + + public BlockState getStateForPlacement( + @Nonnull BlockPlaceContext p_54424_) { + return updateDistance( + this.defaultBlockState() + .setValue(PERSISTENT, Boolean.valueOf(true)), + p_54424_.getLevel(), + p_54424_.getClickedPos()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java index ce8f5070..fb9c0b03 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/TeleportPad.java @@ -28,295 +28,295 @@ public class TeleportPad extends Block { - protected static final VoxelShape TELEPORTPAD_AABB = Block.box( - 0.0D, - 0.0D, - 0.0D, - 16.0D, - 3.0D, - 16.0D); + protected static final VoxelShape TELEPORTPAD_AABB = Block.box( + 0.0D, + 0.0D, + 0.0D, + 16.0D, + 3.0D, + 16.0D); - public TeleportPad(Properties properties) { - super(properties); - // TODO Auto-generated constructor stub - } + public TeleportPad(Properties properties) { + super(properties); + // TODO Auto-generated constructor stub + } - @Override - public VoxelShape getShape( - @Nonnull BlockState state, - @Nonnull BlockGetter worldIn, - @Nonnull BlockPos pos, - @Nonnull CollisionContext context) { - return TELEPORTPAD_AABB; - } + @Override + public VoxelShape getShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context) { + return TELEPORTPAD_AABB; + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } - @Override - public VoxelShape getCollisionShape( - @Nonnull BlockState state, - @Nonnull BlockGetter worldIn, - @Nonnull BlockPos pos, - @Nonnull CollisionContext context) { - return TELEPORTPAD_AABB; - } + @Override + public VoxelShape getCollisionShape( + @Nonnull BlockState state, + @Nonnull BlockGetter worldIn, + @Nonnull BlockPos pos, + @Nonnull CollisionContext context) { + return TELEPORTPAD_AABB; + } - @SuppressWarnings("deprecation") - @Override - public InteractionResult use( - @Nonnull BlockState state, - @Nonnull Level worldIn, - @Nonnull BlockPos pos, - @Nonnull Player player, - @Nonnull InteractionHand handIn, - @Nonnull BlockHitResult hit) { - if ((player instanceof ServerPlayer) && (player.isCrouching() == true)) { - transferPlayer((ServerPlayer) player, pos); - worldIn.addAlwaysVisibleParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY() + 1, - pos.getZ(), - 0, - 1, - 0); - } + @SuppressWarnings("deprecation") + @Override + public InteractionResult use( + @Nonnull BlockState state, + @Nonnull Level worldIn, + @Nonnull BlockPos pos, + @Nonnull Player player, + @Nonnull InteractionHand handIn, + @Nonnull BlockHitResult hit) { + if ((player instanceof ServerPlayer) && (player.isCrouching() == true)) { + transferPlayer((ServerPlayer) player, pos); + worldIn.addAlwaysVisibleParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY() + 1, + pos.getZ(), + 0, + 1, + 0); + } - return super.use(state, worldIn, pos, player, handIn, hit); - } + return super.use(state, worldIn, pos, player, handIn, hit); + } - @Override - public boolean canHarvestBlock( - BlockState state, - BlockGetter world, - BlockPos pos, - Player player) { - if (player.level - .dimension() - .registry() - .getNamespace() - .contains(Reference.MOD_ID)) { - return false; - } else { - return true; - } - } + @Override + public boolean canHarvestBlock( + BlockState state, + BlockGetter world, + BlockPos pos, + Player player) { + if (player.level + .dimension() + .registry() + .getNamespace() + .contains(Reference.MOD_ID)) { + return false; + } else { + return true; + } + } - public void transferPlayer(ServerPlayer player, BlockPos pos) { - boolean config = AllTheModium.ALLOW_TELEPORT_MINING; - if (player.level.dimension().equals(LevelRegistry.Mining)) { - ServerLevel targetWorld = player.server.getLevel( - AllTheModium.OverWorld); + public void transferPlayer(ServerPlayer player, BlockPos pos) { + boolean config = AllTheModium.ALLOW_TELEPORT_MINING; + if (player.level.dimension().equals(LevelRegistry.Mining)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.OverWorld); - if (targetWorld == null) - return; + if (targetWorld == null) + return; - int y = 256; - boolean located = false; - while (y >= 1) { - BlockPos posA = new BlockPos( - Math.round(pos.getX()), - y, - Math.round(pos.getZ())); - Block potential = targetWorld.getBlockState(posA).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - } else { - y--; - } - } - if (located) { - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - y + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya); + int y = 256; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ())); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); - return; - } else { - if ((!targetWorld.getBlockState(pos).hasBlockEntity()) && - (targetWorld - .getBlockState(pos) - .canEntityDestroy(targetWorld, pos, player))) { - // targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); - } + return; + } else { + if ((!targetWorld.getBlockState(pos).hasBlockEntity()) && + (targetWorld + .getBlockState(pos) + .canEntityDestroy(targetWorld, pos, player))) { + // targetWorld.setBlockState(pos, ModBlocks.TELEPORT_PAD.getDefaultState()); + } - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - pos.getY() + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya); - } - } else if (player.level.dimension().equals(AllTheModium.Nether)) { - ServerLevel targetWorld = player.server.getLevel( - LevelRegistry.THE_OTHER); - BlockPos targetPos = new BlockPos( - Math.round(pos.getX()), - Math.round(pos.getY()), - Math.round(pos.getZ())); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + pos.getY() + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); + } + } else if (player.level.dimension().equals(AllTheModium.Nether)) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.THE_OTHER); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + Math.round(pos.getY()), + Math.round(pos.getZ())); - if (targetWorld == null) - return; + if (targetWorld == null) + return; - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - LevelHeightAccessor accessor = targetWorld - .getChunk(pos) - .getHeightAccessorForGeneration(); - int y = targetWorld - .getChunkSource() - .getGenerator() - .getSpawnHeight(accessor); - targetWorld.setBlockAndUpdate( - new BlockPos(targetPos.getX(), y, targetPos.getZ()), - ModRegistry.TELEPORT_PAD.get().defaultBlockState()); + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + LevelHeightAccessor accessor = targetWorld + .getChunk(pos) + .getHeightAccessorForGeneration(); + int y = targetWorld + .getChunkSource() + .getGenerator() + .getSpawnHeight(accessor); + targetWorld.setBlockAndUpdate( + new BlockPos(targetPos.getX(), y, targetPos.getZ()), + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - targetPos.getX() + 0.5D, - y + 0.25D, - targetPos.getZ() + 0.5D, - 0, - 0); - } - } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { - ServerLevel targetWorld = player.server.getLevel( - AllTheModium.Nether); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + y + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0); + } + } else if (player.level.dimension().equals(LevelRegistry.THE_OTHER)) { + ServerLevel targetWorld = player.server.getLevel( + AllTheModium.Nether); - if (targetWorld == null) - return; + if (targetWorld == null) + return; - int y = 128; - boolean located = false; - while (y >= 1) { - BlockPos posA = new BlockPos( - Math.round(pos.getX()), - y, - Math.round(pos.getZ())); - Block potential = targetWorld.getBlockState(posA).getBlock(); - if (potential.getName().toString().contains("teleport_pad")) { - located = true; - break; - } else { - y--; - } - } - if (located) { - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - pos.getX() + 0.5D, - y + 0.25D, - pos.getZ() + 0.5D, - player.rotA, - player.yya); + int y = 128; + boolean located = false; + while (y >= 1) { + BlockPos posA = new BlockPos( + Math.round(pos.getX()), + y, + Math.round(pos.getZ())); + Block potential = targetWorld.getBlockState(posA).getBlock(); + if (potential.getName().toString().contains("teleport_pad")) { + located = true; + break; + } else { + y--; + } + } + if (located) { + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + pos.getX() + 0.5D, + y + 0.25D, + pos.getZ() + 0.5D, + player.rotA, + player.yya); - return; - } else { - BlockPos newPos = new BlockPos(pos.getX(), 90, pos.getZ()); - if ((!targetWorld.getBlockState(newPos).hasBlockEntity()) && - (targetWorld - .getBlockState(newPos) - .canEntityDestroy(targetWorld, newPos, player))) { - targetWorld.setBlockAndUpdate( - newPos, - ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - } + return; + } else { + BlockPos newPos = new BlockPos(pos.getX(), 90, pos.getZ()); + if ((!targetWorld.getBlockState(newPos).hasBlockEntity()) && + (targetWorld + .getBlockState(newPos) + .canEntityDestroy(targetWorld, newPos, player))) { + targetWorld.setBlockAndUpdate( + newPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); + } - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - newPos.getX(), - newPos.getY(), - newPos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - newPos.getX() + 0.5D, - newPos.getY() + 0.25D, - newPos.getZ() + 0.5D, - player.rotA, - player.yya); - } - } else if (player.level.dimension().equals(AllTheModium.OverWorld) && - (config == true)) { - ServerLevel targetWorld = player.server.getLevel( - LevelRegistry.Mining); - BlockPos targetPos = new BlockPos( - Math.round(pos.getX()), - 253, - Math.round(pos.getZ())); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + newPos.getX(), + newPos.getY(), + newPos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + newPos.getX() + 0.5D, + newPos.getY() + 0.25D, + newPos.getZ() + 0.5D, + player.rotA, + player.yya); + } + } else if (player.level.dimension().equals(AllTheModium.OverWorld) && + (config == true)) { + ServerLevel targetWorld = player.server.getLevel( + LevelRegistry.Mining); + BlockPos targetPos = new BlockPos( + Math.round(pos.getX()), + 253, + Math.round(pos.getZ())); - if (targetWorld == null) - return; + if (targetWorld == null) + return; - if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { - targetWorld.setBlockAndUpdate( - targetPos, - ModRegistry.TELEPORT_PAD.get().defaultBlockState()); - targetWorld.addParticle( - ParticleTypes.SOUL_FIRE_FLAME, - pos.getX(), - pos.getY(), - pos.getZ(), - 0, - 1, - 0); - player.teleportTo( - targetWorld, - targetPos.getX() + 0.5D, - targetPos.getY() + 0.25D, - targetPos.getZ() + 0.5D, - 0, - 0); - } - } - } + if (!targetWorld.getBlockState(targetPos).hasBlockEntity()) { + targetWorld.setBlockAndUpdate( + targetPos, + ModRegistry.TELEPORT_PAD.get().defaultBlockState()); + targetWorld.addParticle( + ParticleTypes.SOUL_FIRE_FLAME, + pos.getX(), + pos.getY(), + pos.getZ(), + 0, + 1, + 0); + player.teleportTo( + targetWorld, + targetPos.getX() + 0.5D, + targetPos.getY() + 0.25D, + targetPos.getZ() + 0.5D, + 0, + 0); + } + } + } - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - return list; - } + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java index a0b9e497..56880afa 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java @@ -13,18 +13,18 @@ public class UAAlloyBlock extends Block { - public UAAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } + public UAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UA_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java index 2c356cd3..f1916981 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java @@ -13,18 +13,18 @@ public class UVAlloyBlock extends Block { - public UVAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } + public UVAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UV_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java index 8b7a22a9..bebd1eb7 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java @@ -13,18 +13,18 @@ public class UnobtainiumBlock extends Block { - public UnobtainiumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } + public UnobtainiumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.UNOBTAINIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java index f84bf856..ddd51bac 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java @@ -16,59 +16,59 @@ public class UnobtainiumOre extends DropExperienceBlock { - public UnobtainiumOre() { // func_235861_h_ = setRequiresTool - super( - Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.NETHER_GOLD_ORE) - .strength(80.0f, 5000f)); - } + public UnobtainiumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_GOLD_ORE) + .strength(80.0f, 5000f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if (AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player) - ? 750 - : 5500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 750 + : 5500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player) { - if ((player instanceof FakePlayer) && - state.is(TagRegistry.UNOBTAINIUM_ORE)) { - return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); - } - return (super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F)); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + state.is(TagRegistry.UNOBTAINIUM_ORE)) { + return AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get(); + } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2)); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java index 2defd0f7..db028351 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java @@ -13,18 +13,18 @@ public class VAAlloyBlock extends Block { - public VAAlloyBlock() { - super( - Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); - } + public VAAlloyBlock() { + super( + Properties.of(Material.STONE).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VA_ALLOY_ITEM.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java index 61ab4373..887aa95b 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java @@ -13,18 +13,18 @@ public class VibraniumBlock extends Block { - public VibraniumBlock() { - super( - Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); - } + public VibraniumBlock() { + super( + Properties.of(Material.METAL).sound(SoundType.STONE).strength(7.0f)); + } - @Deprecated - @Override - public List getDrops( - @Nonnull BlockState state, - @Nonnull LootContext.Builder builder) { - List list = new ArrayList(); - list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); - return list; - } + @Deprecated + @Override + public List getDrops( + @Nonnull BlockState state, + @Nonnull LootContext.Builder builder) { + List list = new ArrayList(); + list.add(new ItemStack(ModRegistry.VIBRANIUM_BLOCK.get())); + return list; + } } diff --git a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java index 5ceffc84..bc6ac119 100644 --- a/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java +++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java @@ -16,58 +16,58 @@ public class VibraniumOre extends DropExperienceBlock { - public VibraniumOre() { // func_235861_h_ = setRequiresTool - super( - Properties - .of(Material.STONE) - .requiresCorrectToolForDrops() - .sound(SoundType.NETHER_ORE) - .strength(80.0f, 2500.0f)); - } + public VibraniumOre() { // func_235861_h_ = setRequiresTool + super( + Properties + .of(Material.STONE) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHER_ORE) + .strength(80.0f, 2500.0f)); + } - @Override - @SuppressWarnings("deprecation") // deprecated method from super class - public float getDestroyProgress( - @Nonnull BlockState state, - @Nonnull Player player, - @Nonnull BlockGetter getter, - @Nonnull BlockPos blockPos) { - if (canEntityDestroy(state, getter, blockPos, player)) { - if (AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) - return super.getDestroyProgress(state, player, getter, blockPos); - int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( - state, - player) - ? 500 - : 2500; - return player.getDigSpeed(state, blockPos) / 2.0F / i; - } - return 0.0F; - } + @Override + @SuppressWarnings("deprecation") // deprecated method from super class + public float getDestroyProgress( + @Nonnull BlockState state, + @Nonnull Player player, + @Nonnull BlockGetter getter, + @Nonnull BlockPos blockPos) { + if (canEntityDestroy(state, getter, blockPos, player)) { + if (AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) + return super.getDestroyProgress(state, player, getter, blockPos); + int i = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops( + state, + player) + ? 500 + : 2500; + return player.getDigSpeed(state, blockPos) / 2.0F / i; + } + return 0.0F; + } - @Override - public boolean canEntityDestroy( - BlockState state, - BlockGetter world, - BlockPos pos, - Entity player) { - if ((player instanceof FakePlayer) && - state.is(TagRegistry.VIBRANIUM_ORE)) { - return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); - } - return (super.canEntityDestroy(state, world, pos, player) && - (distanceTo(pos, player.blockPosition) < 16.0F)); - } + @Override + public boolean canEntityDestroy( + BlockState state, + BlockGetter world, + BlockPos pos, + Entity player) { + if ((player instanceof FakePlayer) && + state.is(TagRegistry.VIBRANIUM_ORE)) { + return AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get(); + } + return (super.canEntityDestroy(state, world, pos, player) && + (distanceTo(pos, player.blockPosition) < 16.0F)); + } - private double distanceTo(BlockPos block, BlockPos player) { - return Math.sqrt( - Math.pow(block.getX() - player.getX(), 2) + - Math.pow(block.getY() - player.getY(), 2) + - Math.pow(block.getZ() - player.getZ(), 2)); - } + private double distanceTo(BlockPos block, BlockPos player) { + return Math.sqrt( + Math.pow(block.getX() - player.getX(), 2) + + Math.pow(block.getY() - player.getY(), 2) + + Math.pow(block.getZ() - player.getZ(), 2)); + } - @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { - return PushReaction.BLOCK; - } + @Override + public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + return PushReaction.BLOCK; + } } diff --git a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java index ef2b755c..9b0c9e86 100644 --- a/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java +++ b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java @@ -4,37 +4,37 @@ public class AllthemodiumServerConfigs { - public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); - public static final ForgeConfigSpec SPEC; - - public static final ForgeConfigSpec.ConfigValue ALLTHEMODIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; - public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; - - public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; - - // public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; - - static { - BUILDER.push("AllTheModium Configs"); - ALLTHEMODIUM_QUARRYABLE = BUILDER - .comment( - "Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Allthemodium Quarryable", false); - UNOBTAINIUM_QUARRYABLE = BUILDER - .comment( - "Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Unobtainium Quarryable", false); - VIBRANIUM_QUARRYABLE = BUILDER - .comment( - "Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)") - .define("Vibranium Quarryable", false); - OTHER_PROTECTION = BUILDER - .comment( - "Whether The Other is protected from quarries. (Default value: true)") - .define("Other Protection", true); - - BUILDER.pop(); - SPEC = BUILDER.build(); - } + public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); + public static final ForgeConfigSpec SPEC; + + public static final ForgeConfigSpec.ConfigValue ALLTHEMODIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue UNOBTAINIUM_QUARRYABLE; + public static final ForgeConfigSpec.ConfigValue VIBRANIUM_QUARRYABLE; + + public static final ForgeConfigSpec.ConfigValue OTHER_PROTECTION; + + // public static final ForgeConfigSpec.ConfigValue> ALLTHEMODIUM_BIOMES; + + static { + BUILDER.push("AllTheModium Configs"); + ALLTHEMODIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Allthemodium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Allthemodium Quarryable", false); + UNOBTAINIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Unobtainium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Unobtainium Quarryable", false); + VIBRANIUM_QUARRYABLE = BUILDER + .comment( + "Whether or not Vibranium Ore should be quarryable or only player mineable. (Default value: false)") + .define("Vibranium Quarryable", false); + OTHER_PROTECTION = BUILDER + .comment( + "Whether The Other is protected from quarries. (Default value: true)") + .define("Other Protection", true); + + BUILDER.pop(); + SPEC = BUILDER.build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java index befd8c1d..7986e78e 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java @@ -8,14 +8,14 @@ public class ATMCraftingSetup { - public static final RecipeSerializer SERIALIZER = new ATMRecipeSerializer(); - public static final RecipeSerializer SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); + public static final RecipeSerializer SERIALIZER = new ATMRecipeSerializer(); + public static final RecipeSerializer SERIALIZER_SHAPELESS = new ATMShapelessRecipeSerializer(); - public static final DeferredRegister> REGISTRY = DeferredRegister.create( - ForgeRegistries.RECIPE_SERIALIZERS, - Reference.MOD_ID); - public static final RegistryObject> ATM_DATA = REGISTRY.register("atmshaped_crafting", - () -> SERIALIZER); - public static final RegistryObject> ATM_SHAPELESS_DATA = REGISTRY - .register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); + public static final DeferredRegister> REGISTRY = DeferredRegister.create( + ForgeRegistries.RECIPE_SERIALIZERS, + Reference.MOD_ID); + public static final RegistryObject> ATM_DATA = REGISTRY.register("atmshaped_crafting", + () -> SERIALIZER); + public static final RegistryObject> ATM_SHAPELESS_DATA = REGISTRY + .register("atmshapeless_crafting", () -> SERIALIZER_SHAPELESS); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java index 6c7aaa85..6e4b58c4 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java @@ -8,36 +8,36 @@ public class ATMRecipeSerializer implements RecipeSerializer { - @Override - public ATMShapedRecipe fromJson( - @Nonnull ResourceLocation recipeId, - @Nonnull JsonObject json) { - return new ATMShapedRecipe( - RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json)); - } + @Override + public ATMShapedRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json) { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json)); + } - @Override - public ATMShapedRecipe fromNetwork( - @Nonnull ResourceLocation recipeId, - @Nonnull FriendlyByteBuf buffer) { - try { - return new ATMShapedRecipe( - RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer)); - } catch (Exception e) { - throw e; - } - } + @Override + public ATMShapedRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer) { + try { + return new ATMShapedRecipe( + RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer)); + } catch (Exception e) { + throw e; + } + } - @Override - public void toNetwork( - @Nonnull FriendlyByteBuf buffer, - @Nonnull ATMShapedRecipe recipe) { - try { - RecipeSerializer.SHAPED_RECIPE.toNetwork( - buffer, - recipe.getInternal()); - } catch (Exception e) { - throw e; - } - } + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapedRecipe recipe) { + try { + RecipeSerializer.SHAPED_RECIPE.toNetwork( + buffer, + recipe.getInternal()); + } catch (Exception e) { + throw e; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java index f8d6dcb4..7c81f60b 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapedRecipe.java @@ -16,101 +16,101 @@ public class ATMShapedRecipe implements IATMShapedRecipe { - private final ShapedRecipe internal; - - public ATMShapedRecipe(ShapedRecipe internal) { - this.internal = internal; - } - - public ShapedRecipe getInternal() { - return internal; - } - - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_DATA.get(); - } - - @Override - public boolean matches( - @Nonnull CraftingContainer inv, - @Nonnull Level world) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return internal.matches(inv, world) && !assemble(inv).isEmpty(); - } - - @Override - public ItemStack assemble(@Nonnull CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); - Map enchant = new HashMap<>(); - - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = EnchantmentHelper.getEnchantments(stack); - for (Enchantment e : temp.keySet()) { - if (enchant.containsKey(e) && - (enchant.get(e) == temp.get(e))) { - enchant.put(e, temp.get(e) + 1); - } - if (enchant.containsKey(e) && (enchant.get(e) < temp.get(e))) { - enchant.put(e, temp.get(e)); - } - if (enchant.containsKey(e) && (enchant.get(e) > temp.get(e))) { - break; - } else { - enchant.put(e, temp.get(e)); - } - } - } - } - EnchantmentHelper.setEnchantments(enchant, toReturn); - return toReturn; - } - - @Override - public boolean canCraftInDimensions(int width, int height) { - return internal.canCraftInDimensions(width, height); - } - - @Override - public ItemStack getResultItem() { - return internal.getResultItem(); - } - - @Override - public NonNullList getRemainingItems( - @Nonnull CraftingContainer inv) { - return internal.getRemainingItems(inv); - } - - @Override - public NonNullList getIngredients() { - return internal.getIngredients(); - } - - @Override - public boolean isSpecial() { - return internal.isSpecial(); - } - - @Override - public String getGroup() { - return internal.getGroup(); - } - - @Override - public ItemStack getToastSymbol() { - return internal.getToastSymbol(); - } - - @Override - public ResourceLocation getId() { - return internal.getId(); - } + private final ShapedRecipe internal; + + public ATMShapedRecipe(ShapedRecipe internal) { + this.internal = internal; + } + + public ShapedRecipe getInternal() { + return internal; + } + + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_DATA.get(); + } + + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return internal.matches(inv, world) && !assemble(inv).isEmpty(); + } + + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); + Map enchant = new HashMap<>(); + + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if (enchant.containsKey(e) && + (enchant.get(e) == temp.get(e))) { + enchant.put(e, temp.get(e) + 1); + } + if (enchant.containsKey(e) && (enchant.get(e) < temp.get(e))) { + enchant.put(e, temp.get(e)); + } + if (enchant.containsKey(e) && (enchant.get(e) > temp.get(e))) { + break; + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return internal.canCraftInDimensions(width, height); + } + + @Override + public ItemStack getResultItem() { + return internal.getResultItem(); + } + + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv) { + return internal.getRemainingItems(inv); + } + + @Override + public NonNullList getIngredients() { + return internal.getIngredients(); + } + + @Override + public boolean isSpecial() { + return internal.isSpecial(); + } + + @Override + public String getGroup() { + return internal.getGroup(); + } + + @Override + public ItemStack getToastSymbol() { + return internal.getToastSymbol(); + } + + @Override + public ResourceLocation getId() { + return internal.getId(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java index 86a163e6..abd735f5 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipe.java @@ -15,82 +15,82 @@ public class ATMShapelessRecipe implements IATMShapelessRecipe { - private final ShapelessRecipe recipe; + private final ShapelessRecipe recipe; - public ATMShapelessRecipe(ShapelessRecipe recipe) { - this.recipe = recipe; - } + public ATMShapelessRecipe(ShapelessRecipe recipe) { + this.recipe = recipe; + } - @Override - public RecipeSerializer getSerializer() { - return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); - } + @Override + public RecipeSerializer getSerializer() { + return ATMCraftingSetup.ATM_SHAPELESS_DATA.get(); + } - @Override - public boolean matches( - @Nonnull CraftingContainer inv, - @Nonnull Level world) { - // Note: We do not override the matches method if it matches ignoring NBT, - // to ensure that we return the proper value for if there is a match that gives - // a proper output - return recipe.matches(inv, world) && !assemble(inv).isEmpty(); - } + @Override + public boolean matches( + @Nonnull CraftingContainer inv, + @Nonnull Level world) { + // Note: We do not override the matches method if it matches ignoring NBT, + // to ensure that we return the proper value for if there is a match that gives + // a proper output + return recipe.matches(inv, world) && !assemble(inv).isEmpty(); + } - @Override - public ItemStack assemble(@Nonnull CraftingContainer inv) { - if (getResultItem().isEmpty()) { - return ItemStack.EMPTY; - } - ItemStack toReturn = getResultItem().copy(); + @Override + public ItemStack assemble(@Nonnull CraftingContainer inv) { + if (getResultItem().isEmpty()) { + return ItemStack.EMPTY; + } + ItemStack toReturn = getResultItem().copy(); - Map enchant = new HashMap<>(); + Map enchant = new HashMap<>(); - for (int i = 0; i < inv.getContainerSize(); i++) { - ItemStack stack = inv.getItem(i); - if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { - Map temp = EnchantmentHelper.getEnchantments(stack); - for (Enchantment e : temp.keySet()) { - if (enchant.containsKey(e) && - (enchant.get(e) == temp.get(e))) { - enchant.put(e, temp.get(e) + 1); - } else { - enchant.put(e, temp.get(e)); - } - } - } - } - EnchantmentHelper.setEnchantments(enchant, toReturn); - return toReturn; - } + for (int i = 0; i < inv.getContainerSize(); i++) { + ItemStack stack = inv.getItem(i); + if (!stack.isEmpty() && (!stack.getEnchantmentTags().isEmpty())) { + Map temp = EnchantmentHelper.getEnchantments(stack); + for (Enchantment e : temp.keySet()) { + if (enchant.containsKey(e) && + (enchant.get(e) == temp.get(e))) { + enchant.put(e, temp.get(e) + 1); + } else { + enchant.put(e, temp.get(e)); + } + } + } + } + EnchantmentHelper.setEnchantments(enchant, toReturn); + return toReturn; + } - @Override - public NonNullList getRemainingItems( - @Nonnull CraftingContainer inv) { - return recipe.getRemainingItems(inv); - } + @Override + public NonNullList getRemainingItems( + @Nonnull CraftingContainer inv) { + return recipe.getRemainingItems(inv); + } - @Override - public ItemStack getToastSymbol() { - return recipe.getToastSymbol(); - } + @Override + public ItemStack getToastSymbol() { + return recipe.getToastSymbol(); + } - @Override - public NonNullList getIngredients() { - return recipe.getIngredients(); - } + @Override + public NonNullList getIngredients() { + return recipe.getIngredients(); + } - @Override - public boolean canCraftInDimensions(int width, int height) { - return recipe.canCraftInDimensions(width, height); - } + @Override + public boolean canCraftInDimensions(int width, int height) { + return recipe.canCraftInDimensions(width, height); + } - @Override - public ItemStack getResultItem() { - return recipe.getResultItem(); - } + @Override + public ItemStack getResultItem() { + return recipe.getResultItem(); + } - @Override - public ResourceLocation getId() { - return recipe.getId(); - } + @Override + public ResourceLocation getId() { + return recipe.getId(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java index 02d75787..f3290dbd 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java @@ -8,45 +8,45 @@ import net.minecraft.world.item.crafting.ShapelessRecipe; public class ATMShapelessRecipeSerializer - implements RecipeSerializer { + implements RecipeSerializer { - @Override - public ATMShapelessRecipe fromJson( - @Nonnull ResourceLocation recipeId, - @Nonnull JsonObject json) { - return new ATMShapelessRecipe( - RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json)); - } + @Override + public ATMShapelessRecipe fromJson( + @Nonnull ResourceLocation recipeId, + @Nonnull JsonObject json) { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json)); + } - @Override - public ATMShapelessRecipe fromNetwork( - @Nonnull ResourceLocation recipeId, - @Nonnull FriendlyByteBuf buffer) { - try { - return new ATMShapelessRecipe( - RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer)); - } catch (Exception e) { - throw e; - } - } + @Override + public ATMShapelessRecipe fromNetwork( + @Nonnull ResourceLocation recipeId, + @Nonnull FriendlyByteBuf buffer) { + try { + return new ATMShapelessRecipe( + RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer)); + } catch (Exception e) { + throw e; + } + } - private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { - try { - RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); - } catch (Exception e) { - throw e; - } - } + private void write(FriendlyByteBuf buffer, ShapelessRecipe recipe) { + try { + RecipeSerializer.SHAPELESS_RECIPE.toNetwork(buffer, recipe); + } catch (Exception e) { + throw e; + } + } - @Override - public void toNetwork( - @Nonnull FriendlyByteBuf buffer, - @Nonnull ATMShapelessRecipe recipe) { - ShapelessRecipe newRecipe = new ShapelessRecipe( - recipe.getId(), - recipe.getGroup(), - recipe.getResultItem(), - recipe.getIngredients()); - write(buffer, newRecipe); - } + @Override + public void toNetwork( + @Nonnull FriendlyByteBuf buffer, + @Nonnull ATMShapelessRecipe recipe) { + ShapelessRecipe newRecipe = new ShapelessRecipe( + recipe.getId(), + recipe.getGroup(), + recipe.getResultItem(), + recipe.getIngredients()); + write(buffer, newRecipe); + } } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java index 3301413f..01f0a96f 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapedRecipe extends CraftingRecipe { - ResourceLocation RECIPE_TYPE = new ResourceLocation( - Reference.MOD_ID, - "atmshaped_crafting"); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshaped_crafting"); } diff --git a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java index 90d46c10..a702df4a 100644 --- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java +++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.crafting.CraftingRecipe; public interface IATMShapelessRecipe extends CraftingRecipe { - ResourceLocation RECIPE_TYPE = new ResourceLocation( - Reference.MOD_ID, - "atmshapeless_crafting"); + ResourceLocation RECIPE_TYPE = new ResourceLocation( + Reference.MOD_ID, + "atmshapeless_crafting"); } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java index 53e55ef7..fe3890be 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/DataGenerators.java @@ -15,34 +15,34 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public final class DataGenerators { - private DataGenerators() { - } + private DataGenerators() { + } - @SubscribeEvent - public static void gatherData(GatherDataEvent event) throws IOException { - DataGenerator generator = event.getGenerator(); - ExistingFileHelper fileHelper = event.getExistingFileHelper(); + @SubscribeEvent + public static void gatherData(GatherDataEvent event) throws IOException { + DataGenerator generator = event.getGenerator(); + ExistingFileHelper fileHelper = event.getExistingFileHelper(); - if (event.includeServer()) { - BlockTagsProvider blockTagsProvider = new BlockTags( - generator, - fileHelper); - generator.addProvider( - true, - new ItemTags(generator, blockTagsProvider, fileHelper)); - generator.addProvider(true, blockTagsProvider); - generator.addProvider( - true, - new FluidTags(generator, Reference.MOD_ID, fileHelper)); - generator.addProvider(true, new CraftingRecipes(generator)); - generator.addProvider(true, new ShapelessCrafting(generator)); - generator.addProvider(true, new BlastingRecipes(generator)); - generator.addProvider(true, new SmeltingRecipes(generator)); - generator.addProvider(true, new LootTables(generator)); - } - if (event.includeClient()) { - generator.addProvider(true, new BlockStates(generator, fileHelper)); - generator.addProvider(true, new ItemModels(generator, fileHelper)); - } - } + if (event.includeServer()) { + BlockTagsProvider blockTagsProvider = new BlockTags( + generator, + fileHelper); + generator.addProvider( + true, + new ItemTags(generator, blockTagsProvider, fileHelper)); + generator.addProvider(true, blockTagsProvider); + generator.addProvider( + true, + new FluidTags(generator, Reference.MOD_ID, fileHelper)); + generator.addProvider(true, new CraftingRecipes(generator)); + generator.addProvider(true, new ShapelessCrafting(generator)); + generator.addProvider(true, new BlastingRecipes(generator)); + generator.addProvider(true, new SmeltingRecipes(generator)); + generator.addProvider(true, new LootTables(generator)); + } + if (event.includeClient()) { + generator.addProvider(true, new BlockStates(generator, fileHelper)); + generator.addProvider(true, new ItemModels(generator, fileHelper)); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java index e0297a2a..d46120ef 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/RecipeException.java @@ -2,7 +2,7 @@ public class RecipeException extends IllegalStateException { - public RecipeException(String id, String message) { - super(String.format("recipe error: %s - %s", id, message)); - } + public RecipeException(String id, String message) { + super(String.format("recipe error: %s - %s", id, message)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java index d72b7c48..d4d6f967 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedAncientStones.java @@ -20,200 +20,200 @@ public class ShapedAncientStones { - public enum Slot { - BOOKSHELF, TRAPDOOR, BRICK, FENCE, FENCEGATE, STAIRS, WALL, SLAB, DOOR; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ancientStone; - - public ShapedAncientStones(TagKey ancientStone) { - this.ancientStone = ancientStone; - - this.criteriaName = String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ancientStone) - .build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedAncientStones builder(TagKey ancientStone) { - return new ShapedAncientStones(ancientStone); - } - - public ShapedAncientStones setBookShelf(RegistryObject object) { - pieces.put(Slot.BOOKSHELF, object.get()); - return this; - } - - public ShapedAncientStones setDoor(RegistryObject object) { - pieces.put(Slot.DOOR, object.get()); - return this; - } - - public ShapedAncientStones setTrapDoor(RegistryObject object) { - pieces.put(Slot.TRAPDOOR, object.get()); - return this; - } - - public ShapedAncientStones setBrick(RegistryObject object) { - pieces.put(Slot.BRICK, object.get()); - return this; - } - - public ShapedAncientStones setStairs(RegistryObject object) { - pieces.put(Slot.STAIRS, object.get()); - return this; - } - - public ShapedAncientStones setFence(RegistryObject object) { - pieces.put(Slot.FENCE, object.get()); - return this; - } - - public ShapedAncientStones setFenceGate(RegistryObject object) { - pieces.put(Slot.FENCEGATE, object.get()); - return this; - } - - public ShapedAncientStones setSlab(RegistryObject object) { - pieces.put(Slot.SLAB, object.get()); - return this; - } - - public ShapedAncientStones setWall(RegistryObject object) { - pieces.put(Slot.WALL, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output"); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> builder.save(consumer); - Optional - .ofNullable(pieces.get(Slot.BOOKSHELF)) - .map(this::bookshelf) - .map(this::addBookCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.TRAPDOOR)) - .map(this::trapdoor) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.WALL)) - .map(this::wall) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.BRICK)) - .map(this::brick) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.SLAB)) - .map(this::slab) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.DOOR)) - .map(this::door) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.STAIRS)) - .map(this::stairs) - .map(this::addCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.FENCE)) - .map(this::fence) - .map(this::addStickCriterion) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.FENCEGATE)) - .map(this::fencegate) - .map(this::addStickCriterion) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { - return ShapedRecipeBuilder - .shaped(provider, integer) - .group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .define('s', Items.STICK) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) { - return builder - .define('a', ancientStone) - .define('b', Items.BOOK) - .unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder bookshelf(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("bbb").pattern("aaa"); - } - - private ShapedRecipeBuilder fence(ItemLike provider) { - return shaped(provider, 3).pattern(" ").pattern("asa").pattern("asa"); - } - - private ShapedRecipeBuilder trapdoor(ItemLike provider) { - return shaped(provider, 2).pattern(" ").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder door(ItemLike provider) { - return shaped(provider, 3).pattern("aa ").pattern("aa ").pattern("aa "); - } - - private ShapedRecipeBuilder brick(ItemLike provider) { - return shaped(provider, 4).pattern(" ").pattern("aa ").pattern("aa "); - } - - private ShapedRecipeBuilder fencegate(ItemLike provider) { - return shaped(provider).pattern(" ").pattern("sas").pattern("sas"); - } - - private ShapedRecipeBuilder stairs(ItemLike provider) { - return shaped(provider, 4).pattern("a ").pattern("aa ").pattern("aaa"); - } - - private ShapedRecipeBuilder wall(ItemLike provider) { - return shaped(provider, 6).pattern(" ").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder slab(ItemLike provider) { - return shaped(provider, 6).pattern(" ").pattern(" ").pattern("aaa"); - } + public enum Slot { + BOOKSHELF, TRAPDOOR, BRICK, FENCE, FENCEGATE, STAIRS, WALL, SLAB, DOOR; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ancientStone; + + public ShapedAncientStones(TagKey ancientStone) { + this.ancientStone = ancientStone; + + this.criteriaName = String.format("has_%s_block", TagRegistry.ANCIENT_STONE.toString()); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ancientStone) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedAncientStones builder(TagKey ancientStone) { + return new ShapedAncientStones(ancientStone); + } + + public ShapedAncientStones setBookShelf(RegistryObject object) { + pieces.put(Slot.BOOKSHELF, object.get()); + return this; + } + + public ShapedAncientStones setDoor(RegistryObject object) { + pieces.put(Slot.DOOR, object.get()); + return this; + } + + public ShapedAncientStones setTrapDoor(RegistryObject object) { + pieces.put(Slot.TRAPDOOR, object.get()); + return this; + } + + public ShapedAncientStones setBrick(RegistryObject object) { + pieces.put(Slot.BRICK, object.get()); + return this; + } + + public ShapedAncientStones setStairs(RegistryObject object) { + pieces.put(Slot.STAIRS, object.get()); + return this; + } + + public ShapedAncientStones setFence(RegistryObject object) { + pieces.put(Slot.FENCE, object.get()); + return this; + } + + public ShapedAncientStones setFenceGate(RegistryObject object) { + pieces.put(Slot.FENCEGATE, object.get()); + return this; + } + + public ShapedAncientStones setSlab(RegistryObject object) { + pieces.put(Slot.SLAB, object.get()); + return this; + } + + public ShapedAncientStones setWall(RegistryObject object) { + pieces.put(Slot.WALL, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + Optional + .ofNullable(pieces.get(Slot.BOOKSHELF)) + .map(this::bookshelf) + .map(this::addBookCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.TRAPDOOR)) + .map(this::trapdoor) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.WALL)) + .map(this::wall) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.BRICK)) + .map(this::brick) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.SLAB)) + .map(this::slab) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.DOOR)) + .map(this::door) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.STAIRS)) + .map(this::stairs) + .map(this::addCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCE)) + .map(this::fence) + .map(this::addStickCriterion) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.FENCEGATE)) + .map(this::fencegate) + .map(this::addStickCriterion) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider, int integer) { + return ShapedRecipeBuilder + .shaped(provider, integer) + .group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .define('s', Items.STICK) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) { + return builder + .define('a', ancientStone) + .define('b', Items.BOOK) + .unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder bookshelf(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("bbb").pattern("aaa"); + } + + private ShapedRecipeBuilder fence(ItemLike provider) { + return shaped(provider, 3).pattern(" ").pattern("asa").pattern("asa"); + } + + private ShapedRecipeBuilder trapdoor(ItemLike provider) { + return shaped(provider, 2).pattern(" ").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder door(ItemLike provider) { + return shaped(provider, 3).pattern("aa ").pattern("aa ").pattern("aa "); + } + + private ShapedRecipeBuilder brick(ItemLike provider) { + return shaped(provider, 4).pattern(" ").pattern("aa ").pattern("aa "); + } + + private ShapedRecipeBuilder fencegate(ItemLike provider) { + return shaped(provider).pattern(" ").pattern("sas").pattern("sas"); + } + + private ShapedRecipeBuilder stairs(ItemLike provider) { + return shaped(provider, 4).pattern("a ").pattern("aa ").pattern("aaa"); + } + + private ShapedRecipeBuilder wall(ItemLike provider) { + return shaped(provider, 6).pattern(" ").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder slab(ItemLike provider) { + return shaped(provider, 6).pattern(" ").pattern(" ").pattern("aaa"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java index 20a17abd..bac9c7b1 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedArmorBuilder.java @@ -19,112 +19,112 @@ public class ShapedArmorBuilder { - public enum Slot { - HELMET, CHESTPLATE, LEGGINGS, BOOTS; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ingot; - - public ShapedArmorBuilder(TagKey ingot) { - this.ingot = ingot; - - this.criteriaName = String.format("has_%s_ingot", ingot); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ingot) - .build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedArmorBuilder builder(TagKey ingot) { - return new ShapedArmorBuilder(ingot); - } - - public ShapedArmorBuilder setHelmet(RegistryObject object) { - pieces.put(Slot.HELMET, object.get()); - return this; - } - - public ShapedArmorBuilder setChestplate(RegistryObject object) { - pieces.put(Slot.CHESTPLATE, object.get()); - return this; - } - - public ShapedArmorBuilder setLeggings(RegistryObject object) { - pieces.put(Slot.LEGGINGS, object.get()); - return this; - } - - public ShapedArmorBuilder setBoots(RegistryObject object) { - pieces.put(Slot.BOOTS, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output"); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.HELMET)) - .map(this::helmet) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.CHESTPLATE)) - .map(this::chestplate) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.LEGGINGS)) - .map(this::leggings) - .map(this::addCriterion) - .ifPresent(register); - - Optional - .ofNullable(pieces.get(Slot.BOOTS)) - .map(this::boots) - .map(this::addCriterion) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { - return builder.define('a', ingot).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder helmet(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern(" "); - } - - private ShapedRecipeBuilder chestplate(ItemLike provider) { - return shaped(provider).pattern("a a").pattern("aaa").pattern("aaa"); - } - - private ShapedRecipeBuilder leggings(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern("a a"); - } - - private ShapedRecipeBuilder boots(ItemLike provider) { - return shaped(provider).pattern("a a").pattern("a a").pattern(" "); - } + public enum Slot { + HELMET, CHESTPLATE, LEGGINGS, BOOTS; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ingot; + + public ShapedArmorBuilder(TagKey ingot) { + this.ingot = ingot; + + this.criteriaName = String.format("has_%s_ingot", ingot); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedArmorBuilder builder(TagKey ingot) { + return new ShapedArmorBuilder(ingot); + } + + public ShapedArmorBuilder setHelmet(RegistryObject object) { + pieces.put(Slot.HELMET, object.get()); + return this; + } + + public ShapedArmorBuilder setChestplate(RegistryObject object) { + pieces.put(Slot.CHESTPLATE, object.get()); + return this; + } + + public ShapedArmorBuilder setLeggings(RegistryObject object) { + pieces.put(Slot.LEGGINGS, object.get()); + return this; + } + + public ShapedArmorBuilder setBoots(RegistryObject object) { + pieces.put(Slot.BOOTS, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.HELMET)) + .map(this::helmet) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.CHESTPLATE)) + .map(this::chestplate) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.LEGGINGS)) + .map(this::leggings) + .map(this::addCriterion) + .ifPresent(register); + + Optional + .ofNullable(pieces.get(Slot.BOOTS)) + .map(this::boots) + .map(this::addCriterion) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterion(ShapedRecipeBuilder builder) { + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder helmet(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern(" "); + } + + private ShapedRecipeBuilder chestplate(ItemLike provider) { + return shaped(provider).pattern("a a").pattern("aaa").pattern("aaa"); + } + + private ShapedRecipeBuilder leggings(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern("a a"); + } + + private ShapedRecipeBuilder boots(ItemLike provider) { + return shaped(provider).pattern("a a").pattern("a a").pattern(" "); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java index e867d599..b614a449 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java @@ -18,117 +18,117 @@ public class ShapedBlockBuilder { - public enum Slot { - BLOCK, GEAR, ROD, PLATE; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey ingot; - - public ShapedBlockBuilder(TagKey ingot) { - this.ingot = ingot; - - this.criteriaName = String.format("has_%s_ingot", ingot); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(ingot) - .build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedBlockBuilder builder(TagKey ingot) { - return new ShapedBlockBuilder(ingot); - } - - public ShapedBlockBuilder setBlock(RegistryObject object) { - pieces.put(Slot.BLOCK, object.get()); - return this; - } - - public ShapedBlockBuilder setGear(RegistryObject object) { - pieces.put(Slot.GEAR, object.get()); - return this; - } - - public ShapedBlockBuilder setPlate(RegistryObject object) { - pieces.put(Slot.PLATE, object.get()); - return this; - } - - public ShapedBlockBuilder setRod(RegistryObject object) { - pieces.put(Slot.ROD, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output"); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.BLOCK)) - .map(this::block) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.GEAR)) - .map(this::gear) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.ROD)) - .map(this::rod) - .map(this::addCriterionIngot) - .ifPresent(register); - Optional - .ofNullable(pieces.get(Slot.PLATE)) - .map(this::plate) - .map(this::addCriterionIngot) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterionIngot(ShapedRecipeBuilder builder) { - return builder.define('a', ingot).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder block(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); - } - - // private ShapedRecipeBuilder ingot(ItemLike provider) { - // return shaped(provider) - // .pattern("aaa") - // .pattern("aaa") - // .pattern("aaa"); - - // } - - private ShapedRecipeBuilder gear(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("a a").pattern("aaa"); - } - - private ShapedRecipeBuilder rod(ItemLike provider) { - return shaped(provider).pattern("a ").pattern("a ").pattern("a "); - } - - private ShapedRecipeBuilder plate(ItemLike provider) { - return shaped(provider).pattern("aa ").pattern("aa ").pattern(" "); - } + public enum Slot { + BLOCK, GEAR, ROD, PLATE; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey ingot; + + public ShapedBlockBuilder(TagKey ingot) { + this.ingot = ingot; + + this.criteriaName = String.format("has_%s_ingot", ingot); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(ingot) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedBlockBuilder builder(TagKey ingot) { + return new ShapedBlockBuilder(ingot); + } + + public ShapedBlockBuilder setBlock(RegistryObject object) { + pieces.put(Slot.BLOCK, object.get()); + return this; + } + + public ShapedBlockBuilder setGear(RegistryObject object) { + pieces.put(Slot.GEAR, object.get()); + return this; + } + + public ShapedBlockBuilder setPlate(RegistryObject object) { + pieces.put(Slot.PLATE, object.get()); + return this; + } + + public ShapedBlockBuilder setRod(RegistryObject object) { + pieces.put(Slot.ROD, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.BLOCK)) + .map(this::block) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.GEAR)) + .map(this::gear) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.ROD)) + .map(this::rod) + .map(this::addCriterionIngot) + .ifPresent(register); + Optional + .ofNullable(pieces.get(Slot.PLATE)) + .map(this::plate) + .map(this::addCriterionIngot) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterionIngot(ShapedRecipeBuilder builder) { + return builder.define('a', ingot).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder block(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); + } + + // private ShapedRecipeBuilder ingot(ItemLike provider) { + // return shaped(provider) + // .pattern("aaa") + // .pattern("aaa") + // .pattern("aaa"); + + // } + + private ShapedRecipeBuilder gear(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("a a").pattern("aaa"); + } + + private ShapedRecipeBuilder rod(ItemLike provider) { + return shaped(provider).pattern("a ").pattern("a ").pattern("a "); + } + + private ShapedRecipeBuilder plate(ItemLike provider) { + return shaped(provider).pattern("aa ").pattern("aa ").pattern(" "); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java index 98adf6d6..00b7ae32 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java @@ -18,68 +18,68 @@ public class ShapedIngotBuilder { - public enum Slot { - INGOT; - - public String lower() { - return toString().toLowerCase(Locale.ROOT); - } - } - - private final String criteriaName; - private final InventoryChangeTrigger.TriggerInstance criterion; - private final EnumMap pieces = new EnumMap<>(Slot.class); - private final TagKey nugget; - - public ShapedIngotBuilder(TagKey nugget) { - this.nugget = nugget; - - this.criteriaName = String.format("has_%s_nugget", nugget); - - ItemPredicate predicate = ItemPredicate.Builder - .item() - .of(nugget) - .build(); - this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); - } - - public static ShapedIngotBuilder builder(TagKey nugget) { - return new ShapedIngotBuilder(nugget); - } - - public ShapedIngotBuilder setIngot(RegistryObject object) { - pieces.put(Slot.INGOT, object.get()); - return this; - } - - protected void validate(ResourceLocation id) { - if (pieces.isEmpty()) { - throw new RecipeException( - id.toString(), - "recipe must have at least 1 output"); - } - } - - public void build(Consumer consumer) { - Consumer register = builder -> builder.save(consumer); - - Optional - .ofNullable(pieces.get(Slot.INGOT)) - .map(this::ingot) - .map(this::addCriterionNugget) - .ifPresent(register); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private ShapedRecipeBuilder addCriterionNugget( - ShapedRecipeBuilder builder) { - return builder.define('a', nugget).unlockedBy(criteriaName, criterion); - } - - private ShapedRecipeBuilder ingot(ItemLike provider) { - return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); - } + public enum Slot { + INGOT; + + public String lower() { + return toString().toLowerCase(Locale.ROOT); + } + } + + private final String criteriaName; + private final InventoryChangeTrigger.TriggerInstance criterion; + private final EnumMap pieces = new EnumMap<>(Slot.class); + private final TagKey nugget; + + public ShapedIngotBuilder(TagKey nugget) { + this.nugget = nugget; + + this.criteriaName = String.format("has_%s_nugget", nugget); + + ItemPredicate predicate = ItemPredicate.Builder + .item() + .of(nugget) + .build(); + this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate); + } + + public static ShapedIngotBuilder builder(TagKey nugget) { + return new ShapedIngotBuilder(nugget); + } + + public ShapedIngotBuilder setIngot(RegistryObject object) { + pieces.put(Slot.INGOT, object.get()); + return this; + } + + protected void validate(ResourceLocation id) { + if (pieces.isEmpty()) { + throw new RecipeException( + id.toString(), + "recipe must have at least 1 output"); + } + } + + public void build(Consumer consumer) { + Consumer register = builder -> builder.save(consumer); + + Optional + .ofNullable(pieces.get(Slot.INGOT)) + .map(this::ingot) + .map(this::addCriterionNugget) + .ifPresent(register); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private ShapedRecipeBuilder addCriterionNugget( + ShapedRecipeBuilder builder) { + return builder.define('a', nugget).unlockedBy(criteriaName, criterion); + } + + private ShapedRecipeBuilder ingot(ItemLike provider) { + return shaped(provider).pattern("aaa").pattern("aaa").pattern("aaa"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java index efe890d8..12c62606 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java @@ -15,264 +15,264 @@ public class BlockStates extends BlockStateProvider { - public BlockStates(DataGenerator generator, ExistingFileHelper fileHelper) { - super(generator, Reference.MOD_ID, fileHelper); - } + public BlockStates(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, Reference.MOD_ID, fileHelper); + } - @Override - protected void registerStatesAndModels() { - List entries = ModRegistry.BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .filter(block -> !(block instanceof GrassBlock)) - .filter(block -> !(block instanceof LiquidBlock)) - .collect(Collectors.toList()); + @Override + protected void registerStatesAndModels() { + List entries = ModRegistry.BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .filter(block -> !(block instanceof GrassBlock)) + .filter(block -> !(block instanceof LiquidBlock)) + .collect(Collectors.toList()); - entries.forEach(this::simpleBlockAndItem); + entries.forEach(this::simpleBlockAndItem); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_0.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_1.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_2.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.ANCIENT_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_0.get(), - models().getBuilder("ancient_log_0")); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_1.get(), - models().getBuilder("ancient_log_1")); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_2.get(), - models().getBuilder("ancient_log_2")); - simpleBlockItem( - ModRegistry.ANCIENT_LOG_STRIPPED.get(), - models().getBuilder("stripped_ancient_log")); - // trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new - // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); - simpleBlockItem( - ModRegistry.ANCIENT_BOOKSHELF.get(), - models().getBuilder("ancient_bookshelf")); - stairsBlock( - ModRegistry.ANCIENT_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_0.get(), + models().getBuilder("ancient_log_0")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_1.get(), + models().getBuilder("ancient_log_1")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_2.get(), + models().getBuilder("ancient_log_2")); + simpleBlockItem( + ModRegistry.ANCIENT_LOG_STRIPPED.get(), + models().getBuilder("stripped_ancient_log")); + // trapdoorBlock(ModRegistry.ANCIENT_TRAPDOOR.get(),new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door"),true); + simpleBlockItem( + ModRegistry.ANCIENT_BOOKSHELF.get(), + models().getBuilder("ancient_bookshelf")); + stairsBlock( + ModRegistry.ANCIENT_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_0.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_1.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_2.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.SOUL_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_0.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_1.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_2.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.SOUL_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.SOUL_LOG.get(), - models().getBuilder("soul_log")); - simpleBlockItem( - ModRegistry.SOUL_LOG_0.get(), - models().getBuilder("soul_log_0")); - simpleBlockItem( - ModRegistry.SOUL_LOG_1.get(), - models().getBuilder("soul_log_1")); - simpleBlockItem( - ModRegistry.SOUL_LOG_2.get(), - models().getBuilder("soul_log_2")); - simpleBlockItem( - ModRegistry.SOUL_LOG_STRIPPED.get(), - models().getBuilder("stripped_soul_log")); - simpleBlockItem( - ModRegistry.SOUL_BOOKSHELF.get(), - models().getBuilder("soul_bookshelf")); - stairsBlock( - ModRegistry.SOUL_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + simpleBlockItem( + ModRegistry.SOUL_LOG.get(), + models().getBuilder("soul_log")); + simpleBlockItem( + ModRegistry.SOUL_LOG_0.get(), + models().getBuilder("soul_log_0")); + simpleBlockItem( + ModRegistry.SOUL_LOG_1.get(), + models().getBuilder("soul_log_1")); + simpleBlockItem( + ModRegistry.SOUL_LOG_2.get(), + models().getBuilder("soul_log_2")); + simpleBlockItem( + ModRegistry.SOUL_LOG_STRIPPED.get(), + models().getBuilder("stripped_soul_log")); + simpleBlockItem( + ModRegistry.SOUL_BOOKSHELF.get(), + models().getBuilder("soul_bookshelf")); + stairsBlock( + ModRegistry.SOUL_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG.get()); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG_STRIPPED.get()); - logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_BOOKSHELF.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_LOG_STRIPPED.get()); + logBlock((RotatedPillarBlock) ModRegistry.DEMONIC_BOOKSHELF.get()); - simpleBlockItem( - ModRegistry.DEMONIC_LOG.get(), - models().getBuilder("demonic_log")); - simpleBlockItem( - ModRegistry.DEMONIC_LOG_STRIPPED.get(), - models().getBuilder("stripped_demonic_log")); - simpleBlockItem( - ModRegistry.DEMONIC_BOOKSHELF.get(), - models().getBuilder("demonic_bookshelf")); - stairsBlock( - ModRegistry.DEMONIC_WOODEN_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + simpleBlockItem( + ModRegistry.DEMONIC_LOG.get(), + models().getBuilder("demonic_log")); + simpleBlockItem( + ModRegistry.DEMONIC_LOG_STRIPPED.get(), + models().getBuilder("stripped_demonic_log")); + simpleBlockItem( + ModRegistry.DEMONIC_BOOKSHELF.get(), + models().getBuilder("demonic_bookshelf")); + stairsBlock( + ModRegistry.DEMONIC_WOODEN_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - stairsBlock( - ModRegistry.ANCIENT_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - stairsBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - stairsBlock( - ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - stairsBlock( - ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - stairsBlock( - ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); - stairsBlock( - ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); - stairsBlock( - ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); + stairsBlock( + ModRegistry.ANCIENT_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + stairsBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + stairsBlock( + ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + stairsBlock( + ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + stairsBlock( + ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - fenceBlock( - ModRegistry.ANCIENT_WOOD_FENCE.get(), - "ancient_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - fenceGateBlock( - ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(), - "ancient_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - fenceBlock( - ModRegistry.DEMONIC_WOOD_FENCE.get(), - "demonic_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - fenceGateBlock( - ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(), - "demonic_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - fenceBlock( - ModRegistry.SOUL_WOOD_FENCE.get(), - "soul_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - fenceGateBlock( - ModRegistry.SOUL_WOOD_FENCE_GATE.get(), - "soul_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceBlock( + ModRegistry.ANCIENT_WOOD_FENCE.get(), + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceGateBlock( + ModRegistry.ANCIENT_WOOD_FENCE_GATE.get(), + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceBlock( + ModRegistry.DEMONIC_WOOD_FENCE.get(), + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceGateBlock( + ModRegistry.DEMONIC_WOOD_FENCE_GATE.get(), + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceBlock( + ModRegistry.SOUL_WOOD_FENCE.get(), + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceGateBlock( + ModRegistry.SOUL_WOOD_FENCE_GATE.get(), + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - wallBlock( - ModRegistry.ANCIENT_STONE_WALL.get(), - "ancient_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - wallBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(), - "ancient_smooth_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - wallBlock( - ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(), - "ancient_polished_stone_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); - wallBlock( - ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(), - "ancient_mossy_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - wallBlock( - ModRegistry.ANCIENT_STONE_BRICK_WALL.get(), - "ancient_stone_brick_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - wallBlock( - ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(), - "ancient_chiseled_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); - wallBlock( - ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(), - "ancient_cracked_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); + wallBlock( + ModRegistry.ANCIENT_STONE_WALL.get(), + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + wallBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_WALL.get(), + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + wallBlock( + ModRegistry.ANCIENT_POLISHED_STONE_WALL.get(), + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); + wallBlock( + ModRegistry.ANCIENT_MOSSY_STONE_WALL.get(), + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + wallBlock( + ModRegistry.ANCIENT_STONE_BRICK_WALL.get(), + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + wallBlock( + ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + wallBlock( + ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - slabBlock( - ModRegistry.ANCIENT_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - slabBlock( - ModRegistry.DEMONIC_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - slabBlock( - ModRegistry.SOUL_WOODEN_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - slabBlock( - ModRegistry.ANCIENT_STONE_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - slabBlock( - ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - slabBlock( - ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - slabBlock( - ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - slabBlock( - ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); - slabBlock( - ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); - slabBlock( - ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); + slabBlock( + ModRegistry.ANCIENT_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + slabBlock( + ModRegistry.DEMONIC_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + slabBlock( + ModRegistry.SOUL_WOODEN_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + slabBlock( + ModRegistry.ANCIENT_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + slabBlock( + ModRegistry.ANCIENT_SMOOTH_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + slabBlock( + ModRegistry.ANCIENT_STONE_BRICK_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + slabBlock( + ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + slabBlock( + ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get(), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - doorBlock( - ModRegistry.ANCIENT_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/ancient_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_door_top")); - doorBlock( - ModRegistry.DEMONIC_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/demonic_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_door_top")); - doorBlock( - ModRegistry.SOUL_DOOR_.get(), - new ResourceLocation(Reference.MOD_ID, "block/soul_door_bottom"), - new ResourceLocation(Reference.MOD_ID, "block/soul_door_top")); - } + doorBlock( + ModRegistry.ANCIENT_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_door_top")); + doorBlock( + ModRegistry.DEMONIC_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_door_top")); + doorBlock( + ModRegistry.SOUL_DOOR_.get(), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_bottom"), + new ResourceLocation(Reference.MOD_ID, "block/soul_door_top")); + } - /** - * Generates an item model and block model/block state for a simple block - * - * @param block - * the block - */ - private void simpleBlockAndItem(Block block) { - ResourceLocation blockName = ForgeRegistries.BLOCKS.getKey(block); - simpleBlock(block); - BlockModelBuilder builder = models().getBuilder(blockName.toString()); - simpleBlockItem(block, builder); - } + /** + * Generates an item model and block model/block state for a simple block + * + * @param block + * the block + */ + private void simpleBlockAndItem(Block block) { + ResourceLocation blockName = ForgeRegistries.BLOCKS.getKey(block); + simpleBlock(block); + BlockModelBuilder builder = models().getBuilder(blockName.toString()); + simpleBlockItem(block, builder); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java index 0362375e..46190695 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/client/ItemModels.java @@ -10,256 +10,256 @@ public class ItemModels extends ItemModelProvider { - public ItemModels(DataGenerator generator, ExistingFileHelper fileHelper) { - super(generator, Reference.MOD_ID, fileHelper); - } + public ItemModels(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, Reference.MOD_ID, fileHelper); + } - private ResourceLocation res(String name) { - return new ResourceLocation(Reference.MOD_ID, ITEM_FOLDER + "/" + name); - } + private ResourceLocation res(String name) { + return new ResourceLocation(Reference.MOD_ID, ITEM_FOLDER + "/" + name); + } - @Override - protected void registerModels() { - ResourceLocation generated = new ResourceLocation("item/generated"); - // ResourceLocation handheld = new ResourceLocation("item/handheld"); - ModRegistry.ITEMS - .getEntries() - .stream() - .filter(item -> !(item.get() instanceof BlockItem)) - .filter(item -> !(item.get() instanceof SwordItem)) - .filter(item -> !(item.get() instanceof PickaxeItem)) - .filter(item -> !(item.get() instanceof ShovelItem)) - .filter(item -> !(item.get() instanceof AxeItem)) - .filter(item -> !(item.get() instanceof HoeItem)) - .forEach(item -> { - String name = item.getId().getPath(); - if (!name.contains("bucket")) { - withExistingParent(name, generated) - .texture("layer0", res(name)); - } - }); + @Override + protected void registerModels() { + ResourceLocation generated = new ResourceLocation("item/generated"); + // ResourceLocation handheld = new ResourceLocation("item/handheld"); + ModRegistry.ITEMS + .getEntries() + .stream() + .filter(item -> !(item.get() instanceof BlockItem)) + .filter(item -> !(item.get() instanceof SwordItem)) + .filter(item -> !(item.get() instanceof PickaxeItem)) + .filter(item -> !(item.get() instanceof ShovelItem)) + .filter(item -> !(item.get() instanceof AxeItem)) + .filter(item -> !(item.get() instanceof HoeItem)) + .forEach(item -> { + String name = item.getId().getPath(); + if (!name.contains("bucket")) { + withExistingParent(name, generated) + .texture("layer0", res(name)); + } + }); - stairs( - "ancient_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + stairs( + "ancient_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - stairs( - "demonic_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + stairs( + "demonic_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - stairs( - "soul_wooden_stairs", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + stairs( + "soul_wooden_stairs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - stairs( - "ancient_stone_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + stairs( + "ancient_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - stairs( - "ancient_smooth_stone_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + stairs( + "ancient_smooth_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - stairs( - "ancient_polished_stone_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); + stairs( + "ancient_polished_stone_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - stairs( - "ancient_mossy_stone_stairs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + stairs( + "ancient_mossy_stone_stairs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - stairs( - "ancient_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + stairs( + "ancient_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - stairs( - "ancient_chiseled_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); + stairs( + "ancient_chiseled_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); - stairs( - "ancient_cracked_stone_brick_stairs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); + stairs( + "ancient_cracked_stone_brick_stairs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - fenceInventory( - "ancient_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - fenceGate( - "ancient_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceInventory( + "ancient_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + fenceGate( + "ancient_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - fenceInventory( - "demonic_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - fenceGate( - "demonic_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceInventory( + "demonic_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + fenceGate( + "demonic_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - fenceInventory( - "soul_wooden_fence", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - fenceGate( - "soul_wooden_fence_gate", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceInventory( + "soul_wooden_fence", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + fenceGate( + "soul_wooden_fence_gate", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - wallInventory( - "ancient_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - wallInventory( - "ancient_smooth_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - wallInventory( - "ancient_polished_stone_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); - wallInventory( - "ancient_mossy_stone_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - wallInventory( - "ancient_stone_brick_wall", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - wallInventory( - "ancient_chiseled_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); - wallInventory( - "ancient_cracked_stone_brick_wall", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); + wallInventory( + "ancient_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + wallInventory( + "ancient_smooth_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + wallInventory( + "ancient_polished_stone_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); + wallInventory( + "ancient_mossy_stone_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + wallInventory( + "ancient_stone_brick_wall", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + wallInventory( + "ancient_chiseled_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); + wallInventory( + "ancient_cracked_stone_brick_wall", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); - slab( - "ancient_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); + slab( + "ancient_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_planks")); - slab( - "demonic_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), - new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); + slab( + "demonic_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks"), + new ResourceLocation(Reference.MOD_ID, "block/demonic_planks")); - slab( - "soul_wooden_slabs", - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), - new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); + slab( + "soul_wooden_slabs", + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks"), + new ResourceLocation(Reference.MOD_ID, "block/soul_planks")); - slab( - "ancient_stone_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); + slab( + "ancient_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone")); - slab( - "ancient_smooth_stone_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_smooth_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); + slab( + "ancient_smooth_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_smooth_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_smooth_stone")); - slab( - "ancient_polished_stone_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_polished_stone")); + slab( + "ancient_polished_stone_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_polished_stone")); - slab( - "ancient_mossy_stone_slabs", - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); + slab( + "ancient_mossy_stone_slabs", + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_mossy_stone")); - slab( - "ancient_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_stone_bricks"), - new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); + slab( + "ancient_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_stone_bricks"), + new ResourceLocation(Reference.MOD_ID, "block/ancient_stone_bricks")); - slab( - "ancient_chiseled_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_chiseled_stone_bricks")); + slab( + "ancient_chiseled_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_chiseled_stone_bricks")); - slab( - "ancient_cracked_stone_brick_slabs", - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks"), - new ResourceLocation( - Reference.MOD_ID, - "block/ancient_cracked_stone_bricks")); - // trapdoorOrientableTop("ancient_trap_door",new - // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); - } + slab( + "ancient_cracked_stone_brick_slabs", + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks"), + new ResourceLocation( + Reference.MOD_ID, + "block/ancient_cracked_stone_bricks")); + // trapdoorOrientableTop("ancient_trap_door",new + // ResourceLocation(Reference.MOD_ID,"block/ancient_trap_door")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java index 3d70c80d..6676e381 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlastingRecipes.java @@ -12,95 +12,95 @@ public class BlastingRecipes extends RecipeProvider { - public BlastingRecipes(DataGenerator generator) { - super(generator); - } + public BlastingRecipes(DataGenerator generator) { + super(generator); + } - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut + "_blasting"); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut + "_blasting"); + } - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), - ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer, recipeDir("allthemodium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer, recipeDir("vibranium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer, recipeDir("unobtainium_ingot", "raw_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "raw_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) - .save(consumer, recipeDir("allthemodium_ingot", "dust_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) + .save(consumer, recipeDir("allthemodium_ingot", "dust_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) - .save(consumer, recipeDir("vibranium_ingot", "dust_blasting")); + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) + .save(consumer, recipeDir("vibranium_ingot", "dust_blasting")); - SimpleCookingRecipeBuilder - .blasting( - Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) - .save(consumer, recipeDir("unobtainium_ingot", "dust_blasting")); - } + SimpleCookingRecipeBuilder + .blasting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) + .save(consumer, recipeDir("unobtainium_ingot", "dust_blasting")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java index 897f471b..450e9ca4 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/BlockTags.java @@ -14,434 +14,434 @@ public class BlockTags extends BlockTagsProvider { - public BlockTags( - DataGenerator generator, - @Nullable ExistingFileHelper existingFileHelper) { - super(generator, Reference.MOD_ID, existingFileHelper); - } - - @Override - protected void addTags() { - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.FURNACE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BLAST_FURNACE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BREWING_STAND); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BARREL); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CHEST); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CAMPFIRE); - tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.SOUL_CAMPFIRE); - - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); - tag(TagRegistry.PAXEL_TARGETS) - .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); - - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(TagRegistry.ANCIENT_WOODEN_PLANKS) - .add(ModRegistry.ANCIENT_PLANKS.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(TagRegistry.SOUL_WOODEN_PLANKS).add(ModRegistry.SOUL_PLANKS.get()); - tag(TagRegistry.ANCIENT_STONE).add(ModRegistry.ANCIENT_STONE.get()); - tag(TagRegistry.ANCIENT_DIRT).add(ModRegistry.ANCIENT_DIRT.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE) - .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE) - .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE) - .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS) - .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.PLANKS) - .add(ModRegistry.ANCIENT_PLANKS.get()); - - tag(net.minecraft.tags.BlockTags.CLIMBABLE) - .add(ModRegistry.ANCIENT_CAVEVINES_.get()); - tag(net.minecraft.tags.BlockTags.CLIMBABLE) - .add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); - - tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) - .add(ModRegistry.UNOBTAINIUM_ORE.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_PLANKS.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_0.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_1.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_2.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) - .add(ModRegistry.SOUL_LOG_STRIPPED.get()); - - tag(net.minecraft.tags.BlockTags.NYLIUM) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_STONE.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.BEE_GROWABLES) - .add(ModRegistry.ANCIENT_SAPLING.get()); - tag(net.minecraft.tags.BlockTags.DIRT) - .add(ModRegistry.ANCIENT_GRASS.get()); - tag(net.minecraft.tags.BlockTags.DIRT) - .add(ModRegistry.ANCIENT_DIRT.get()); - tag(net.minecraft.tags.BlockTags.SAPLINGS) - .add(ModRegistry.ANCIENT_SAPLING.get()); - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCES) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.FENCE_GATES) - .add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); - - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.SOUL_WOOD_FENCE.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WALLS) - .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) - .add(ModRegistry.SOUL_WOODEN_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); - tag(net.minecraft.tags.BlockTags.SLABS) - .add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); - - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) - .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); - - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) - .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); - tag(net.minecraft.tags.BlockTags.STAIRS) - .add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); - - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.ANCIENT_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.SOUL_LEAVES.get()); - tag(net.minecraft.tags.BlockTags.LEAVES) - .add(ModRegistry.DEMONIC_LEAVES.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK) - .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE) - .add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); - tag(TagRegistry.VIBRANIUM_BLOCK).add(ModRegistry.VIBRANIUM_BLOCK.get()); - tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.VIBRANIUM_ORE.get()); - tag(TagRegistry.VIBRANIUM_ORE) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VIBRANIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK) - .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); - tag(TagRegistry.UNOBTAINIUM_ORE).add(ModRegistry.UNOBTAINIUM_ORE.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UNOBTAINIUM_ORE.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UV_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.UA_ALLOY.get()); - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.VA_ALLOY.get()); - - tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) - .add(ModRegistry.TELEPORT_PAD.get()); - - ModRegistry.BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.SHAPED_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.STAIR_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.SLAB_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.WALL_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - ModRegistry.PILLAR_BLOCKS - .getEntries() - .stream() - .forEach(blockRegistryObject -> { - tag(TagRegistry.OTHER_PROTECTION) - .add(blockRegistryObject.get()); - }); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.CRIMSON_NYLIUM); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.WARPED_NYLIUM); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERRACK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SAND); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SOIL); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DEEPSLATE); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_ALUMINUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COAL_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COPPER_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_DIAMOND_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LEAD_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_NICKEL_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_IRIDIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LAPIS_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_PLATINUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_SILVER_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_OSMIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_URANIUM_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ZINC_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_TIN_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRON_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_REDSTONE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_GOLD_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_QUARTZ_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.OTHER_EMERALD_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.ALUMINUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.LEAD_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.NICKEL_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OSMIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.PLATINUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.SILVER_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.TIN_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.URANIUM_SLATE_ORE.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ZINC_SLATE_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.IRIDIUM_SLATE_ORE.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_ALUMINUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_LEAD_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_NICKEL_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_OSMIUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_PLATINUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_SILVER_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_TIN_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_URANIUM_BLOCK.get()); - tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ZINC_BLOCK.get()); - - tag(TagRegistry.OTHER_PROTECTION) - .add(BlockList.RAW_IRIDIUM_BLOCK.get()); - - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERITE_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DIAMOND_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_BLOCK); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_CLUSTER); - tag(TagRegistry.OTHER_PROTECTION).add(Blocks.GOLD_BLOCK); - - tag(TagRegistry.OTHER_PROTECTION).addTag(TagRegistry.BLOCK_ORES); - } + public BlockTags( + DataGenerator generator, + @Nullable ExistingFileHelper existingFileHelper) { + super(generator, Reference.MOD_ID, existingFileHelper); + } + + @Override + protected void addTags() { + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.FURNACE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BLAST_FURNACE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BREWING_STAND); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.BARREL); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CHEST); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.CAMPFIRE); + tag(TagRegistry.OTHER_TILE_WHITELIST).add(Blocks.SOUL_CAMPFIRE); + + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL); + tag(TagRegistry.PAXEL_TARGETS) + .addTag(net.minecraft.tags.BlockTags.MINEABLE_WITH_HOE); + + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.SOUL_FIRE_BASE_BLOCKS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(TagRegistry.ANCIENT_WOODEN_PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(TagRegistry.SOUL_WOODEN_PLANKS).add(ModRegistry.SOUL_PLANKS.get()); + tag(TagRegistry.ANCIENT_STONE).add(ModRegistry.ANCIENT_STONE.get()); + tag(TagRegistry.ANCIENT_DIRT).add(ModRegistry.ANCIENT_DIRT.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.LOGS).add(ModRegistry.SOUL_LOG.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS.get()); + + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_.get()); + tag(net.minecraft.tags.BlockTags.CLIMBABLE) + .add(ModRegistry.ANCIENT_CAVEVINES_PLANT_.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_SHOVEL) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_MOSSY_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_POLISHED_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_SMOOTH_STONE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.ANCIENT_LOG_STRIPPED.get()); + + tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(NEEDS_NETHERITE_TOOL).add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.NEEDS_ALLTHEMODIUM_TOOL) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.DEMONIC_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_PLANKS.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_0.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_1.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_2.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE) + .add(ModRegistry.SOUL_LOG_STRIPPED.get()); + + tag(net.minecraft.tags.BlockTags.NYLIUM) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_STONE.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.INFINIBURN_NETHER) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.BEE_GROWABLES) + .add(ModRegistry.ANCIENT_SAPLING.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_GRASS.get()); + tag(net.minecraft.tags.BlockTags.DIRT) + .add(ModRegistry.ANCIENT_DIRT.get()); + tag(net.minecraft.tags.BlockTags.SAPLINGS) + .add(ModRegistry.ANCIENT_SAPLING.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.ANCIENT_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.DEMONIC_WOOD_FENCE_GATE.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCES) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.FENCE_GATES) + .add(ModRegistry.SOUL_WOOD_FENCE_GATE.get()); + + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.DEMONIC_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.SOUL_WOOD_FENCE.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WALLS) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.ANCIENT_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.DEMONIC_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_SLABS) + .add(ModRegistry.SOUL_WOODEN_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_SLABS.get()); + tag(net.minecraft.tags.BlockTags.SLABS) + .add(ModRegistry.ANCIENT_STONE_BRICK_SLABS.get()); + + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_POLISHED_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_MOSSY_STONE_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_FENCES) + .add(ModRegistry.ANCIENT_STONE_BRICK_WALL.get()); + + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.ANCIENT_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.DEMONIC_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.WOODEN_STAIRS) + .add(ModRegistry.SOUL_WOODEN_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS.get()); + tag(net.minecraft.tags.BlockTags.STAIRS) + .add(ModRegistry.ANCIENT_STONE_BRICK_STAIRS.get()); + + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.ANCIENT_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.SOUL_LEAVES.get()); + tag(net.minecraft.tags.BlockTags.LEAVES) + .add(ModRegistry.DEMONIC_LEAVES.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE.get()); + tag(TagRegistry.VIBRANIUM_BLOCK).add(ModRegistry.VIBRANIUM_BLOCK.get()); + tag(TagRegistry.VIBRANIUM_ORE).add(ModRegistry.VIBRANIUM_ORE.get()); + tag(TagRegistry.VIBRANIUM_ORE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VIBRANIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.OTHER_VIBRANIUM_ORE.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(TagRegistry.UNOBTAINIUM_ORE).add(ModRegistry.UNOBTAINIUM_ORE.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UNOBTAINIUM_ORE.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UV_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.UA_ALLOY.get()); + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.VA_ALLOY.get()); + + tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE) + .add(ModRegistry.TELEPORT_PAD.get()); + + ModRegistry.BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SHAPED_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .forEach(blockRegistryObject -> { + tag(TagRegistry.OTHER_PROTECTION) + .add(blockRegistryObject.get()); + }); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.CRIMSON_NYLIUM); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.WARPED_NYLIUM); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERRACK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SAND); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SOUL_SOIL); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DEEPSLATE); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_ALUMINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COAL_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_COPPER_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_DIAMOND_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LEAD_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_NICKEL_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_IRIDIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_LAPIS_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_PLATINUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_SILVER_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_OSMIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_URANIUM_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_ZINC_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_TIN_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_IRON_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_REDSTONE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_GOLD_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OTHER_QUARTZ_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.OTHER_EMERALD_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.ALUMINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.LEAD_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.NICKEL_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.OSMIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.PLATINUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.SILVER_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.TIN_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.URANIUM_SLATE_ORE.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.ZINC_SLATE_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.IRIDIUM_SLATE_ORE.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_ALUMINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_LEAD_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_NICKEL_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_OSMIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_PLATINUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_SILVER_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_TIN_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_URANIUM_BLOCK.get()); + tag(TagRegistry.OTHER_PROTECTION).add(BlockList.RAW_ZINC_BLOCK.get()); + + tag(TagRegistry.OTHER_PROTECTION) + .add(BlockList.RAW_IRIDIUM_BLOCK.get()); + + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.NETHERITE_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.DIAMOND_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_BLOCK); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.AMETHYST_CLUSTER); + tag(TagRegistry.OTHER_PROTECTION).add(Blocks.GOLD_BLOCK); + + tag(TagRegistry.OTHER_PROTECTION).addTag(TagRegistry.BLOCK_ORES); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java index 9f844457..1ac113ac 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/CraftingRecipes.java @@ -22,306 +22,306 @@ public class CraftingRecipes extends RecipeProvider { - public CraftingRecipes(DataGenerator generatorIn) { - super(generatorIn); - } - - private ShapedRecipeBuilder shaped(ItemLike provider) { - return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); - } - - private static InventoryChangeTrigger.TriggerInstance hasTag( - TagKey tagKey) { - return inventoryTrigger( - ItemPredicate.Builder.item().of(tagKey).build()); - } - - @Override - protected void buildCraftingRecipes(Consumer consumer) { - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_ALLTHEMODIUM), 9) - .unlockedBy( - "has_raw_allthemodium", - hasTag(TagRegistry.RAW_ALLTHEMODIUM)) - .save(consumer); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_VIBRANIUM), 9) - .unlockedBy("has_raw_vibranium", hasTag(TagRegistry.RAW_VIBRANIUM)) - .save(consumer); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) - .group(Reference.MOD_ID) - .requires(Ingredient.of(TagRegistry.RAW_UNOBTAINIUM), 9) - .unlockedBy( - "has_raw_unobtainium", - hasTag(TagRegistry.RAW_UNOBTAINIUM)) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_APPLE.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.APPLE) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_CARROT.get()) - .pattern("nnn") - .pattern("nan") - .pattern("nnn") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.CARROT) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build())) - .save(consumer); - - shaped(ModRegistry.TELEPORT_PAD_ITEM.get()) - .pattern(" n ") - .pattern("nan") - .pattern(" n ") - .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) - .define('a', Items.ENDER_PEARL) - .unlockedBy( - "has_allthemodium_nugget", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_NUGGET) - .build())) - .unlockedBy( - "has_ender_pearl", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_PICKAXE.get()) - .pattern("ara") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_AXE.get()) - .pattern("aa ") - .pattern("ar ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_SHOVEL.get()) - .pattern(" a ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_HOE.get()) - .pattern("aa ") - .pattern(" r ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build())) - .save(consumer); - - shaped(ModRegistry.ALLTHEMODIUM_SWORD.get()) - .pattern(" a ") - .pattern(" a ") - .pattern(" r ") - .define('r', TagRegistry.ALLTHEMODIUM_ROD) - .define('a', TagRegistry.ALLTHEMODIUM_PLATE) - .unlockedBy( - "has_allthemodium_rod", - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ALLTHEMODIUM_ROD) - .build())) - .save(consumer); - - // final String hasCondition = "has_item"; - - ShapedAncientStones - .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) - .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) - .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) - .setDoor(ModRegistry.SOUL_DOOR_ITEM) - .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) - .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) - .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) - .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) - .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) - .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) - .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) - .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) - .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_STONE_ITEM) - .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) - .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedAncientStones - .builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) - .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) - .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .setGear(ModRegistry.ATM_GEAR) - .setPlate(ModRegistry.ATM_PLATE) - .setRod(ModRegistry.ATM_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.VIBRANIUM_INGOT) - .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) - .setGear(ModRegistry.VIB_GEAR) - .setPlate(ModRegistry.VIB_PLATE) - .setRod(ModRegistry.VIB_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_INGOT) - .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) - .setGear(ModRegistry.UNOB_GEAR) - .setPlate(ModRegistry.UNOB_PLATE) - .setRod(ModRegistry.UNOB_ROD) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.UA_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) - .setBlock(ModRegistry.UV_ALLOY_ITEM) - .build(consumer); - - ShapedBlockBuilder - .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) - .setBlock(ModRegistry.VA_ALLOY_ITEM) - .build(consumer); - - ShapedIngotBuilder - .builder(TagRegistry.ALLTHEMODIUM_NUGGET) - .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) - .build(consumer); - ShapedIngotBuilder - .builder(TagRegistry.VIBRANIUM_NUGGET) - .setIngot(ModRegistry.VIBRANIUM_INGOT) - .build(consumer); - ShapedIngotBuilder - .builder(TagRegistry.UNOBTAINIUM_NUGGET) - .setIngot(ModRegistry.UNOBTAINIUM_INGOT) - .build(consumer); - } + public CraftingRecipes(DataGenerator generatorIn) { + super(generatorIn); + } + + private ShapedRecipeBuilder shaped(ItemLike provider) { + return ShapedRecipeBuilder.shaped(provider).group(Reference.MOD_ID); + } + + private static InventoryChangeTrigger.TriggerInstance hasTag( + TagKey tagKey) { + return inventoryTrigger( + ItemPredicate.Builder.item().of(tagKey).build()); + } + + @Override + protected void buildCraftingRecipes(Consumer consumer) { + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_ALLTHEMODIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_ALLTHEMODIUM), 9) + .unlockedBy( + "has_raw_allthemodium", + hasTag(TagRegistry.RAW_ALLTHEMODIUM)) + .save(consumer); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_VIBRANIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_VIBRANIUM), 9) + .unlockedBy("has_raw_vibranium", hasTag(TagRegistry.RAW_VIBRANIUM)) + .save(consumer); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_UNOBTAINIUM_BLOCK.get()) + .group(Reference.MOD_ID) + .requires(Ingredient.of(TagRegistry.RAW_UNOBTAINIUM), 9) + .unlockedBy( + "has_raw_unobtainium", + hasTag(TagRegistry.RAW_UNOBTAINIUM)) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_APPLE.get()) + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.APPLE) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_CARROT.get()) + .pattern("nnn") + .pattern("nan") + .pattern("nnn") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.CARROT) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .save(consumer); + + shaped(ModRegistry.TELEPORT_PAD_ITEM.get()) + .pattern(" n ") + .pattern("nan") + .pattern(" n ") + .define('n', TagRegistry.ALLTHEMODIUM_NUGGET) + .define('a', Items.ENDER_PEARL) + .unlockedBy( + "has_allthemodium_nugget", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_NUGGET) + .build())) + .unlockedBy( + "has_ender_pearl", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder.item().of(Items.ENDER_PEARL).build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_PICKAXE.get()) + .pattern("ara") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_AXE.get()) + .pattern("aa ") + .pattern("ar ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_SHOVEL.get()) + .pattern(" a ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_HOE.get()) + .pattern("aa ") + .pattern(" r ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + shaped(ModRegistry.ALLTHEMODIUM_SWORD.get()) + .pattern(" a ") + .pattern(" a ") + .pattern(" r ") + .define('r', TagRegistry.ALLTHEMODIUM_ROD) + .define('a', TagRegistry.ALLTHEMODIUM_PLATE) + .unlockedBy( + "has_allthemodium_rod", + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ALLTHEMODIUM_ROD) + .build())) + .save(consumer); + + // final String hasCondition = "has_item"; + + ShapedAncientStones + .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM) + .setDoor(ModRegistry.DEMONIC_DOOR_ITEM) + .setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.DEMONIC_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.DEMONIC_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.DEMONIC_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM) + .setDoor(ModRegistry.SOUL_DOOR_ITEM) + .setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM) + .setStairs(ModRegistry.SOUL_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.SOUL_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.SOUL_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM) + .setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM) + .setDoor(ModRegistry.ANCIENT_DOOR_ITEM) + .setStairs(ModRegistry.ANCIENT_WOODEN_STAIRS_ITEM) + .setFence(ModRegistry.ANCIENT_WOOD_FENCE_ITEM) + .setFenceGate(ModRegistry.ANCIENT_WOOD_FENCE_GATE_ITEM) + .setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_BRICK_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_BRICK_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_STONE_ITEM) + .setBrick(ModRegistry.ANCIENT_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_MOSSY_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_MOSSY_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_MOSSY_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_SMOOTH_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_SMOOTH_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_SMOOTH_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .setStairs(ModRegistry.ANCIENT_POLISHED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_POLISHED_STONE_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_POLISHED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CHISELED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CHISELED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedAncientStones + .builder(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .setStairs(ModRegistry.ANCIENT_CRACKED_STONE_STAIRS_ITEM) + .setWall(ModRegistry.ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM) + .setSlab(ModRegistry.ANCIENT_CRACKED_STONE_SLABS_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .setGear(ModRegistry.ATM_GEAR) + .setPlate(ModRegistry.ATM_PLATE) + .setRod(ModRegistry.ATM_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_INGOT) + .setBlock(ModRegistry.VIBRANIUM_BLOCK_ITEM) + .setGear(ModRegistry.VIB_GEAR) + .setPlate(ModRegistry.VIB_PLATE) + .setRod(ModRegistry.VIB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_INGOT) + .setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM) + .setGear(ModRegistry.UNOB_GEAR) + .setPlate(ModRegistry.UNOB_PLATE) + .setRod(ModRegistry.UNOB_ROD) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.UA_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .setBlock(ModRegistry.UV_ALLOY_ITEM) + .build(consumer); + + ShapedBlockBuilder + .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .setBlock(ModRegistry.VA_ALLOY_ITEM) + .build(consumer); + + ShapedIngotBuilder + .builder(TagRegistry.ALLTHEMODIUM_NUGGET) + .setIngot(ModRegistry.ALLTHEMODIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.VIBRANIUM_NUGGET) + .setIngot(ModRegistry.VIBRANIUM_INGOT) + .build(consumer); + ShapedIngotBuilder + .builder(TagRegistry.UNOBTAINIUM_NUGGET) + .setIngot(ModRegistry.UNOBTAINIUM_INGOT) + .build(consumer); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java index 4e48a650..307992b1 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/FluidTags.java @@ -9,23 +9,23 @@ public class FluidTags extends FluidTagsProvider { - public FluidTags( - DataGenerator p_126523_, - String modId, - @Nullable ExistingFileHelper existingFileHelper) { - super(p_126523_, modId, existingFileHelper); - } + public FluidTags( + DataGenerator p_126523_, + String modId, + @Nullable ExistingFileHelper existingFileHelper) { + super(p_126523_, modId, existingFileHelper); + } - @Override - protected void addTags() { - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); - tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA) - .add(FluidRegistry.SOULLAVA.get()); - tag(net.minecraft.tags.FluidTags.LAVA) - .add(FluidRegistry.FLOWING_SOULLAVA.get()); - // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); - // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); - // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); - } + @Override + protected void addTags() { + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.SOULLAVA.get()); + tag(TagRegistry.SOUL_LAVA).add(FluidRegistry.FLOWING_SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.SOULLAVA.get()); + tag(net.minecraft.tags.FluidTags.LAVA) + .add(FluidRegistry.FLOWING_SOULLAVA.get()); + // tag(TagRegistry.ALLTHEMODIUM).add(ModRegistry.moltenAllthemodium.get()); + // tag(TagRegistry.VIBRANIUM).add(ModRegistry.moltenVibranium.get()); + // tag(TagRegistry.UNOBTAINIUM).add(ModRegistry.moltenUnobtainium.get()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java index 8d63d311..7fefdf21 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ItemTags.java @@ -12,254 +12,254 @@ public class ItemTags extends ItemTagsProvider { - public ItemTags( - DataGenerator generator, - BlockTagsProvider blockTagsProvider, - ExistingFileHelper existingFileHelper) { - super( - generator, - blockTagsProvider, - Reference.MOD_ID, - existingFileHelper); - } - - @Override - protected void addTags() { - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.DEMONIC_LOG_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.PLANKS) - .add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_0_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_1_ITEM.get()); - tag(net.minecraft.tags.ItemTags.LOGS) - .add(ModRegistry.SOUL_LOG_2_ITEM.get()); - - tag(TagRegistry.SAPLINGS).add(ModRegistry.SOUL_SAPLING_ITEM.get()); - tag(TagRegistry.SAPLINGS).add(ModRegistry.DEMONIC_SAPLING_ITEM.get()); - tag(TagRegistry.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING_ITEM.get()); - - tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - - tag(TagRegistry.FORGE_PICKAXES) - .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); - - tag(TagRegistry.FORGE_AXES).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - - tag(TagRegistry.FORGE_SHOVELS) - .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); - - tag(TagRegistry.FORGE_HOES).add(ModRegistry.ALLTHEMODIUM_HOE.get()); - - tag(TagRegistry.FORGE_SWORDS).add(ModRegistry.ALLTHEMODIUM_SWORD.get()); - tag(TagRegistry.FORGE_SWORDS).add(ItemRegistry.ATM_ALLOY_SWORD.get()); - - tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PICK.get()); - tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_AXE.get()); - - tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_SHOVEL.get()); - tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(Tags.Items.SHEARS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.FORGE_HOES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); - - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_AXE.get()); - - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HOE.get()); - - tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_BOOTS.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); - tag(TagRegistry.PIGLIN_LOVED) - .add(ModRegistry.ALLTHEMODIUM_HELMET.get()); - - tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) - .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); - tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) - .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); - tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) - .add(ModRegistry.SOUL_PLANKS_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_ITEM) - .add(ModRegistry.ANCIENT_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) - .add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) - .add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) - .add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); - tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); - tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) - .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM) - .add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_VIBRANIUM).add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM).add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE) - .add(ModRegistry.RAW_ALLTHEMODIUM.get()); - tag(TagRegistry.RAW_VIBRANIUM_FORGE) - .add(ModRegistry.RAW_VIBRANIUM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_FORGE) - .add(ModRegistry.RAW_UNOBTAINIUM.get()); - - tag(TagRegistry.ALLTHEMODIUM_INGOT) - .add(ModRegistry.ALLTHEMODIUM_INGOT.get()); - tag(TagRegistry.VIBRANIUM_INGOT).add(ModRegistry.VIBRANIUM_INGOT.get()); - tag(TagRegistry.UNOBTAINIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_INGOT.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) - .add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) - .add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); - - tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.VA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.UA_ALLOY_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) - .add(ModRegistry.UV_ALLOY_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_DUST) - .add(ModRegistry.ALLTHEMODIUM_DUST.get()); - tag(TagRegistry.VIBRANIUM_DUST).add(ModRegistry.VIBRANIUM_DUST.get()); - tag(TagRegistry.UNOBTAINIUM_DUST) - .add(ModRegistry.UNOBTAINIUM_DUST.get()); - - tag(TagRegistry.DUSTS).add(ModRegistry.ALLTHEMODIUM_DUST.get()); - tag(TagRegistry.DUSTS).add(ModRegistry.VIBRANIUM_DUST.get()); - tag(TagRegistry.DUSTS).add(ModRegistry.UNOBTAINIUM_DUST.get()); - - tag(TagRegistry.INGOTS).add(ModRegistry.ALLTHEMODIUM_INGOT.get()); - tag(TagRegistry.INGOTS).add(ModRegistry.VIBRANIUM_INGOT.get()); - tag(TagRegistry.INGOTS).add(ModRegistry.UNOBTAINIUM_INGOT.get()); - - tag(TagRegistry.ALLTHEMODIUM_NUGGET) - .add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); - tag(TagRegistry.VIBRANIUM_NUGGET) - .add(ModRegistry.VIBRANIUM_NUGGET.get()); - tag(TagRegistry.UNOBTAINIUM_NUGGET) - .add(ModRegistry.UNOBTAINIUM_NUGGET.get()); - - tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.VIBRANIUM_BLOCK_ITEM) - .add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) - .add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); - - tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) - .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_VIBRANIUM_BLOCK) - .add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); - tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK) - .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) - .add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM) - .add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.VIBRANIUM_ORE_ITEM) - .add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.UNOBTAINIUM_ORE_ITEM) - .add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); - - tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES) - .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); - tag(TagRegistry.ORES).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); - - tag(TagRegistry.ALLTHEMODIUM_GEAR).add(ModRegistry.ATM_GEAR.get()); - tag(TagRegistry.VIBRANIUM_GEAR).add(ModRegistry.VIB_GEAR.get()); - tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.UNOB_GEAR.get()); - - tag(TagRegistry.ALLTHEMODIUM_PLATE).add(ModRegistry.ATM_PLATE.get()); - tag(TagRegistry.VIBRANIUM_PLATE).add(ModRegistry.VIB_PLATE.get()); - tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.UNOB_PLATE.get()); - - tag(TagRegistry.ALLTHEMODIUM_ROD).add(ModRegistry.ATM_ROD.get()); - tag(TagRegistry.VIBRANIUM_ROD).add(ModRegistry.VIB_ROD.get()); - tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.UNOB_ROD.get()); - - tag(TagRegistry.ALLTHEMODIUM_SHARD).add(ModRegistry.ATM_SHARD.get()); - tag(TagRegistry.VIBRANIUM_SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.UNOB_SHARD.get()); - - tag(TagRegistry.ALLTHEMODIUM_CLUMP).add(ModRegistry.ATM_CLUMP.get()); - tag(TagRegistry.VIBRANIUM_CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.UNOB_CLUMP.get()); - - tag(TagRegistry.ALLTHEMODIUM_CRYSTAL) - .add(ModRegistry.ATM_CRYSTAL.get()); - tag(TagRegistry.VIBRANIUM_CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.UNOBTAINIUM_CRYSTAL) - .add(ModRegistry.UNOB_CRYSTAL.get()); - - tag(TagRegistry.ALLTHEMODIUM_DIRTY_DUST) - .add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.VIBRANIUM_DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.UNOBTAINIUM_DIRTY_DUST) - .add(ModRegistry.UNOB_DIRTY.get()); - - tag(TagRegistry.SHARD).add(ModRegistry.ATM_SHARD.get()); - tag(TagRegistry.SHARD).add(ModRegistry.VIB_SHARD.get()); - tag(TagRegistry.SHARD).add(ModRegistry.UNOB_SHARD.get()); - - tag(TagRegistry.CLUMP).add(ModRegistry.ATM_CLUMP.get()); - tag(TagRegistry.CLUMP).add(ModRegistry.VIB_CLUMP.get()); - tag(TagRegistry.CLUMP).add(ModRegistry.UNOB_CLUMP.get()); - - tag(TagRegistry.CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); - tag(TagRegistry.CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); - tag(TagRegistry.CRYSTAL).add(ModRegistry.UNOB_CRYSTAL.get()); - - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.ATM_DIRTY.get()); - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); - tag(TagRegistry.DIRTY_DUST).add(ModRegistry.UNOB_DIRTY.get()); - } + public ItemTags( + DataGenerator generator, + BlockTagsProvider blockTagsProvider, + ExistingFileHelper existingFileHelper) { + super( + generator, + blockTagsProvider, + Reference.MOD_ID, + existingFileHelper); + } + + @Override + protected void addTags() { + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.ANCIENT_LOG_2_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.DEMONIC_LOG_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.PLANKS) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_0_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_1_ITEM.get()); + tag(net.minecraft.tags.ItemTags.LOGS) + .add(ModRegistry.SOUL_LOG_2_ITEM.get()); + + tag(TagRegistry.SAPLINGS).add(ModRegistry.SOUL_SAPLING_ITEM.get()); + tag(TagRegistry.SAPLINGS).add(ModRegistry.DEMONIC_SAPLING_ITEM.get()); + tag(TagRegistry.SAPLINGS).add(ModRegistry.ANCIENT_SAPLING_ITEM.get()); + + tag(net.minecraft.tags.ItemTags.STONE_CRAFTING_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(net.minecraft.tags.ItemTags.STONE_TOOL_MATERIALS) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + + tag(TagRegistry.FORGE_PICKAXES) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + + tag(TagRegistry.FORGE_AXES).add(ModRegistry.ALLTHEMODIUM_AXE.get()); + + tag(TagRegistry.FORGE_SHOVELS) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + + tag(TagRegistry.FORGE_HOES).add(ModRegistry.ALLTHEMODIUM_HOE.get()); + + tag(TagRegistry.FORGE_SWORDS).add(ModRegistry.ALLTHEMODIUM_SWORD.get()); + tag(TagRegistry.FORGE_SWORDS).add(ItemRegistry.ATM_ALLOY_SWORD.get()); + + tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PICK.get()); + tag(TagRegistry.FORGE_PICKAXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_AXE.get()); + + tag(TagRegistry.FORGE_AXES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_SHOVEL.get()); + tag(TagRegistry.FORGE_SHOVELS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(Tags.Items.SHEARS).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.FORGE_HOES).add(ItemRegistry.ATM_ALLOY_PAXEL.get()); + + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_PICKAXE.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_AXE.get()); + + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_SHOVEL.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_HOE.get()); + + tag(TagRegistry.PIGLIN_LOVED).add(ModRegistry.ALLTHEMODIUM_BOOTS.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_LEGGINGS.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get()); + tag(TagRegistry.PIGLIN_LOVED) + .add(ModRegistry.ALLTHEMODIUM_HELMET.get()); + + tag(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM) + .add(ModRegistry.ANCIENT_PLANKS_ITEM.get()); + tag(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM) + .add(ModRegistry.DEMONIC_PLANKS_ITEM.get()); + tag(TagRegistry.SOUL_WOODEN_PLANKS_ITEM) + .add(ModRegistry.SOUL_PLANKS_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_ITEM) + .add(ModRegistry.ANCIENT_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_MOSSY_STONE_ITEM) + .add(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_POLISHED_STONE_ITEM) + .add(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_SMOOTH_STONE_ITEM) + .add(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()); + tag(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get()); + tag(TagRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM) + .add(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_VIBRANIUM).add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM).add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_MATERIALS).add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM_FORGE) + .add(ModRegistry.RAW_ALLTHEMODIUM.get()); + tag(TagRegistry.RAW_VIBRANIUM_FORGE) + .add(ModRegistry.RAW_VIBRANIUM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_FORGE) + .add(ModRegistry.RAW_UNOBTAINIUM.get()); + + tag(TagRegistry.ALLTHEMODIUM_INGOT) + .add(ModRegistry.ALLTHEMODIUM_INGOT.get()); + tag(TagRegistry.VIBRANIUM_INGOT).add(ModRegistry.VIBRANIUM_INGOT.get()); + tag(TagRegistry.UNOBTAINIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_INGOT.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT) + .add(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get()); + + tag(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.VA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.UA_ALLOY_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .add(ModRegistry.UV_ALLOY_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_DUST) + .add(ModRegistry.ALLTHEMODIUM_DUST.get()); + tag(TagRegistry.VIBRANIUM_DUST).add(ModRegistry.VIBRANIUM_DUST.get()); + tag(TagRegistry.UNOBTAINIUM_DUST) + .add(ModRegistry.UNOBTAINIUM_DUST.get()); + + tag(TagRegistry.DUSTS).add(ModRegistry.ALLTHEMODIUM_DUST.get()); + tag(TagRegistry.DUSTS).add(ModRegistry.VIBRANIUM_DUST.get()); + tag(TagRegistry.DUSTS).add(ModRegistry.UNOBTAINIUM_DUST.get()); + + tag(TagRegistry.INGOTS).add(ModRegistry.ALLTHEMODIUM_INGOT.get()); + tag(TagRegistry.INGOTS).add(ModRegistry.VIBRANIUM_INGOT.get()); + tag(TagRegistry.INGOTS).add(ModRegistry.UNOBTAINIUM_INGOT.get()); + + tag(TagRegistry.ALLTHEMODIUM_NUGGET) + .add(ModRegistry.ALLTHEMODIUM_NUGGET.get()); + tag(TagRegistry.VIBRANIUM_NUGGET) + .add(ModRegistry.VIBRANIUM_NUGGET.get()); + tag(TagRegistry.UNOBTAINIUM_NUGGET) + .add(ModRegistry.UNOBTAINIUM_NUGGET.get()); + + tag(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .add(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .add(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .add(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .add(ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_VIBRANIUM_BLOCK) + .add(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()); + tag(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .add(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + tag(TagRegistry.ALLTHEMODIUM_ORE_ITEM) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.VIBRANIUM_ORE_ITEM) + .add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.UNOBTAINIUM_ORE_ITEM) + .add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); + + tag(TagRegistry.ORES).add(ModRegistry.ALLTHEMODIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES) + .add(ModRegistry.ALLTHEMODIUM_SLATE_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.OTHER_VIBRANIUM_ORE_ITEM.get()); + tag(TagRegistry.ORES).add(ModRegistry.UNOBTAINIUM_ORE_ITEM.get()); + + tag(TagRegistry.ALLTHEMODIUM_GEAR).add(ModRegistry.ATM_GEAR.get()); + tag(TagRegistry.VIBRANIUM_GEAR).add(ModRegistry.VIB_GEAR.get()); + tag(TagRegistry.UNOBTAINIUM_GEAR).add(ModRegistry.UNOB_GEAR.get()); + + tag(TagRegistry.ALLTHEMODIUM_PLATE).add(ModRegistry.ATM_PLATE.get()); + tag(TagRegistry.VIBRANIUM_PLATE).add(ModRegistry.VIB_PLATE.get()); + tag(TagRegistry.UNOBTAINIUM_PLATE).add(ModRegistry.UNOB_PLATE.get()); + + tag(TagRegistry.ALLTHEMODIUM_ROD).add(ModRegistry.ATM_ROD.get()); + tag(TagRegistry.VIBRANIUM_ROD).add(ModRegistry.VIB_ROD.get()); + tag(TagRegistry.UNOBTAINIUM_ROD).add(ModRegistry.UNOB_ROD.get()); + + tag(TagRegistry.ALLTHEMODIUM_SHARD).add(ModRegistry.ATM_SHARD.get()); + tag(TagRegistry.VIBRANIUM_SHARD).add(ModRegistry.VIB_SHARD.get()); + tag(TagRegistry.UNOBTAINIUM_SHARD).add(ModRegistry.UNOB_SHARD.get()); + + tag(TagRegistry.ALLTHEMODIUM_CLUMP).add(ModRegistry.ATM_CLUMP.get()); + tag(TagRegistry.VIBRANIUM_CLUMP).add(ModRegistry.VIB_CLUMP.get()); + tag(TagRegistry.UNOBTAINIUM_CLUMP).add(ModRegistry.UNOB_CLUMP.get()); + + tag(TagRegistry.ALLTHEMODIUM_CRYSTAL) + .add(ModRegistry.ATM_CRYSTAL.get()); + tag(TagRegistry.VIBRANIUM_CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); + tag(TagRegistry.UNOBTAINIUM_CRYSTAL) + .add(ModRegistry.UNOB_CRYSTAL.get()); + + tag(TagRegistry.ALLTHEMODIUM_DIRTY_DUST) + .add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.VIBRANIUM_DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.UNOBTAINIUM_DIRTY_DUST) + .add(ModRegistry.UNOB_DIRTY.get()); + + tag(TagRegistry.SHARD).add(ModRegistry.ATM_SHARD.get()); + tag(TagRegistry.SHARD).add(ModRegistry.VIB_SHARD.get()); + tag(TagRegistry.SHARD).add(ModRegistry.UNOB_SHARD.get()); + + tag(TagRegistry.CLUMP).add(ModRegistry.ATM_CLUMP.get()); + tag(TagRegistry.CLUMP).add(ModRegistry.VIB_CLUMP.get()); + tag(TagRegistry.CLUMP).add(ModRegistry.UNOB_CLUMP.get()); + + tag(TagRegistry.CRYSTAL).add(ModRegistry.ATM_CRYSTAL.get()); + tag(TagRegistry.CRYSTAL).add(ModRegistry.VIB_CRYSTAL.get()); + tag(TagRegistry.CRYSTAL).add(ModRegistry.UNOB_CRYSTAL.get()); + + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.ATM_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.VIB_DIRTY.get()); + tag(TagRegistry.DIRTY_DUST).add(ModRegistry.UNOB_DIRTY.get()); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java index 00d03431..82c45fbf 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/LootTables.java @@ -29,123 +29,123 @@ public class LootTables extends LootTableProvider { - public LootTables(DataGenerator generator) { - super(generator); - } - - @Override - protected List>>, LootContextParamSet>> getTables() { - return ImmutableList.of( - Pair.of(BlockLoots::new, LootContextParamSets.BLOCK)); - } - - public static class BlockLoots extends BlockLoot { - - @Override - public void addTables() { - getKnownBlocks().forEach(this::dropRaw); - } - - // private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[] { - // 0.05F, 0.0625F, 0.083333336F, 0.1F }; - - private void dropRaw(Block block) { - if (block instanceof LiquidBlock) { - return; - } - - if (block.getName().getString().contains("ancient_bookshelf")) { - this.add( - ModRegistry.ANCIENT_BOOKSHELF.get(), - p_124241_ -> { - return createSingleItemTableWithSilkTouch( - p_124241_, - Items.BOOK, - ConstantValue.exactly(3.0F)); - }); - } - String oreType = block.getName().getString(); - - if (block instanceof AllthemodiumOre) { - this.add( - block, - block1 -> createOreDrop( - block1, - ModRegistry.RAW_ALLTHEMODIUM.get())); - } else if (block instanceof VibraniumOre) { - this.add( - block, - block1 -> createOreDrop( - block1, - ModRegistry.RAW_VIBRANIUM.get())); - } else if (block instanceof UnobtainiumOre) { - this.add( - block, - block1 -> createOreDrop( - block1, - ModRegistry.RAW_UNOBTAINIUM.get())); - } else if (oreType.contains("raw_")) { - this.dropSelf(block); - } else { - this.dropSelf(block); - } - } - - @Override - protected Iterable getKnownBlocks() { - return Stream - .of( - ModRegistry.BLOCKS.getEntries(), - ModRegistry.STAIR_BLOCKS.getEntries(), - ModRegistry.SLAB_BLOCKS.getEntries(), - ModRegistry.WALL_BLOCKS.getEntries(), - ModRegistry.PILLAR_BLOCKS.getEntries()) - .filter(block -> !(block instanceof LeavesBlock)) - .flatMap(Collection::stream) - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownStairs() { - return ModRegistry.STAIR_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownSlabs() { - return ModRegistry.SLAB_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getKnownWalls() { - return ModRegistry.WALL_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - - protected Iterable getUnknownBlocks() { - return ModRegistry.PILLAR_BLOCKS - .getEntries() - .stream() - .map(RegistryObject::get) - .collect(Collectors.toList()); - } - } - - @Override - protected void validate( - Map map, - ValidationContext validationTracker) { - map.forEach((name, table) -> net.minecraft.world.level.storage.loot.LootTables.validate( - validationTracker, - name, - table)); - } + public LootTables(DataGenerator generator) { + super(generator); + } + + @Override + protected List>>, LootContextParamSet>> getTables() { + return ImmutableList.of( + Pair.of(BlockLoots::new, LootContextParamSets.BLOCK)); + } + + public static class BlockLoots extends BlockLoot { + + @Override + public void addTables() { + getKnownBlocks().forEach(this::dropRaw); + } + + // private static final float[] NORMAL_LEAVES_SAPLING_CHANCES = new float[] { + // 0.05F, 0.0625F, 0.083333336F, 0.1F }; + + private void dropRaw(Block block) { + if (block instanceof LiquidBlock) { + return; + } + + if (block.getName().getString().contains("ancient_bookshelf")) { + this.add( + ModRegistry.ANCIENT_BOOKSHELF.get(), + p_124241_ -> { + return createSingleItemTableWithSilkTouch( + p_124241_, + Items.BOOK, + ConstantValue.exactly(3.0F)); + }); + } + String oreType = block.getName().getString(); + + if (block instanceof AllthemodiumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_ALLTHEMODIUM.get())); + } else if (block instanceof VibraniumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_VIBRANIUM.get())); + } else if (block instanceof UnobtainiumOre) { + this.add( + block, + block1 -> createOreDrop( + block1, + ModRegistry.RAW_UNOBTAINIUM.get())); + } else if (oreType.contains("raw_")) { + this.dropSelf(block); + } else { + this.dropSelf(block); + } + } + + @Override + protected Iterable getKnownBlocks() { + return Stream + .of( + ModRegistry.BLOCKS.getEntries(), + ModRegistry.STAIR_BLOCKS.getEntries(), + ModRegistry.SLAB_BLOCKS.getEntries(), + ModRegistry.WALL_BLOCKS.getEntries(), + ModRegistry.PILLAR_BLOCKS.getEntries()) + .filter(block -> !(block instanceof LeavesBlock)) + .flatMap(Collection::stream) + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownStairs() { + return ModRegistry.STAIR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownSlabs() { + return ModRegistry.SLAB_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getKnownWalls() { + return ModRegistry.WALL_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + + protected Iterable getUnknownBlocks() { + return ModRegistry.PILLAR_BLOCKS + .getEntries() + .stream() + .map(RegistryObject::get) + .collect(Collectors.toList()); + } + } + + @Override + protected void validate( + Map map, + ValidationContext validationTracker) { + map.forEach((name, table) -> net.minecraft.world.level.storage.loot.LootTables.validate( + validationTracker, + name, + table)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java index ca58f3a3..b965d26e 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/ShapelessCrafting.java @@ -13,268 +13,268 @@ public class ShapelessCrafting extends RecipeProvider { - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut); - } - - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; - - ShapelessRecipeBuilder - .shapeless(ModRegistry.DEMONIC_PLANKS.get(), 4) - .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get())) - .save(consumer, recipeDir("demonic_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get())) - .save(consumer, recipeDir("soul_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get())) - .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get())) - .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) - .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get())) - .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get())) - .save(consumer, recipeDir("ancient_planks", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get())) - .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get())) - .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) - .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get())) - .save(consumer, recipeDir("ancient_planks_3", "shapelesscrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(), 1) - .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) - .requires(Items.VINE) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer, recipeDir("ancient_mossy_stone", "vinecrafting")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(), 1) - .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) - .requires(Items.HONEYCOMB) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get())) - .save(consumer, recipeDir("ancient_polished_stone", "waxing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(), 1) - .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) - .build())) - .save( - consumer, - recipeDir("ancient_cracked_stone_bricks", "crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(), 1) - .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.inventoryTrigger( - ItemPredicate.Builder - .item() - .of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) - .build())) - .save( - consumer, - recipeDir("ancient_chiseled_stone_bricks", "crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer, recipeDir("allthemodium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(), 9) - .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("allthemodium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9) - .requires(TagRegistry.ALLTHEMODIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get())) - .save(consumer, recipeDir("allthemodium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_VIBRANIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer, recipeDir("vibranium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(), 2) - .requires(ModRegistry.RAW_UNOBTAINIUM.get()) - .requires(ItemTagRegistry.ORE_HAMMERS) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer, recipeDir("unobtainium_dust", "ore_crushing")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_INGOT.get(), 9) - .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("vibranium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9) - .requires(TagRegistry.VIBRANIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get())) - .save(consumer, recipeDir("vibranium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("unobtainium_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_INGOT) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get())) - .save(consumer, recipeDir("unobtainium_nugget", "ingot")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(), 9) - .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has( - ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("raw_allthemodium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_VIBRANIUM.get(), 9) - .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("raw_vibranium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(), 9) - .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get())) - .save(consumer, recipeDir("raw_unobtainium", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get())) - .save( - consumer, - recipeDir("unobtainium_allthemodium_alloy_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(), 9) - .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get())) - .save( - consumer, - recipeDir("unobtainium_vibranium_alloy_ingot", "block")); - - ShapelessRecipeBuilder - .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(), 9) - .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get())) - .save( - consumer, - recipeDir("vibranium_allthemodium_alloy_ingot", "block")); - } - - public ShapelessCrafting(DataGenerator generatorIn) { - super(generatorIn); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut); + } + + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; + + ShapelessRecipeBuilder + .shapeless(ModRegistry.DEMONIC_PLANKS.get(), 4) + .requires(ModRegistry.DEMONIC_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get())) + .save(consumer, recipeDir("demonic_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get())) + .save(consumer, recipeDir("soul_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get())) + .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get())) + .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.SOUL_PLANKS.get(), 4) + .requires(ModRegistry.SOUL_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get())) + .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_0_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get())) + .save(consumer, recipeDir("ancient_planks", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_1_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_2_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_PLANKS.get(), 4) + .requires(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get()) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_LOG_STRIPPED_ITEM.get())) + .save(consumer, recipeDir("ancient_planks_3", "shapelesscrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_MOSSY_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_STONE_ITEM.get()) + .requires(Items.VINE) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_mossy_stone", "vinecrafting")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_POLISHED_STONE_ITEM.get(), 1) + .requires(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get()) + .requires(Items.HONEYCOMB) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_polished_stone", "waxing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_STONE_BRICKS_ITEM) + .build())) + .save( + consumer, + recipeDir("ancient_cracked_stone_bricks", "crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ANCIENT_CHISELED_STONE_BRICKS_ITEM.get(), 1) + .requires(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.inventoryTrigger( + ItemPredicate.Builder + .item() + .of(TagRegistry.ANCIENT_CRACKED_STONE_BRICKS_ITEM) + .build())) + .save( + consumer, + recipeDir("ancient_chiseled_stone_bricks", "crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_ALLTHEMODIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9) + .requires(TagRegistry.ALLTHEMODIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get())) + .save(consumer, recipeDir("allthemodium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_VIBRANIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(), 2) + .requires(ModRegistry.RAW_UNOBTAINIUM.get()) + .requires(ItemTagRegistry.ORE_HAMMERS) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_dust", "ore_crushing")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_INGOT.get(), 9) + .requires(TagRegistry.VIBRANIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("vibranium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9) + .requires(TagRegistry.VIBRANIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get())) + .save(consumer, recipeDir("vibranium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_BLOCK_ITEM) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_INGOT) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get())) + .save(consumer, recipeDir("unobtainium_nugget", "ingot")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(), 9) + .requires(TagRegistry.RAW_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has( + ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_allthemodium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_VIBRANIUM.get(), 9) + .requires(TagRegistry.RAW_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_vibranium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(), 9) + .requires(TagRegistry.RAW_UNOBTAINIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get())) + .save(consumer, recipeDir("raw_unobtainium", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UA_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("unobtainium_allthemodium_alloy_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.UNOBTAINIUM_VIBRANIUM_ALLOY.get(), 9) + .requires(TagRegistry.UNOBTAINIUM_VIBRANIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UV_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("unobtainium_vibranium_alloy_ingot", "block")); + + ShapelessRecipeBuilder + .shapeless(ModRegistry.VIBRANIUM_ALLTHEMODIUM_ALLOY.get(), 9) + .requires(TagRegistry.VIBRANIUM_ALLTHEMODIUM_BLOCK) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VA_ALLOY_ITEM.get())) + .save( + consumer, + recipeDir("vibranium_allthemodium_alloy_ingot", "block")); + } + + public ShapelessCrafting(DataGenerator generatorIn) { + super(generatorIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java index 3b3861a7..bf98c039 100644 --- a/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java +++ b/src/main/java/com/thevortex/allthemodium/datagen/server/SmeltingRecipes.java @@ -12,95 +12,95 @@ public class SmeltingRecipes extends RecipeProvider { - public SmeltingRecipes(DataGenerator generator) { - super(generator); - } + public SmeltingRecipes(DataGenerator generator) { + super(generator); + } - private ResourceLocation recipeDir(String typeIn, String typeOut) { - return new ResourceLocation( - Reference.MOD_ID, - typeIn + "_from_" + typeOut); - } + private ResourceLocation recipeDir(String typeIn, String typeOut) { + return new ResourceLocation( + Reference.MOD_ID, + typeIn + "_from_" + typeOut); + } - @Override - protected void buildCraftingRecipes(Consumer consumer) { - final String hasCondition = "has_item"; + @Override + protected void buildCraftingRecipes(Consumer consumer) { + final String hasCondition = "has_item"; - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), - ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) - .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.ANCIENT_STONE_ITEM.get()), + ModRegistry.ANCIENT_SMOOTH_STONE_ITEM.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ANCIENT_STONE_ITEM.get())) + .save(consumer, recipeDir("ancient_smooth_stone", "ancient_stone")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) - .save(consumer, recipeDir("allthemodium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_ALLTHEMODIUM.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get())) + .save(consumer, recipeDir("allthemodium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) - .save(consumer, recipeDir("vibranium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_VIBRANIUM.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get())) + .save(consumer, recipeDir("vibranium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) - .save(consumer, recipeDir("unobtainium_ingot", "raw")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.RAW_UNOBTAINIUM.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get())) + .save(consumer, recipeDir("unobtainium_ingot", "raw")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), - ModRegistry.ALLTHEMODIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) - .save(consumer, recipeDir("allthemodium_ingot", "dust")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.ALLTHEMODIUM_DUST.get()), + ModRegistry.ALLTHEMODIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.ALLTHEMODIUM_DUST.get())) + .save(consumer, recipeDir("allthemodium_ingot", "dust")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), - ModRegistry.VIBRANIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) - .save(consumer, recipeDir("vibranium_ingot", "dust")); + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.VIBRANIUM_DUST.get()), + ModRegistry.VIBRANIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.VIBRANIUM_DUST.get())) + .save(consumer, recipeDir("vibranium_ingot", "dust")); - SimpleCookingRecipeBuilder - .smelting( - Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), - ModRegistry.UNOBTAINIUM_INGOT.get(), - 0.15f, - 200) - .unlockedBy( - hasCondition, - RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) - .save(consumer, recipeDir("unobtainium_ingot", "dust")); - } + SimpleCookingRecipeBuilder + .smelting( + Ingredient.of(ModRegistry.UNOBTAINIUM_DUST.get()), + ModRegistry.UNOBTAINIUM_INGOT.get(), + 0.15f, + 200) + .unlockedBy( + hasCondition, + RecipeProvider.has(ModRegistry.UNOBTAINIUM_DUST.get())) + .save(consumer, recipeDir("unobtainium_ingot", "dust")); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java index d1148005..a7a7f599 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichEntity.java @@ -35,402 +35,402 @@ public class PiglichEntity extends Piglin implements IAnimatable { - private final SimpleContainer inventory = new SimpleContainer(8); - private AnimationFactory factory = new AnimationFactory(this); - private boolean isSummoning = false; - - public PiglichEntity(EntityType type, Level world) { - super(type, world); - this.setImmuneToZombification(true); - this.registerGoals(); - } - - @Override - public boolean canAttack(@Nonnull LivingEntity entity) { - if (entity instanceof Player) { - if (((Player) entity).isCreative()) { - return false; - } - } - return true; - } - - protected void populateDefaultEquipmentSlots(DifficultyInstance diff) { - if (this.isAdult()) { - this.maybeWearArmor( - EquipmentSlot.HEAD, - new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get())); - this.maybeWearArmor( - EquipmentSlot.CHEST, - new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())); - this.maybeWearArmor( - EquipmentSlot.LEGS, - new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get())); - this.maybeWearArmor( - EquipmentSlot.FEET, - new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get())); - } - } - - private void maybeWearArmor(EquipmentSlot slot, ItemStack stack) { - if (this.level.random.nextFloat() < 0.5F) { - this.setItemSlot(slot, stack); - } - } - - @Override - public void addAdditionalSaveData(@Nonnull CompoundTag tag) { - super.addAdditionalSaveData(tag); - - tag.put("Inventory", this.inventory.createTag()); - } - - @Override - public void readAdditionalSaveData(@Nonnull CompoundTag tag) { - super.readAdditionalSaveData(tag); - this.inventory.fromTag(tag.getList("Inventory", 10)); - } - - @Override - protected void registerGoals() { - this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 3.0D, true)); - this.goalSelector.addGoal( - 2, - new MoveTowardsTargetGoal(this, 0.9D, 32.0F)); - this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); - this.targetSelector.addGoal( - 1, - new NearestAttackableTargetGoal( - this, - Skeleton.class, - true)); - this.targetSelector.addGoal( - 1, - new NearestAttackableTargetGoal( - this, - WitherSkeleton.class, - true)); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); - this.targetSelector.addGoal( - 3, - new NearestAttackableTargetGoal( - this, - Player.class, - true)); - this.goalSelector.addGoal( - 4, - new LookAtPlayerGoal(this, Player.class, 8.0F)); - this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); - this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); - } - - @Override - public MobType getMobType() { - return MobType.UNDEFINED; - } - - private ItemStack createSpawnWeapon() { - return (double) this.random.nextFloat() < 0.4D - ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) - : new ItemStack(Items.NETHERITE_SWORD); - } - - @Override - public void setImmuneToZombification(boolean p_34671_) { - super.setImmuneToZombification(true); - } - - @Override - public SpawnGroupData finalizeSpawn( - @Nonnull ServerLevelAccessor sla, - @Nonnull DifficultyInstance difficultyInstance, - @Nonnull MobSpawnType mobSpawnType, - @Nullable SpawnGroupData spawnGroupData, - @Nullable CompoundTag tag) { - if (mobSpawnType != MobSpawnType.STRUCTURE) { - this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); - } - - this.populateDefaultEquipmentSlots(difficultyInstance); - return super.finalizeSpawn( - sla, - difficultyInstance, - mobSpawnType, - spawnGroupData, - tag); - } - - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 12) - .add(Attributes.ARMOR, 24) - .add(Attributes.ARMOR_TOUGHNESS, 24) - .add(Attributes.MAX_HEALTH, 9999); - } - - private PlayState predicate( - AnimationEvent event) { - if (event.isMoving()) { - event - .getController() - .setAnimation( - new AnimationBuilder() - .addAnimation("walk.piglich.nik", true)); - return PlayState.CONTINUE; - } - if (this.isSummoning) { - event - .getController() - .setAnimation( - new AnimationBuilder() - .addAnimation("summon.piglich.nik", true)); - return PlayState.CONTINUE; - } - event - .getController() - .setAnimation( - new AnimationBuilder().addAnimation("idle.piglich.nik", true)); - return PlayState.CONTINUE; - } - - @Override - public void registerControllers(AnimationData animationData) { - animationData.addAnimationController( - new AnimationController( - this, - "controller", - 0, - this::predicate)); - } - - @Override - public AnimationFactory getFactory() { - return this.factory; - } - - static class PigLichAttackGoal extends Goal { - - private final PiglichEntity piglich; - private int attackStep; - private int attackTime; - private int lastSeen; - - public PigLichAttackGoal(PiglichEntity p_32247_) { - this.piglich = p_32247_; - this.setFlags( - EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET)); - } - - public boolean canUse() { - LivingEntity livingEntity = this.piglich.getTarget(); - return (livingEntity != null && - livingEntity.isAlive() && - this.piglich.canAttack(livingEntity)); - } - - public void start() { - this.attackStep = 0; - } - - public void stop() { - this.lastSeen = 0; - } - - public boolean requiresUpdateEveryTick() { - return true; - } - - @SuppressWarnings("unused") - public void tick() { - --this.attackTime; - LivingEntity livingEntity = this.piglich.getTarget(); - if (livingEntity != null) { - boolean flag = this.piglich.getSensing().hasLineOfSight(livingEntity); - if (flag) { - this.lastSeen = 0; - } else { - ++this.lastSeen; - } - - double d0 = this.piglich.distanceToSqr(livingEntity); - if (d0 < 4.0D) { - if (!flag) { - return; - } - - if (this.attackTime <= 0) { - this.attackTime = 20; - this.piglich.doHurtTarget(livingEntity); - } - - this.piglich.getMoveControl() - .setWantedPosition( - livingEntity.getX(), - livingEntity.getY(), - livingEntity.getZ(), - 1.0D); - } else if (d0 < this.getFollowDistance() * this.getFollowDistance() && - flag) { - double d1 = livingEntity.getX() - this.piglich.getX(); - double d2 = livingEntity.getY(0.5D) - this.piglich.getY(0.5D); - double d3 = livingEntity.getZ() - this.piglich.getZ(); - if (this.attackTime <= 0) { - ++this.attackStep; - if (this.attackStep == 1) { - this.attackTime = 60; - } else if (this.attackStep <= 4) { - this.attackTime = 6; - } else { - this.attackTime = 100; - this.attackStep = 0; - } - - if (this.attackStep > 1) { - double d4 = Math.sqrt(Math.sqrt(d0)) * 0.5D; - if (!this.piglich.isSilent()) { - this.piglich.level.levelEvent( - (Player) null, - 1018, - this.piglich.blockPosition(), - 0); - } - // for (int i = 0; i < 3; ++i) { - // Vec3 vec3 = this.piglich.getViewVector(1.0F); - // this.piglich.isSummoning = true; - // LargeFireball largeFireball = new LargeFireball(this.piglich.level, this.piglich, d2, - // d3, d4, - // (int) this.piglich.getHealth()); - // largeFireball.setPos(this.piglich.getX() + - // vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, - // largeFireball.getZ() + vec3.z - // * 4.0D); - // this.piglich.level.addFreshEntity(largeFireball); - // } - - } - } - - this.piglich.getLookControl() - .setLookAt(livingEntity, 10.0F, 10.0F); - } else if (this.lastSeen < 5) { - this.piglich.getMoveControl() - .setWantedPosition( - livingEntity.getX(), - livingEntity.getY(), - livingEntity.getZ(), - 1.0D); - } - - super.tick(); - } - } - - private double getFollowDistance() { - return this.piglich.getAttributeValue(Attributes.FOLLOW_RANGE); - } - } - - @Override - public boolean hurt(@Nonnull DamageSource source, float damage) { - if (!super.hurt(source, damage)) { - return false; - } else if (!(this.level instanceof ServerLevel)) { - return false; - } else { - LivingEntity livingEntity = this.getTarget(); - if (livingEntity == null && - source.getEntity() instanceof LivingEntity) { - livingEntity = (LivingEntity) source.getEntity(); - } - - if (!(livingEntity instanceof Player)) { - return false; - } else { - int i = Mth.floor(this.getX()); - int j = Mth.floor(this.getY()); - int k = Mth.floor(this.getZ()); - return this.spawnSupport(this, i, j, k); - } - } - } - - protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { - ServerLevel serverLevel = (ServerLevel) piglich.level; - LivingEntity livingEntity = piglich.getTarget(); - int mobType = Mth.nextInt(piglich.random, 1, 6); - Monster spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create( - piglich.level); - switch (mobType) { - case 1: - spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create(piglich.level); - case 2: - spawnMob = (Monster) EntityType.BLAZE.create(piglich.level); - case 3: - spawnMob = (Monster) EntityType.ENDERMAN.create(piglich.level); - case 4: - spawnMob = (Monster) EntityType.EVOKER.create(piglich.level); - case 5: - spawnMob = (Monster) EntityType.VINDICATOR.create(piglich.level); - case 6: - spawnMob = (Monster) EntityType.WITCH.create(piglich.level); - default: - for (int l = 0; l < 5; ++l) { - int i1 = i + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - int j1 = j + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - int k1 = k + - Mth.nextInt(piglich.random, 7, 40) * - Mth.nextInt(piglich.random, -1, 1); - BlockPos blockPos = new BlockPos(i1, j1, k1); - - if (spawnMob == null) - return false; - - EntityType entityType = spawnMob.getType(); - SpawnPlacements.Type spawnPlacements$type = SpawnPlacements.getPlacementType(entityType); - if (NaturalSpawner.isSpawnPositionOk( - spawnPlacements$type, - piglich.level, - blockPos, - entityType) && - SpawnPlacements.checkSpawnRules( - entityType, - serverLevel, - MobSpawnType.REINFORCEMENT, - blockPos, - piglich.level.random)) { - spawnMob.setPos((double) i1, (double) j1, (double) k1); - if (!piglich.level.hasNearbyAlivePlayer( - (double) i1, - (double) j1, - (double) k1, - 7.0D) && - piglich.level.isUnobstructed(spawnMob) && - piglich.level.noCollision(spawnMob) && - !piglich.level.containsAnyLiquid( - spawnMob.getBoundingBox())) { - if (livingEntity != null) { - spawnMob.setTarget(livingEntity); - } - - spawnMob.finalizeSpawn( - serverLevel, - piglich.level.getCurrentDifficultyAt( - spawnMob.blockPosition()), - MobSpawnType.REINFORCEMENT, - (SpawnGroupData) null, - (CompoundTag) null); - serverLevel.addFreshEntityWithPassengers(spawnMob); - } - } - } - this.isSummoning = true; - return true; - } - } + private final SimpleContainer inventory = new SimpleContainer(8); + private AnimationFactory factory = new AnimationFactory(this); + private boolean isSummoning = false; + + public PiglichEntity(EntityType type, Level world) { + super(type, world); + this.setImmuneToZombification(true); + this.registerGoals(); + } + + @Override + public boolean canAttack(@Nonnull LivingEntity entity) { + if (entity instanceof Player) { + if (((Player) entity).isCreative()) { + return false; + } + } + return true; + } + + protected void populateDefaultEquipmentSlots(DifficultyInstance diff) { + if (this.isAdult()) { + this.maybeWearArmor( + EquipmentSlot.HEAD, + new ItemStack(ModRegistry.ALLTHEMODIUM_HELMET.get())); + this.maybeWearArmor( + EquipmentSlot.CHEST, + new ItemStack(ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())); + this.maybeWearArmor( + EquipmentSlot.LEGS, + new ItemStack(ModRegistry.ALLTHEMODIUM_LEGGINGS.get())); + this.maybeWearArmor( + EquipmentSlot.FEET, + new ItemStack(ModRegistry.ALLTHEMODIUM_BOOTS.get())); + } + } + + private void maybeWearArmor(EquipmentSlot slot, ItemStack stack) { + if (this.level.random.nextFloat() < 0.5F) { + this.setItemSlot(slot, stack); + } + } + + @Override + public void addAdditionalSaveData(@Nonnull CompoundTag tag) { + super.addAdditionalSaveData(tag); + + tag.put("Inventory", this.inventory.createTag()); + } + + @Override + public void readAdditionalSaveData(@Nonnull CompoundTag tag) { + super.readAdditionalSaveData(tag); + this.inventory.fromTag(tag.getList("Inventory", 10)); + } + + @Override + protected void registerGoals() { + this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 3.0D, true)); + this.goalSelector.addGoal( + 2, + new MoveTowardsTargetGoal(this, 0.9D, 32.0F)); + this.goalSelector.addGoal(1, new PigLichAttackGoal(this)); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + Skeleton.class, + true)); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal( + this, + WitherSkeleton.class, + true)); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); + this.targetSelector.addGoal( + 3, + new NearestAttackableTargetGoal( + this, + Player.class, + true)); + this.goalSelector.addGoal( + 4, + new LookAtPlayerGoal(this, Player.class, 8.0F)); + this.goalSelector.addGoal(5, new RandomLookAroundGoal(this)); + this.goalSelector.addGoal(6, new RandomStrollGoal(this, 1.0D)); + } + + @Override + public MobType getMobType() { + return MobType.UNDEFINED; + } + + private ItemStack createSpawnWeapon() { + return (double) this.random.nextFloat() < 0.4D + ? new ItemStack(ModRegistry.ALLTHEMODIUM_SWORD.get()) + : new ItemStack(Items.NETHERITE_SWORD); + } + + @Override + public void setImmuneToZombification(boolean p_34671_) { + super.setImmuneToZombification(true); + } + + @Override + public SpawnGroupData finalizeSpawn( + @Nonnull ServerLevelAccessor sla, + @Nonnull DifficultyInstance difficultyInstance, + @Nonnull MobSpawnType mobSpawnType, + @Nullable SpawnGroupData spawnGroupData, + @Nullable CompoundTag tag) { + if (mobSpawnType != MobSpawnType.STRUCTURE) { + this.setItemSlot(EquipmentSlot.MAINHAND, this.createSpawnWeapon()); + } + + this.populateDefaultEquipmentSlots(difficultyInstance); + return super.finalizeSpawn( + sla, + difficultyInstance, + mobSpawnType, + spawnGroupData, + tag); + } + + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 12) + .add(Attributes.ARMOR, 24) + .add(Attributes.ARMOR_TOUGHNESS, 24) + .add(Attributes.MAX_HEALTH, 9999); + } + + private PlayState predicate( + AnimationEvent event) { + if (event.isMoving()) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("walk.piglich.nik", true)); + return PlayState.CONTINUE; + } + if (this.isSummoning) { + event + .getController() + .setAnimation( + new AnimationBuilder() + .addAnimation("summon.piglich.nik", true)); + return PlayState.CONTINUE; + } + event + .getController() + .setAnimation( + new AnimationBuilder().addAnimation("idle.piglich.nik", true)); + return PlayState.CONTINUE; + } + + @Override + public void registerControllers(AnimationData animationData) { + animationData.addAnimationController( + new AnimationController( + this, + "controller", + 0, + this::predicate)); + } + + @Override + public AnimationFactory getFactory() { + return this.factory; + } + + static class PigLichAttackGoal extends Goal { + + private final PiglichEntity piglich; + private int attackStep; + private int attackTime; + private int lastSeen; + + public PigLichAttackGoal(PiglichEntity p_32247_) { + this.piglich = p_32247_; + this.setFlags( + EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Flag.TARGET)); + } + + public boolean canUse() { + LivingEntity livingEntity = this.piglich.getTarget(); + return (livingEntity != null && + livingEntity.isAlive() && + this.piglich.canAttack(livingEntity)); + } + + public void start() { + this.attackStep = 0; + } + + public void stop() { + this.lastSeen = 0; + } + + public boolean requiresUpdateEveryTick() { + return true; + } + + @SuppressWarnings("unused") + public void tick() { + --this.attackTime; + LivingEntity livingEntity = this.piglich.getTarget(); + if (livingEntity != null) { + boolean flag = this.piglich.getSensing().hasLineOfSight(livingEntity); + if (flag) { + this.lastSeen = 0; + } else { + ++this.lastSeen; + } + + double d0 = this.piglich.distanceToSqr(livingEntity); + if (d0 < 4.0D) { + if (!flag) { + return; + } + + if (this.attackTime <= 0) { + this.attackTime = 20; + this.piglich.doHurtTarget(livingEntity); + } + + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D); + } else if (d0 < this.getFollowDistance() * this.getFollowDistance() && + flag) { + double d1 = livingEntity.getX() - this.piglich.getX(); + double d2 = livingEntity.getY(0.5D) - this.piglich.getY(0.5D); + double d3 = livingEntity.getZ() - this.piglich.getZ(); + if (this.attackTime <= 0) { + ++this.attackStep; + if (this.attackStep == 1) { + this.attackTime = 60; + } else if (this.attackStep <= 4) { + this.attackTime = 6; + } else { + this.attackTime = 100; + this.attackStep = 0; + } + + if (this.attackStep > 1) { + double d4 = Math.sqrt(Math.sqrt(d0)) * 0.5D; + if (!this.piglich.isSilent()) { + this.piglich.level.levelEvent( + (Player) null, + 1018, + this.piglich.blockPosition(), + 0); + } + // for (int i = 0; i < 3; ++i) { + // Vec3 vec3 = this.piglich.getViewVector(1.0F); + // this.piglich.isSummoning = true; + // LargeFireball largeFireball = new LargeFireball(this.piglich.level, this.piglich, d2, + // d3, d4, + // (int) this.piglich.getHealth()); + // largeFireball.setPos(this.piglich.getX() + + // vec3.x * 4.0D, this.piglich.getY(0.5D) + 0.5D, + // largeFireball.getZ() + vec3.z + // * 4.0D); + // this.piglich.level.addFreshEntity(largeFireball); + // } + + } + } + + this.piglich.getLookControl() + .setLookAt(livingEntity, 10.0F, 10.0F); + } else if (this.lastSeen < 5) { + this.piglich.getMoveControl() + .setWantedPosition( + livingEntity.getX(), + livingEntity.getY(), + livingEntity.getZ(), + 1.0D); + } + + super.tick(); + } + } + + private double getFollowDistance() { + return this.piglich.getAttributeValue(Attributes.FOLLOW_RANGE); + } + } + + @Override + public boolean hurt(@Nonnull DamageSource source, float damage) { + if (!super.hurt(source, damage)) { + return false; + } else if (!(this.level instanceof ServerLevel)) { + return false; + } else { + LivingEntity livingEntity = this.getTarget(); + if (livingEntity == null && + source.getEntity() instanceof LivingEntity) { + livingEntity = (LivingEntity) source.getEntity(); + } + + if (!(livingEntity instanceof Player)) { + return false; + } else { + int i = Mth.floor(this.getX()); + int j = Mth.floor(this.getY()); + int k = Mth.floor(this.getZ()); + return this.spawnSupport(this, i, j, k); + } + } + } + + protected boolean spawnSupport(PiglichEntity piglich, int i, int j, int k) { + ServerLevel serverLevel = (ServerLevel) piglich.level; + LivingEntity livingEntity = piglich.getTarget(); + int mobType = Mth.nextInt(piglich.random, 1, 6); + Monster spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create( + piglich.level); + switch (mobType) { + case 1: + spawnMob = (Monster) EntityType.PIGLIN_BRUTE.create(piglich.level); + case 2: + spawnMob = (Monster) EntityType.BLAZE.create(piglich.level); + case 3: + spawnMob = (Monster) EntityType.ENDERMAN.create(piglich.level); + case 4: + spawnMob = (Monster) EntityType.EVOKER.create(piglich.level); + case 5: + spawnMob = (Monster) EntityType.VINDICATOR.create(piglich.level); + case 6: + spawnMob = (Monster) EntityType.WITCH.create(piglich.level); + default: + for (int l = 0; l < 5; ++l) { + int i1 = i + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int j1 = j + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + int k1 = k + + Mth.nextInt(piglich.random, 7, 40) * + Mth.nextInt(piglich.random, -1, 1); + BlockPos blockPos = new BlockPos(i1, j1, k1); + + if (spawnMob == null) + return false; + + EntityType entityType = spawnMob.getType(); + SpawnPlacements.Type spawnPlacements$type = SpawnPlacements.getPlacementType(entityType); + if (NaturalSpawner.isSpawnPositionOk( + spawnPlacements$type, + piglich.level, + blockPos, + entityType) && + SpawnPlacements.checkSpawnRules( + entityType, + serverLevel, + MobSpawnType.REINFORCEMENT, + blockPos, + piglich.level.random)) { + spawnMob.setPos((double) i1, (double) j1, (double) k1); + if (!piglich.level.hasNearbyAlivePlayer( + (double) i1, + (double) j1, + (double) k1, + 7.0D) && + piglich.level.isUnobstructed(spawnMob) && + piglich.level.noCollision(spawnMob) && + !piglich.level.containsAnyLiquid( + spawnMob.getBoundingBox())) { + if (livingEntity != null) { + spawnMob.setTarget(livingEntity); + } + + spawnMob.finalizeSpawn( + serverLevel, + piglich.level.getCurrentDifficultyAt( + spawnMob.blockPosition()), + MobSpawnType.REINFORCEMENT, + (SpawnGroupData) null, + (CompoundTag) null); + serverLevel.addFreshEntityWithPassengers(spawnMob); + } + } + } + this.isSummoning = true; + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java index 860e5c4a..b95ad3c2 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java @@ -9,357 +9,357 @@ public class PiglichModel extends AnimatedGeoModel { - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "piglich"), - "main"); + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main"); - public PiglichModel() { - } + public PiglichModel() { + } - @SuppressWarnings("unused") - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); + @SuppressWarnings("unused") + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); - PartDefinition head = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(84, 0) - .addBox( - -5.0F, - -14.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.5F)) - .texOffs(48, 0) - .addBox( - -5.1F, - -8.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.35F)) - .texOffs(0, 0) - .addBox( - -5.0F, - -8.0F, - -4.0F, - 10.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.0F)) - .texOffs(29, 1) - .addBox( - -2.0F, - -4.0F, - -5.0F, - 4.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.0F)) - .texOffs(2, 0) - .addBox( - -3.0F, - -2.0F, - -5.0F, - 1.0F, - 2.0F, - 1.0F, - new CubeDeformation(0.0F)) - .texOffs(2, 4) - .addBox( - 2.0F, - -2.0F, - -5.0F, - 1.0F, - 2.0F, - 1.0F, - new CubeDeformation(0.0F)), - PartPose.offset(0.0F, -4.0F, -3.0F)); + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(84, 0) + .addBox( + -5.0F, + -14.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.5F)) + .texOffs(48, 0) + .addBox( + -5.1F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.35F)) + .texOffs(0, 0) + .addBox( + -5.0F, + -8.0F, + -4.0F, + 10.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F)) + .texOffs(29, 1) + .addBox( + -2.0F, + -4.0F, + -5.0F, + 4.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 0) + .addBox( + -3.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 4) + .addBox( + 2.0F, + -2.0F, + -5.0F, + 1.0F, + 2.0F, + 1.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, -4.0F, -3.0F)); - PartDefinition rightEar_r1 = head.addOrReplaceChild( - "rightEar_r1", - CubeListBuilder - .create() - .texOffs(104, 18) - .addBox( - -1.0F, - 0.0F, - -2.0F, - 1.0F, - 5.0F, - 4.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F)); + PartDefinition rightEar_r1 = head.addOrReplaceChild( + "rightEar_r1", + CubeListBuilder + .create() + .texOffs(104, 18) + .addBox( + -1.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-5.0F, -6.0F, 0.0F, 0.0F, 0.0F, 0.1745F)); - PartDefinition leftEar_r1 = head.addOrReplaceChild( - "leftEar_r1", - CubeListBuilder - .create() - .texOffs(115, 18) - .addBox( - 0.0F, - 0.0F, - -2.0F, - 1.0F, - 5.0F, - 4.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F)); + PartDefinition leftEar_r1 = head.addOrReplaceChild( + "leftEar_r1", + CubeListBuilder + .create() + .texOffs(115, 18) + .addBox( + 0.0F, + 0.0F, + -2.0F, + 1.0F, + 5.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(5.0F, -6.0F, 0.0F, 0.0F, 0.0F, -0.1745F)); - PartDefinition leftHornTop_r1 = head.addOrReplaceChild( - "leftHornTop_r1", - CubeListBuilder - .create() - .texOffs(88, 0) - .addBox( - 0.0F, - -4.0F, - 0.0F, - 1.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.3F)), - PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F)); + PartDefinition leftHornTop_r1 = head.addOrReplaceChild( + "leftHornTop_r1", + CubeListBuilder + .create() + .texOffs(88, 0) + .addBox( + 0.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F)), + PartPose.offsetAndRotation(6.0F, -9.0F, 1.0F, 0.0F, 0.0F, -0.3491F)); - PartDefinition leftHorn_r1 = head.addOrReplaceChild( - "leftHorn_r1", - CubeListBuilder - .create() - .texOffs(76, 0) - .addBox( - -1.0F, - -4.0F, - -1.0F, - 3.0F, - 5.0F, - 3.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F)); + PartDefinition leftHorn_r1 = head.addOrReplaceChild( + "leftHorn_r1", + CubeListBuilder + .create() + .texOffs(76, 0) + .addBox( + -1.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(4.0F, -7.0F, 1.0F, 0.0F, 0.0F, 0.7854F)); - PartDefinition rightHorn_r1 = head.addOrReplaceChild( - "rightHorn_r1", - CubeListBuilder - .create() - .texOffs(44, 0) - .addBox( - -2.0F, - -4.0F, - -1.0F, - 3.0F, - 5.0F, - 3.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F)); + PartDefinition rightHorn_r1 = head.addOrReplaceChild( + "rightHorn_r1", + CubeListBuilder + .create() + .texOffs(44, 0) + .addBox( + -2.0F, + -4.0F, + -1.0F, + 3.0F, + 5.0F, + 3.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-4.0F, -7.0F, 1.0F, 0.0F, 0.0F, -0.7854F)); - PartDefinition rightHornTop_r1 = head.addOrReplaceChild( - "rightHornTop_r1", - CubeListBuilder - .create() - .texOffs(40, 0) - .addBox( - -1.0F, - -4.0F, - 0.0F, - 1.0F, - 4.0F, - 1.0F, - new CubeDeformation(0.3F)), - PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F)); + PartDefinition rightHornTop_r1 = head.addOrReplaceChild( + "rightHornTop_r1", + CubeListBuilder + .create() + .texOffs(40, 0) + .addBox( + -1.0F, + -4.0F, + 0.0F, + 1.0F, + 4.0F, + 1.0F, + new CubeDeformation(0.3F)), + PartPose.offsetAndRotation(-6.0F, -9.0F, 1.0F, 0.0F, 0.0F, 0.3491F)); - PartDefinition body = partDefinition.addOrReplaceChild( - "body", - CubeListBuilder - .create() - .texOffs(81, 38) - .addBox( - -5.0F, - -7.0F, - -3.0F, - 10.0F, - 10.0F, - 6.0F, - new CubeDeformation(0.2F)) - .texOffs(33, 35) - .addBox( - -3.0F, - -7.0F, - -2.0F, - 6.0F, - 7.0F, - 5.0F, - new CubeDeformation(0.0F)), - PartPose.offset(0.0F, 10.0F, 2.0F)); + PartDefinition body = partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(81, 38) + .addBox( + -5.0F, + -7.0F, + -3.0F, + 10.0F, + 10.0F, + 6.0F, + new CubeDeformation(0.2F)) + .texOffs(33, 35) + .addBox( + -3.0F, + -7.0F, + -2.0F, + 6.0F, + 7.0F, + 5.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, 10.0F, 2.0F)); - PartDefinition bodyTop = body.addOrReplaceChild( - "bodyTop", - CubeListBuilder - .create() - .texOffs(48, 46) - .addBox( - -6.0F, - -10.0F, - -4.0F, - 12.0F, - 10.0F, - 8.0F, - new CubeDeformation(0.5F)) - .texOffs(0, 40) - .addBox( - -6.0F, - -10.0F, - -4.0F, - 12.0F, - 10.0F, - 8.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); + PartDefinition bodyTop = body.addOrReplaceChild( + "bodyTop", + CubeListBuilder + .create() + .texOffs(48, 46) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.5F)) + .texOffs(0, 40) + .addBox( + -6.0F, + -10.0F, + -4.0F, + 12.0F, + 10.0F, + 8.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(0.0F, -5.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); - PartDefinition leftArm = bodyTop.addOrReplaceChild( - "leftArm", - CubeListBuilder - .create() - .texOffs(84, 16) - .addBox( - -2.0F, - -2.0F, - -3.0F, - 4.0F, - 15.0F, - 6.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); + PartDefinition leftArm = bodyTop.addOrReplaceChild( + "leftArm", + CubeListBuilder + .create() + .texOffs(84, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); - PartDefinition rightArm = bodyTop.addOrReplaceChild( - "rightArm", - CubeListBuilder - .create() - .texOffs(64, 16) - .addBox( - -2.0F, - -2.0F, - -3.0F, - 4.0F, - 15.0F, - 6.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); + PartDefinition rightArm = bodyTop.addOrReplaceChild( + "rightArm", + CubeListBuilder + .create() + .texOffs(64, 16) + .addBox( + -2.0F, + -2.0F, + -3.0F, + 4.0F, + 15.0F, + 6.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(8.0F, -8.0F, 0.0F, -0.4363F, 0.0F, 0.0F)); - PartDefinition leftLeg = partDefinition.addOrReplaceChild( - "leftLeg", - CubeListBuilder - .create() - .texOffs(48, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.5F)) - .texOffs(32, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation( - -2.0F, - 12.0F, - 1.0F, - -0.6109F, - 0.6109F, - 0.0F)); + PartDefinition leftLeg = partDefinition.addOrReplaceChild( + "leftLeg", + CubeListBuilder + .create() + .texOffs(48, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F)) + .texOffs(32, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation( + -2.0F, + 12.0F, + 1.0F, + -0.6109F, + 0.6109F, + 0.0F)); - PartDefinition leftLegDown = leftLeg.addOrReplaceChild( - "leftLegDown", - CubeListBuilder - .create() - .texOffs(16, 28) - .addBox( - -2.0F, - 0.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(-0.1F)), - PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); + PartDefinition leftLegDown = leftLeg.addOrReplaceChild( + "leftLegDown", + CubeListBuilder + .create() + .texOffs(16, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F)), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); - PartDefinition rightLeg = partDefinition.addOrReplaceChild( - "rightLeg", - CubeListBuilder - .create() - .texOffs(16, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.5F)) - .texOffs(0, 16) - .addBox( - -2.0F, - -2.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation( - 2.0F, - 12.0F, - 1.0F, - -0.6109F, - -0.6109F, - 0.0F)); + PartDefinition rightLeg = partDefinition.addOrReplaceChild( + "rightLeg", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.5F)) + .texOffs(0, 16) + .addBox( + -2.0F, + -2.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation( + 2.0F, + 12.0F, + 1.0F, + -0.6109F, + -0.6109F, + 0.0F)); - PartDefinition rightLegDown = rightLeg.addOrReplaceChild( - "rightLegDown", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox( - -2.0F, - 0.0F, - -2.0F, - 4.0F, - 8.0F, - 4.0F, - new CubeDeformation(-0.1F)), - PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); + PartDefinition rightLegDown = rightLeg.addOrReplaceChild( + "rightLegDown", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox( + -2.0F, + 0.0F, + -2.0F, + 4.0F, + 8.0F, + 4.0F, + new CubeDeformation(-0.1F)), + PartPose.offsetAndRotation(0.0F, 5.0F, 0.0F, 0.6109F, 0.0F, 0.0F)); - return LayerDefinition.create(meshDefinition, 128, 64); - } + return LayerDefinition.create(meshDefinition, 128, 64); + } - @Override - public ResourceLocation getModelResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "geo/piglich_anim.geo.json"); - } + @Override + public ResourceLocation getModelResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "geo/piglich_anim.geo.json"); + } - @Override - public ResourceLocation getTextureResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/piglich.png"); - } + @Override + public ResourceLocation getTextureResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png"); + } - @Override - public ResourceLocation getAnimationResource(PiglichEntity piglichEntity) { - return new ResourceLocation( - Reference.MOD_ID, - "animations/piglich.animation.json"); - } + @Override + public ResourceLocation getAnimationResource(PiglichEntity piglichEntity) { + return new ResourceLocation( + Reference.MOD_ID, + "animations/piglich.animation.json"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java index d8c80758..f38f914d 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModelOld.java @@ -19,190 +19,190 @@ @SuppressWarnings("unused") // TODO: Determine if we will keep this model around public class PiglichModelOld extends PlayerModel { - private final ModelPart rightEar = this.head.getChild("right_ear"); - private final ModelPart leftEar = this.head.getChild("left_ear"); - private final PartPose bodyDefault = this.body.storePose(); - private final PartPose headDefault = this.head.storePose(); - private final PartPose leftArmDefault = this.leftArm.storePose(); - private final PartPose rightArmDefault = this.rightArm.storePose(); - - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "piglich"), - "main"); - - public PiglichModelOld(ModelPart p_170821_, boolean p_170822_) { - super(p_170821_, p_170822_); - } - - public static MeshDefinition createMesh() { - CubeDeformation cubeDeformation = CubeDeformation.NONE; - MeshDefinition meshDefinition = PlayerModel.createMesh( - cubeDeformation, - false); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "body", - CubeListBuilder - .create() - .texOffs(16, 16) - .addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), - PartPose.ZERO); - PartDefinition partDefinition1 = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation) - .texOffs(31, 1) - .addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation) - .texOffs(2, 4) - .addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation) - .texOffs(2, 0) - .addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), - PartPose.ZERO); - partDefinition1.addOrReplaceChild( - "left_ear", - CubeListBuilder - .create() - .texOffs(51, 6) - .addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), - PartPose.offsetAndRotation( - 4.5F, - -6.0F, - 0.0F, - 0.0F, - 0.0F, - (-(float) Math.PI / 6F))); - partDefinition1.addOrReplaceChild( - "right_ear", - CubeListBuilder - .create() - .texOffs(39, 6) - .addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), - PartPose.offsetAndRotation( - -4.5F, - -6.0F, - 0.0F, - 0.0F, - 0.0F, - ((float) Math.PI / 6F))); - - partDefinition1.addOrReplaceChild( - "hat", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition1.addOrReplaceChild( - "right_arm", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition1.addOrReplaceChild( - "left_arm", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition1.addOrReplaceChild( - "right_leg", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition1.addOrReplaceChild( - "left_leg", - CubeListBuilder.create(), - PartPose.ZERO); - - return meshDefinition; - } - - @Override - protected Iterable bodyParts() { - return super.bodyParts(); - } - - @Override - public void renderEars( - @Nonnull PoseStack stack, - @Nonnull VertexConsumer consumer, - int p_103404_, - int p_103405_) { - super.renderEars(stack, consumer, p_103404_, p_103405_); - } - - @Override - public void renderCloak( - @Nonnull PoseStack p_103412_, - @Nonnull VertexConsumer p_103413_, - int p_103414_, - int p_103415_) { - super.renderCloak(p_103412_, p_103413_, p_103414_, p_103415_); - } - - @Override - public void setAllVisible(boolean p_103419_) { - super.setAllVisible(p_103419_); - } - - @Override - public ModelPart getRandomModelPart(@Nonnull RandomSource p_103407_) { - return super.getRandomModelPart(p_103407_); - } - - public void setupAnim( - @Nonnull T p_103366_, - float p_103367_, - float p_103368_, - float p_103369_, - float p_103370_, - float p_103371_) { - super.setupAnim( - p_103366_, - p_103367_, - p_103368_, - p_103369_, - p_103370_, - p_103371_); - } - - protected void setupAttackAnimation(@Nonnull T p_103363_, float p_103364_) { - super.setupAttackAnimation(p_103363_, p_103364_); - } - - @Override - public void prepareMobModel( - @Nonnull T p_102861_, - float p_102862_, - float p_102863_, - float p_102864_) { - super.prepareMobModel(p_102861_, p_102862_, p_102863_, p_102864_); - setPartVisibility(); - } - - @Override - public void renderToBuffer( - @Nonnull PoseStack poseStack, - @Nonnull VertexConsumer buffer, - int packedLight, - int packedOverlay, - float red, - float green, - float blue, - float alpha) { - setPartVisibility(); - super.renderToBuffer( - poseStack, - buffer, - packedLight, - packedOverlay, - red, - green, - blue, - alpha); - } - - private void setPartVisibility() { - head.visible = true; - hat.visible = true; - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; - } + private final ModelPart rightEar = this.head.getChild("right_ear"); + private final ModelPart leftEar = this.head.getChild("left_ear"); + private final PartPose bodyDefault = this.body.storePose(); + private final PartPose headDefault = this.head.storePose(); + private final PartPose leftArmDefault = this.leftArm.storePose(); + private final PartPose rightArmDefault = this.rightArm.storePose(); + + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "piglich"), + "main"); + + public PiglichModelOld(ModelPart p_170821_, boolean p_170822_) { + super(p_170821_, p_170822_); + } + + public static MeshDefinition createMesh() { + CubeDeformation cubeDeformation = CubeDeformation.NONE; + MeshDefinition meshDefinition = PlayerModel.createMesh( + cubeDeformation, + false); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder + .create() + .texOffs(16, 16) + .addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, cubeDeformation), + PartPose.ZERO); + PartDefinition partDefinition1 = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-5.0F, -8.0F, -4.0F, 10.0F, 8.0F, 8.0F, cubeDeformation) + .texOffs(31, 1) + .addBox(-2.0F, -4.0F, -5.0F, 4.0F, 4.0F, 1.0F, cubeDeformation) + .texOffs(2, 4) + .addBox(2.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation) + .texOffs(2, 0) + .addBox(-3.0F, -2.0F, -5.0F, 1.0F, 2.0F, 1.0F, cubeDeformation), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_ear", + CubeListBuilder + .create() + .texOffs(51, 6) + .addBox(0.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + 4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + (-(float) Math.PI / 6F))); + partDefinition1.addOrReplaceChild( + "right_ear", + CubeListBuilder + .create() + .texOffs(39, 6) + .addBox(-1.0F, 0.0F, -2.0F, 1.0F, 5.0F, 4.0F, cubeDeformation), + PartPose.offsetAndRotation( + -4.5F, + -6.0F, + 0.0F, + 0.0F, + 0.0F, + ((float) Math.PI / 6F))); + + partDefinition1.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition1.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO); + + return meshDefinition; + } + + @Override + protected Iterable bodyParts() { + return super.bodyParts(); + } + + @Override + public void renderEars( + @Nonnull PoseStack stack, + @Nonnull VertexConsumer consumer, + int p_103404_, + int p_103405_) { + super.renderEars(stack, consumer, p_103404_, p_103405_); + } + + @Override + public void renderCloak( + @Nonnull PoseStack p_103412_, + @Nonnull VertexConsumer p_103413_, + int p_103414_, + int p_103415_) { + super.renderCloak(p_103412_, p_103413_, p_103414_, p_103415_); + } + + @Override + public void setAllVisible(boolean p_103419_) { + super.setAllVisible(p_103419_); + } + + @Override + public ModelPart getRandomModelPart(@Nonnull RandomSource p_103407_) { + return super.getRandomModelPart(p_103407_); + } + + public void setupAnim( + @Nonnull T p_103366_, + float p_103367_, + float p_103368_, + float p_103369_, + float p_103370_, + float p_103371_) { + super.setupAnim( + p_103366_, + p_103367_, + p_103368_, + p_103369_, + p_103370_, + p_103371_); + } + + protected void setupAttackAnimation(@Nonnull T p_103363_, float p_103364_) { + super.setupAttackAnimation(p_103363_, p_103364_); + } + + @Override + public void prepareMobModel( + @Nonnull T p_102861_, + float p_102862_, + float p_102863_, + float p_102864_) { + super.prepareMobModel(p_102861_, p_102862_, p_102863_, p_102864_); + setPartVisibility(); + } + + @Override + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha) { + setPartVisibility(); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha); + } + + private void setPartVisibility() { + head.visible = true; + hat.visible = true; + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java index f4304208..5969ed1f 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java @@ -15,35 +15,35 @@ @OnlyIn(Dist.CLIENT) public class PiglichRenderer extends GeoEntityRenderer { - public PiglichRenderer(EntityRendererProvider.Context context) { - super(context, new PiglichModel()); - this.shadowRadius = 0.3f; - } + public PiglichRenderer(EntityRendererProvider.Context context) { + super(context, new PiglichModel()); + this.shadowRadius = 0.3f; + } - @Override - public ResourceLocation getTextureLocation(PiglichEntity instance) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/piglich.png"); - } + @Override + public ResourceLocation getTextureLocation(PiglichEntity instance) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/piglich.png"); + } - @Override - public RenderType getRenderType( - PiglichEntity animatable, - float partialTicks, - PoseStack stack, - @Nullable MultiBufferSource renderTypeBuffer, - @Nullable VertexConsumer vertexBuilder, - int packedLightIn, - ResourceLocation textureLocation) { - stack.scale(1.1f, 1.1f, 1.1f); - return super.getRenderType( - animatable, - partialTicks, - stack, - renderTypeBuffer, - vertexBuilder, - packedLightIn, - textureLocation); - } + @Override + public RenderType getRenderType( + PiglichEntity animatable, + float partialTicks, + PoseStack stack, + @Nullable MultiBufferSource renderTypeBuffer, + @Nullable VertexConsumer vertexBuilder, + int packedLightIn, + ResourceLocation textureLocation) { + stack.scale(1.1f, 1.1f, 1.1f); + return super.getRenderType( + animatable, + partialTicks, + stack, + renderTypeBuffer, + vertexBuilder, + packedLightIn, + textureLocation); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java index f2b399af..0c7e44c4 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerEntity.java @@ -9,19 +9,19 @@ public class ATMShulkerEntity extends Shulker { - public ATMShulkerEntity( - EntityType p_33404_, - Level p_33405_) { - super(p_33404_, p_33405_); - } + public ATMShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java index 7017a104..4d93b282 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerModel.java @@ -18,85 +18,85 @@ public class ATMShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"), - "main"); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_shulker"), + "main"); - public ATMShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public ATMShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java index 8dfbe823..28360993 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/atm/ATMShulkerRenderer.java @@ -9,39 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class ATMShulkerRenderer - extends MobRenderer> { + extends MobRenderer> { - public ATMShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new ATMShulkerModel<>( - context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), - true), - 0.5F); - } + public ATMShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new ATMShulkerModel<>( + context.bakeLayer(ATMShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull ATMShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_); - } + @Override + public void render( + @Nonnull ATMShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull ATMShulkerEntity p_114482_) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/allthemodium_shulker.png"); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull ATMShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/allthemodium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java index b73b9c59..76332982 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerEntity.java @@ -9,19 +9,19 @@ public class UNOBShulkerEntity extends Shulker { - public UNOBShulkerEntity( - EntityType p_33404_, - Level p_33405_) { - super(p_33404_, p_33405_); - } + public UNOBShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java index c1768503..b3f389a6 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerModel.java @@ -18,85 +18,85 @@ public class UNOBShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"), - "main"); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "unobtainium_shulker"), + "main"); - public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public UNOBShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java index c6866ffd..331396f9 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/unob/UNOBShulkerRenderer.java @@ -9,39 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class UNOBShulkerRenderer - extends MobRenderer> { + extends MobRenderer> { - public UNOBShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new UNOBShulkerModel<>( - context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), - true), - 0.5F); - } + public UNOBShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new UNOBShulkerModel<>( + context.bakeLayer(UNOBShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull UNOBShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_); - } + @Override + public void render( + @Nonnull UNOBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull UNOBShulkerEntity p_114482_) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/unobtainium_shulker.png"); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull UNOBShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/unobtainium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java index 97dd683f..9389a035 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerEntity.java @@ -9,19 +9,19 @@ public class VIBShulkerEntity extends Shulker { - public VIBShulkerEntity( - EntityType p_33404_, - Level p_33405_) { - super(p_33404_, p_33405_); - } + public VIBShulkerEntity( + EntityType p_33404_, + Level p_33405_) { + super(p_33404_, p_33405_); + } - public static AttributeSupplier.Builder createAttributes() { - return Monster - .createMonsterAttributes() - .add(Attributes.MOVEMENT_SPEED, 0.21F) - .add(Attributes.ATTACK_DAMAGE, 4) - .add(Attributes.ARMOR, 18) - .add(Attributes.ARMOR_TOUGHNESS, 12) - .add(Attributes.MAX_HEALTH, 45); - } + public static AttributeSupplier.Builder createAttributes() { + return Monster + .createMonsterAttributes() + .add(Attributes.MOVEMENT_SPEED, 0.21F) + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.ARMOR, 18) + .add(Attributes.ARMOR_TOUGHNESS, 12) + .add(Attributes.MAX_HEALTH, 45); + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java index 7f36ad29..0e9ba2ce 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerModel.java @@ -18,85 +18,85 @@ public class VIBShulkerModel extends ListModel { - // private static final String LID = "lid"; - // private static final String BASE = "base"; - private final ModelPart base; - private final ModelPart lid; - private final ModelPart head; - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"), - "main"); + // private static final String LID = "lid"; + // private static final String BASE = "base"; + private final ModelPart base; + private final ModelPart lid; + private final ModelPart head; + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "vibranium_shulker"), + "main"); - public VIBShulkerModel(ModelPart p_170922_, boolean bool) { - super(RenderType::entityCutoutNoCullZOffset); - this.lid = p_170922_.getChild("lid"); - this.base = p_170922_.getChild("base"); - this.head = p_170922_.getChild("head"); - } + public VIBShulkerModel(ModelPart p_170922_, boolean bool) { + super(RenderType::entityCutoutNoCullZOffset); + this.lid = p_170922_.getChild("lid"); + this.base = p_170922_.getChild("base"); + this.head = p_170922_.getChild("head"); + } - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); - partDefinition.addOrReplaceChild( - "lid", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "base", - CubeListBuilder - .create() - .texOffs(0, 28) - .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), - PartPose.offset(0.0F, 24.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 52) - .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.offset(0.0F, 12.0F, 0.0F)); - return LayerDefinition.create(meshDefinition, 64, 64); - } + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild( + "lid", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox(-8.0F, -16.0F, -8.0F, 16.0F, 12.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "base", + CubeListBuilder + .create() + .texOffs(0, 28) + .addBox(-8.0F, -8.0F, -8.0F, 16.0F, 8.0F, 16.0F), + PartPose.offset(0.0F, 24.0F, 0.0F)); + partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 52) + .addBox(-3.0F, 0.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.offset(0.0F, 12.0F, 0.0F)); + return LayerDefinition.create(meshDefinition, 64, 64); + } - public void setupAnim( - @Nonnull T p_103735_, - float p_103736_, - float p_103737_, - float p_103738_, - float p_103739_, - float p_103740_) { - float f = p_103738_ - (float) p_103735_.tickCount; - float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; - float f2 = -1.0F + Mth.sin(f1); - float f3 = 0.0F; - if (f1 > (float) Math.PI) { - f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; - } + public void setupAnim( + @Nonnull T p_103735_, + float p_103736_, + float p_103737_, + float p_103738_, + float p_103739_, + float p_103740_) { + float f = p_103738_ - (float) p_103735_.tickCount; + float f1 = (0.5F + p_103735_.getClientPeekAmount(f)) * (float) Math.PI; + float f2 = -1.0F + Mth.sin(f1); + float f3 = 0.0F; + if (f1 > (float) Math.PI) { + f3 = Mth.sin(p_103738_ * 0.1F) * 0.7F; + } - this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); - if (p_103735_.getClientPeekAmount(f) > 0.3F) { - this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; - } else { - this.lid.yRot = 0.0F; - } + this.lid.setPos(0.0F, 16.0F + Mth.sin(f1) * 8.0F + f3, 0.0F); + if (p_103735_.getClientPeekAmount(f) > 0.3F) { + this.lid.yRot = f2 * f2 * f2 * f2 * (float) Math.PI * 0.125F; + } else { + this.lid.yRot = 0.0F; + } - this.head.xRot = p_103740_ * ((float) Math.PI / 180F); - this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * - ((float) Math.PI / 180F); - } + this.head.xRot = p_103740_ * ((float) Math.PI / 180F); + this.head.yRot = (p_103735_.yHeadRot - 180.0F - p_103735_.yBodyRot) * + ((float) Math.PI / 180F); + } - public Iterable parts() { - return ImmutableList.of(this.base, this.lid); - } + public Iterable parts() { + return ImmutableList.of(this.base, this.lid); + } - public ModelPart getLid() { - return this.lid; - } + public ModelPart getLid() { + return this.lid; + } - public ModelPart getHead() { - return this.head; - } + public ModelPart getHead() { + return this.head; + } } diff --git a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java index b0d880d0..2fb65f9b 100644 --- a/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java +++ b/src/main/java/com/thevortex/allthemodium/entity/shulkers/vib/VIBShulkerRenderer.java @@ -9,39 +9,39 @@ import net.minecraft.resources.ResourceLocation; public class VIBShulkerRenderer - extends MobRenderer> { + extends MobRenderer> { - public VIBShulkerRenderer(EntityRendererProvider.Context context) { - super( - context, - new VIBShulkerModel<>( - context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), - true), - 0.5F); - } + public VIBShulkerRenderer(EntityRendererProvider.Context context) { + super( + context, + new VIBShulkerModel<>( + context.bakeLayer(VIBShulkerModel.LAYER_LOCATION), + true), + 0.5F); + } - @Override - public void render( - @Nonnull VIBShulkerEntity p_114485_, - float p_114486_, - float p_114487_, - @Nonnull PoseStack p_114488_, - @Nonnull MultiBufferSource p_114489_, - int p_114490_) { - super.render( - p_114485_, - p_114486_, - p_114487_, - p_114488_, - p_114489_, - p_114490_); - } + @Override + public void render( + @Nonnull VIBShulkerEntity p_114485_, + float p_114486_, + float p_114487_, + @Nonnull PoseStack p_114488_, + @Nonnull MultiBufferSource p_114489_, + int p_114490_) { + super.render( + p_114485_, + p_114486_, + p_114487_, + p_114488_, + p_114489_, + p_114490_); + } - @Override - public ResourceLocation getTextureLocation( - @Nonnull VIBShulkerEntity p_114482_) { - return new ResourceLocation( - Reference.MOD_ID, - "textures/entity/vibranium_shulker.png"); - } + @Override + public ResourceLocation getTextureLocation( + @Nonnull VIBShulkerEntity p_114482_) { + return new ResourceLocation( + Reference.MOD_ID, + "textures/entity/vibranium_shulker.png"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java index 00512c63..ac823ef8 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java @@ -14,55 +14,55 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class ArmorEvents { - @SubscribeEvent - public static void onPlayerFall(LivingFallEvent event) { - Iterable armorList = event.getEntity().getArmorSlots(); - Iterator iterator = armorList.iterator(); - while (iterator.hasNext()) { - ItemStack armor = iterator.next(); - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { - event.setCanceled(true); - } - } - } + @SubscribeEvent + public static void onPlayerFall(LivingFallEvent event) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_BOOTS.get())) { + event.setCanceled(true); + } + } + } - @SubscribeEvent - public static void onEntityHurt(LivingAttackEvent event) { - LivingEntity entity = event.getEntity(); + @SubscribeEvent + public static void onEntityHurt(LivingAttackEvent event) { + LivingEntity entity = event.getEntity(); - if (entity instanceof PiglichEntity) { - } + if (entity instanceof PiglichEntity) { + } - if (!entity.getCommandSenderWorld().isClientSide()) { - Iterable armorList = event.getEntity().getArmorSlots(); - Iterator iterator = armorList.iterator(); - while (iterator.hasNext()) { - ItemStack armor = iterator.next(); - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())) { - if ((event.getSource() == DamageSource.HOT_FLOOR) || - (event.getSource() == DamageSource.IN_FIRE) || - (event.getSource() == DamageSource.LAVA) || - (event.getSource() == DamageSource.ON_FIRE)) { - event.getEntity().clearFire(); - event.setCanceled(true); - } - } - if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get())) { - if (event.getSource() == DamageSource.FLY_INTO_WALL) { - event.setCanceled(true); - } - if (event.getSource() == DamageSource.DROWN) { - event - .getEntity() - .setAirSupply(event.getEntity().getMaxAirSupply()); - event.setCanceled(true); - } - } - } - } - } + if (!entity.getCommandSenderWorld().isClientSide()) { + Iterable armorList = event.getEntity().getArmorSlots(); + Iterator iterator = armorList.iterator(); + while (iterator.hasNext()) { + ItemStack armor = iterator.next(); + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_CHESTPLATE.get())) { + if ((event.getSource() == DamageSource.HOT_FLOOR) || + (event.getSource() == DamageSource.IN_FIRE) || + (event.getSource() == DamageSource.LAVA) || + (event.getSource() == DamageSource.ON_FIRE)) { + event.getEntity().clearFire(); + event.setCanceled(true); + } + } + if ((armor.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get())) { + if (event.getSource() == DamageSource.FLY_INTO_WALL) { + event.setCanceled(true); + } + if (event.getSource() == DamageSource.DROWN) { + event + .getEntity() + .setAirSupply(event.getEntity().getMaxAirSupply()); + event.setCanceled(true); + } + } + } + } + } - @SubscribeEvent - public static void onEntityCollide(ProjectileImpactEvent event) { - } + @SubscribeEvent + public static void onEntityCollide(ProjectileImpactEvent event) { + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java index 90fa6514..5c673e15 100644 --- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java +++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java @@ -10,48 +10,48 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class BlockBreak { - @SubscribeEvent - public static void on(BlockEvent.BreakEvent event) { - if (event.getPlayer().isCreative()) { - return; - } + @SubscribeEvent + public static void on(BlockEvent.BreakEvent event) { + if (event.getPlayer().isCreative()) { + return; + } - boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || - (event.getPlayer() == null); - boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); + boolean fakePlayer = (event.getPlayer() instanceof FakePlayer) || + (event.getPlayer() == null); + boolean emptyHand = event.getPlayer().getMainHandItem().isEmpty(); - if ((event.getState().is(TagRegistry.OTHER_PROTECTION)) && - fakePlayer && - event - .getLevel() - .getBiome(event.getPos()) - .is(TagRegistry.OTHER_BIOMES) - && - AllthemodiumServerConfigs.OTHER_PROTECTION.get()) { - event.setCanceled(true); - return; - } - if ((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { - event.setCanceled(true); - return; - } + if ((event.getState().is(TagRegistry.OTHER_PROTECTION)) && + fakePlayer && + event + .getLevel() + .getBiome(event.getPos()) + .is(TagRegistry.OTHER_BIOMES) + && + AllthemodiumServerConfigs.OTHER_PROTECTION.get()) { + event.setCanceled(true); + return; + } + if ((event.getState().is(TagRegistry.ALLTHEMODIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } - if ((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) { - event.setCanceled(true); - return; - } - if ((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && - (fakePlayer || emptyHand) && - !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) { - event.setCanceled(true); - return; - } - if (event.getPlayer() instanceof FakePlayer) { - return; - } - } + if ((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } + if ((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && + (fakePlayer || emptyHand) && + !AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) { + event.setCanceled(true); + return; + } + if (event.getPlayer() instanceof FakePlayer) { + return; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java index 65508889..5d62e8b8 100644 --- a/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java +++ b/src/main/java/com/thevortex/allthemodium/events/ClientEvents.java @@ -17,102 +17,102 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) public class ClientEvents { - @SubscribeEvent - public static void registerRenderers( - EntityRenderersEvent.RegisterRenderers event) { - event.registerEntityRenderer( - ModRegistry.PIGLICH.get(), - PiglichRenderer::new); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), - // UNOBShulkerRenderer::new); - // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), - // UNOBShulkerRenderer::new); - } + @SubscribeEvent + public static void registerRenderers( + EntityRenderersEvent.RegisterRenderers event) { + event.registerEntityRenderer( + ModRegistry.PIGLICH.get(), + PiglichRenderer::new); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); + // event.registerEntityRenderer(ModRegistry.ATM_SHULKER.get(), + // UNOBShulkerRenderer::new); + } - @SuppressWarnings("removal") // TODO: Alternative required for 1.20+ - @SubscribeEvent - public static void registerTree(FMLClientSetupEvent event) { - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_HERB.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_SAPLING.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_LEAVES.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_TRAPDOOR.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_DOOR_.get(), - RenderType.cutoutMipped()); + @SuppressWarnings("removal") // TODO: Alternative required for 1.20+ + @SubscribeEvent + public static void registerTree(FMLClientSetupEvent event) { + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_DOOR_.get(), + RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_HERB.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_SAPLING.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_LEAVES.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_TRAPDOOR.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.DEMONIC_DOOR_.get(), - RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.DEMONIC_DOOR_.get(), + RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_HERB.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_SAPLING.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_LEAVES.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_LEAVES_BOTTOM.get(), - RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_TRAPDOOR.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.SOUL_DOOR_.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_CAVEVINES_.get(), - RenderType.cutoutMipped()); - ItemBlockRenderTypes.setRenderLayer( - ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), - RenderType.cutoutMipped()); - } + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_HERB.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_SAPLING.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_LEAVES_BOTTOM.get(), + RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_TRAPDOOR.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.SOUL_DOOR_.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_.get(), + RenderType.cutoutMipped()); + ItemBlockRenderTypes.setRenderLayer( + ModRegistry.ANCIENT_CAVEVINES_PLANT_.get(), + RenderType.cutoutMipped()); + } - @SubscribeEvent - public static void registerMesh(EntityRenderersEvent.AddLayers event) { - event.getEntityModels().bakeLayer(PiglichModel.LAYER_LOCATION); - event.getEntityModels().bakeLayer(ATMShulkerModel.LAYER_LOCATION); - } + @SubscribeEvent + public static void registerMesh(EntityRenderersEvent.AddLayers event) { + event.getEntityModels().bakeLayer(PiglichModel.LAYER_LOCATION); + event.getEntityModels().bakeLayer(ATMShulkerModel.LAYER_LOCATION); + } - @SubscribeEvent - public static void registerLayer( - EntityRenderersEvent.RegisterLayerDefinitions event) { - event.registerLayerDefinition( - PiglichModel.LAYER_LOCATION, - () -> PiglichModel.createBodyLayer()); - event.registerLayerDefinition( - ATMShulkerModel.LAYER_LOCATION, - () -> ATMShulkerModel.createBodyLayer()); - event.registerLayerDefinition( - AllthemodiumHelmetModel.LAYER_LOCATION, - AllthemodiumHelmetModel::createBodyLayer); - } + @SubscribeEvent + public static void registerLayer( + EntityRenderersEvent.RegisterLayerDefinitions event) { + event.registerLayerDefinition( + PiglichModel.LAYER_LOCATION, + () -> PiglichModel.createBodyLayer()); + event.registerLayerDefinition( + ATMShulkerModel.LAYER_LOCATION, + () -> ATMShulkerModel.createBodyLayer()); + event.registerLayerDefinition( + AllthemodiumHelmetModel.LAYER_LOCATION, + AllthemodiumHelmetModel::createBodyLayer); + } } diff --git a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java index 61cd7287..b8725ab6 100644 --- a/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java +++ b/src/main/java/com/thevortex/allthemodium/events/PlayerHarvest.java @@ -16,22 +16,22 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) public class PlayerHarvest { - // TODO: Determine if this class should be kept - // @SubscribeEvent - // public static void on(PlayerEvent.HarvestCheck event) { - // Player player = event.getPlayer(); - // BlockState blockstate = event.getTargetBlock(); - // ItemStack heldItem = player.getMainHandItem(); - // if (blockstate.getBlock() instanceof Allthemodium_Ore) { - // boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, - // player); - // event.setCanHarvest(b); - // } - // if (blockstate.getBlock() instanceof Vibranium_Ore) { - // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - // } - // if (blockstate.getBlock() instanceof Unobtainium_Ore) { - // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); - // } - // } + // TODO: Determine if this class should be kept + // @SubscribeEvent + // public static void on(PlayerEvent.HarvestCheck event) { + // Player player = event.getPlayer(); + // BlockState blockstate = event.getTargetBlock(); + // ItemStack heldItem = player.getMainHandItem(); + // if (blockstate.getBlock() instanceof Allthemodium_Ore) { + // boolean b = net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, + // player); + // event.setCanHarvest(b); + // } + // if (blockstate.getBlock() instanceof Vibranium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // if (blockstate.getBlock() instanceof Unobtainium_Ore) { + // event.setCanHarvest(net.minecraftforge.common.ForgeHooks.isCorrectToolForDrops(blockstate, player)); + // } + // } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java index 2f0a572e..481cfe6e 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidATM.java @@ -30,166 +30,166 @@ public class FluidATM extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.ALLTHEMODIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_ATM_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_HONEY; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_ATM_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_))); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return (fluidIn == FluidRegistry.ALLTHEMODIUM.get() || - fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get()); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_) { - return (p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.ATM.get()); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.ATM.get(); - } - - public static class Flowing extends FluidATM { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidATM { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_ALLTHEMODIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.ALLTHEMODIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_ATM_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_HONEY; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_ATM_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.ALLTHEMODIUM.get() || + fluidIn == FluidRegistry.FLOWING_ALLTHEMODIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.ATM.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.ATM.get(); + } + + public static class Flowing extends FluidATM { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidATM { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java index 1df6797b..8588f447 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidSoulLava.java @@ -27,166 +27,166 @@ public class FluidSoulLava extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_SOULLAVA.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.SOULLAVA.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.SOUL_LAVA_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.SOUL_FIRE_FLAME; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.SOULLAVA_BLOCK - .get() - .defaultBlockState() - .setValue( - SoulLava.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_))); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return (fluidIn == FluidRegistry.SOULLAVA.get() || - fluidIn == FluidRegistry.FLOWING_SOULLAVA.get()); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_) { - return (p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get()); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.SOULLAVA.get(); - } - - public static class Flowing extends FluidSoulLava { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidSoulLava { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_SOULLAVA.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.SOULLAVA.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.SOUL_LAVA_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.SOUL_FIRE_FLAME; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState() + .setValue( + SoulLava.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.SOULLAVA.get() || + fluidIn == FluidRegistry.FLOWING_SOULLAVA.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.SOULLAVA.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.SOULLAVA.get(); + } + + public static class Flowing extends FluidSoulLava { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidSoulLava { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java index d64dd655..03277ab7 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidUNOB.java @@ -30,166 +30,166 @@ public class FluidUNOB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_UNOBTAINIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.UNOBTAINIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_UNOB_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_))); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return (fluidIn == FluidRegistry.UNOBTAINIUM.get() || - fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get()); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_) { - return (p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get()); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.UNOB.get(); - } - - public static class Flowing extends FluidUNOB { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidUNOB { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_UNOBTAINIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.UNOBTAINIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_UNOB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.DRIPPING_OBSIDIAN_TEAR; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_UNOB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.UNOBTAINIUM.get() || + fluidIn == FluidRegistry.FLOWING_UNOBTAINIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.UNOB.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.UNOB.get(); + } + + public static class Flowing extends FluidUNOB { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidUNOB { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java index b25afdb2..3a76b94f 100644 --- a/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java +++ b/src/main/java/com/thevortex/allthemodium/fluid/FluidVIB.java @@ -30,166 +30,166 @@ public class FluidVIB extends FlowingFluid { - @Override - public Fluid getFlowing() { - return FluidRegistry.FLOWING_VIBRANIUM.get(); - } - - @Override - public Fluid getSource() { - return FluidRegistry.VIBRANIUM.get(); - } - - @Override - public Item getBucket() { - return ItemRegistry.MOLTEN_VIB_BUCKET.get(); - } - - @Override - protected void animateTick( - @Nonnull Level level, - @Nonnull BlockPos blockPos, - @Nonnull FluidState state, - @Nonnull RandomSource randomSource) { - super.animateTick(level, blockPos, state, randomSource); - if (!state.isSource() && !state.getValue(FALLING)) { - if (randomSource.nextInt(64) == 0) { - level.playLocalSound( - (double) blockPos.getX() + 0.5D, - (double) blockPos.getY() + 0.5D, - (double) blockPos.getZ() + 0.5D, - SoundEvents.WATER_AMBIENT, - SoundSource.BLOCKS, - randomSource.nextFloat() * 0.25F + 0.75F, - randomSource.nextFloat() + 0.5F, - false); - } - } else if (randomSource.nextInt(10) == 0) { - level.addParticle( - ParticleTypes.UNDERWATER, - (double) blockPos.getX() + randomSource.nextDouble(), - (double) blockPos.getY() + randomSource.nextDouble(), - (double) blockPos.getZ() + randomSource.nextDouble(), - 0.0D, - 0.0D, - 0.0D); - } - } - - @Nullable - @Override - protected ParticleOptions getDripParticle() { - return ParticleTypes.ELECTRIC_SPARK; - } - - @Override - protected boolean canConvertToSource() { - return false; - } - - @Override - protected void beforeDestroyingBlock( - @Nonnull LevelAccessor worldIn, - @Nonnull BlockPos pos, - @Nonnull BlockState state) { - BlockEntity blockEntity = state.hasBlockEntity() - ? worldIn.getBlockEntity(pos) - : null; - Block.dropResources(state, worldIn, pos, blockEntity); - } - - @Override - protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { - return 4; - } - - @Override - protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { - return BlockRegistry.MOLTEN_VIB_BLOCK - .get() - .defaultBlockState() - .setValue( - LiquidBlock.LEVEL, - Integer.valueOf(getLegacyLevel(p_76136_))); - } - - @Override - public boolean isSource(@Nonnull FluidState p_76140_) { - return false; - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 4; - } - - @Override - public boolean isSame(@Nonnull Fluid fluidIn) { - return (fluidIn == FluidRegistry.VIBRANIUM.get() || - fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get()); - } - - @Override - protected int getDropOff(@Nonnull LevelReader p_76087_) { - return 1; - } - - @Override - public int getTickDelay(@Nonnull LevelReader p_76120_) { - return 8; - } - - @Override - protected boolean canBeReplacedWith( - @Nonnull FluidState p_76127_, - @Nonnull BlockGetter p_76128_, - @Nonnull BlockPos p_76129_, - @Nonnull Fluid p_76130_, - @Nonnull Direction p_76131_) { - return (p_76131_ == Direction.DOWN && - p_76127_.getFluidType() != FluidTypeRegistry.VIB.get()); - } - - @Override - protected float getExplosionResistance() { - return 100.0F; - } - - @Override - public FluidType getFluidType() { - return FluidTypeRegistry.VIB.get(); - } - - public static class Flowing extends FluidVIB { - - @Override - protected void createFluidStateDefinition( - @Nonnull StateDefinition.Builder p_76046_) { - super.createFluidStateDefinition(p_76046_); - p_76046_.add(LEVEL); - } - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return p_164509_.getValue(LEVEL); - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return false; - } - } - - public static class Source extends FluidVIB { - - @Override - public int getAmount(@Nonnull FluidState p_164509_) { - return 8; - } - - @Override - public boolean isSource(@Nonnull FluidState state) { - return true; - } - } + @Override + public Fluid getFlowing() { + return FluidRegistry.FLOWING_VIBRANIUM.get(); + } + + @Override + public Fluid getSource() { + return FluidRegistry.VIBRANIUM.get(); + } + + @Override + public Item getBucket() { + return ItemRegistry.MOLTEN_VIB_BUCKET.get(); + } + + @Override + protected void animateTick( + @Nonnull Level level, + @Nonnull BlockPos blockPos, + @Nonnull FluidState state, + @Nonnull RandomSource randomSource) { + super.animateTick(level, blockPos, state, randomSource); + if (!state.isSource() && !state.getValue(FALLING)) { + if (randomSource.nextInt(64) == 0) { + level.playLocalSound( + (double) blockPos.getX() + 0.5D, + (double) blockPos.getY() + 0.5D, + (double) blockPos.getZ() + 0.5D, + SoundEvents.WATER_AMBIENT, + SoundSource.BLOCKS, + randomSource.nextFloat() * 0.25F + 0.75F, + randomSource.nextFloat() + 0.5F, + false); + } + } else if (randomSource.nextInt(10) == 0) { + level.addParticle( + ParticleTypes.UNDERWATER, + (double) blockPos.getX() + randomSource.nextDouble(), + (double) blockPos.getY() + randomSource.nextDouble(), + (double) blockPos.getZ() + randomSource.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } + + @Nullable + @Override + protected ParticleOptions getDripParticle() { + return ParticleTypes.ELECTRIC_SPARK; + } + + @Override + protected boolean canConvertToSource() { + return false; + } + + @Override + protected void beforeDestroyingBlock( + @Nonnull LevelAccessor worldIn, + @Nonnull BlockPos pos, + @Nonnull BlockState state) { + BlockEntity blockEntity = state.hasBlockEntity() + ? worldIn.getBlockEntity(pos) + : null; + Block.dropResources(state, worldIn, pos, blockEntity); + } + + @Override + protected int getSlopeFindDistance(@Nonnull LevelReader p_76074_) { + return 4; + } + + @Override + protected BlockState createLegacyBlock(@Nonnull FluidState p_76136_) { + return BlockRegistry.MOLTEN_VIB_BLOCK + .get() + .defaultBlockState() + .setValue( + LiquidBlock.LEVEL, + Integer.valueOf(getLegacyLevel(p_76136_))); + } + + @Override + public boolean isSource(@Nonnull FluidState p_76140_) { + return false; + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 4; + } + + @Override + public boolean isSame(@Nonnull Fluid fluidIn) { + return (fluidIn == FluidRegistry.VIBRANIUM.get() || + fluidIn == FluidRegistry.FLOWING_VIBRANIUM.get()); + } + + @Override + protected int getDropOff(@Nonnull LevelReader p_76087_) { + return 1; + } + + @Override + public int getTickDelay(@Nonnull LevelReader p_76120_) { + return 8; + } + + @Override + protected boolean canBeReplacedWith( + @Nonnull FluidState p_76127_, + @Nonnull BlockGetter p_76128_, + @Nonnull BlockPos p_76129_, + @Nonnull Fluid p_76130_, + @Nonnull Direction p_76131_) { + return (p_76131_ == Direction.DOWN && + p_76127_.getFluidType() != FluidTypeRegistry.VIB.get()); + } + + @Override + protected float getExplosionResistance() { + return 100.0F; + } + + @Override + public FluidType getFluidType() { + return FluidTypeRegistry.VIB.get(); + } + + public static class Flowing extends FluidVIB { + + @Override + protected void createFluidStateDefinition( + @Nonnull StateDefinition.Builder p_76046_) { + super.createFluidStateDefinition(p_76046_); + p_76046_.add(LEVEL); + } + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return p_164509_.getValue(LEVEL); + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return false; + } + } + + public static class Source extends FluidVIB { + + @Override + public int getAmount(@Nonnull FluidState p_164509_) { + return 8; + } + + @Override + public boolean isSource(@Nonnull FluidState state) { + return true; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java index 88cf85d8..f6b418cc 100644 --- a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java +++ b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java @@ -4,29 +4,29 @@ public class ModFoods { - public static final FoodProperties ALLTHEMODIUM_APPLE; - public static final FoodProperties ALLTHEMODIUM_CARROT; + public static final FoodProperties ALLTHEMODIUM_APPLE; + public static final FoodProperties ALLTHEMODIUM_CARROT; - public static final FoodProperties SOUL_BERRIES; + public static final FoodProperties SOUL_BERRIES; - static { - ALLTHEMODIUM_APPLE = new FoodProperties.Builder() - .nutrition(20) - .saturationMod(2.0F) - .alwaysEat() - .fast() - .build(); - ALLTHEMODIUM_CARROT = new FoodProperties.Builder() - .nutrition(40) - .saturationMod(4.0F) - .alwaysEat() - .fast() - .build(); - SOUL_BERRIES = new FoodProperties.Builder() - .nutrition(5) - .saturationMod(4.0F) - .alwaysEat() - .fast() - .build(); - } + static { + ALLTHEMODIUM_APPLE = new FoodProperties.Builder() + .nutrition(20) + .saturationMod(2.0F) + .alwaysEat() + .fast() + .build(); + ALLTHEMODIUM_CARROT = new FoodProperties.Builder() + .nutrition(40) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + SOUL_BERRIES = new FoodProperties.Builder() + .nutrition(5) + .saturationMod(4.0F) + .alwaysEat() + .fast() + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java index 5993a611..f12889d3 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyDust.java @@ -4,7 +4,7 @@ public class AlloyDust extends Item { - public AlloyDust(Properties properties) { - super(properties); - } + public AlloyDust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java index cd36b7fd..dc112bd7 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java +++ b/src/main/java/com/thevortex/allthemodium/items/AlloyIngot.java @@ -4,7 +4,7 @@ public class AlloyIngot extends Item { - public AlloyIngot(Properties properties) { - super(properties); - } + public AlloyIngot(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java index 5481c25a..e9713dd3 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java @@ -18,43 +18,43 @@ public class AllthemodiumApple extends Item { - public AllthemodiumApple(Properties properties) { - super(properties); - } + public AllthemodiumApple(Properties properties) { + super(properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving) { - if ((entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get())) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.REGENERATION, - 600, - 1, - false, - false)); - player.addEffect( - new MobEffectInstance( - MobEffects.ABSORPTION, - 600, - 1, - false, - false)); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_APPLE.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 1, + false, + false)); + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 1, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java index 00f0a618..db9e36b5 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumBlock.java @@ -5,7 +5,7 @@ public class AllthemodiumBlock extends BlockItem { - public AllthemodiumBlock(Properties properties) { - super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); - } + public AllthemodiumBlock(Properties properties) { + super(ModRegistry.ALLTHEMODIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java index 1fe8a377..8a4197dc 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java @@ -17,43 +17,43 @@ public class AllthemodiumCarrot extends Item { - public AllthemodiumCarrot(Properties properties) { - super(properties); - } + public AllthemodiumCarrot(Properties properties) { + super(properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving) { - if ((entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get())) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.ABSORPTION, - 600, - 2, - false, - false)); - player.addEffect( - new MobEffectInstance( - MobEffects.REGENERATION, - 600, - 2, - false, - false)); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ALLTHEMODIUM_CARROT.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.ABSORPTION, + 600, + 2, + false, + false)); + player.addEffect( + new MobEffectInstance( + MobEffects.REGENERATION, + 600, + 2, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } - @OnlyIn(Dist.CLIENT) - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @OnlyIn(Dist.CLIENT) + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java index 6b85b3df..20bca7e1 100644 --- a/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java +++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java @@ -16,31 +16,31 @@ public class AllthemodiumOreItem extends BlockItem { - public AllthemodiumOreItem(Block block, Properties properties) { - super(block, properties); - } + public AllthemodiumOreItem(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.loc", - new Object()) - .withStyle(ChatFormatting.GOLD)); - if (!AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object()) - .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.ALLTHEMODIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Clump.java b/src/main/java/com/thevortex/allthemodium/items/Clump.java index 3595c02a..16c4107e 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Clump.java +++ b/src/main/java/com/thevortex/allthemodium/items/Clump.java @@ -4,7 +4,7 @@ public class Clump extends Item { - public Clump(Properties properties) { - super(properties); - } + public Clump(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Crystal.java b/src/main/java/com/thevortex/allthemodium/items/Crystal.java index 60d174b7..7b9f9aff 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Crystal.java +++ b/src/main/java/com/thevortex/allthemodium/items/Crystal.java @@ -4,7 +4,7 @@ public class Crystal extends Item { - public Crystal(Properties properties) { - super(properties); - } + public Crystal(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java b/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java index 337133d5..15139819 100644 --- a/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java +++ b/src/main/java/com/thevortex/allthemodium/items/DirtyDust.java @@ -4,7 +4,7 @@ public class DirtyDust extends Item { - public DirtyDust(Properties properties) { - super(properties); - } + public DirtyDust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Dust.java b/src/main/java/com/thevortex/allthemodium/items/Dust.java index cb909a5c..cbc0ae8a 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Dust.java +++ b/src/main/java/com/thevortex/allthemodium/items/Dust.java @@ -4,7 +4,7 @@ public class Dust extends Item { - public Dust(Properties properties) { - super(properties); - } + public Dust(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Gear.java b/src/main/java/com/thevortex/allthemodium/items/Gear.java index 9d5e8f22..7759dc6d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Gear.java +++ b/src/main/java/com/thevortex/allthemodium/items/Gear.java @@ -4,7 +4,7 @@ public class Gear extends Item { - public Gear(Properties properties) { - super(properties); - } + public Gear(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Ingot.java b/src/main/java/com/thevortex/allthemodium/items/Ingot.java index b4a72f40..fb3c5695 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Ingot.java +++ b/src/main/java/com/thevortex/allthemodium/items/Ingot.java @@ -4,7 +4,7 @@ public class Ingot extends Item { - public Ingot(Properties properties) { - super(properties); - } + public Ingot(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Nugget.java b/src/main/java/com/thevortex/allthemodium/items/Nugget.java index a4c318b4..b1c0a74e 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Nugget.java +++ b/src/main/java/com/thevortex/allthemodium/items/Nugget.java @@ -4,7 +4,7 @@ public class Nugget extends Item { - public Nugget(Properties properties) { - super(properties); - } + public Nugget(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java index 6a931adc..43e5e2ae 100644 --- a/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java +++ b/src/main/java/com/thevortex/allthemodium/items/PiglichHeart.java @@ -4,7 +4,7 @@ public class PiglichHeart extends Item { - public PiglichHeart(Properties properties) { - super(properties); - } + public PiglichHeart(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Plate.java b/src/main/java/com/thevortex/allthemodium/items/Plate.java index 6d9bf537..41f2083d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Plate.java +++ b/src/main/java/com/thevortex/allthemodium/items/Plate.java @@ -4,7 +4,7 @@ public class Plate extends Item { - public Plate(Properties properties) { - super(properties); - } + public Plate(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/RawOre.java b/src/main/java/com/thevortex/allthemodium/items/RawOre.java index c754ba25..681bd2eb 100644 --- a/src/main/java/com/thevortex/allthemodium/items/RawOre.java +++ b/src/main/java/com/thevortex/allthemodium/items/RawOre.java @@ -4,7 +4,7 @@ public class RawOre extends Item { - public RawOre(Properties properties) { - super(properties); - } + public RawOre(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Rod.java b/src/main/java/com/thevortex/allthemodium/items/Rod.java index 40a0964b..9a1e6914 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Rod.java +++ b/src/main/java/com/thevortex/allthemodium/items/Rod.java @@ -4,7 +4,7 @@ public class Rod extends Item { - public Rod(Properties properties) { - super(properties); - } + public Rod(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Shard.java b/src/main/java/com/thevortex/allthemodium/items/Shard.java index 2be23e4e..6ed515d9 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Shard.java +++ b/src/main/java/com/thevortex/allthemodium/items/Shard.java @@ -4,7 +4,7 @@ public class Shard extends Item { - public Shard(Properties properties) { - super(properties); - } + public Shard(Properties properties) { + super(properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java index 0102a538..45a7bd34 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java @@ -13,26 +13,26 @@ public class SoulBerries extends ItemNameBlockItem { - public SoulBerries(Block block, Properties properties) { - super(block, properties); - } + public SoulBerries(Block block, Properties properties) { + super(block, properties); + } - @Override - public ItemStack finishUsingItem( - @Nonnull ItemStack stack, - @Nonnull Level worldIn, - @Nonnull LivingEntity entityLiving) { - if ((entityLiving instanceof Player) && - (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get())) { - Player player = (Player) entityLiving; - player.addEffect( - new MobEffectInstance( - MobEffects.NIGHT_VISION, - 1200, - 2, - false, - false)); - } - return super.finishUsingItem(stack, worldIn, entityLiving); - } + @Override + public ItemStack finishUsingItem( + @Nonnull ItemStack stack, + @Nonnull Level worldIn, + @Nonnull LivingEntity entityLiving) { + if ((entityLiving instanceof Player) && + (stack.getItem() == ModRegistry.ANCIENT_SOULBERRY.get())) { + Player player = (Player) entityLiving; + player.addEffect( + new MobEffectInstance( + MobEffects.NIGHT_VISION, + 1200, + 2, + false, + false)); + } + return super.finishUsingItem(stack, worldIn, entityLiving); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java index 573416fb..ddadbb0d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java +++ b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java @@ -13,19 +13,19 @@ public class SoulBucket extends BucketItem { - public SoulBucket(Supplier supplier, Properties builder) { - super(supplier, builder); - } + public SoulBucket(Supplier supplier, Properties builder) { + super(supplier, builder); + } - @Override - public ICapabilityProvider initCapabilities( - @Nonnull ItemStack stack, - @Nullable CompoundTag nbt) { - return new FluidBucketWrapper(stack); - } + @Override + public ICapabilityProvider initCapabilities( + @Nonnull ItemStack stack, + @Nullable CompoundTag nbt) { + return new FluidBucketWrapper(stack); + } - @Override - public int getBurnTime(ItemStack itemStack, RecipeType provider) { - return 100000; - } + @Override + public int getBurnTime(ItemStack itemStack, RecipeType provider) { + return 100000; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java index 20304116..ea663565 100644 --- a/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java +++ b/src/main/java/com/thevortex/allthemodium/items/TeleportPad.java @@ -5,7 +5,7 @@ public class TeleportPad extends BlockItem { - public TeleportPad(Block blockIn, Properties builder) { - super(blockIn, builder); - } + public TeleportPad(Block blockIn, Properties builder) { + super(blockIn, builder); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java index 894fe958..7960f319 100644 --- a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumBlock.java @@ -12,7 +12,7 @@ */ public class UnobtainiumBlock extends BlockItem { - public UnobtainiumBlock(Properties properties) { - super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); - } + public UnobtainiumBlock(Properties properties) { + super(ModRegistry.UNOBTAINIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java index abaa5009..b7f5c246 100644 --- a/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java +++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java @@ -16,31 +16,31 @@ public class UnobtainiumOreItem extends BlockItem { - public UnobtainiumOreItem(Block block, Properties properties) { - super(block, properties); - } + public UnobtainiumOreItem(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "unobtainium.loc", - new Object()) - .withStyle(ChatFormatting.GOLD)); - if (!AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object()) - .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "unobtainium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.UNOBTAINIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java index 7bda452f..906bb8ac 100644 --- a/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java +++ b/src/main/java/com/thevortex/allthemodium/items/VibraniumBlock.java @@ -12,7 +12,7 @@ */ public class VibraniumBlock extends BlockItem { - public VibraniumBlock(Properties properties) { - super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); - } + public VibraniumBlock(Properties properties) { + super(ModRegistry.VIBRANIUM_BLOCK.get(), properties); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java index 245e5a5b..c441de9d 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java @@ -16,31 +16,31 @@ public class Vibranium_Ore_Item extends BlockItem { - public Vibranium_Ore_Item(Block block, Properties properties) { - super(block, properties); - } + public Vibranium_Ore_Item(Block block, Properties properties) { + super(block, properties); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "vibranium.loc", - new Object()) - .withStyle(ChatFormatting.GOLD)); - if (!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "allthemodium.mine", - new Object()) - .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "vibranium.loc", + new Object()) + .withStyle(ChatFormatting.GOLD)); + if (!AllthemodiumServerConfigs.VIBRANIUM_QUARRYABLE.get()) + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "allthemodium.mine", + new Object()) + .withStyle(ChatFormatting.GOLD)); + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java index ed1f575b..4714f03e 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumBoots.java @@ -8,30 +8,30 @@ public class AllthemodiumBoots extends ArmorItem { - public AllthemodiumBoots( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder) { - super(materialIn, slot, builder); - } + public AllthemodiumBoots( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { - return stack.is(ModRegistry.ALLTHEMODIUM_BOOTS.get()); - } + @Override + public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { + return stack.is(ModRegistry.ALLTHEMODIUM_BOOTS.get()); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java index c6bab80b..a1d55067 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java @@ -9,25 +9,25 @@ public class AllthemodiumChestplate extends ArmorItem { - public AllthemodiumChestplate( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder) { - super(materialIn, slot, builder); - } + public AllthemodiumChestplate( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java index 200a1b39..a60f5db2 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java @@ -12,36 +12,36 @@ public class AllthemodiumHelmet extends ArmorItem { - public AllthemodiumHelmet( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder) { - super(materialIn, slot, builder); - } + public AllthemodiumHelmet( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } - @Override - public void onArmorTick(ItemStack stack, Level world, Player player) { - if ((stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && - (!world.isClientSide)) { - if (player.isInWater() && player.isSwimming()) { - player.setAirSupply(300); - } - } - super.onArmorTick(stack, world, player); - } + @Override + public void onArmorTick(ItemStack stack, Level world, Player player) { + if ((stack.getItem() == ModRegistry.ALLTHEMODIUM_HELMET.get()) && + (!world.isClientSide)) { + if (player.isInWater() && player.isSwimming()) { + player.setAirSupply(300); + } + } + super.onArmorTick(stack, world, player); + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java index 543bd465..ea6b6ff3 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java @@ -9,25 +9,25 @@ public class AllthemodiumLeggings extends ArmorItem { - public AllthemodiumLeggings( - ArmorMaterial materialIn, - EquipmentSlot slot, - Properties builder) { - super(materialIn, slot, builder); - } + public AllthemodiumLeggings( + ArmorMaterial materialIn, + EquipmentSlot slot, + Properties builder) { + super(materialIn, slot, builder); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { - return true; - } + @Override + public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) { + return true; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java index e428c2e7..c7d5f88b 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java @@ -19,155 +19,155 @@ import net.minecraft.world.entity.LivingEntity; public class AllthemodiumHelmetModel - extends HumanoidModel { + extends HumanoidModel { - // This layer location should be baked with EntityRendererProvider.Context in - // the entity renderer and passed into this model's constructor - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( - new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), - "main"); - protected final EquipmentSlot slot; + // This layer location should be baked with EntityRendererProvider.Context in + // the entity renderer and passed into this model's constructor + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( + new ResourceLocation(Reference.MOD_ID, "allthemodium_armor"), + "main"); + protected final EquipmentSlot slot; - public AllthemodiumHelmetModel(ModelPart root, EquipmentSlot slot) { - super(root); - this.slot = slot; - } + public AllthemodiumHelmetModel(ModelPart root, EquipmentSlot slot) { + super(root); + this.slot = slot; + } - @SuppressWarnings("unused") - public static LayerDefinition createBodyLayer() { - MeshDefinition meshDefinition = new MeshDefinition(); - PartDefinition partDefinition = meshDefinition.getRoot(); + @SuppressWarnings("unused") + public static LayerDefinition createBodyLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); - PartDefinition head = partDefinition.addOrReplaceChild( - "head", - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox( - -4.0F, - -8.5F, - -4.0F, - 8.0F, - 8.0F, - 8.0F, - new CubeDeformation(0.0F)), - PartPose.offset(0.0F, 24.0F, 0.0F)); + PartDefinition head = partDefinition.addOrReplaceChild( + "head", + CubeListBuilder + .create() + .texOffs(0, 0) + .addBox( + -4.0F, + -8.5F, + -4.0F, + 8.0F, + 8.0F, + 8.0F, + new CubeDeformation(0.0F)), + PartPose.offset(0.0F, 24.0F, 0.0F)); - PartDefinition horn_r_1_r1 = head.addOrReplaceChild( - "horn_r_1_r1", - CubeListBuilder - .create() - .texOffs(0, 2) - .addBox( - -1.0F, - -3.0F, - 1.0F, - 1.0F, - 1.0F, - 1.0F, - new CubeDeformation(0.0F)) - .texOffs(2, 2) - .addBox( - -1.0F, - -3.0F, - -1.0F, - 1.0F, - 4.0F, - 2.0F, - new CubeDeformation(0.0F)) - .texOffs(28, 2) - .addBox( - 8.0F, - -3.0F, - 1.0F, - 1.0F, - 1.0F, - 1.0F, - new CubeDeformation(0.0F)) - .texOffs(24, 2) - .addBox( - 8.0F, - -3.0F, - -1.0F, - 1.0F, - 4.0F, - 2.0F, - new CubeDeformation(0.0F)), - PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F)); + PartDefinition horn_r_1_r1 = head.addOrReplaceChild( + "horn_r_1_r1", + CubeListBuilder + .create() + .texOffs(0, 2) + .addBox( + -1.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(2, 2) + .addBox( + -1.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F)) + .texOffs(28, 2) + .addBox( + 8.0F, + -3.0F, + 1.0F, + 1.0F, + 1.0F, + 1.0F, + new CubeDeformation(0.0F)) + .texOffs(24, 2) + .addBox( + 8.0F, + -3.0F, + -1.0F, + 1.0F, + 4.0F, + 2.0F, + new CubeDeformation(0.0F)), + PartPose.offsetAndRotation(-4.0F, -6.0F, -3.0F, 0.7854F, 0.0F, 0.0F)); - partDefinition.addOrReplaceChild( - "hat", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition.addOrReplaceChild( - "body", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition.addOrReplaceChild( - "right_arm", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition.addOrReplaceChild( - "left_arm", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition.addOrReplaceChild( - "right_leg", - CubeListBuilder.create(), - PartPose.ZERO); - partDefinition.addOrReplaceChild( - "left_leg", - CubeListBuilder.create(), - PartPose.ZERO); + partDefinition.addOrReplaceChild( + "hat", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "body", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "right_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "left_arm", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "right_leg", + CubeListBuilder.create(), + PartPose.ZERO); + partDefinition.addOrReplaceChild( + "left_leg", + CubeListBuilder.create(), + PartPose.ZERO); - return LayerDefinition.create(meshDefinition, 64, 32); - } + return LayerDefinition.create(meshDefinition, 64, 32); + } - @Override - public void renderToBuffer( - @Nonnull PoseStack poseStack, - @Nonnull VertexConsumer buffer, - int packedLight, - int packedOverlay, - float red, - float green, - float blue, - float alpha) { - setPartVisibility(slot); - super.renderToBuffer( - poseStack, - buffer, - packedLight, - packedOverlay, - red, - green, - blue, - alpha); - } + @Override + public void renderToBuffer( + @Nonnull PoseStack poseStack, + @Nonnull VertexConsumer buffer, + int packedLight, + int packedOverlay, + float red, + float green, + float blue, + float alpha) { + setPartVisibility(slot); + super.renderToBuffer( + poseStack, + buffer, + packedLight, + packedOverlay, + red, + green, + blue, + alpha); + } - private void setPartVisibility(EquipmentSlot slot) { - setAllVisible(false); - switch (slot) { - case HEAD: - head.visible = true; - hat.visible = true; - break; - case CHEST: - body.visible = true; - rightArm.visible = true; - leftArm.visible = true; - break; - case LEGS: - body.visible = true; - rightLeg.visible = true; - leftLeg.visible = true; - break; - case FEET: - rightLeg.visible = true; - leftLeg.visible = true; - case MAINHAND: - case OFFHAND: - break; - } - } + private void setPartVisibility(EquipmentSlot slot) { + setAllVisible(false); + switch (slot) { + case HEAD: + head.visible = true; + hat.visible = true; + break; + case CHEST: + body.visible = true; + rightArm.visible = true; + leftArm.visible = true; + break; + case LEGS: + body.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + break; + case FEET: + rightLeg.visible = true; + leftLeg.visible = true; + case MAINHAND: + case OFFHAND: + break; + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java index 22b81dd9..8b16dd98 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyAxe.java @@ -20,60 +20,60 @@ public class AlloyAxe extends AxeItem { - public AlloyAxe(Tier tier, int damage, float speed, Properties properties) { - super(tier, damage, speed, properties); - } + public AlloyAxe(Tier tier, int damage, float speed, Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java index 89c78bac..fce3e6ae 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPaxel.java @@ -32,288 +32,288 @@ public class AlloyPaxel extends DiggerItem { - public static Map STRIPPABLES = AxeItem.STRIPPABLES; + public static Map STRIPPABLES = AxeItem.STRIPPABLES; - public AlloyPaxel( - float attack, - float speed, - Tier tier, - TagKey effectiveBlocks, - Properties properties) { - super(attack, speed, tier, effectiveBlocks, properties); - } + public AlloyPaxel( + float attack, + float speed, + Tier tier, + TagKey effectiveBlocks, + Properties properties) { + super(attack, speed, tier, effectiveBlocks, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return speed * 1.4f; - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return speed * 1.8f; - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return speed * 1.8f; - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return speed * 1.9f; - if (state.is(Tags.Blocks.GLASS)) - return speed * 3.0F; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed * 1.4f; + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed * 1.8f; + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return speed * 1.9f; + if (state.is(Tags.Blocks.GLASS)) + return speed * 3.0F; + return super.getDestroySpeed(stack, state); + } - @Override - public net.minecraft.world.InteractionResult interactLivingEntity( - @Nonnull ItemStack stack, - @Nonnull net.minecraft.world.entity.player.Player playerIn, - @Nonnull LivingEntity entity, - @Nonnull net.minecraft.world.InteractionHand hand) { - if (entity instanceof net.minecraftforge.common.IForgeShearable target) { - if (entity.level.isClientSide) - return net.minecraft.world.InteractionResult.SUCCESS; - BlockPos pos = new BlockPos( - entity.getX(), - entity.getY(), - entity.getZ()); - if (target.isShearable(stack, entity.level, pos)) { - @SuppressWarnings("deprecation") - java.util.List drops = target.onSheared( - playerIn, - stack, - entity.level, - pos, - net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel( - net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, - stack)); - java.util.Random rand = new java.util.Random(); - drops.forEach(d -> { - net.minecraft.world.entity.item.ItemEntity dropEntity = entity.spawnAtLocation(d, 1.0F); - if (dropEntity == null) - return; + @Override + public net.minecraft.world.InteractionResult interactLivingEntity( + @Nonnull ItemStack stack, + @Nonnull net.minecraft.world.entity.player.Player playerIn, + @Nonnull LivingEntity entity, + @Nonnull net.minecraft.world.InteractionHand hand) { + if (entity instanceof net.minecraftforge.common.IForgeShearable target) { + if (entity.level.isClientSide) + return net.minecraft.world.InteractionResult.SUCCESS; + BlockPos pos = new BlockPos( + entity.getX(), + entity.getY(), + entity.getZ()); + if (target.isShearable(stack, entity.level, pos)) { + @SuppressWarnings("deprecation") + java.util.List drops = target.onSheared( + playerIn, + stack, + entity.level, + pos, + net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel( + net.minecraft.world.item.enchantment.Enchantments.BLOCK_FORTUNE, + stack)); + java.util.Random rand = new java.util.Random(); + drops.forEach(d -> { + net.minecraft.world.entity.item.ItemEntity dropEntity = entity.spawnAtLocation(d, 1.0F); + if (dropEntity == null) + return; - dropEntity.setDeltaMovement( - dropEntity - .getDeltaMovement() - .add( - (double) ((rand.nextFloat() - - rand.nextFloat()) * - 0.1F), - (double) (rand.nextFloat() * 0.05F), - (double) ((rand.nextFloat() - - rand.nextFloat()) * - 0.1F))); - }); - stack.hurtAndBreak( - 1, - playerIn, - e -> e.broadcastBreakEvent(hand)); - } - return net.minecraft.world.InteractionResult.SUCCESS; - } - return net.minecraft.world.InteractionResult.PASS; - } + dropEntity.setDeltaMovement( + dropEntity + .getDeltaMovement() + .add( + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F), + (double) (rand.nextFloat() * 0.05F), + (double) ((rand.nextFloat() - + rand.nextFloat()) * + 0.1F))); + }); + stack.hurtAndBreak( + 1, + playerIn, + e -> e.broadcastBreakEvent(hand)); + } + return net.minecraft.world.InteractionResult.SUCCESS; + } + return net.minecraft.world.InteractionResult.PASS; + } - @Override - public boolean canPerformAction( - ItemStack stack, - net.minecraftforge.common.ToolAction toolAction) { - return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains( - toolAction); - } + @Override + public boolean canPerformAction( + ItemStack stack, + net.minecraftforge.common.ToolAction toolAction) { + return net.minecraftforge.common.ToolActions.DEFAULT_SHEARS_ACTIONS.contains( + toolAction); + } - @Override - public boolean hurtEnemy( - @Nonnull ItemStack stack, - @Nonnull LivingEntity entity, - @Nonnull LivingEntity player) { - // entity.setSecondsOnFire(30); - return super.hurtEnemy(stack, entity, player); - } + @Override + public boolean hurtEnemy( + @Nonnull ItemStack stack, + @Nonnull LivingEntity entity, + @Nonnull LivingEntity player) { + // entity.setSecondsOnFire(30); + return super.hurtEnemy(stack, entity, player); + } - @Override - public InteractionResult useOn(@Nonnull UseOnContext context) { - Level world = context.getLevel(); - BlockPos blockPos = context.getClickedPos(); - BlockState blockState = world.getBlockState(blockPos); - if (blockState.getBlock() == Blocks.OBSIDIAN) { - BlockState defaultBlockState = Blocks.CRYING_OBSIDIAN.defaultBlockState(); - Player playerEntity = context.getPlayer(); - world.playSound( - playerEntity, - blockPos, - SoundEvents.NETHER_ORE_BREAK, - SoundSource.BLOCKS, - 1.0F, - 1.0F); - if (!world.isClientSide) { - world.setBlock(blockPos, defaultBlockState, 11); - if (playerEntity != null) { - context - .getItemInHand() - .hurtAndBreak( - 1, - playerEntity, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent( - context.getHand()); - }); - } - } + @Override + public InteractionResult useOn(@Nonnull UseOnContext context) { + Level world = context.getLevel(); + BlockPos blockPos = context.getClickedPos(); + BlockState blockState = world.getBlockState(blockPos); + if (blockState.getBlock() == Blocks.OBSIDIAN) { + BlockState defaultBlockState = Blocks.CRYING_OBSIDIAN.defaultBlockState(); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.NETHER_ORE_BREAK, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, defaultBlockState, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand()); + }); + } + } - return InteractionResult.sidedSuccess(world.isClientSide); - } - if (blockState.getBlock() instanceof GrowingPlantHeadBlock growingPlantHeadBlock) { - if (!growingPlantHeadBlock.isMaxAge(blockState)) { - Player player = context.getPlayer(); + return InteractionResult.sidedSuccess(world.isClientSide); + } + if (blockState.getBlock() instanceof GrowingPlantHeadBlock growingPlantHeadBlock) { + if (!growingPlantHeadBlock.isMaxAge(blockState)) { + Player player = context.getPlayer(); - if (player == null) - return InteractionResult.PASS; + if (player == null) + return InteractionResult.PASS; - ItemStack itemStack = context.getItemInHand(); - if (player instanceof ServerPlayer) { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger( - (ServerPlayer) player, - blockPos, - itemStack); - } + ItemStack itemStack = context.getItemInHand(); + if (player instanceof ServerPlayer) { + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger( + (ServerPlayer) player, + blockPos, + itemStack); + } - world.playSound( - player, - blockPos, - SoundEvents.GROWING_PLANT_CROP, - SoundSource.BLOCKS, - 1.0F, - 1.0F); - world.setBlockAndUpdate( - blockPos, - growingPlantHeadBlock.getMaxAgeState(blockState)); - itemStack.hurtAndBreak( - 1, - player, - p_186374_ -> { - p_186374_.broadcastBreakEvent(context.getHand()); - }); + world.playSound( + player, + blockPos, + SoundEvents.GROWING_PLANT_CROP, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + world.setBlockAndUpdate( + blockPos, + growingPlantHeadBlock.getMaxAgeState(blockState)); + itemStack.hurtAndBreak( + 1, + player, + p_186374_ -> { + p_186374_.broadcastBreakEvent(context.getHand()); + }); - return InteractionResult.sidedSuccess(world.isClientSide); - } - } - if ((blockState.is(BlockTags.DIRT))) { - Player player = context.getPlayer(); - if (player == null) - return InteractionResult.PASS; + return InteractionResult.sidedSuccess(world.isClientSide); + } + } + if ((blockState.is(BlockTags.DIRT))) { + Player player = context.getPlayer(); + if (player == null) + return InteractionResult.PASS; - // tags dirt - boolean isSneaking = player.isCrouching(); - BlockState blockPath = isSneaking - ? Blocks.FARMLAND.defaultBlockState() - : Blocks.DIRT_PATH.defaultBlockState(); + // tags dirt + boolean isSneaking = player.isCrouching(); + BlockState blockPath = isSneaking + ? Blocks.FARMLAND.defaultBlockState() + : Blocks.DIRT_PATH.defaultBlockState(); - world.playSound( - player, - blockPos, - SoundEvents.SHOVEL_FLATTEN, - SoundSource.BLOCKS, - 1.0F, - 1.0F); - if (!world.isClientSide) { - world.setBlock(blockPos, blockPath, 11); + world.playSound( + player, + blockPos, + SoundEvents.SHOVEL_FLATTEN, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, blockPath, 11); - context - .getItemInHand() - .hurtAndBreak( - 1, - player, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent(context.getHand()); - }); - } + context + .getItemInHand() + .hurtAndBreak( + 1, + player, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent(context.getHand()); + }); + } - return InteractionResult.sidedSuccess(world.isClientSide); - } - if (blockState.is(BlockTags.LOGS)) { - // tags logs - Block check = STRIPPABLES.get(blockState.getBlock()); - if (check != null) { - BlockState block = check.defaultBlockState(); - Player playerEntity = context.getPlayer(); - world.playSound( - playerEntity, - blockPos, - SoundEvents.AXE_STRIP, - SoundSource.BLOCKS, - 1.0F, - 1.0F); - if (!world.isClientSide) { - world.setBlock(blockPos, block, 11); - if (playerEntity != null) { - context - .getItemInHand() - .hurtAndBreak( - 1, - playerEntity, - p_220040_1_ -> { - p_220040_1_.broadcastBreakEvent( - context.getHand()); - }); - } - } - return InteractionResult.sidedSuccess(world.isClientSide); - } - } - return InteractionResult.PASS; - } + return InteractionResult.sidedSuccess(world.isClientSide); + } + if (blockState.is(BlockTags.LOGS)) { + // tags logs + Block check = STRIPPABLES.get(blockState.getBlock()); + if (check != null) { + BlockState block = check.defaultBlockState(); + Player playerEntity = context.getPlayer(); + world.playSound( + playerEntity, + blockPos, + SoundEvents.AXE_STRIP, + SoundSource.BLOCKS, + 1.0F, + 1.0F); + if (!world.isClientSide) { + world.setBlock(blockPos, block, 11); + if (playerEntity != null) { + context + .getItemInHand() + .hurtAndBreak( + 1, + playerEntity, + p_220040_1_ -> { + p_220040_1_.broadcastBreakEvent( + context.getHand()); + }); + } + } + return InteractionResult.sidedSuccess(world.isClientSide); + } + } + return InteractionResult.PASS; + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java index cb030fd5..2e7a7c53 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyPick.java @@ -20,64 +20,64 @@ public class AlloyPick extends PickaxeItem { - public AlloyPick( - Tier tier, - int damage, - float speed, - Properties properties) { - super(tier, damage, speed, properties); - } + public AlloyPick( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java index 7a6a33bc..20a26276 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloyShovel.java @@ -20,64 +20,64 @@ public class AlloyShovel extends ShovelItem { - public AlloyShovel( - Tier tier, - int damage, - float speed, - Properties properties) { - super(tier, damage, speed, properties); - } + public AlloyShovel( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return speed; - return super.getDestroySpeed(stack, state); - } + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed; + return super.getDestroySpeed(stack, state); + } - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } - @Override - public boolean canBeDepleted() { - return false; - } + @Override + public boolean canBeDepleted() { + return false; + } - @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLOY_TIER, - state); - return false; - } + @Override + public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLOY_TIER, + state); + return false; + } } diff --git a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java index 5105eacb..f865a324 100644 --- a/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java +++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/tools/AlloySword.java @@ -16,42 +16,42 @@ public class AlloySword extends SwordItem { - public AlloySword( - Tier tier, - int damage, - float speed, - Properties properties) { - super(tier, damage, speed, properties); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - protected TranslatableContents getTooltip(String key) { - return new TranslatableContents(key); - } + public AlloySword( + Tier tier, + int damage, + float speed, + Properties properties) { + super(tier, damage, speed, properties); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + protected TranslatableContents getTooltip(String key) { + return new TranslatableContents(key); + } } diff --git a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java index 7184447b..6d29f5b1 100644 --- a/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java +++ b/src/main/java/com/thevortex/allthemodium/material/AArmorMaterial.java @@ -14,86 +14,86 @@ @SuppressWarnings("deprecation") // TODO: Determine alternative to LazyLoadedValue public enum AArmorMaterial implements ArmorMaterial { - ALLTHEMODIUM( - "allthemodium", - 42, - new int[] { 4, 7, 9, 4 }, - 85, - SoundEvents.ARMOR_EQUIP_NETHERITE, - 5.0F, - 0.5f, - () -> { - return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); - }); + ALLTHEMODIUM( + "allthemodium", + 42, + new int[] { 4, 7, 9, 4 }, + 85, + SoundEvents.ARMOR_EQUIP_NETHERITE, + 5.0F, + 0.5f, + () -> { + return Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get()); + }); - private static final int[] MAX_DAMAGE_ARRAY = new int[] { 25, 45, 45, 25 }; - private final String name; + private static final int[] MAX_DAMAGE_ARRAY = new int[] { 25, 45, 45, 25 }; + private final String name; - private final int maxDamageFactor; - private final int[] damageReductionAmountArray; - private final int enchantability; - private final SoundEvent soundEvent; - private final float toughness; - private final float knockback; + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + private final SoundEvent soundEvent; + private final float toughness; + private final float knockback; - private final LazyLoadedValue repairMaterial; + private final LazyLoadedValue repairMaterial; - AArmorMaterial( - String nameIn, - int maxDamageFactorIn, - int[] damageReductionAmountsIn, - int enchantabilityIn, - SoundEvent equipSoundIn, - float toughness, - float knockback, - Supplier repairMaterialSupplier) { - this.name = nameIn; - this.maxDamageFactor = maxDamageFactorIn; - this.damageReductionAmountArray = damageReductionAmountsIn; - this.enchantability = enchantabilityIn; - this.soundEvent = equipSoundIn; - this.toughness = toughness; - this.repairMaterial = new LazyLoadedValue(repairMaterialSupplier); - this.knockback = knockback; - } + AArmorMaterial( + String nameIn, + int maxDamageFactorIn, + int[] damageReductionAmountsIn, + int enchantabilityIn, + SoundEvent equipSoundIn, + float toughness, + float knockback, + Supplier repairMaterialSupplier) { + this.name = nameIn; + this.maxDamageFactor = maxDamageFactorIn; + this.damageReductionAmountArray = damageReductionAmountsIn; + this.enchantability = enchantabilityIn; + this.soundEvent = equipSoundIn; + this.toughness = toughness; + this.repairMaterial = new LazyLoadedValue(repairMaterialSupplier); + this.knockback = knockback; + } - @Override - public int getDurabilityForSlot(@Nonnull EquipmentSlot slotIn) { - return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; - } + @Override + public int getDurabilityForSlot(@Nonnull EquipmentSlot slotIn) { + return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; + } - @Override - public int getDefenseForSlot(@Nonnull EquipmentSlot slotIn) { - return this.damageReductionAmountArray[slotIn.getIndex()]; - } + @Override + public int getDefenseForSlot(@Nonnull EquipmentSlot slotIn) { + return this.damageReductionAmountArray[slotIn.getIndex()]; + } - @Override - public int getEnchantmentValue() { - return this.enchantability; - } + @Override + public int getEnchantmentValue() { + return this.enchantability; + } - @Override - public SoundEvent getEquipSound() { - return this.soundEvent; - } + @Override + public SoundEvent getEquipSound() { + return this.soundEvent; + } - @Override - public Ingredient getRepairIngredient() { - return this.repairMaterial.get(); - } + @Override + public Ingredient getRepairIngredient() { + return this.repairMaterial.get(); + } - @OnlyIn(Dist.CLIENT) - public String getName() { - return this.name; - } + @OnlyIn(Dist.CLIENT) + public String getName() { + return this.name; + } - @Override - public float getToughness() { - return this.toughness; - } + @Override + public float getToughness() { + return this.toughness; + } - @Override - public float getKnockbackResistance() { - return this.knockback; - } + @Override + public float getKnockbackResistance() { + return this.knockback; + } } diff --git a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java index 3328591b..22c9b3e4 100644 --- a/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java +++ b/src/main/java/com/thevortex/allthemodium/material/ToolTiers.java @@ -16,35 +16,35 @@ public class ToolTiers { - public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create( - new ResourceLocation("mineable/pickaxe")); + public static final TagKey ALLTHEMODIUM_TOOL_TAG = BlockTags.create( + new ResourceLocation("mineable/pickaxe")); - public static final TagKey ALLTHEMODIUM_TIER_TAG = TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; - public static final TagKey ALLOY_TIER_TAG = TagRegistry.NEEDS_ALLOY_TOOL; + public static final TagKey ALLTHEMODIUM_TIER_TAG = TagRegistry.NEEDS_ALLTHEMODIUM_TOOL; + public static final TagKey ALLOY_TIER_TAG = TagRegistry.NEEDS_ALLOY_TOOL; - public static final Tier ALLTHEMODIUM_TIER = TierSortingRegistry.registerTier( - new ForgeTier( - 5, - 15000, - 10, - 11.0F, - 85, - ALLTHEMODIUM_TIER_TAG, - () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), - new ResourceLocation(Reference.MOD_ID, "allthemodium"), - List.of(Tiers.NETHERITE), - List.of()); + public static final Tier ALLTHEMODIUM_TIER = TierSortingRegistry.registerTier( + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLTHEMODIUM_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), + new ResourceLocation(Reference.MOD_ID, "allthemodium"), + List.of(Tiers.NETHERITE), + List.of()); - public static final Tier ALLOY_TIER = TierSortingRegistry.registerTier( - new ForgeTier( - 5, - 15000, - 10, - 11.0F, - 85, - ALLOY_TIER_TAG, - () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), - new ResourceLocation(Reference.MOD_ID, "allthemodium_alloy"), - List.of(ToolTiers.ALLTHEMODIUM_TIER), - List.of()); + public static final Tier ALLOY_TIER = TierSortingRegistry.registerTier( + new ForgeTier( + 5, + 15000, + 10, + 11.0F, + 85, + ALLOY_TIER_TAG, + () -> Ingredient.of(ModRegistry.ALLTHEMODIUM_INGOT.get())), + new ResourceLocation(Reference.MOD_ID, "allthemodium_alloy"), + List.of(ToolTiers.ALLTHEMODIUM_TIER), + List.of()); } diff --git a/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java b/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java index 4db534c9..deaac90a 100644 --- a/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java +++ b/src/main/java/com/thevortex/allthemodium/mixins/MixinConnector.java @@ -5,11 +5,11 @@ public class MixinConnector implements IMixinConnector { - /** - * Connect to Mixin - */ - @Override - public void connect() { - Mixins.addConfigurations("allthemodium.mixins.json"); - } + /** + * Connect to Mixin + */ + @Override + public void connect() { + Mixins.addConfigurations("allthemodium.mixins.json"); + } } diff --git a/src/main/java/com/thevortex/allthemodium/reference/Reference.java b/src/main/java/com/thevortex/allthemodium/reference/Reference.java index d4ca70f3..39be326b 100644 --- a/src/main/java/com/thevortex/allthemodium/reference/Reference.java +++ b/src/main/java/com/thevortex/allthemodium/reference/Reference.java @@ -4,87 +4,87 @@ public class Reference { - public static final ResourceLocation ORE_TYPE = location( - "forge:ores/allthemodium"); - public static final ResourceLocation ORE_TYPE2 = location( - "forge:ores/vibranium"); - public static final ResourceLocation ORE_TYPE3 = location( - "forge:ores/unobtainium"); - public static final String MOD_ID = "allthemodium"; - - public static ResourceLocation atm(String path) { - return new ResourceLocation(MOD_ID, path); - } - - public static ResourceLocation mek(String path) { - return new ResourceLocation("mekanism", path); - } - - public static ResourceLocation location(String pathIn) { - return new ResourceLocation(pathIn); - } - - public static ResourceLocation forge(String path) { - return new ResourceLocation("forge", path); - } - - public static ResourceLocation raw_ores(String path) { - return forge("raw_ores/" + path); - } - - public static ResourceLocation material(String path) { - return forge("raw_materials/" + path); - } - - public static ResourceLocation ingot(String path) { - return forge("ingots/" + path); - } - - public static ResourceLocation dust(String path) { - return forge("dusts/" + path); - } - - public static ResourceLocation dirty(String path) { - return mek("dirty_dusts/" + path); - } - - public static ResourceLocation shard(String path) { - return mek("shards/" + path); - } - - public static ResourceLocation clump(String path) { - return mek("clumps/" + path); - } - - public static ResourceLocation crystal(String path) { - return mek("crystals/" + path); - } - - public static ResourceLocation nugget(String path) { - return forge("nuggets/" + path); - } - - public static ResourceLocation ore(String path) { - return forge("ores/" + path); - } - - public static ResourceLocation rod(String path) { - return forge("rods/" + path); - } - - public static ResourceLocation gear(String path) { - return forge("gears/" + path); - } - - public static ResourceLocation plate(String path) { - return forge("plates/" + path); - } - - public static ResourceLocation block(String path) { - return forge("storage_blocks/" + path); - } - - public static ResourceLocation raw_block(String path) { - return forge("raw_blocks/" + path); - } + public static final ResourceLocation ORE_TYPE = location( + "forge:ores/allthemodium"); + public static final ResourceLocation ORE_TYPE2 = location( + "forge:ores/vibranium"); + public static final ResourceLocation ORE_TYPE3 = location( + "forge:ores/unobtainium"); + public static final String MOD_ID = "allthemodium"; + + public static ResourceLocation atm(String path) { + return new ResourceLocation(MOD_ID, path); + } + + public static ResourceLocation mek(String path) { + return new ResourceLocation("mekanism", path); + } + + public static ResourceLocation location(String pathIn) { + return new ResourceLocation(pathIn); + } + + public static ResourceLocation forge(String path) { + return new ResourceLocation("forge", path); + } + + public static ResourceLocation raw_ores(String path) { + return forge("raw_ores/" + path); + } + + public static ResourceLocation material(String path) { + return forge("raw_materials/" + path); + } + + public static ResourceLocation ingot(String path) { + return forge("ingots/" + path); + } + + public static ResourceLocation dust(String path) { + return forge("dusts/" + path); + } + + public static ResourceLocation dirty(String path) { + return mek("dirty_dusts/" + path); + } + + public static ResourceLocation shard(String path) { + return mek("shards/" + path); + } + + public static ResourceLocation clump(String path) { + return mek("clumps/" + path); + } + + public static ResourceLocation crystal(String path) { + return mek("crystals/" + path); + } + + public static ResourceLocation nugget(String path) { + return forge("nuggets/" + path); + } + + public static ResourceLocation ore(String path) { + return forge("ores/" + path); + } + + public static ResourceLocation rod(String path) { + return forge("rods/" + path); + } + + public static ResourceLocation gear(String path) { + return forge("gears/" + path); + } + + public static ResourceLocation plate(String path) { + return forge("plates/" + path); + } + + public static ResourceLocation block(String path) { + return forge("storage_blocks/" + path); + } + + public static ResourceLocation raw_block(String path) { + return forge("raw_blocks/" + path); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java index 6b7613a4..fb3dfba1 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/BlockRegistry.java @@ -12,51 +12,51 @@ public class BlockRegistry { - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA_BLOCK = BLOCKS.register( - "soul_lava", - () -> new SoulLava( - FluidRegistry.SOULLAVA, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noOcclusion() - .jumpFactor(0.1F) - .speedFactor(0.01F) - .lightLevel(light -> { - return 15; - }) - .color(MaterialColor.COLOR_BLUE) - .noLootTable())); + public static final RegistryObject SOULLAVA_BLOCK = BLOCKS.register( + "soul_lava", + () -> new SoulLava( + FluidRegistry.SOULLAVA, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noOcclusion() + .jumpFactor(0.1F) + .speedFactor(0.01F) + .lightLevel(light -> { + return 15; + }) + .color(MaterialColor.COLOR_BLUE) + .noLootTable())); - public static final RegistryObject MOLTEN_ATM_BLOCK = BLOCKS.register( - "molten_allthemodium_block", - () -> new LiquidBlock( - FluidRegistry.ALLTHEMODIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable())); - public static final RegistryObject MOLTEN_VIB_BLOCK = BLOCKS.register( - "molten_vibranium_block", - () -> new LiquidBlock( - FluidRegistry.VIBRANIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable())); - public static final RegistryObject MOLTEN_UNOB_BLOCK = BLOCKS.register( - "molten_unobtainium_block", - () -> new LiquidBlock( - FluidRegistry.UNOBTAINIUM, - Block.Properties - .of(Material.LAVA) - .noCollission() - .strength(100f) - .noLootTable())); + public static final RegistryObject MOLTEN_ATM_BLOCK = BLOCKS.register( + "molten_allthemodium_block", + () -> new LiquidBlock( + FluidRegistry.ALLTHEMODIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); + public static final RegistryObject MOLTEN_VIB_BLOCK = BLOCKS.register( + "molten_vibranium_block", + () -> new LiquidBlock( + FluidRegistry.VIBRANIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); + public static final RegistryObject MOLTEN_UNOB_BLOCK = BLOCKS.register( + "molten_unobtainium_block", + () -> new LiquidBlock( + FluidRegistry.UNOBTAINIUM, + Block.Properties + .of(Material.LAVA) + .noCollission() + .strength(100f) + .noLootTable())); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java index d31cf395..4e86beed 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidInteractionsRegistry.java @@ -12,28 +12,28 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class FluidInteractionsRegistry { - @SubscribeEvent - public static void register(FMLCommonSetupEvent event) { - event.enqueueWork(() -> { - addInteraction(FluidTypeRegistry.SOULLAVA.get()); - }); - } + @SubscribeEvent + public static void register(FMLCommonSetupEvent event) { + event.enqueueWork(() -> { + addInteraction(FluidTypeRegistry.SOULLAVA.get()); + }); + } - // Lava + Water = Obsidian (Source Lava) / Cobblestone (Flowing Lava) - private static void addInteraction(FluidType fluidType) { - FluidInteractionRegistry.addInteraction( - ForgeMod.LAVA_TYPE.get(), - new FluidInteractionRegistry.InteractionInformation( - fluidType, - fluidState -> fluidState.isSource() - ? Blocks.GILDED_BLACKSTONE.defaultBlockState() - : Blocks.BLACKSTONE.defaultBlockState())); - FluidInteractionRegistry.addInteraction( - ForgeMod.WATER_TYPE.get(), - new FluidInteractionRegistry.InteractionInformation( - fluidType, - fluidState -> fluidState.isSource() - ? Blocks.CRYING_OBSIDIAN.defaultBlockState() - : Blocks.OBSIDIAN.defaultBlockState())); - } + // Lava + Water = Obsidian (Source Lava) / Cobblestone (Flowing Lava) + private static void addInteraction(FluidType fluidType) { + FluidInteractionRegistry.addInteraction( + ForgeMod.LAVA_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> fluidState.isSource() + ? Blocks.GILDED_BLACKSTONE.defaultBlockState() + : Blocks.BLACKSTONE.defaultBlockState())); + FluidInteractionRegistry.addInteraction( + ForgeMod.WATER_TYPE.get(), + new FluidInteractionRegistry.InteractionInformation( + fluidType, + fluidState -> fluidState.isSource() + ? Blocks.CRYING_OBSIDIAN.defaultBlockState() + : Blocks.OBSIDIAN.defaultBlockState())); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java index 3f0d7ef3..64cedd8e 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidRegistry.java @@ -13,27 +13,27 @@ public class FluidRegistry { - public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, - Reference.MOD_ID); + public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA = FLUIDS.register( - "soul_lava", - FluidSoulLava.Source::new); - public static final RegistryObject FLOWING_SOULLAVA = FLUIDS.register("flowing_soul_lava", - FluidSoulLava.Flowing::new); + public static final RegistryObject SOULLAVA = FLUIDS.register( + "soul_lava", + FluidSoulLava.Source::new); + public static final RegistryObject FLOWING_SOULLAVA = FLUIDS.register("flowing_soul_lava", + FluidSoulLava.Flowing::new); - public static final RegistryObject ALLTHEMODIUM = FLUIDS.register("molten_allthemodium", - FluidATM.Source::new); - public static final RegistryObject FLOWING_ALLTHEMODIUM = FLUIDS - .register("flowing_molten_allthemodium", FluidATM.Flowing::new); + public static final RegistryObject ALLTHEMODIUM = FLUIDS.register("molten_allthemodium", + FluidATM.Source::new); + public static final RegistryObject FLOWING_ALLTHEMODIUM = FLUIDS + .register("flowing_molten_allthemodium", FluidATM.Flowing::new); - public static final RegistryObject VIBRANIUM = FLUIDS.register("molten_vibranium", - FluidVIB.Source::new); - public static final RegistryObject FLOWING_VIBRANIUM = FLUIDS.register("flowing_molten_vibranium", - FluidVIB.Flowing::new); + public static final RegistryObject VIBRANIUM = FLUIDS.register("molten_vibranium", + FluidVIB.Source::new); + public static final RegistryObject FLOWING_VIBRANIUM = FLUIDS.register("flowing_molten_vibranium", + FluidVIB.Flowing::new); - public static final RegistryObject UNOBTAINIUM = FLUIDS.register("molten_unobtainium", - FluidUNOB.Source::new); - public static final RegistryObject FLOWING_UNOBTAINIUM = FLUIDS.register("flowing_molten_unobtainium", - FluidUNOB.Flowing::new); + public static final RegistryObject UNOBTAINIUM = FLUIDS.register("molten_unobtainium", + FluidUNOB.Source::new); + public static final RegistryObject FLOWING_UNOBTAINIUM = FLUIDS.register("flowing_molten_unobtainium", + FluidUNOB.Flowing::new); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java index d07f8e37..da7d3e3f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/FluidTypeRegistry.java @@ -14,79 +14,79 @@ public class FluidTypeRegistry { - public static final DeferredRegister FLUID_TYPES = DeferredRegister.create( - ForgeRegistries.Keys.FLUID_TYPES, - Reference.MOD_ID); + public static final DeferredRegister FLUID_TYPES = DeferredRegister.create( + ForgeRegistries.Keys.FLUID_TYPES, + Reference.MOD_ID); - public static final RegistryObject SOULLAVA = FLUID_TYPES.register( - "soul_lava", - () -> new SoulLavaType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".soul_lava") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound( - SoundActions.BUCKET_FILL, - SoundEvents.BUCKET_FILL) - .sound( - SoundActions.BUCKET_EMPTY, - SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false))); + public static final RegistryObject SOULLAVA = FLUID_TYPES.register( + "soul_lava", + () -> new SoulLavaType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".soul_lava") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound( + SoundActions.BUCKET_FILL, + SoundEvents.BUCKET_FILL) + .sound( + SoundActions.BUCKET_EMPTY, + SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject ATM = FLUID_TYPES.register( - "molten_atm", - () -> new MoltenATMType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_allthemodium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false))); + public static final RegistryObject ATM = FLUID_TYPES.register( + "molten_atm", + () -> new MoltenATMType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_allthemodium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject VIB = FLUID_TYPES.register( - "molten_vibranium", - () -> new MoltenVIBType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_vibranium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false))); + public static final RegistryObject VIB = FLUID_TYPES.register( + "molten_vibranium", + () -> new MoltenVIBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_vibranium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); - public static final RegistryObject UNOB = FLUID_TYPES.register( - "molten_unobtainium", - () -> new MoltenUNOBType( - FluidType.Properties - .create() - .descriptionId( - "block." + Reference.MOD_ID + ".molten_unobtainium") - .fallDistanceModifier(0F) - .canExtinguish(false) - .supportsBoating(true) - .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) - .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) - .sound( - SoundActions.FLUID_VAPORIZE, - SoundEvents.FIRE_EXTINGUISH) - .canHydrate(false))); + public static final RegistryObject UNOB = FLUID_TYPES.register( + "molten_unobtainium", + () -> new MoltenUNOBType( + FluidType.Properties + .create() + .descriptionId( + "block." + Reference.MOD_ID + ".molten_unobtainium") + .fallDistanceModifier(0F) + .canExtinguish(false) + .supportsBoating(true) + .sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) + .sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) + .sound( + SoundActions.FLUID_VAPORIZE, + SoundEvents.FIRE_EXTINGUISH) + .canHydrate(false))); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java index f0ad0a9f..181555ab 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ItemRegistry.java @@ -11,98 +11,98 @@ public class ItemRegistry { - public static final DeferredRegister ITEMS = DeferredRegister.create( - ForgeRegistries.ITEMS, - Reference.MOD_ID); + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID); - public static final RegistryObject SOUL_LAVA_BUCKET = ITEMS.register( - "soul_lava_bucket", - () -> new BucketItem( - FluidRegistry.SOULLAVA, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LAVA_BUCKET = ITEMS.register( + "soul_lava_bucket", + () -> new BucketItem( + FluidRegistry.SOULLAVA, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_ATM_BUCKET = ITEMS.register( - "molten_allthemodium_bucket", - () -> new BucketItem( - FluidRegistry.ALLTHEMODIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_VIB_BUCKET = ITEMS.register( - "molten_vibranium_bucket", - () -> new BucketItem( - FluidRegistry.VIBRANIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP))); - public static final RegistryObject MOLTEN_UNOB_BUCKET = ITEMS.register( - "molten_unobtainium_bucket", - () -> new BucketItem( - FluidRegistry.UNOBTAINIUM, - new Item.Properties() - .craftRemainder(Items.BUCKET) - .stacksTo(1) - .tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_ATM_BUCKET = ITEMS.register( + "molten_allthemodium_bucket", + () -> new BucketItem( + FluidRegistry.ALLTHEMODIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_VIB_BUCKET = ITEMS.register( + "molten_vibranium_bucket", + () -> new BucketItem( + FluidRegistry.VIBRANIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); + public static final RegistryObject MOLTEN_UNOB_BUCKET = ITEMS.register( + "molten_unobtainium_bucket", + () -> new BucketItem( + FluidRegistry.UNOBTAINIUM, + new Item.Properties() + .craftRemainder(Items.BUCKET) + .stacksTo(1) + .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_SWORD = ITEMS.register( - "alloy_sword", - () -> new AlloySword( - ToolTiers.ALLOY_TIER, - 35, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register( - "alloy_axe", - () -> new AlloyAxe( - ToolTiers.ALLOY_TIER, - 39, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_PICK = ITEMS.register( - "alloy_pick", - () -> new AlloyPick( - ToolTiers.ALLOY_TIER, - 15, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_SHOVEL = ITEMS.register( - "alloy_shovel", - () -> new AlloyShovel( - ToolTiers.ALLOY_TIER, - 13, - 5.0F, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_ALLOY_PAXEL = ITEMS.register( - "alloy_paxel", - () -> new AlloyPaxel( - 33, - 5.0F, - ToolTiers.ALLOY_TIER, - TagRegistry.PAXEL_TARGETS, - new Item.Properties() - .fireResistant() - .stacksTo(1) - .rarity(Rarity.EPIC) - .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_SWORD = ITEMS.register( + "alloy_sword", + () -> new AlloySword( + ToolTiers.ALLOY_TIER, + 35, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_AXE = ITEMS.register( + "alloy_axe", + () -> new AlloyAxe( + ToolTiers.ALLOY_TIER, + 39, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_PICK = ITEMS.register( + "alloy_pick", + () -> new AlloyPick( + ToolTiers.ALLOY_TIER, + 15, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_SHOVEL = ITEMS.register( + "alloy_shovel", + () -> new AlloyShovel( + ToolTiers.ALLOY_TIER, + 13, + 5.0F, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_ALLOY_PAXEL = ITEMS.register( + "alloy_paxel", + () -> new AlloyPaxel( + 33, + 5.0F, + ToolTiers.ALLOY_TIER, + TagRegistry.PAXEL_TARGETS, + new Item.Properties() + .fireResistant() + .stacksTo(1) + .rarity(Rarity.EPIC) + .tab(AllTheModium.GROUP))); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java index 21462e2d..6c35c92f 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/LevelRegistry.java @@ -9,11 +9,11 @@ public class LevelRegistry { - public static final ResourceKey Mining = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - MINING_DIM_ID); + public static final ResourceKey Mining = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + MINING_DIM_ID); - public static final ResourceKey THE_OTHER = ResourceKey.create( - Registry.DIMENSION_REGISTRY, - THE_OTHER_DIM_ID); + public static final ResourceKey THE_OTHER = ResourceKey.create( + Registry.DIMENSION_REGISTRY, + THE_OTHER_DIM_ID); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java index 44572ba9..fb6051c8 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/MekRegistry.java @@ -10,25 +10,25 @@ public class MekRegistry extends WrappedDeferredRegister { - public MekRegistry(String modid) { - super(modid, MekanismAPI.slurryRegistryName()); - } + public MekRegistry(String modid) { + super(modid, MekanismAPI.slurryRegistryName()); + } - public SlurryRegistryObject register(ATMResource resource) { - return register( - resource.getRegistrySuffix(), - builder -> builder.color(resource.getTint()).ore(resource.getOreTag())); - } + public SlurryRegistryObject register(ATMResource resource) { + return register( + resource.getRegistrySuffix(), + builder -> builder.color(resource.getTint()).ore(resource.getOreTag())); + } - public SlurryRegistryObject register( - String baseName, - UnaryOperator builderModifier) { - return new SlurryRegistryObject<>( - internal.register( - "dirty_" + baseName, - () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty()))), - internal.register( - "clean_" + baseName, - () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())))); - } + public SlurryRegistryObject register( + String baseName, + UnaryOperator builderModifier) { + return new SlurryRegistryObject<>( + internal.register( + "dirty_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.dirty()))), + internal.register( + "clean_" + baseName, + () -> new Slurry(builderModifier.apply(SlurryBuilder.clean())))); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java index 792a84af..86ce47ff 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java @@ -54,1684 +54,1684 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModRegistry { - public static final DeferredRegister SHAPED_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister STAIR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister WALL_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister SLAB_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister PILLAR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Reference.MOD_ID); - public static final DeferredRegister BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, - Reference.MOD_ID); - - public static final DeferredRegister ITEMS = DeferredRegister.create( - ForgeRegistries.ITEMS, - Reference.MOD_ID); - - public static final DeferredRegister> ENTITY = DeferredRegister.create( - ForgeRegistries.BLOCK_ENTITY_TYPES, - Reference.MOD_ID); - public static final DeferredRegister> CARVERS = DeferredRegister.create( - ForgeRegistries.WORLD_CARVERS, - Reference.MOD_ID); - public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, - Reference.MOD_ID); - - public static final DeferredRegister> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, - Reference.MOD_ID); - - // TODO: Add spawn eggs for mobs - // private static ArrayList SPAWN_EGGS = new ArrayList() - - // BIOMES - - RegistryObject MINING = BIOMES.register( - "mining", - () -> ATMBiomes.mining()); - RegistryObject THE_OTHER = BIOMES.register( - "the_other", - () -> ATMBiomes.the_other()); - RegistryObject DESERT = BIOMES.register( - "desert", - () -> ATMBiomes.desert()); - RegistryObject DESERT_HILLS = BIOMES.register( - "desert_hills", - () -> ATMBiomes.desert_hills()); - RegistryObject SOULSAND = BIOMES.register( - "soul_sand_valley", - () -> ATMBiomes.soul_sand_valley()); - RegistryObject WARPED_FOREST = BIOMES.register( - "warped_forest", - () -> ATMBiomes.warped_forest()); - RegistryObject CRIMSON_FOREST = BIOMES.register( - "crimson_forest", - () -> ATMBiomes.crimson_forest()); - RegistryObject BASALT_DELTAS = BIOMES.register( - "basalt_deltas", - () -> ATMBiomes.basalt_deltas()); - - // FOOD - - public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register( - "allthemodium_apple", - () -> new AllthemodiumApple( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - .food(ModFoods.ALLTHEMODIUM_APPLE) - .rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register( - "allthemodium_carrot", - () -> new AllthemodiumCarrot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant() - .food(ModFoods.ALLTHEMODIUM_CARROT) - .rarity(Rarity.EPIC))); - - // ARMORS - - public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register( - "allthemodium_boots", - () -> (ArmorItem) new AllthemodiumBoots( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.FEET, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_LEGGINGS = ITEMS.register( - "allthemodium_leggings", - () -> (ArmorItem) new AllthemodiumLeggings( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.LEGS, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_CHESTPLATE = ITEMS.register( - "allthemodium_chestplate", - () -> (ArmorItem) new AllthemodiumChestplate( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.CHEST, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC))); - public static RegistryObject ALLTHEMODIUM_HELMET = ITEMS.register( - "allthemodium_helmet", - () -> (ArmorItem) new AllthemodiumHelmet( - AArmorMaterial.ALLTHEMODIUM, - EquipmentSlot.HEAD, - new Item.Properties() - .tab(AllTheModium.GROUP) - .stacksTo(1) - .fireResistant() - .rarity(Rarity.EPIC))); - - // Volcano - - public static Feature VOLCANO_F = new Volcano( - VolcanoConfig.CODEC); - public static RegistryObject> VOLCANO = FEATURES.register("volcano", () -> VOLCANO_F); - - public static final RegistryObject ANCIENT_CAVEVINES_ = PILLAR_BLOCKS.register( - "ancient_cavevines", - () -> new AncientCaveVines( - BlockBehaviour.Properties - .of(Material.PLANT) - .randomTicks() - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES), - Direction.DOWN, - ACaveVines.SHAPE, - false, - 0.1D)); - - public static final RegistryObject ANCIENT_CAVEVINES_PLANT_ = PILLAR_BLOCKS.register( - "ancient_cavevines_plant", - () -> new AncientCaveVinesPlant( - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .noOcclusion() - .lightLevel(ACaveVines.emission(14)) - .instabreak() - .sound(SoundType.CAVE_VINES), - Direction.DOWN, - ACaveVines.SHAPE, - false)); - - public static final RegistryObject ANCIENT_HERB = PILLAR_BLOCKS.register( - "ancient_herb", - () -> new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission())); - - public static final RegistryObject ANCIENT_SMOOTH_STONE = BLOCKS.register( - "ancient_smooth_stone", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.STONE) - .strength(2.25f))); - public static final RegistryObject ANCIENT_STONE = BLOCKS.register( - "ancient_stone", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.STONE) - .strength(1.5f))); - public static final RegistryObject ANCIENT_DIRT = BLOCKS.register( - "ancient_dirt", - () -> new AncientDirt( - BlockBehaviour.Properties - .of(Material.DIRT) - .sound(SoundType.WET_GRASS) - .strength(0.6f))); - public static final RegistryObject ANCIENT_GRASS = BLOCKS.register( - "ancient_grass", - () -> new AncientGrass( - BlockBehaviour.Properties - .of(Material.DIRT) - .sound(SoundType.MOSS) - .strength(0.6f))); - public static final RegistryObject ANCIENT_MOSSY_STONE = BLOCKS.register( - "ancient_mossy_stone", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.MOSS_CARPET) - .strength(1.5f))); - public static final RegistryObject ANCIENT_STONE_BRICKS = BLOCKS.register( - "ancient_stone_bricks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.5f))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = BLOCKS.register( - "ancient_chiseled_stone_bricks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.0f))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = BLOCKS.register( - "ancient_cracked_stone_bricks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.NETHER_BRICKS) - .strength(3.25f))); - public static final RegistryObject ANCIENT_POLISHED_STONE = BLOCKS.register( - "ancient_polished_stone", - () -> new Block( - BlockBehaviour.Properties - .of(Material.STONE) - .sound(SoundType.METAL) - .strength(2.5f))); - - public static final RegistryObject ANCIENT_LOG_0 = PILLAR_BLOCKS.register( - "ancient_log_0", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_1 = PILLAR_BLOCKS.register( - "ancient_log_1", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_2 = PILLAR_BLOCKS.register( - "ancient_log_2", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LOG_STRIPPED = PILLAR_BLOCKS.register( - "stripped_ancient_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register( - "ancient_leaves", - () -> new AncientLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_PURPLE))); - public static final RegistryObject ANCIENT_LEAVES_BOTTOM = PILLAR_BLOCKS.register( - "ancient_leaves_bottom", - () -> new AncientLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_PURPLE))); - public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register( - "ancient_planks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_TRAPDOOR = PILLAR_BLOCKS.register( - "ancient_trap_door", - () -> new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion())); - public static final RegistryObject ANCIENT_WOOD_FENCE = PILLAR_BLOCKS.register( - "ancient_wooden_fence", - () -> new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( - "ancient_wooden_fence_gate", - () -> new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject ANCIENT_DOOR_ = PILLAR_BLOCKS.register( - "ancient_door", - () -> new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD))); - - public static final RegistryObject DEMONIC_HERB = PILLAR_BLOCKS.register( - "demonic_herb", - () -> new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission())); - public static final RegistryObject DEMONIC_LOG = PILLAR_BLOCKS.register( - "demonic_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject DEMONIC_LOG_STRIPPED = PILLAR_BLOCKS.register( - "stripped_demonic_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register( - "demonic_leaves", - () -> new DemonicLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_RED))); - public static final RegistryObject DEMONIC_LEAVES_BOTTOM = PILLAR_BLOCKS.register( - "demonic_leaves_bottom", - () -> new DemonicLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_RED))); - public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register( - "demonic_planks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_TRAPDOOR = PILLAR_BLOCKS.register( - "demonic_trap_door", - () -> new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion())); - public static final RegistryObject DEMONIC_WOOD_FENCE = PILLAR_BLOCKS.register( - "demonic_wooden_fence", - () -> new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( - "demonic_wooden_fence_gate", - () -> new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_DOOR_ = PILLAR_BLOCKS.register( - "demonic_door", - () -> new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD))); - - public static final RegistryObject SOUL_HERB = PILLAR_BLOCKS.register( - "soul_herb", - () -> new AncientHerb( - BlockBehaviour.Properties - .of(Material.GRASS) - .sound(SoundType.WET_GRASS) - .instabreak() - .noCollission())); - public static final RegistryObject SOUL_LOG = PILLAR_BLOCKS.register( - "soul_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_0 = PILLAR_BLOCKS.register( - "soul_log_0", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_1 = PILLAR_BLOCKS.register( - "soul_log_1", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_2 = PILLAR_BLOCKS.register( - "soul_log_2", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LOG_STRIPPED = PILLAR_BLOCKS.register( - "stripped_soul_log", - () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); - public static final RegistryObject SOUL_LEAVES = BLOCKS.register( - "soul_leaves", - () -> new SoulLeaves( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noOcclusion() - .color(MaterialColor.COLOR_BLUE))); - public static final RegistryObject SOUL_LEAVES_BOTTOM = PILLAR_BLOCKS.register( - "soul_leaves_bottom", - () -> new SoulLeavesBottom( - BlockBehaviour.Properties - .of(Material.LEAVES) - .strength(0.2F) - .randomTicks() - .sound(SoundType.AZALEA_LEAVES) - .noCollission() - .noOcclusion() - .color(MaterialColor.COLOR_BLUE))); - public static final RegistryObject SOUL_PLANKS = BLOCKS.register( - "soul_planks", - () -> new Block( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - public static final RegistryObject SOUL_TRAPDOOR = PILLAR_BLOCKS.register( - "soul_trap_door", - () -> new TrapDoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.2F) - .randomTicks() - .sound(SoundType.WOOD) - .noOcclusion())); - public static final RegistryObject SOUL_WOOD_FENCE = PILLAR_BLOCKS.register( - "soul_wooden_fence", - () -> new FenceBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject SOUL_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( - "soul_wooden_fence_gate", - () -> new FenceGateBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .dynamicShape() - .sound(SoundType.WOOD))); - public static final RegistryObject SOUL_DOOR_ = PILLAR_BLOCKS.register( - "soul_door", - () -> new DoorBlock( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(2.0F) - .sound(SoundType.WOOD))); - - public static final RegistryObject ANCIENT_STONE_WALL = WALL_BLOCKS.register( - "ancient_stone_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = WALL_BLOCKS.register( - "ancient_smooth_stone_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = WALL_BLOCKS.register( - "ancient_polished_stone_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL = WALL_BLOCKS.register( - "ancient_stone_brick_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL = WALL_BLOCKS.register( - "ancient_chiseled_stone_brick_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy( - ANCIENT_CHISELED_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL = WALL_BLOCKS.register( - "ancient_cracked_stone_brick_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy( - ANCIENT_CRACKED_STONE_BRICKS.get()))); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = WALL_BLOCKS.register( - "ancient_mossy_stone_wall", - () -> new WallBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = ITEMS.register( - "ancient_cavevines_plant", - () -> new BlockItem( - ANCIENT_CAVEVINES_PLANT_.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register( - "ancient_soulberries", - () -> new SoulBerries( - ANCIENT_CAVEVINES_.get(), - (new Item.Properties()).food(ModFoods.SOUL_BERRIES) - .tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = ITEMS.register( - "ancient_trap_door", - () -> new BlockItem( - ANCIENT_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = ITEMS.register( - "demonic_trap_door", - () -> new BlockItem( - DEMONIC_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_TRAP_DOOR_ITEM = ITEMS.register( - "soul_trap_door", - () -> new BlockItem( - SOUL_TRAPDOOR.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register( - "ancient_door", - () -> new BlockItem( - ANCIENT_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register( - "demonic_door", - () -> new BlockItem( - DEMONIC_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register( - "soul_door", - () -> new BlockItem( - SOUL_DOOR_.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_STONE_WALL_ITEM = ITEMS.register( - "ancient_stone_wall", - () -> new BlockItem( - ANCIENT_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = ITEMS.register( - "ancient_smooth_stone_wall", - () -> new BlockItem( - ANCIENT_SMOOTH_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = ITEMS.register( - "ancient_polished_stone_wall", - () -> new BlockItem( - ANCIENT_POLISHED_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = ITEMS.register( - "ancient_stone_brick_wall", - () -> new BlockItem( - ANCIENT_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register( - "ancient_chiseled_stone_brick_wall", - () -> new BlockItem( - ANCIENT_CHISELED_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register( - "ancient_cracked_stone_brick_wall", - () -> new BlockItem( - ANCIENT_CRACKED_STONE_BRICK_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = ITEMS.register( - "ancient_mossy_stone_wall", - () -> new BlockItem( - ANCIENT_MOSSY_STONE_WALL.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_BOOKSHELF = PILLAR_BLOCKS.register( - "ancient_bookshelf", - () -> new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - public static final RegistryObject DEMONIC_BOOKSHELF = PILLAR_BLOCKS.register( - "demonic_bookshelf", - () -> new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - public static final RegistryObject SOUL_BOOKSHELF = PILLAR_BLOCKS.register( - "soul_bookshelf", - () -> new AncientBookShelf( - BlockBehaviour.Properties - .of(Material.NETHER_WOOD) - .strength(0.8F) - .randomTicks() - .sound(SoundType.WOOD))); - - public static final RegistryObject ANCIENT_SAPLING = PILLAR_BLOCKS.register( - "ancient_sapling", - () -> new SaplingBlock( - new AncientTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS))); - public static final RegistryObject DEMONIC_SAPLING = PILLAR_BLOCKS.register( - "demonic_sapling", - () -> new SaplingBlock( - new DemonicTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS))); - public static final RegistryObject SOUL_SAPLING = PILLAR_BLOCKS.register( - "soul_sapling", - () -> new SaplingBlock( - new SoulTreeGrower(), - BlockBehaviour.Properties - .of(Material.PLANT) - .noCollission() - .randomTicks() - .instabreak() - .dynamicShape() - .sound(SoundType.GRASS))); - - public static final RegistryObject ANCIENT_WOODEN_STAIRS = STAIR_BLOCKS.register( - "ancient_wooden_stairs", - () -> new StairBlock( - () -> ANCIENT_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); - public static final RegistryObject DEMONIC_WOODEN_STAIRS = STAIR_BLOCKS.register( - "demonic_wooden_stairs", - () -> new StairBlock( - () -> DEMONIC_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); - public static final RegistryObject SOUL_WOODEN_STAIRS = STAIR_BLOCKS.register( - "soul_wooden_stairs", - () -> new StairBlock( - () -> SOUL_PLANKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); - public static final RegistryObject ANCIENT_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_stone_stairs", - () -> new StairBlock( - () -> ANCIENT_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_smooth_stone_stairs", - () -> new StairBlock( - () -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = STAIR_BLOCKS.register( - "ancient_stone_brick_stairs", - () -> new StairBlock( - () -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_mossy_stone_stairs", - () -> new StairBlock( - () -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_chiseled_stone_brick_stairs", - () -> new StairBlock( - () -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_cracked_stone_brick_stairs", - () -> new StairBlock( - () -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS = STAIR_BLOCKS.register( - "ancient_polished_stone_stairs", - () -> new StairBlock( - () -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - public static final RegistryObject ANCIENT_WOODEN_SLABS = SLAB_BLOCKS.register( - "ancient_wooden_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); - public static final RegistryObject DEMONIC_WOODEN_SLABS = SLAB_BLOCKS.register( - "demonic_wooden_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); - public static final RegistryObject SOUL_WOODEN_SLABS = SLAB_BLOCKS.register( - "soul_wooden_slabs", - () -> new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); - public static final RegistryObject ANCIENT_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_stone_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_smooth_stone_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = SLAB_BLOCKS.register( - "ancient_stone_brick_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_mossy_stone_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_chiseled_stone_brick_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_cracked_stone_brick_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = SLAB_BLOCKS.register( - "ancient_polished_stone_slabs", - () -> new SlabBlock( - BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); - - public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = ITEMS.register( - "ancient_wooden_slabs", - () -> new BlockItem( - ANCIENT_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = ITEMS.register( - "demonic_wooden_slabs", - () -> new BlockItem( - DEMONIC_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = ITEMS.register( - "soul_wooden_slabs", - () -> new BlockItem( - SOUL_WOODEN_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = ITEMS.register( - "ancient_stone_slabs", - () -> new BlockItem( - ANCIENT_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = ITEMS.register( - "ancient_smooth_stone_slabs", - () -> new BlockItem( - ANCIENT_SMOOTH_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = ITEMS.register( - "ancient_stone_brick_slabs", - () -> new BlockItem( - ANCIENT_STONE_BRICK_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = ITEMS.register( - "ancient_mossy_stone_slabs", - () -> new BlockItem( - ANCIENT_MOSSY_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = ITEMS.register( - "ancient_chiseled_stone_brick_slabs", - () -> new BlockItem( - ANCIENT_CHISELED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = ITEMS.register( - "ancient_cracked_stone_brick_slabs", - () -> new BlockItem( - ANCIENT_CRACKED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = ITEMS.register( - "ancient_polished_stone_slabs", - () -> new BlockItem( - ANCIENT_POLISHED_STONE_SLABS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register( - "ancient_herb", - () -> new BlockItem( - ANCIENT_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register( - "demonic_herb", - () -> new BlockItem( - DEMONIC_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register( - "soul_herb", - () -> new BlockItem( - SOUL_HERB.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_LOG_0_ITEM = ITEMS.register( - "ancient_log_0", - () -> new BlockItem( - ANCIENT_LOG_0.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_1_ITEM = ITEMS.register( - "ancient_log_1", - () -> new BlockItem( - ANCIENT_LOG_1.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_2_ITEM = ITEMS.register( - "ancient_log_2", - () -> new BlockItem( - ANCIENT_LOG_2.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = ITEMS.register( - "stripped_ancient_log", - () -> new BlockItem( - ANCIENT_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_LEAVES_ITEM = ITEMS.register( - "ancient_leaves", - () -> new BlockItem( - ANCIENT_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_PLANKS_ITEM = ITEMS.register( - "ancient_planks", - () -> new BlockItem( - ANCIENT_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = ITEMS.register( - "ancient_bookshelf", - () -> new BlockItem( - ANCIENT_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SAPLING_ITEM = ITEMS.register( - "ancient_sapling", - () -> new BlockItem( - ANCIENT_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register( - "soul_log", - () -> new BlockItem( - SOUL_LOG.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register( - "soul_log_0", - () -> new BlockItem( - SOUL_LOG_0.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register( - "soul_log_1", - () -> new BlockItem( - SOUL_LOG_1.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register( - "soul_log_2", - () -> new BlockItem( - SOUL_LOG_2.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = ITEMS.register( - "stripped_soul_log", - () -> new BlockItem( - SOUL_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register( - "soul_leaves", - () -> new BlockItem( - SOUL_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register( - "soul_planks", - () -> new BlockItem( - SOUL_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_BOOKSHELF_ITEM = ITEMS.register( - "soul_bookshelf", - () -> new BlockItem( - SOUL_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register( - "soul_sapling", - () -> new BlockItem( - SOUL_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register( - "demonic_log", - () -> new BlockItem( - DEMONIC_LOG.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = ITEMS.register( - "stripped_demonic_log", - () -> new BlockItem( - DEMONIC_LOG_STRIPPED.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_LEAVES_ITEM = ITEMS.register( - "demonic_leaves", - () -> new BlockItem( - DEMONIC_LEAVES.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_PLANKS_ITEM = ITEMS.register( - "demonic_planks", - () -> new BlockItem( - DEMONIC_PLANKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = ITEMS.register( - "demonic_bookshelf", - () -> new BlockItem( - DEMONIC_BOOKSHELF.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_SAPLING_ITEM = ITEMS.register( - "demonic_sapling", - () -> new BlockItem( - DEMONIC_SAPLING.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = ITEMS.register( - "ancient_wooden_stairs", - () -> new BlockItem( - ANCIENT_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = ITEMS.register( - "demonic_wooden_stairs", - () -> new BlockItem( - DEMONIC_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = ITEMS.register( - "soul_wooden_stairs", - () -> new BlockItem( - SOUL_WOODEN_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_stone_stairs", - () -> new BlockItem( - ANCIENT_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_smooth_stone_stairs", - () -> new BlockItem( - ANCIENT_SMOOTH_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = ITEMS.register( - "ancient_stone_brick_stairs", - () -> new BlockItem( - ANCIENT_STONE_BRICK_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_mossy_stone_stairs", - () -> new BlockItem( - ANCIENT_MOSSY_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_chiseled_stone_brick_stairs", - () -> new BlockItem( - ANCIENT_CHISELED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_cracked_stone_brick_stairs", - () -> new BlockItem( - ANCIENT_CRACKED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register( - "ancient_polished_stone_stairs", - () -> new BlockItem( - ANCIENT_POLISHED_STONE_STAIRS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = ITEMS.register( - "ancient_wooden_fence", - () -> new BlockItem( - ANCIENT_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = ITEMS.register( - "ancient_wooden_fence_gate", - () -> new BlockItem( - ANCIENT_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = ITEMS.register( - "demonic_wooden_fence", - () -> new BlockItem( - DEMONIC_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = ITEMS.register( - "demonic_wooden_fence_gate", - () -> new BlockItem( - DEMONIC_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOOD_FENCE_ITEM = ITEMS.register( - "soul_wooden_fence", - () -> new BlockItem( - SOUL_WOOD_FENCE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = ITEMS.register( - "soul_wooden_fence_gate", - () -> new BlockItem( - SOUL_WOOD_FENCE_GATE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = ITEMS.register( - "ancient_smooth_stone", - () -> new BlockItem( - ANCIENT_SMOOTH_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_ITEM = ITEMS.register( - "ancient_stone", - () -> new BlockItem( - ANCIENT_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register( - "ancient_dirt", - () -> new BlockItem( - ANCIENT_DIRT.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_GRASS_ITEM = ITEMS.register( - "ancient_grass", - () -> new BlockItem( - ANCIENT_GRASS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = ITEMS.register( - "ancient_mossy_stone", - () -> new BlockItem( - ANCIENT_MOSSY_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = ITEMS.register( - "ancient_stone_bricks", - () -> new BlockItem( - ANCIENT_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register( - "ancient_chiseled_stone_bricks", - () -> new BlockItem( - ANCIENT_CHISELED_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = ITEMS.register( - "ancient_cracked_stone_bricks", - () -> new BlockItem( - ANCIENT_CRACKED_STONE_BRICKS.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = ITEMS.register( - "ancient_polished_stone", - () -> new BlockItem( - ANCIENT_POLISHED_STONE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_ORE = BLOCKS.register("allthemodium_ore", - AllthemodiumOre::new); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = BLOCKS - .register("allthemodium_slate_ore", AllthemodiumOre::new); - - public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register( - "vibranium_ore", - VibraniumOre::new); - public static final RegistryObject OTHER_VIBRANIUM_ORE = BLOCKS.register("other_vibranium_ore", - VibraniumOre::new); - public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register( - "unobtainium_ore", - UnobtainiumOre::new); - - public static final RegistryObject ALLTHEMODIUM_BLOCK = BLOCKS.register("allthemodium_block", - AllthemodiumBlock::new); - public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register( - "vibranium_block", - VibraniumBlock::new); - public static final RegistryObject UNOBTAINIUM_BLOCK = BLOCKS.register("unobtainium_block", - UnobtainiumBlock::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = BLOCKS.register("raw_allthemodium_block", - RawATM::new); - public static final RegistryObject RAW_VIBRANIUM_BLOCK = BLOCKS.register("raw_vibranium_block", RawVIB::new); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = BLOCKS.register("raw_unobtainium_block", - RawUNO::new); - - public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( - "raw_allthemodium_block", - () -> new BlockItem( - RAW_ALLTHEMODIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = ITEMS.register( - "raw_vibranium_block", - () -> new BlockItem( - RAW_VIBRANIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( - "raw_unobtainium_block", - () -> new BlockItem( - RAW_UNOBTAINIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = ITEMS.register( - "allthemodium_ore", - () -> new AllthemodiumOreItem( - ALLTHEMODIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = ITEMS.register( - "allthemodium_slate_ore", - () -> new AllthemodiumOreItem( - ALLTHEMODIUM_SLATE_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject VIBRANIUM_ORE_ITEM = ITEMS.register( - "vibranium_ore", - () -> new Vibranium_Ore_Item( - VIBRANIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = ITEMS.register( - "other_vibranium_ore", - () -> new Vibranium_Ore_Item( - OTHER_VIBRANIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_ORE_ITEM = ITEMS.register( - "unobtainium_ore", - () -> new UnobtainiumOreItem( - UNOBTAINIUM_ORE.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( - "allthemodium_block", - () -> new BlockItem( - ALLTHEMODIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_BLOCK_ITEM = ITEMS.register( - "vibranium_block", - () -> new BlockItem( - VIBRANIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( - "unobtainium_block", - () -> new BlockItem( - UNOBTAINIUM_BLOCK.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register( - "raw_allthemodium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_VIBRANIUM = ITEMS.register( - "raw_vibranium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register( - "raw_unobtainium", - () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_INGOT = ITEMS.register( - "allthemodium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register( - "vibranium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register( - "unobtainium_ingot", - () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject ATM_PLATE = ITEMS.register( - "allthemodium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_PLATE = ITEMS.register( - "vibranium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_PLATE = ITEMS.register( - "unobtainium_plate", - () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_GEAR = ITEMS.register( - "allthemodium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_GEAR = ITEMS.register( - "vibranium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_GEAR = ITEMS.register( - "unobtainium_gear", - () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_ROD = ITEMS.register( - "allthemodium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_ROD = ITEMS.register( - "vibranium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_ROD = ITEMS.register( - "unobtainium_rod", - () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_NUGGET = ITEMS.register( - "allthemodium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register( - "vibranium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_NUGGET = ITEMS.register( - "unobtainium_nugget", - () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register( - "allthemodium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIBRANIUM_DUST = ITEMS.register( - "vibranium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register( - "unobtainium_dust", - () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_CLUMP = ITEMS.register( - "allthemodium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_CLUMP = ITEMS.register( - "vibranium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_CLUMP = ITEMS.register( - "unobtainium_clump", - () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_SHARD = ITEMS.register( - "allthemodium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_SHARD = ITEMS.register( - "vibranium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_SHARD = ITEMS.register( - "unobtainium_shard", - () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_DIRTY = ITEMS.register( - "dirty_allthemodium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_DIRTY = ITEMS.register( - "dirty_vibranium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_DIRTY = ITEMS.register( - "dirty_unobtainium_dust", - () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ATM_CRYSTAL = ITEMS.register( - "allthemodium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VIB_CRYSTAL = ITEMS.register( - "vibranium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UNOB_CRYSTAL = ITEMS.register( - "unobtainium_crystal", - () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = ITEMS.register( - "unobtainium_allthemodium_alloy_dust", - () -> new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = ITEMS.register( - "unobtainium_vibranium_alloy_dust", - () -> new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = ITEMS.register( - "vibranium_allthemodium_alloy_dust", - () -> new AlloyDust( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - - public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( - "unobtainium_allthemodium_alloy_ingot", - () -> new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = ITEMS.register( - "unobtainium_vibranium_alloy_ingot", - () -> new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( - "vibranium_allthemodium_alloy_ingot", - () -> new AlloyIngot( - new Item.Properties() - .tab(AllTheModium.GROUP) - .fireResistant())); - - public static final RegistryObject TELEPORT_PAD = SHAPED_BLOCKS.register( - "teleport_pad", - () -> new TeleportPad( - Block.Properties - .of(Material.METAL) - .noLootTable() - .noOcclusion() - .strength(20.0F))); - public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register( - "teleport_pad", - () -> new BlockItem( - TELEPORT_PAD.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject ALLTHEMODIUM_SWORD = ITEMS.register( - "allthemodium_sword", - () -> new SwordItem( - ToolTiers.ALLTHEMODIUM_TIER, - 4, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC)) { - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - }); - - public static final RegistryObject ALLTHEMODIUM_PICKAXE = ITEMS.register( - "allthemodium_pickaxe", - () -> new PickaxeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 2, - 1.0f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_AXE = ITEMS.register( - "allthemodium_axe", - () -> new AxeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 6, - 1.0f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_AXE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_SHOVEL = ITEMS.register( - "allthemodium_shovel", - () -> new ShovelItem( - ToolTiers.ALLTHEMODIUM_TIER, - 1, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - return false; - } - }); - - public static final RegistryObject ALLTHEMODIUM_HOE = ITEMS.register( - "allthemodium_hoe", - () -> new HoeItem( - ToolTiers.ALLTHEMODIUM_TIER, - 0, - 1.5f, - new Item.Properties() - .fireResistant() - .tab(AllTheModium.GROUP) - .rarity(Rarity.EPIC)) { - @Override - public float getDestroySpeed( - @Nonnull ItemStack stack, - @Nonnull BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return speed; - return super.getDestroySpeed(stack, state); - } - - @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { - return true; - } - - @Override - public boolean canBeDepleted() { - return false; - } - - @Override - public void appendHoverText( - @Nonnull ItemStack stack, - @Nullable Level worldIn, - @Nonnull List tooltip, - @Nonnull TooltipFlag flagIn) { - tooltip.add( - TextComponentHelper - .createComponentTranslation( - CommandSource.NULL, - "indestructible", - new Object()) - .withStyle(ChatFormatting.GOLD)); - - super.appendHoverText(stack, worldIn, tooltip, flagIn); - } - - @Override - public boolean isCorrectToolForDrops( - ItemStack stack, - BlockState state) { - if (state.is(BlockTags.MINEABLE_WITH_HOE)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) - return TierSortingRegistry.isCorrectTierForDrops( - ToolTiers.ALLTHEMODIUM_TIER, - state); - return false; - } - }); - - public static final RegistryObject UA_ALLOY = BLOCKS.register( - "unobtainium_allthemodium_alloy_block", - UAAlloyBlock::new); - public static final RegistryObject UV_ALLOY = BLOCKS.register( - "unobtainium_vibranium_alloy_block", - UVAlloyBlock::new); - public static final RegistryObject VA_ALLOY = BLOCKS.register( - "vibranium_allthemodium_alloy_block", - VAAlloyBlock::new); - - public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register( - "unobtainium_allthemodium_alloy_block", - () -> new BlockItem( - UA_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register( - "unobtainium_vibranium_alloy_block", - () -> new BlockItem( - UV_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register( - "vibranium_allthemodium_alloy_block", - () -> new BlockItem( - VA_ALLOY.get(), - new Item.Properties().tab(AllTheModium.GROUP))); - - public static final RegistryObject PIGLICH_HEART = ITEMS.register( - "piglich_heart", - () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP))); - public static final RegistryObject> PIGLICH = createMonsterEntity( - "piglich", - PiglichEntity::new, - 0.6F, - 3.0F, - 0x000000, - 0xebe834); - - private static RegistryObject> createMonsterEntity( - String name, - EntityType.EntityFactory factory, - float width, - float height, - int eggPrimary, - int eggSecondary) { - ResourceLocation location = new ResourceLocation( - Reference.MOD_ID, - name); - - return ENTITIES.register( - name, - () -> EntityType.Builder - .of(factory, MobCategory.MONSTER) - .sized(width, height) - .setTrackingRange(64) - .setUpdateInterval(1) - .build(location.toString())); - // EntityType entity = EntityType.Builder.of(factory, - // MobCategory.MONSTER).sized(width, - // height) - // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, - // (new Item.Properties()).tab(AllTheModium.GROUP)); - // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + - // "_spawn_egg")); - // SPAWN_EGGS.add(spawnEgg); - - // return ENTITIES.register(name, () -> entity); - } - - // private static RegistryObject> createShulkerEntity(String name, - // EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { - // ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); - // EntityType entity = EntityType.Builder.of(factory, - // MobCategory.MONSTER).sized(width, - // height) - // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); - // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, - // (new Item.Properties()).tab(AllTheModium.GROUP)); - // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + - // "_spawn_egg")); - // SPAWN_EGGS.add(spawnEgg); - - // return ENTITIES.register(name, () -> entity); - // } - - @SubscribeEvent - public static void addEntityAttributes(EntityAttributeCreationEvent event) { - event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); - // event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); - } - - private static RotatedPillarBlock log( - MaterialColor color1, - MaterialColor color2) { - return new RotatedPillarBlock( - BlockBehaviour.Properties - .of( - Material.NETHER_WOOD, - woodLog -> { - return (woodLog.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y) - ? color1 - : color2; - }) - .strength(2.0F) - .sound(SoundType.WOOD)); - } + public static final DeferredRegister SHAPED_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister STAIR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister WALL_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister SLAB_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister PILLAR_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, + Reference.MOD_ID); + public static final DeferredRegister BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, + Reference.MOD_ID); + + public static final DeferredRegister ITEMS = DeferredRegister.create( + ForgeRegistries.ITEMS, + Reference.MOD_ID); + + public static final DeferredRegister> ENTITY = DeferredRegister.create( + ForgeRegistries.BLOCK_ENTITY_TYPES, + Reference.MOD_ID); + public static final DeferredRegister> CARVERS = DeferredRegister.create( + ForgeRegistries.WORLD_CARVERS, + Reference.MOD_ID); + public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, + Reference.MOD_ID); + + public static final DeferredRegister> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, + Reference.MOD_ID); + + // TODO: Add spawn eggs for mobs + // private static ArrayList SPAWN_EGGS = new ArrayList() + + // BIOMES + + RegistryObject MINING = BIOMES.register( + "mining", + () -> ATMBiomes.mining()); + RegistryObject THE_OTHER = BIOMES.register( + "the_other", + () -> ATMBiomes.the_other()); + RegistryObject DESERT = BIOMES.register( + "desert", + () -> ATMBiomes.desert()); + RegistryObject DESERT_HILLS = BIOMES.register( + "desert_hills", + () -> ATMBiomes.desert_hills()); + RegistryObject SOULSAND = BIOMES.register( + "soul_sand_valley", + () -> ATMBiomes.soul_sand_valley()); + RegistryObject WARPED_FOREST = BIOMES.register( + "warped_forest", + () -> ATMBiomes.warped_forest()); + RegistryObject CRIMSON_FOREST = BIOMES.register( + "crimson_forest", + () -> ATMBiomes.crimson_forest()); + RegistryObject BASALT_DELTAS = BIOMES.register( + "basalt_deltas", + () -> ATMBiomes.basalt_deltas()); + + // FOOD + + public static RegistryObject ALLTHEMODIUM_APPLE = ITEMS.register( + "allthemodium_apple", + () -> new AllthemodiumApple( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_APPLE) + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_CARROT = ITEMS.register( + "allthemodium_carrot", + () -> new AllthemodiumCarrot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant() + .food(ModFoods.ALLTHEMODIUM_CARROT) + .rarity(Rarity.EPIC))); + + // ARMORS + + public static RegistryObject ALLTHEMODIUM_BOOTS = ITEMS.register( + "allthemodium_boots", + () -> (ArmorItem) new AllthemodiumBoots( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.FEET, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_LEGGINGS = ITEMS.register( + "allthemodium_leggings", + () -> (ArmorItem) new AllthemodiumLeggings( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.LEGS, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_CHESTPLATE = ITEMS.register( + "allthemodium_chestplate", + () -> (ArmorItem) new AllthemodiumChestplate( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.CHEST, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + public static RegistryObject ALLTHEMODIUM_HELMET = ITEMS.register( + "allthemodium_helmet", + () -> (ArmorItem) new AllthemodiumHelmet( + AArmorMaterial.ALLTHEMODIUM, + EquipmentSlot.HEAD, + new Item.Properties() + .tab(AllTheModium.GROUP) + .stacksTo(1) + .fireResistant() + .rarity(Rarity.EPIC))); + + // Volcano + + public static Feature VOLCANO_F = new Volcano( + VolcanoConfig.CODEC); + public static RegistryObject> VOLCANO = FEATURES.register("volcano", () -> VOLCANO_F); + + public static final RegistryObject ANCIENT_CAVEVINES_ = PILLAR_BLOCKS.register( + "ancient_cavevines", + () -> new AncientCaveVines( + BlockBehaviour.Properties + .of(Material.PLANT) + .randomTicks() + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false, + 0.1D)); + + public static final RegistryObject ANCIENT_CAVEVINES_PLANT_ = PILLAR_BLOCKS.register( + "ancient_cavevines_plant", + () -> new AncientCaveVinesPlant( + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .noOcclusion() + .lightLevel(ACaveVines.emission(14)) + .instabreak() + .sound(SoundType.CAVE_VINES), + Direction.DOWN, + ACaveVines.SHAPE, + false)); + + public static final RegistryObject ANCIENT_HERB = PILLAR_BLOCKS.register( + "ancient_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + + public static final RegistryObject ANCIENT_SMOOTH_STONE = BLOCKS.register( + "ancient_smooth_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(2.25f))); + public static final RegistryObject ANCIENT_STONE = BLOCKS.register( + "ancient_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.STONE) + .strength(1.5f))); + public static final RegistryObject ANCIENT_DIRT = BLOCKS.register( + "ancient_dirt", + () -> new AncientDirt( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.WET_GRASS) + .strength(0.6f))); + public static final RegistryObject ANCIENT_GRASS = BLOCKS.register( + "ancient_grass", + () -> new AncientGrass( + BlockBehaviour.Properties + .of(Material.DIRT) + .sound(SoundType.MOSS) + .strength(0.6f))); + public static final RegistryObject ANCIENT_MOSSY_STONE = BLOCKS.register( + "ancient_mossy_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.MOSS_CARPET) + .strength(1.5f))); + public static final RegistryObject ANCIENT_STONE_BRICKS = BLOCKS.register( + "ancient_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.5f))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS = BLOCKS.register( + "ancient_chiseled_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.0f))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS = BLOCKS.register( + "ancient_cracked_stone_bricks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.NETHER_BRICKS) + .strength(3.25f))); + public static final RegistryObject ANCIENT_POLISHED_STONE = BLOCKS.register( + "ancient_polished_stone", + () -> new Block( + BlockBehaviour.Properties + .of(Material.STONE) + .sound(SoundType.METAL) + .strength(2.5f))); + + public static final RegistryObject ANCIENT_LOG_0 = PILLAR_BLOCKS.register( + "ancient_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_1 = PILLAR_BLOCKS.register( + "ancient_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_2 = PILLAR_BLOCKS.register( + "ancient_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_ancient_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject ANCIENT_LEAVES = BLOCKS.register( + "ancient_leaves", + () -> new AncientLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE))); + public static final RegistryObject ANCIENT_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "ancient_leaves_bottom", + () -> new AncientLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_PURPLE))); + public static final RegistryObject ANCIENT_PLANKS = BLOCKS.register( + "ancient_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_TRAPDOOR = PILLAR_BLOCKS.register( + "ancient_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject ANCIENT_WOOD_FENCE = PILLAR_BLOCKS.register( + "ancient_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "ancient_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject ANCIENT_DOOR_ = PILLAR_BLOCKS.register( + "ancient_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject DEMONIC_HERB = PILLAR_BLOCKS.register( + "demonic_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + public static final RegistryObject DEMONIC_LOG = PILLAR_BLOCKS.register( + "demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject DEMONIC_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_demonic_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject DEMONIC_LEAVES = BLOCKS.register( + "demonic_leaves", + () -> new DemonicLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_RED))); + public static final RegistryObject DEMONIC_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "demonic_leaves_bottom", + () -> new DemonicLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_RED))); + public static final RegistryObject DEMONIC_PLANKS = BLOCKS.register( + "demonic_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_TRAPDOOR = PILLAR_BLOCKS.register( + "demonic_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject DEMONIC_WOOD_FENCE = PILLAR_BLOCKS.register( + "demonic_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "demonic_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_DOOR_ = PILLAR_BLOCKS.register( + "demonic_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject SOUL_HERB = PILLAR_BLOCKS.register( + "soul_herb", + () -> new AncientHerb( + BlockBehaviour.Properties + .of(Material.GRASS) + .sound(SoundType.WET_GRASS) + .instabreak() + .noCollission())); + public static final RegistryObject SOUL_LOG = PILLAR_BLOCKS.register( + "soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_0 = PILLAR_BLOCKS.register( + "soul_log_0", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_1 = PILLAR_BLOCKS.register( + "soul_log_1", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_2 = PILLAR_BLOCKS.register( + "soul_log_2", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LOG_STRIPPED = PILLAR_BLOCKS.register( + "stripped_soul_log", + () -> log(MaterialColor.WOOD, MaterialColor.WOOD)); + public static final RegistryObject SOUL_LEAVES = BLOCKS.register( + "soul_leaves", + () -> new SoulLeaves( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noOcclusion() + .color(MaterialColor.COLOR_BLUE))); + public static final RegistryObject SOUL_LEAVES_BOTTOM = PILLAR_BLOCKS.register( + "soul_leaves_bottom", + () -> new SoulLeavesBottom( + BlockBehaviour.Properties + .of(Material.LEAVES) + .strength(0.2F) + .randomTicks() + .sound(SoundType.AZALEA_LEAVES) + .noCollission() + .noOcclusion() + .color(MaterialColor.COLOR_BLUE))); + public static final RegistryObject SOUL_PLANKS = BLOCKS.register( + "soul_planks", + () -> new Block( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_TRAPDOOR = PILLAR_BLOCKS.register( + "soul_trap_door", + () -> new TrapDoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.2F) + .randomTicks() + .sound(SoundType.WOOD) + .noOcclusion())); + public static final RegistryObject SOUL_WOOD_FENCE = PILLAR_BLOCKS.register( + "soul_wooden_fence", + () -> new FenceBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_WOOD_FENCE_GATE = PILLAR_BLOCKS.register( + "soul_wooden_fence_gate", + () -> new FenceGateBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .dynamicShape() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_DOOR_ = PILLAR_BLOCKS.register( + "soul_door", + () -> new DoorBlock( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(2.0F) + .sound(SoundType.WOOD))); + + public static final RegistryObject ANCIENT_STONE_WALL = WALL_BLOCKS.register( + "ancient_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL = WALL_BLOCKS.register( + "ancient_smooth_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL = WALL_BLOCKS.register( + "ancient_polished_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_POLISHED_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_chiseled_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CHISELED_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL = WALL_BLOCKS.register( + "ancient_cracked_stone_brick_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy( + ANCIENT_CRACKED_STONE_BRICKS.get()))); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL = WALL_BLOCKS.register( + "ancient_mossy_stone_wall", + () -> new WallBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_CAVEVINE_PLANT_ITEM = ITEMS.register( + "ancient_cavevines_plant", + () -> new BlockItem( + ANCIENT_CAVEVINES_PLANT_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SOULBERRY = ITEMS.register( + "ancient_soulberries", + () -> new SoulBerries( + ANCIENT_CAVEVINES_.get(), + (new Item.Properties()).food(ModFoods.SOUL_BERRIES) + .tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_TRAP_DOOR_ITEM = ITEMS.register( + "ancient_trap_door", + () -> new BlockItem( + ANCIENT_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_TRAP_DOOR_ITEM = ITEMS.register( + "demonic_trap_door", + () -> new BlockItem( + DEMONIC_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_TRAP_DOOR_ITEM = ITEMS.register( + "soul_trap_door", + () -> new BlockItem( + SOUL_TRAPDOOR.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_DOOR_ITEM = ITEMS.register( + "ancient_door", + () -> new BlockItem( + ANCIENT_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_DOOR_ITEM = ITEMS.register( + "demonic_door", + () -> new BlockItem( + DEMONIC_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_DOOR_ITEM = ITEMS.register( + "soul_door", + () -> new BlockItem( + SOUL_DOOR_.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_STONE_WALL_ITEM = ITEMS.register( + "ancient_stone_wall", + () -> new BlockItem( + ANCIENT_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_WALL_ITEM = ITEMS.register( + "ancient_smooth_stone_wall", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_WALL_ITEM = ITEMS.register( + "ancient_polished_stone_wall", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_stone_brick_wall", + () -> new BlockItem( + ANCIENT_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_wall", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICK_WALL_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_wall", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_BRICK_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_WALL_ITEM = ITEMS.register( + "ancient_mossy_stone_wall", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_WALL.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_BOOKSHELF = PILLAR_BLOCKS.register( + "ancient_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject DEMONIC_BOOKSHELF = PILLAR_BLOCKS.register( + "demonic_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + public static final RegistryObject SOUL_BOOKSHELF = PILLAR_BLOCKS.register( + "soul_bookshelf", + () -> new AncientBookShelf( + BlockBehaviour.Properties + .of(Material.NETHER_WOOD) + .strength(0.8F) + .randomTicks() + .sound(SoundType.WOOD))); + + public static final RegistryObject ANCIENT_SAPLING = PILLAR_BLOCKS.register( + "ancient_sapling", + () -> new SaplingBlock( + new AncientTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + public static final RegistryObject DEMONIC_SAPLING = PILLAR_BLOCKS.register( + "demonic_sapling", + () -> new SaplingBlock( + new DemonicTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + public static final RegistryObject SOUL_SAPLING = PILLAR_BLOCKS.register( + "soul_sapling", + () -> new SaplingBlock( + new SoulTreeGrower(), + BlockBehaviour.Properties + .of(Material.PLANT) + .noCollission() + .randomTicks() + .instabreak() + .dynamicShape() + .sound(SoundType.GRASS))); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS = STAIR_BLOCKS.register( + "ancient_wooden_stairs", + () -> new StairBlock( + () -> ANCIENT_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); + public static final RegistryObject DEMONIC_WOODEN_STAIRS = STAIR_BLOCKS.register( + "demonic_wooden_stairs", + () -> new StairBlock( + () -> DEMONIC_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); + public static final RegistryObject SOUL_WOODEN_STAIRS = STAIR_BLOCKS.register( + "soul_wooden_stairs", + () -> new StairBlock( + () -> SOUL_PLANKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); + public static final RegistryObject ANCIENT_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_smooth_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_SMOOTH_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS = STAIR_BLOCKS.register( + "ancient_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_mossy_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_MOSSY_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_chiseled_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_CHISELED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_cracked_stone_brick_stairs", + () -> new StairBlock( + () -> ANCIENT_CRACKED_STONE_BRICKS.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS = STAIR_BLOCKS.register( + "ancient_polished_stone_stairs", + () -> new StairBlock( + () -> ANCIENT_POLISHED_STONE.get().defaultBlockState(), + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_WOODEN_SLABS = SLAB_BLOCKS.register( + "ancient_wooden_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_PLANKS.get()))); + public static final RegistryObject DEMONIC_WOODEN_SLABS = SLAB_BLOCKS.register( + "demonic_wooden_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(DEMONIC_PLANKS.get()))); + public static final RegistryObject SOUL_WOODEN_SLABS = SLAB_BLOCKS.register( + "soul_wooden_slabs", + () -> new SlabBlock(BlockBehaviour.Properties.copy(SOUL_PLANKS.get()))); + public static final RegistryObject ANCIENT_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_smooth_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_SMOOTH_STONE.get()))); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS = SLAB_BLOCKS.register( + "ancient_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_STONE.get()))); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_mossy_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_chiseled_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_cracked_stone_brick_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS = SLAB_BLOCKS.register( + "ancient_polished_stone_slabs", + () -> new SlabBlock( + BlockBehaviour.Properties.copy(ANCIENT_MOSSY_STONE.get()))); + + public static final RegistryObject ANCIENT_WOODEN_SLABS_ITEM = ITEMS.register( + "ancient_wooden_slabs", + () -> new BlockItem( + ANCIENT_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOODEN_SLABS_ITEM = ITEMS.register( + "demonic_wooden_slabs", + () -> new BlockItem( + DEMONIC_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOODEN_SLABS_ITEM = ITEMS.register( + "soul_wooden_slabs", + () -> new BlockItem( + SOUL_WOODEN_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_SLABS_ITEM = ITEMS.register( + "ancient_stone_slabs", + () -> new BlockItem( + ANCIENT_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_SLABS_ITEM = ITEMS.register( + "ancient_smooth_stone_slabs", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_SLABS_ITEM = ITEMS.register( + "ancient_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_STONE_BRICK_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_SLABS_ITEM = ITEMS.register( + "ancient_mossy_stone_slabs", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_slabs", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_SLABS_ITEM = ITEMS.register( + "ancient_polished_stone_slabs", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_SLABS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_HERB_ITEM = ITEMS.register( + "ancient_herb", + () -> new BlockItem( + ANCIENT_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_HERB_ITEM = ITEMS.register( + "demonic_herb", + () -> new BlockItem( + DEMONIC_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_HERB_ITEM = ITEMS.register( + "soul_herb", + () -> new BlockItem( + SOUL_HERB.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_LOG_0_ITEM = ITEMS.register( + "ancient_log_0", + () -> new BlockItem( + ANCIENT_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_1_ITEM = ITEMS.register( + "ancient_log_1", + () -> new BlockItem( + ANCIENT_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_2_ITEM = ITEMS.register( + "ancient_log_2", + () -> new BlockItem( + ANCIENT_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_ancient_log", + () -> new BlockItem( + ANCIENT_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_LEAVES_ITEM = ITEMS.register( + "ancient_leaves", + () -> new BlockItem( + ANCIENT_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_PLANKS_ITEM = ITEMS.register( + "ancient_planks", + () -> new BlockItem( + ANCIENT_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_BOOKSHELF_ITEM = ITEMS.register( + "ancient_bookshelf", + () -> new BlockItem( + ANCIENT_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SAPLING_ITEM = ITEMS.register( + "ancient_sapling", + () -> new BlockItem( + ANCIENT_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject SOUL_LOG_ITEM = ITEMS.register( + "soul_log", + () -> new BlockItem( + SOUL_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_0_ITEM = ITEMS.register( + "soul_log_0", + () -> new BlockItem( + SOUL_LOG_0.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_1_ITEM = ITEMS.register( + "soul_log_1", + () -> new BlockItem( + SOUL_LOG_1.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_2_ITEM = ITEMS.register( + "soul_log_2", + () -> new BlockItem( + SOUL_LOG_2.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_soul_log", + () -> new BlockItem( + SOUL_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_LEAVES_ITEM = ITEMS.register( + "soul_leaves", + () -> new BlockItem( + SOUL_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_PLANKS_ITEM = ITEMS.register( + "soul_planks", + () -> new BlockItem( + SOUL_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_BOOKSHELF_ITEM = ITEMS.register( + "soul_bookshelf", + () -> new BlockItem( + SOUL_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_SAPLING_ITEM = ITEMS.register( + "soul_sapling", + () -> new BlockItem( + SOUL_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject DEMONIC_LOG_ITEM = ITEMS.register( + "demonic_log", + () -> new BlockItem( + DEMONIC_LOG.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_LOG_STRIPPED_ITEM = ITEMS.register( + "stripped_demonic_log", + () -> new BlockItem( + DEMONIC_LOG_STRIPPED.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_LEAVES_ITEM = ITEMS.register( + "demonic_leaves", + () -> new BlockItem( + DEMONIC_LEAVES.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_PLANKS_ITEM = ITEMS.register( + "demonic_planks", + () -> new BlockItem( + DEMONIC_PLANKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_BOOKSHELF_ITEM = ITEMS.register( + "demonic_bookshelf", + () -> new BlockItem( + DEMONIC_BOOKSHELF.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_SAPLING_ITEM = ITEMS.register( + "demonic_sapling", + () -> new BlockItem( + DEMONIC_SAPLING.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_WOODEN_STAIRS_ITEM = ITEMS.register( + "ancient_wooden_stairs", + () -> new BlockItem( + ANCIENT_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOODEN_STAIRS_ITEM = ITEMS.register( + "demonic_wooden_stairs", + () -> new BlockItem( + DEMONIC_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOODEN_STAIRS_ITEM = ITEMS.register( + "soul_wooden_stairs", + () -> new BlockItem( + SOUL_WOODEN_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_stone_stairs", + () -> new BlockItem( + ANCIENT_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_SMOOTH_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_smooth_stone_stairs", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICK_STAIRS_ITEM = ITEMS.register( + "ancient_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_STONE_BRICK_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_mossy_stone_stairs", + () -> new BlockItem( + ANCIENT_MOSSY_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_chiseled_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_cracked_stone_brick_stairs", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_STAIRS_ITEM = ITEMS.register( + "ancient_polished_stone_stairs", + () -> new BlockItem( + ANCIENT_POLISHED_STONE_STAIRS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_WOOD_FENCE_ITEM = ITEMS.register( + "ancient_wooden_fence", + () -> new BlockItem( + ANCIENT_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "ancient_wooden_fence_gate", + () -> new BlockItem( + ANCIENT_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOOD_FENCE_ITEM = ITEMS.register( + "demonic_wooden_fence", + () -> new BlockItem( + DEMONIC_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject DEMONIC_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "demonic_wooden_fence_gate", + () -> new BlockItem( + DEMONIC_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOOD_FENCE_ITEM = ITEMS.register( + "soul_wooden_fence", + () -> new BlockItem( + SOUL_WOOD_FENCE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject SOUL_WOOD_FENCE_GATE_ITEM = ITEMS.register( + "soul_wooden_fence_gate", + () -> new BlockItem( + SOUL_WOOD_FENCE_GATE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ANCIENT_SMOOTH_STONE_ITEM = ITEMS.register( + "ancient_smooth_stone", + () -> new BlockItem( + ANCIENT_SMOOTH_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_ITEM = ITEMS.register( + "ancient_stone", + () -> new BlockItem( + ANCIENT_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_DIRT_ITEM = ITEMS.register( + "ancient_dirt", + () -> new BlockItem( + ANCIENT_DIRT.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_GRASS_ITEM = ITEMS.register( + "ancient_grass", + () -> new BlockItem( + ANCIENT_GRASS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_MOSSY_STONE_ITEM = ITEMS.register( + "ancient_mossy_stone", + () -> new BlockItem( + ANCIENT_MOSSY_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_stone_bricks", + () -> new BlockItem( + ANCIENT_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CHISELED_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_chiseled_stone_bricks", + () -> new BlockItem( + ANCIENT_CHISELED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_CRACKED_STONE_BRICKS_ITEM = ITEMS.register( + "ancient_cracked_stone_bricks", + () -> new BlockItem( + ANCIENT_CRACKED_STONE_BRICKS.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ANCIENT_POLISHED_STONE_ITEM = ITEMS.register( + "ancient_polished_stone", + () -> new BlockItem( + ANCIENT_POLISHED_STONE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_ORE = BLOCKS.register("allthemodium_ore", + AllthemodiumOre::new); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE = BLOCKS + .register("allthemodium_slate_ore", AllthemodiumOre::new); + + public static final RegistryObject VIBRANIUM_ORE = BLOCKS.register( + "vibranium_ore", + VibraniumOre::new); + public static final RegistryObject OTHER_VIBRANIUM_ORE = BLOCKS.register("other_vibranium_ore", + VibraniumOre::new); + public static final RegistryObject UNOBTAINIUM_ORE = BLOCKS.register( + "unobtainium_ore", + UnobtainiumOre::new); + + public static final RegistryObject ALLTHEMODIUM_BLOCK = BLOCKS.register("allthemodium_block", + AllthemodiumBlock::new); + public static final RegistryObject VIBRANIUM_BLOCK = BLOCKS.register( + "vibranium_block", + VibraniumBlock::new); + public static final RegistryObject UNOBTAINIUM_BLOCK = BLOCKS.register("unobtainium_block", + UnobtainiumBlock::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK = BLOCKS.register("raw_allthemodium_block", + RawATM::new); + public static final RegistryObject RAW_VIBRANIUM_BLOCK = BLOCKS.register("raw_vibranium_block", RawVIB::new); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK = BLOCKS.register("raw_unobtainium_block", + RawUNO::new); + + public static final RegistryObject RAW_ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( + "raw_allthemodium_block", + () -> new BlockItem( + RAW_ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_VIBRANIUM_BLOCK_ITEM = ITEMS.register( + "raw_vibranium_block", + () -> new BlockItem( + RAW_VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( + "raw_unobtainium_block", + () -> new BlockItem( + RAW_UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_ORE_ITEM = ITEMS.register( + "allthemodium_ore", + () -> new AllthemodiumOreItem( + ALLTHEMODIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ALLTHEMODIUM_SLATE_ORE_ITEM = ITEMS.register( + "allthemodium_slate_ore", + () -> new AllthemodiumOreItem( + ALLTHEMODIUM_SLATE_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject VIBRANIUM_ORE_ITEM = ITEMS.register( + "vibranium_ore", + () -> new Vibranium_Ore_Item( + VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = ITEMS.register( + "other_vibranium_ore", + () -> new Vibranium_Ore_Item( + OTHER_VIBRANIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_ORE_ITEM = ITEMS.register( + "unobtainium_ore", + () -> new UnobtainiumOreItem( + UNOBTAINIUM_ORE.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_BLOCK_ITEM = ITEMS.register( + "allthemodium_block", + () -> new BlockItem( + ALLTHEMODIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_BLOCK_ITEM = ITEMS.register( + "vibranium_block", + () -> new BlockItem( + VIBRANIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_BLOCK_ITEM = ITEMS.register( + "unobtainium_block", + () -> new BlockItem( + UNOBTAINIUM_BLOCK.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject RAW_ALLTHEMODIUM = ITEMS.register( + "raw_allthemodium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_VIBRANIUM = ITEMS.register( + "raw_vibranium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject RAW_UNOBTAINIUM = ITEMS.register( + "raw_unobtainium", + () -> new RawOre(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_INGOT = ITEMS.register( + "allthemodium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_INGOT = ITEMS.register( + "vibranium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_INGOT = ITEMS.register( + "unobtainium_ingot", + () -> new Ingot(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject ATM_PLATE = ITEMS.register( + "allthemodium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_PLATE = ITEMS.register( + "vibranium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_PLATE = ITEMS.register( + "unobtainium_plate", + () -> new Plate(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_GEAR = ITEMS.register( + "allthemodium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_GEAR = ITEMS.register( + "vibranium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_GEAR = ITEMS.register( + "unobtainium_gear", + () -> new Gear(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_ROD = ITEMS.register( + "allthemodium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_ROD = ITEMS.register( + "vibranium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_ROD = ITEMS.register( + "unobtainium_rod", + () -> new Rod(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_NUGGET = ITEMS.register( + "allthemodium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_NUGGET = ITEMS.register( + "vibranium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_NUGGET = ITEMS.register( + "unobtainium_nugget", + () -> new Nugget(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_DUST = ITEMS.register( + "allthemodium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIBRANIUM_DUST = ITEMS.register( + "vibranium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOBTAINIUM_DUST = ITEMS.register( + "unobtainium_dust", + () -> new Dust(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_CLUMP = ITEMS.register( + "allthemodium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_CLUMP = ITEMS.register( + "vibranium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_CLUMP = ITEMS.register( + "unobtainium_clump", + () -> new Clump(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_SHARD = ITEMS.register( + "allthemodium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_SHARD = ITEMS.register( + "vibranium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_SHARD = ITEMS.register( + "unobtainium_shard", + () -> new Shard(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_DIRTY = ITEMS.register( + "dirty_allthemodium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_DIRTY = ITEMS.register( + "dirty_vibranium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_DIRTY = ITEMS.register( + "dirty_unobtainium_dust", + () -> new DirtyDust(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ATM_CRYSTAL = ITEMS.register( + "allthemodium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VIB_CRYSTAL = ITEMS.register( + "vibranium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UNOB_CRYSTAL = ITEMS.register( + "unobtainium_crystal", + () -> new Crystal(new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_DUST = ITEMS.register( + "unobtainium_allthemodium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_DUST = ITEMS.register( + "unobtainium_vibranium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_DUST = ITEMS.register( + "vibranium_allthemodium_alloy_dust", + () -> new AlloyDust( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + + public static final RegistryObject UNOBTAINIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( + "unobtainium_allthemodium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject UNOBTAINIUM_VIBRANIUM_ALLOY = ITEMS.register( + "unobtainium_vibranium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + public static final RegistryObject VIBRANIUM_ALLTHEMODIUM_ALLOY = ITEMS.register( + "vibranium_allthemodium_alloy_ingot", + () -> new AlloyIngot( + new Item.Properties() + .tab(AllTheModium.GROUP) + .fireResistant())); + + public static final RegistryObject TELEPORT_PAD = SHAPED_BLOCKS.register( + "teleport_pad", + () -> new TeleportPad( + Block.Properties + .of(Material.METAL) + .noLootTable() + .noOcclusion() + .strength(20.0F))); + public static final RegistryObject TELEPORT_PAD_ITEM = ITEMS.register( + "teleport_pad", + () -> new BlockItem( + TELEPORT_PAD.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject ALLTHEMODIUM_SWORD = ITEMS.register( + "allthemodium_sword", + () -> new SwordItem( + ToolTiers.ALLTHEMODIUM_TIER, + 4, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + }); + + public static final RegistryObject ALLTHEMODIUM_PICKAXE = ITEMS.register( + "allthemodium_pickaxe", + () -> new PickaxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 2, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_AXE = ITEMS.register( + "allthemodium_axe", + () -> new AxeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 6, + 1.0f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_AXE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_SHOVEL = ITEMS.register( + "allthemodium_shovel", + () -> new ShovelItem( + ToolTiers.ALLTHEMODIUM_TIER, + 1, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject ALLTHEMODIUM_HOE = ITEMS.register( + "allthemodium_hoe", + () -> new HoeItem( + ToolTiers.ALLTHEMODIUM_TIER, + 0, + 1.5f, + new Item.Properties() + .fireResistant() + .tab(AllTheModium.GROUP) + .rarity(Rarity.EPIC)) { + @Override + public float getDestroySpeed( + @Nonnull ItemStack stack, + @Nonnull BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return speed; + return super.getDestroySpeed(stack, state); + } + + @Override + public boolean isEnchantable(@Nonnull ItemStack stack) { + return true; + } + + @Override + public boolean canBeDepleted() { + return false; + } + + @Override + public void appendHoverText( + @Nonnull ItemStack stack, + @Nullable Level worldIn, + @Nonnull List tooltip, + @Nonnull TooltipFlag flagIn) { + tooltip.add( + TextComponentHelper + .createComponentTranslation( + CommandSource.NULL, + "indestructible", + new Object()) + .withStyle(ChatFormatting.GOLD)); + + super.appendHoverText(stack, worldIn, tooltip, flagIn); + } + + @Override + public boolean isCorrectToolForDrops( + ItemStack stack, + BlockState state) { + if (state.is(BlockTags.MINEABLE_WITH_HOE)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG)) + return TierSortingRegistry.isCorrectTierForDrops( + ToolTiers.ALLTHEMODIUM_TIER, + state); + return false; + } + }); + + public static final RegistryObject UA_ALLOY = BLOCKS.register( + "unobtainium_allthemodium_alloy_block", + UAAlloyBlock::new); + public static final RegistryObject UV_ALLOY = BLOCKS.register( + "unobtainium_vibranium_alloy_block", + UVAlloyBlock::new); + public static final RegistryObject VA_ALLOY = BLOCKS.register( + "vibranium_allthemodium_alloy_block", + VAAlloyBlock::new); + + public static final RegistryObject UA_ALLOY_ITEM = ITEMS.register( + "unobtainium_allthemodium_alloy_block", + () -> new BlockItem( + UA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject UV_ALLOY_ITEM = ITEMS.register( + "unobtainium_vibranium_alloy_block", + () -> new BlockItem( + UV_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject VA_ALLOY_ITEM = ITEMS.register( + "vibranium_allthemodium_alloy_block", + () -> new BlockItem( + VA_ALLOY.get(), + new Item.Properties().tab(AllTheModium.GROUP))); + + public static final RegistryObject PIGLICH_HEART = ITEMS.register( + "piglich_heart", + () -> new PiglichHeart(new Item.Properties().tab(AllTheModium.GROUP))); + public static final RegistryObject> PIGLICH = createMonsterEntity( + "piglich", + PiglichEntity::new, + 0.6F, + 3.0F, + 0x000000, + 0xebe834); + + private static RegistryObject> createMonsterEntity( + String name, + EntityType.EntityFactory factory, + float width, + float height, + int eggPrimary, + int eggSecondary) { + ResourceLocation location = new ResourceLocation( + Reference.MOD_ID, + name); + + return ENTITIES.register( + name, + () -> EntityType.Builder + .of(factory, MobCategory.MONSTER) + .sized(width, height) + .setTrackingRange(64) + .setUpdateInterval(1) + .build(location.toString())); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + } + + // private static RegistryObject> createShulkerEntity(String name, + // EntityType.EntityFactory factory, float width, float height, int eggPrimary, int eggSecondary) { + // ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name); + // EntityType entity = EntityType.Builder.of(factory, + // MobCategory.MONSTER).sized(width, + // height) + // .setTrackingRange(64).setUpdateInterval(1).build(location.toString()); + // Item spawnEgg = new SpawnEggItem(entity, eggPrimary, eggSecondary, + // (new Item.Properties()).tab(AllTheModium.GROUP)); + // spawnEgg.setRegistryName(new ResourceLocation(Reference.MOD_ID, name + + // "_spawn_egg")); + // SPAWN_EGGS.add(spawnEgg); + + // return ENTITIES.register(name, () -> entity); + // } + + @SubscribeEvent + public static void addEntityAttributes(EntityAttributeCreationEvent event) { + event.put(PIGLICH.get(), PiglichEntity.createAttributes().build()); + // event.put(ATM_SHULKER.get(), UNOBShulkerEntity.createAttributes().build()); + } + + private static RotatedPillarBlock log( + MaterialColor color1, + MaterialColor color2) { + return new RotatedPillarBlock( + BlockBehaviour.Properties + .of( + Material.NETHER_WOOD, + woodLog -> { + return (woodLog.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y) + ? color1 + : color2; + }) + .strength(2.0F) + .sound(SoundType.WOOD)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java index c85b5109..df3c496a 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/TagRegistry.java @@ -10,240 +10,240 @@ public class TagRegistry { - public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create( - Reference.ore("allthemodium")); - public static final TagKey VIBRANIUM_ORE = BlockTags.create( - Reference.ore("vibranium")); - public static final TagKey UNOBTAINIUM_ORE = BlockTags.create( - Reference.ore("unobtainium")); - - public static final TagKey OTHER_PROTECTION = BlockTags.create( - Reference.atm("blocks/blocklist")); - - public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = BlockTags - .create(Reference.forge("needs_allthemodium_tool")); - public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create( - Reference.forge("needs_allthemodiumalloy_tool")); - - public static final TagKey FORGE_SWORDS = ItemTags.create( - Reference.forge("tools/swords")); - public static final TagKey FORGE_PICKAXES = ItemTags.create( - Reference.forge("tools/pickaxes")); - public static final TagKey FORGE_AXES = ItemTags.create( - Reference.forge("tools/axes")); - public static final TagKey FORGE_SHOVELS = ItemTags.create( - Reference.forge("tools/shovels")); - public static final TagKey FORGE_HOES = ItemTags.create( - Reference.forge("tools/hoes")); - public static final TagKey PAXEL_TARGETS = BlockTags.create( - Reference.atm("paxel_effective")); - - public static final TagKey PIGLIN_LOVED = ItemTags.create( - Reference.location("minecraft:items/piglin_loved")); - public static final TagKey RAW_MATERIALS = ItemTags.create( - Reference.forge("raw_materials")); - - public static final TagKey SAPLINGS = ItemTags.create( - Reference.location("saplings")); - public static final TagKey DUSTS = ItemTags.create( - Reference.forge("dusts")); - public static final TagKey INGOTS = ItemTags.create( - Reference.forge("ingots")); - public static final TagKey ORES = ItemTags.create( - Reference.forge("ores")); - public static final TagKey BLOCK_ORES = BlockTags.create( - Reference.forge("ores")); - - public static final TagKey OTHER_BIOMES = TagKey.create( - Registry.BIOME_REGISTRY, - Reference.location("allthemodium:other_biomes")); - - public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create( - Reference.location("allthemodium:other_te_whitelist")); - public static final TagKey ANCIENT_DIRT = BlockTags.create( - Reference.location("allthemodium:ancient_dirt")); - public static final TagKey ANCIENT_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_stone")); - public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_stone")); - public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:ancient_planks")); - public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = ItemTags - .create(Reference.location("allthemodium:ancient_planks")); - public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:demonic_planks")); - public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = ItemTags - .create(Reference.location("allthemodium:demonic_planks")); - public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create( - Reference.location("allthemodium:soul_planks")); - public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create( - Reference.location("allthemodium:soul_planks")); - - public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_mossy_stone")); - public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_mossy_stone")); - public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_smooth_stone")); - public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_smooth_stone")); - public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create( - Reference.location("allthemodium:ancient_polished_stone")); - public static final TagKey ANCIENT_POLISHED_STONE_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_polished_stone")); - public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create( - Reference.location("allthemodium:ancient_stone_bricks")); - public static final TagKey ANCIENT_STONE_BRICKS_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_stone_bricks")); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = BlockTags.create( - Reference.location("allthemodium:ancient_cracked_stone_bricks")); - public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_cracked_stone_bricks")); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = BlockTags.create( - Reference.location("allthemodium:ancient_chiseled_stone_bricks")); - public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = ItemTags.create( - Reference.location("allthemodium:ancient_chiseled_stone_bricks")); - - public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create( - Reference.ore("allthemodium")); - public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create( - Reference.ore("vibranium")); - public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create( - Reference.ore("unobtainium")); - - public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create( - Reference.block("allthemodium")); - public static final TagKey VIBRANIUM_BLOCK = BlockTags.create( - Reference.block("vibranium")); - public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create( - Reference.block("unobtainium")); - - public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create( - Reference.block("raw_allthemodium")); - public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create( - Reference.block("raw_vibranium")); - public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create( - Reference.block("raw_unobtainium")); - - public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("allthemodium")); - public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("vibranium")); - public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create( - Reference.block("unobtainium")); - - public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create( - Reference.ingot("allthemodium")); - public static final TagKey VIBRANIUM_INGOT = ItemTags.create( - Reference.ingot("vibranium")); - public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create( - Reference.ingot("unobtainium")); - public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = ItemTags - .create(Reference.ingot("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = ItemTags - .create(Reference.ingot("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = ItemTags - .create(Reference.ingot("unobtainium_allthemodium_alloy")); - - public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = ItemTags - .create(Reference.block("vibranium_allthemodium_alloy")); - public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = ItemTags - .create(Reference.block("unobtainium_vibranium_alloy")); - public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = ItemTags - .create(Reference.block("unobtainium_allthemodium_alloy")); - - public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create( - Reference.plate("allthemodium")); - public static final TagKey VIBRANIUM_PLATE = ItemTags.create( - Reference.plate("vibranium")); - public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create( - Reference.plate("unobtainium")); - - public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create( - Reference.gear("allthemodium")); - public static final TagKey VIBRANIUM_GEAR = ItemTags.create( - Reference.gear("vibranium")); - public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create( - Reference.gear("unobtainium")); - - public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create( - Reference.rod("allthemodium")); - public static final TagKey VIBRANIUM_ROD = ItemTags.create( - Reference.rod("vibranium")); - public static final TagKey UNOBTAINIUM_ROD = ItemTags.create( - Reference.rod("unobtainium")); - - public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create( - Reference.dust("allthemodium")); - public static final TagKey VIBRANIUM_DUST = ItemTags.create( - Reference.dust("vibranium")); - public static final TagKey UNOBTAINIUM_DUST = ItemTags.create( - Reference.dust("unobtainium")); - - public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create( - Reference.nugget("allthemodium")); - public static final TagKey VIBRANIUM_NUGGET = ItemTags.create( - Reference.nugget("vibranium")); - public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create( - Reference.nugget("unobtainium")); - - public static final TagKey SOUL_LAVA = FluidTags.create( - Reference.forge("soul_lava")); - public static final TagKey ALLTHEMODIUM = FluidTags.create( - Reference.forge("molten_allthemodium")); - public static final TagKey VIBRANIUM = FluidTags.create( - Reference.forge("molten_vibranium")); - public static final TagKey UNOBTAINIUM = FluidTags.create( - Reference.forge("molten_unobtainium")); - - public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create( - Reference.raw_ores("allthemodium")); - public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create( - Reference.raw_ores("vibranium")); - public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create( - Reference.raw_ores("unobtainium")); - - public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create( - Reference.material("allthemodium")); - public static final TagKey RAW_VIBRANIUM = ItemTags.create( - Reference.material("vibranium")); - public static final TagKey RAW_UNOBTAINIUM = ItemTags.create( - Reference.material("unobtainium")); - - public static final TagKey DIRTY_DUST = ItemTags.create( - Reference.mek("dirty_dusts")); - public static final TagKey CRYSTAL = ItemTags.create( - Reference.mek("crystals")); - public static final TagKey CLUMP = ItemTags.create( - Reference.mek("clumps")); - public static final TagKey SHARD = ItemTags.create( - Reference.mek("shards")); - - public static final TagKey ALLTHEMODIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("allthemodium")); - public static final TagKey VIBRANIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("vibranium")); - public static final TagKey UNOBTAINIUM_DIRTY_DUST = ItemTags.create( - Reference.dirty("unobtainium")); - - public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create( - Reference.crystal("allthemodium")); - public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create( - Reference.crystal("vibranium")); - public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create( - Reference.crystal("unobtainium")); - - public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create( - Reference.clump("allthemodium")); - public static final TagKey VIBRANIUM_CLUMP = ItemTags.create( - Reference.clump("vibranium")); - public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create( - Reference.clump("unobtainium")); - - public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create( - Reference.shard("allthemodium")); - public static final TagKey VIBRANIUM_SHARD = ItemTags.create( - Reference.shard("vibranium")); - public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create( - Reference.shard("unobtainium")); + public static final TagKey ALLTHEMODIUM_ORE = BlockTags.create( + Reference.ore("allthemodium")); + public static final TagKey VIBRANIUM_ORE = BlockTags.create( + Reference.ore("vibranium")); + public static final TagKey UNOBTAINIUM_ORE = BlockTags.create( + Reference.ore("unobtainium")); + + public static final TagKey OTHER_PROTECTION = BlockTags.create( + Reference.atm("blocks/blocklist")); + + public static final TagKey NEEDS_ALLTHEMODIUM_TOOL = BlockTags + .create(Reference.forge("needs_allthemodium_tool")); + public static final TagKey NEEDS_ALLOY_TOOL = BlockTags.create( + Reference.forge("needs_allthemodiumalloy_tool")); + + public static final TagKey FORGE_SWORDS = ItemTags.create( + Reference.forge("tools/swords")); + public static final TagKey FORGE_PICKAXES = ItemTags.create( + Reference.forge("tools/pickaxes")); + public static final TagKey FORGE_AXES = ItemTags.create( + Reference.forge("tools/axes")); + public static final TagKey FORGE_SHOVELS = ItemTags.create( + Reference.forge("tools/shovels")); + public static final TagKey FORGE_HOES = ItemTags.create( + Reference.forge("tools/hoes")); + public static final TagKey PAXEL_TARGETS = BlockTags.create( + Reference.atm("paxel_effective")); + + public static final TagKey PIGLIN_LOVED = ItemTags.create( + Reference.location("minecraft:items/piglin_loved")); + public static final TagKey RAW_MATERIALS = ItemTags.create( + Reference.forge("raw_materials")); + + public static final TagKey SAPLINGS = ItemTags.create( + Reference.location("saplings")); + public static final TagKey DUSTS = ItemTags.create( + Reference.forge("dusts")); + public static final TagKey INGOTS = ItemTags.create( + Reference.forge("ingots")); + public static final TagKey ORES = ItemTags.create( + Reference.forge("ores")); + public static final TagKey BLOCK_ORES = BlockTags.create( + Reference.forge("ores")); + + public static final TagKey OTHER_BIOMES = TagKey.create( + Registry.BIOME_REGISTRY, + Reference.location("allthemodium:other_biomes")); + + public static final TagKey OTHER_TILE_WHITELIST = BlockTags.create( + Reference.location("allthemodium:other_te_whitelist")); + public static final TagKey ANCIENT_DIRT = BlockTags.create( + Reference.location("allthemodium:ancient_dirt")); + public static final TagKey ANCIENT_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_stone")); + public static final TagKey ANCIENT_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_stone")); + public static final TagKey ANCIENT_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:ancient_planks")); + public static final TagKey ANCIENT_WOODEN_PLANKS_ITEM = ItemTags + .create(Reference.location("allthemodium:ancient_planks")); + public static final TagKey DEMONIC_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:demonic_planks")); + public static final TagKey DEMONIC_WOODEN_PLANKS_ITEM = ItemTags + .create(Reference.location("allthemodium:demonic_planks")); + public static final TagKey SOUL_WOODEN_PLANKS = BlockTags.create( + Reference.location("allthemodium:soul_planks")); + public static final TagKey SOUL_WOODEN_PLANKS_ITEM = ItemTags.create( + Reference.location("allthemodium:soul_planks")); + + public static final TagKey ANCIENT_MOSSY_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_mossy_stone")); + public static final TagKey ANCIENT_MOSSY_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_mossy_stone")); + public static final TagKey ANCIENT_SMOOTH_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_smooth_stone")); + public static final TagKey ANCIENT_SMOOTH_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_smooth_stone")); + public static final TagKey ANCIENT_POLISHED_STONE = BlockTags.create( + Reference.location("allthemodium:ancient_polished_stone")); + public static final TagKey ANCIENT_POLISHED_STONE_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_polished_stone")); + public static final TagKey ANCIENT_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_stone_bricks")); + public static final TagKey ANCIENT_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_stone_bricks")); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks")); + public static final TagKey ANCIENT_CRACKED_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_cracked_stone_bricks")); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS = BlockTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks")); + public static final TagKey ANCIENT_CHISELED_STONE_BRICKS_ITEM = ItemTags.create( + Reference.location("allthemodium:ancient_chiseled_stone_bricks")); + + public static final TagKey ALLTHEMODIUM_ORE_ITEM = ItemTags.create( + Reference.ore("allthemodium")); + public static final TagKey VIBRANIUM_ORE_ITEM = ItemTags.create( + Reference.ore("vibranium")); + public static final TagKey UNOBTAINIUM_ORE_ITEM = ItemTags.create( + Reference.ore("unobtainium")); + + public static final TagKey ALLTHEMODIUM_BLOCK = BlockTags.create( + Reference.block("allthemodium")); + public static final TagKey VIBRANIUM_BLOCK = BlockTags.create( + Reference.block("vibranium")); + public static final TagKey UNOBTAINIUM_BLOCK = BlockTags.create( + Reference.block("unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM_BLOCK = ItemTags.create( + Reference.block("raw_allthemodium")); + public static final TagKey RAW_VIBRANIUM_BLOCK = ItemTags.create( + Reference.block("raw_vibranium")); + public static final TagKey RAW_UNOBTAINIUM_BLOCK = ItemTags.create( + Reference.block("raw_unobtainium")); + + public static final TagKey ALLTHEMODIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("allthemodium")); + public static final TagKey VIBRANIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("vibranium")); + public static final TagKey UNOBTAINIUM_BLOCK_ITEM = ItemTags.create( + Reference.block("unobtainium")); + + public static final TagKey ALLTHEMODIUM_INGOT = ItemTags.create( + Reference.ingot("allthemodium")); + public static final TagKey VIBRANIUM_INGOT = ItemTags.create( + Reference.ingot("vibranium")); + public static final TagKey UNOBTAINIUM_INGOT = ItemTags.create( + Reference.ingot("unobtainium")); + public static final TagKey VIBRANIUM_ALLTHEMODIUM_INGOT = ItemTags + .create(Reference.ingot("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_INGOT = ItemTags + .create(Reference.ingot("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_INGOT = ItemTags + .create(Reference.ingot("unobtainium_allthemodium_alloy")); + + public static final TagKey VIBRANIUM_ALLTHEMODIUM_BLOCK = ItemTags + .create(Reference.block("vibranium_allthemodium_alloy")); + public static final TagKey UNOBTAINIUM_VIBRANIUM_BLOCK = ItemTags + .create(Reference.block("unobtainium_vibranium_alloy")); + public static final TagKey UNOBTAINIUM_ALLTHEMODIUM_BLOCK = ItemTags + .create(Reference.block("unobtainium_allthemodium_alloy")); + + public static final TagKey ALLTHEMODIUM_PLATE = ItemTags.create( + Reference.plate("allthemodium")); + public static final TagKey VIBRANIUM_PLATE = ItemTags.create( + Reference.plate("vibranium")); + public static final TagKey UNOBTAINIUM_PLATE = ItemTags.create( + Reference.plate("unobtainium")); + + public static final TagKey ALLTHEMODIUM_GEAR = ItemTags.create( + Reference.gear("allthemodium")); + public static final TagKey VIBRANIUM_GEAR = ItemTags.create( + Reference.gear("vibranium")); + public static final TagKey UNOBTAINIUM_GEAR = ItemTags.create( + Reference.gear("unobtainium")); + + public static final TagKey ALLTHEMODIUM_ROD = ItemTags.create( + Reference.rod("allthemodium")); + public static final TagKey VIBRANIUM_ROD = ItemTags.create( + Reference.rod("vibranium")); + public static final TagKey UNOBTAINIUM_ROD = ItemTags.create( + Reference.rod("unobtainium")); + + public static final TagKey ALLTHEMODIUM_DUST = ItemTags.create( + Reference.dust("allthemodium")); + public static final TagKey VIBRANIUM_DUST = ItemTags.create( + Reference.dust("vibranium")); + public static final TagKey UNOBTAINIUM_DUST = ItemTags.create( + Reference.dust("unobtainium")); + + public static final TagKey ALLTHEMODIUM_NUGGET = ItemTags.create( + Reference.nugget("allthemodium")); + public static final TagKey VIBRANIUM_NUGGET = ItemTags.create( + Reference.nugget("vibranium")); + public static final TagKey UNOBTAINIUM_NUGGET = ItemTags.create( + Reference.nugget("unobtainium")); + + public static final TagKey SOUL_LAVA = FluidTags.create( + Reference.forge("soul_lava")); + public static final TagKey ALLTHEMODIUM = FluidTags.create( + Reference.forge("molten_allthemodium")); + public static final TagKey VIBRANIUM = FluidTags.create( + Reference.forge("molten_vibranium")); + public static final TagKey UNOBTAINIUM = FluidTags.create( + Reference.forge("molten_unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM_FORGE = ItemTags.create( + Reference.raw_ores("allthemodium")); + public static final TagKey RAW_VIBRANIUM_FORGE = ItemTags.create( + Reference.raw_ores("vibranium")); + public static final TagKey RAW_UNOBTAINIUM_FORGE = ItemTags.create( + Reference.raw_ores("unobtainium")); + + public static final TagKey RAW_ALLTHEMODIUM = ItemTags.create( + Reference.material("allthemodium")); + public static final TagKey RAW_VIBRANIUM = ItemTags.create( + Reference.material("vibranium")); + public static final TagKey RAW_UNOBTAINIUM = ItemTags.create( + Reference.material("unobtainium")); + + public static final TagKey DIRTY_DUST = ItemTags.create( + Reference.mek("dirty_dusts")); + public static final TagKey CRYSTAL = ItemTags.create( + Reference.mek("crystals")); + public static final TagKey CLUMP = ItemTags.create( + Reference.mek("clumps")); + public static final TagKey SHARD = ItemTags.create( + Reference.mek("shards")); + + public static final TagKey ALLTHEMODIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("allthemodium")); + public static final TagKey VIBRANIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("vibranium")); + public static final TagKey UNOBTAINIUM_DIRTY_DUST = ItemTags.create( + Reference.dirty("unobtainium")); + + public static final TagKey ALLTHEMODIUM_CRYSTAL = ItemTags.create( + Reference.crystal("allthemodium")); + public static final TagKey VIBRANIUM_CRYSTAL = ItemTags.create( + Reference.crystal("vibranium")); + public static final TagKey UNOBTAINIUM_CRYSTAL = ItemTags.create( + Reference.crystal("unobtainium")); + + public static final TagKey ALLTHEMODIUM_CLUMP = ItemTags.create( + Reference.clump("allthemodium")); + public static final TagKey VIBRANIUM_CLUMP = ItemTags.create( + Reference.clump("vibranium")); + public static final TagKey UNOBTAINIUM_CLUMP = ItemTags.create( + Reference.clump("unobtainium")); + + public static final TagKey ALLTHEMODIUM_SHARD = ItemTags.create( + Reference.shard("allthemodium")); + public static final TagKey VIBRANIUM_SHARD = ItemTags.create( + Reference.shard("vibranium")); + public static final TagKey UNOBTAINIUM_SHARD = ItemTags.create( + Reference.shard("unobtainium")); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java index 8b21d202..84e80931 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/OtherSky.java @@ -9,51 +9,51 @@ public class OtherSky extends DimensionSpecialEffects { - public OtherSky( - float p_108866_, - boolean p_108867_, - SkyType p_108868_, - boolean p_108869_, - boolean p_108870_) { - super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); - } - - @Override - public Vec3 getBrightnessDependentFogColor( - @Nonnull Vec3 p_108878_, - float p_108879_) { - return p_108878_; - } - - @Override - public boolean isFoggyAt(int p_108874_, int p_108875_) { - return true; - } - - @Override - public float getCloudHeight() { - return Float.NaN; - } - - @Override - public boolean renderClouds( - @Nonnull ClientLevel level, - int ticks, - float partialTick, - @Nonnull PoseStack poseStack, - double camX, - double camY, - double camZ, - @Nonnull Matrix4f projectionMatrix) { - return false; - } - // @Override - // public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, - // Matrix4f projectionMatrix, - // boolean isFoggy, Runnable setupFog) { - // return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || - // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || - // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); - // } + public OtherSky( + float p_108866_, + boolean p_108867_, + SkyType p_108868_, + boolean p_108869_, + boolean p_108870_) { + super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); + } + + @Override + public Vec3 getBrightnessDependentFogColor( + @Nonnull Vec3 p_108878_, + float p_108879_) { + return p_108878_; + } + + @Override + public boolean isFoggyAt(int p_108874_, int p_108875_) { + return true; + } + + @Override + public float getCloudHeight() { + return Float.NaN; + } + + @Override + public boolean renderClouds( + @Nonnull ClientLevel level, + int ticks, + float partialTick, + @Nonnull PoseStack poseStack, + double camX, + double camY, + double camZ, + @Nonnull Matrix4f projectionMatrix) { + return false; + } + // @Override + // public boolean renderSky(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, Camera camera, + // Matrix4f projectionMatrix, + // boolean isFoggy, Runnable setupFog) { + // return ((level.getBiome(camera.getBlockPosition()).is(ATMBiomes.CRIMSON_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.WARPED_FOREST)) || + // (level.getBiome(camera.getBlockPosition()).is(ATMBiomes.THE_OTHER))); + // } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java index 42a39b80..e84fa7e5 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/client/SkyRegistry.java @@ -11,23 +11,23 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class SkyRegistry { - @SubscribeEvent - public static void register(RegisterDimensionSpecialEffectsEvent event) { - event.register( - new ResourceLocation(Reference.MOD_ID, "the_other"), - new OtherSky( - Float.NaN, - true, - DimensionSpecialEffects.SkyType.NORMAL, - false, - false)); - event.register( - new ResourceLocation(Reference.MOD_ID, "mining"), - new OtherSky( - Float.NaN, - true, - DimensionSpecialEffects.SkyType.NORMAL, - true, - true)); - } + @SubscribeEvent + public static void register(RegisterDimensionSpecialEffectsEvent event) { + event.register( + new ResourceLocation(Reference.MOD_ID, "the_other"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + false, + false)); + event.register( + new ResourceLocation(Reference.MOD_ID, "mining"), + new OtherSky( + Float.NaN, + true, + DimensionSpecialEffects.SkyType.NORMAL, + true, + true)); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java index 2e490c5b..bbc45295 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMResource.java @@ -10,64 +10,64 @@ import org.jetbrains.annotations.Nullable; public enum ATMResource implements IResource { - ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), VIBRANIUM("vibranium", 2547336, - TagRegistry.VIBRANIUM_ORE_ITEM), UNOBTAINIUM("unobtainium", 13718243, TagRegistry.UNOBTAINIUM_ORE_ITEM); + ALLTHEMODIUM("allthemodium", 16701786, TagRegistry.ALLTHEMODIUM_ORE_ITEM), VIBRANIUM("vibranium", 2547336, + TagRegistry.VIBRANIUM_ORE_ITEM), UNOBTAINIUM("unobtainium", 13718243, TagRegistry.UNOBTAINIUM_ORE_ITEM); - private final String name; - private final int tint; - // Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource - private final Supplier> oreTag; - private final boolean isVanilla; - private final BlockResourceInfo resourceBlockInfo; - private final BlockResourceInfo rawResourceBlockInfo; + private final String name; + private final int tint; + // Note: This is a supplier because of the chicken and egg of referencing OreType and OreType referencing PrimaryResource + private final Supplier> oreTag; + private final boolean isVanilla; + private final BlockResourceInfo resourceBlockInfo; + private final BlockResourceInfo rawResourceBlockInfo; - ATMResource(String name, int colour, TagKey oreTag) { - this(name, colour, () -> oreTag, true, null, null); - } + ATMResource(String name, int colour, TagKey oreTag) { + this(name, colour, () -> oreTag, true, null, null); + } - ATMResource( - String name, - int tint, - Supplier> oreTag, - boolean isVanilla, - BlockResourceInfo resourceBlockInfo, - BlockResourceInfo rawResourceBlockInfo) { - this.name = name; - this.tint = tint; - this.oreTag = oreTag; - this.isVanilla = isVanilla; - this.resourceBlockInfo = resourceBlockInfo; - this.rawResourceBlockInfo = rawResourceBlockInfo; - } + ATMResource( + String name, + int tint, + Supplier> oreTag, + boolean isVanilla, + BlockResourceInfo resourceBlockInfo, + BlockResourceInfo rawResourceBlockInfo) { + this.name = name; + this.tint = tint; + this.oreTag = oreTag; + this.isVanilla = isVanilla; + this.resourceBlockInfo = resourceBlockInfo; + this.rawResourceBlockInfo = rawResourceBlockInfo; + } - @Override - public String getRegistrySuffix() { - return name; - } + @Override + public String getRegistrySuffix() { + return name; + } - public int getTint() { - return tint; - } + public int getTint() { + return tint; + } - public TagKey getOreTag() { - return oreTag.get(); - } + public TagKey getOreTag() { + return oreTag.get(); + } - public boolean has(ResourceType type) { - return (type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla())); - } + public boolean has(ResourceType type) { + return (type != ResourceType.ENRICHED && (!isVanilla || !type.isVanilla())); + } - public boolean isVanilla() { - return isVanilla; - } + public boolean isVanilla() { + return isVanilla; + } - @Nullable - public BlockResourceInfo getResourceBlockInfo() { - return resourceBlockInfo; - } + @Nullable + public BlockResourceInfo getResourceBlockInfo() { + return resourceBlockInfo; + } - @Nullable - public BlockResourceInfo getRawResourceBlockInfo() { - return rawResourceBlockInfo; - } + @Nullable + public BlockResourceInfo getRawResourceBlockInfo() { + return rawResourceBlockInfo; + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java index 3027ff09..11bae6af 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/ATMSlurries.java @@ -9,14 +9,14 @@ public class ATMSlurries { - public static final MekRegistry SLURRIES = new MekRegistry( - Reference.MOD_ID); + public static final MekRegistry SLURRIES = new MekRegistry( + Reference.MOD_ID); - public static final Map> PROCESSED_RESOURCES = new LinkedHashMap<>(); + public static final Map> PROCESSED_RESOURCES = new LinkedHashMap<>(); - static { - for (ATMResource resource : EnumFunc.PRIMARY_RESOURCES) { - PROCESSED_RESOURCES.put(resource, SLURRIES.register(resource)); - } - } + static { + for (ATMResource resource : EnumFunc.PRIMARY_RESOURCES) { + PROCESSED_RESOURCES.put(resource, SLURRIES.register(resource)); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java index 2fa703f6..9604475c 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/EnumFunc.java @@ -2,5 +2,5 @@ public class EnumFunc { - public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); + public static final ATMResource[] PRIMARY_RESOURCES = ATMResource.values(); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java index 245ff41a..cb4cfe16 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenATMType.java @@ -24,100 +24,100 @@ public class MoltenATMType extends FluidType { - public MoltenATMType(Properties properties) { - super(properties); - } + public MoltenATMType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/atm_molten_still"); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/atm_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localPlayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localPlayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localPlayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localPlayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - }); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java index 2812395c..7dd23f9e 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenUNOBType.java @@ -24,100 +24,100 @@ public class MoltenUNOBType extends FluidType { - public MoltenUNOBType(Properties properties) { - super(properties); - } + public MoltenUNOBType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/unobtainium_molten_still"); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/unobtainium_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - }); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java index 5409ce1f..0990ae32 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/MoltenVIBType.java @@ -24,100 +24,100 @@ public class MoltenVIBType extends FluidType { - public MoltenVIBType(Properties properties) { - super(properties); - } + public MoltenVIBType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/vibranium_molten_still"); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/vibranium_molten_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - }); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java index f8867559..c45169a1 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java +++ b/src/main/java/com/thevortex/allthemodium/registry/resource/SoulLavaType.java @@ -24,100 +24,100 @@ public class SoulLavaType extends FluidType { - public SoulLavaType(Properties properties) { - super(properties); - } + public SoulLavaType(Properties properties) { + super(properties); + } - @Override - public @Nullable BlockPathTypes getBlockPathType( - FluidState state, - BlockGetter level, - BlockPos pos, - @Nullable Mob mob, - boolean canFluidLog) { - return canFluidLog - ? super.getBlockPathType(state, level, pos, mob, true) - : null; - } + @Override + public @Nullable BlockPathTypes getBlockPathType( + FluidState state, + BlockGetter level, + BlockPos pos, + @Nullable Mob mob, + boolean canFluidLog) { + return canFluidLog + ? super.getBlockPathType(state, level, pos, mob, true) + : null; + } - @Override - public void initializeClient( - Consumer consumer) { - consumer.accept( - new IClientFluidTypeExtensions() { - private static final ResourceLocation UNDER_FLUID = new ResourceLocation( - Reference.MOD_ID, - "textures/block/fluid/molten_still.png"); - private static final ResourceLocation FLUID_STILL = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_still"); - private static final ResourceLocation FLUID_FLOW = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_flow"); - private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( - Reference.MOD_ID, - "block/fluid/soul_lava_still"); + @Override + public void initializeClient( + Consumer consumer) { + consumer.accept( + new IClientFluidTypeExtensions() { + private static final ResourceLocation UNDER_FLUID = new ResourceLocation( + Reference.MOD_ID, + "textures/block/fluid/molten_still.png"); + private static final ResourceLocation FLUID_STILL = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still"); + private static final ResourceLocation FLUID_FLOW = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_flow"); + private static final ResourceLocation FLUID_OVERLAY = new ResourceLocation( + Reference.MOD_ID, + "block/fluid/soul_lava_still"); - @Override - public ResourceLocation getStillTexture() { - return FLUID_STILL; - } + @Override + public ResourceLocation getStillTexture() { + return FLUID_STILL; + } - @Override - public ResourceLocation getFlowingTexture() { - return FLUID_FLOW; - } + @Override + public ResourceLocation getFlowingTexture() { + return FLUID_FLOW; + } - @Nullable - @Override - public ResourceLocation getOverlayTexture() { - return FLUID_OVERLAY; - } + @Nullable + @Override + public ResourceLocation getOverlayTexture() { + return FLUID_OVERLAY; + } - @Override - public ResourceLocation getRenderOverlayTexture(Minecraft mc) { - return UNDER_FLUID; - } + @Override + public ResourceLocation getRenderOverlayTexture(Minecraft mc) { + return UNDER_FLUID; + } - @Override - public @NotNull Vector3f modifyFogColor( - Camera camera, - float partialTick, - ClientLevel level, - int renderDistance, - float darkenWorldAmount, - Vector3f fluidFogColor) { - return new Vector3f(0.08F, 0.08F, 0.0F); - } + @Override + public @NotNull Vector3f modifyFogColor( + Camera camera, + float partialTick, + ClientLevel level, + int renderDistance, + float darkenWorldAmount, + Vector3f fluidFogColor) { + return new Vector3f(0.08F, 0.08F, 0.0F); + } - @Override - public void modifyFogRender( - Camera camera, - FogRenderer.FogMode mode, - float renderDistance, - float partialTick, - float nearDistance, - float farDistance, - FogShape shape) { - nearDistance = -8.0F; - farDistance = 96.0F; + @Override + public void modifyFogRender( + Camera camera, + FogRenderer.FogMode mode, + float renderDistance, + float partialTick, + float nearDistance, + float farDistance, + FogShape shape) { + nearDistance = -8.0F; + farDistance = 96.0F; - Entity entity = camera.getEntity(); + Entity entity = camera.getEntity(); - if (camera.getEntity() instanceof LocalPlayer) { - LocalPlayer localplayer = (LocalPlayer) entity; - farDistance *= Math.max(0.25F, localplayer.getWaterVision()); - } + if (camera.getEntity() instanceof LocalPlayer) { + LocalPlayer localplayer = (LocalPlayer) entity; + farDistance *= Math.max(0.25F, localplayer.getWaterVision()); + } - if (farDistance > renderDistance) { - farDistance = renderDistance; - shape = FogShape.CYLINDER; - } + if (farDistance > renderDistance) { + farDistance = renderDistance; + shape = FogShape.CYLINDER; + } - RenderSystem.setShaderFogStart(nearDistance); - RenderSystem.setShaderFogEnd(farDistance); - RenderSystem.setShaderFogShape(shape); - } - }); - } + RenderSystem.setShaderFogStart(nearDistance); + RenderSystem.setShaderFogEnd(farDistance); + RenderSystem.setShaderFogShape(shape); + } + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java index e386bf31..734f9afd 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMConfiguredFeature.java @@ -33,282 +33,282 @@ public class ATMConfiguredFeature { - public static final ImmutableList ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList - .of( - OreConfiguration.target( - OreFeatures.STONE_ORE_REPLACEABLES, - ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState()), - OreConfiguration.target( - OreFeatures.DEEPSLATE_ORE_REPLACEABLES, - ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState())); - public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, - 4); + public static final ImmutableList ORE_ALLTHEMODIUM_TARGET_LIST = ImmutableList + .of( + OreConfiguration.target( + OreFeatures.STONE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_ORE.get().defaultBlockState()), + OreConfiguration.target( + OreFeatures.DEEPSLATE_ORE_REPLACEABLES, + ModRegistry.ALLTHEMODIUM_SLATE_ORE.get().defaultBlockState())); + public static final OreConfiguration ORE_ALLTHEMODIUM_CONFIG = new OreConfiguration(ORE_ALLTHEMODIUM_TARGET_LIST, + 4); - public static Holder> ORE_ALLTHEMODIUM = FeatureUtils.register( - "allthemodium:ore_allthemodium", - Feature.ORE, - ORE_ALLTHEMODIUM_CONFIG); + public static Holder> ORE_ALLTHEMODIUM = FeatureUtils.register( + "allthemodium:ore_allthemodium", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG); - public static Holder> ORE_ATM_MINING = FeatureUtils.register( - "allthemodium:ore_atm_mining", - Feature.ORE, - ORE_ALLTHEMODIUM_CONFIG); + public static Holder> ORE_ATM_MINING = FeatureUtils.register( + "allthemodium:ore_atm_mining", + Feature.ORE, + ORE_ALLTHEMODIUM_CONFIG); - public static Holder> ORE_VIBRANIUM = FeatureUtils.register( - "allthemodium:ore_vibranium", - Feature.ORE, - new OreConfiguration( - OreFeatures.NETHER_ORE_REPLACEABLES, - ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), - 4)); + public static Holder> ORE_VIBRANIUM = FeatureUtils.register( + "allthemodium:ore_vibranium", + Feature.ORE, + new OreConfiguration( + OreFeatures.NETHER_ORE_REPLACEABLES, + ModRegistry.VIBRANIUM_ORE.get().defaultBlockState(), + 4)); - public static Holder> OTHER_ORE_VIBRANIUM = FeatureUtils.register( - "allthemodium:other_ore_vibranium", - Feature.ORE, - new OreConfiguration( - new TagMatchTest(TagRegistry.ANCIENT_STONE), - ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), - 3)); + public static Holder> OTHER_ORE_VIBRANIUM = FeatureUtils.register( + "allthemodium:other_ore_vibranium", + Feature.ORE, + new OreConfiguration( + new TagMatchTest(TagRegistry.ANCIENT_STONE), + ModRegistry.OTHER_VIBRANIUM_ORE.get().defaultBlockState(), + 3)); - public static Holder> ORE_UNOBTAINIUM = FeatureUtils.register( - "allthemodium:ore_unobtainium", - Feature.ORE, - new OreConfiguration( - new BlockMatchTest(Blocks.END_STONE), - ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), - 4)); + public static Holder> ORE_UNOBTAINIUM = FeatureUtils.register( + "allthemodium:ore_unobtainium", + Feature.ORE, + new OreConfiguration( + new BlockMatchTest(Blocks.END_STONE), + ModRegistry.UNOBTAINIUM_ORE.get().defaultBlockState(), + 4)); - public static Holder> VOLCANO_CF = FeatureUtils.register( - "allthemodium:volcano", - ModRegistry.VOLCANO.get(), - VolcanoConfig.INSTANCE); + public static Holder> VOLCANO_CF = FeatureUtils.register( + "allthemodium:volcano", + ModRegistry.VOLCANO.get(), + VolcanoConfig.INSTANCE); - public static final Holder> MOD_DELTAS = FeatureUtils.register( - "allthemodium:other_deltas", - Feature.DELTA_FEATURE, - new DeltaFeatureConfiguration( - ModRegistry.ANCIENT_STONE.get().defaultBlockState(), - Blocks.MAGMA_BLOCK.defaultBlockState(), - UniformInt.of(3, 4), - UniformInt.of(0, 2))); + public static final Holder> MOD_DELTAS = FeatureUtils.register( + "allthemodium:other_deltas", + Feature.DELTA_FEATURE, + new DeltaFeatureConfiguration( + ModRegistry.ANCIENT_STONE.get().defaultBlockState(), + Blocks.MAGMA_BLOCK.defaultBlockState(), + UniformInt.of(3, 4), + UniformInt.of(0, 2))); - public static final Holder> ANCIENT_TREE_GIANT = FeatureUtils.register( - "allthemodium:ancient_tree_giant", - Feature.TREE, - createAncientGiantTree().build()); - public static final Holder> ANCIENT_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:ancient_tree_medium", - Feature.TREE, - createAncientMediumTree().build()); - public static final Holder> ANCIENT_TREE = FeatureUtils.register( - "allthemodium:ancient_tree", - Feature.TREE, - createAncientTree().build()); + public static final Holder> ANCIENT_TREE_GIANT = FeatureUtils.register( + "allthemodium:ancient_tree_giant", + Feature.TREE, + createAncientGiantTree().build()); + public static final Holder> ANCIENT_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:ancient_tree_medium", + Feature.TREE, + createAncientMediumTree().build()); + public static final Holder> ANCIENT_TREE = FeatureUtils.register( + "allthemodium:ancient_tree", + Feature.TREE, + createAncientTree().build()); - public static final Holder> DEMONIC_TREE_GIANT = FeatureUtils.register( - "allthemodium:demonic_tree_giant", - Feature.TREE, - createDemonicGiantTree().build()); - public static final Holder> DEMONIC_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:demonic_tree_medium", - Feature.TREE, - createDemonicMediumTree().build()); - public static final Holder> DEMONIC_TREE = FeatureUtils.register( - "allthemodium:demonic_tree", - Feature.TREE, - createDemonicTree().build()); + public static final Holder> DEMONIC_TREE_GIANT = FeatureUtils.register( + "allthemodium:demonic_tree_giant", + Feature.TREE, + createDemonicGiantTree().build()); + public static final Holder> DEMONIC_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:demonic_tree_medium", + Feature.TREE, + createDemonicMediumTree().build()); + public static final Holder> DEMONIC_TREE = FeatureUtils.register( + "allthemodium:demonic_tree", + Feature.TREE, + createDemonicTree().build()); - public static final Holder> SOUL_TREE_GIANT = FeatureUtils.register( - "allthemodium:soul_tree_giant", - Feature.TREE, - createSoulGiantTree().build()); - public static final Holder> SOUL_TREE_MEDIUM = FeatureUtils.register( - "allthemodium:soul_tree_medium", - Feature.TREE, - createSoulMediumTree().build()); - public static final Holder> SOUL_TREE = FeatureUtils.register( - "allthemodium:soul_tree", - Feature.TREE, - createSoulTree().build()); + public static final Holder> SOUL_TREE_GIANT = FeatureUtils.register( + "allthemodium:soul_tree_giant", + Feature.TREE, + createSoulGiantTree().build()); + public static final Holder> SOUL_TREE_MEDIUM = FeatureUtils.register( + "allthemodium:soul_tree_medium", + Feature.TREE, + createSoulMediumTree().build()); + public static final Holder> SOUL_TREE = FeatureUtils.register( + "allthemodium:soul_tree", + Feature.TREE, + createSoulTree().build()); - private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = new WeightedStateProvider( - SimpleWeightedRandomList - .builder() - .add( - ModRegistry.ANCIENT_CAVEVINES_PLANT_ - .get() - .defaultBlockState(), - 4) - .add( - ModRegistry.ANCIENT_CAVEVINES_PLANT_ - .get() - .defaultBlockState() - .setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), - 1)); - private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = new RandomizedIntStateProvider( - new WeightedStateProvider( - SimpleWeightedRandomList - .builder() - .add( - ModRegistry.ANCIENT_CAVEVINES_ - .get() - .defaultBlockState(), - 4) - .add( - ModRegistry.ANCIENT_CAVEVINES_ - .get() - .defaultBlockState() - .setValue( - ACaveVines.BERRIES, - Boolean.valueOf(true)), - 1)), - AncientCaveVines.AGE, - UniformInt.of(23, 25)); - public static final Holder> CAVE_VINE = FeatureUtils.register( - "allthemodium:cave_vine", - Feature.BLOCK_COLUMN, - new BlockColumnConfiguration( - List.of( - BlockColumnConfiguration.layer( - new WeightedListInt( - SimpleWeightedRandomList - .builder() - .add(UniformInt.of(0, 19), 2) - .add(UniformInt.of(0, 2), 3) - .add(UniformInt.of(0, 6), 10) - .build()), - CAVE_VINES_BODY_PROVIDER), - BlockColumnConfiguration.layer( - ConstantInt.of(1), - CAVE_VINES_HEAD_PROVIDER)), - Direction.DOWN, - BlockPredicate.ONLY_IN_AIR_PREDICATE, - true)); + private static final WeightedStateProvider CAVE_VINES_BODY_PROVIDER = new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState(), + 4) + .add( + ModRegistry.ANCIENT_CAVEVINES_PLANT_ + .get() + .defaultBlockState() + .setValue(ACaveVines.BERRIES, Boolean.valueOf(true)), + 1)); + private static final RandomizedIntStateProvider CAVE_VINES_HEAD_PROVIDER = new RandomizedIntStateProvider( + new WeightedStateProvider( + SimpleWeightedRandomList + .builder() + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState(), + 4) + .add( + ModRegistry.ANCIENT_CAVEVINES_ + .get() + .defaultBlockState() + .setValue( + ACaveVines.BERRIES, + Boolean.valueOf(true)), + 1)), + AncientCaveVines.AGE, + UniformInt.of(23, 25)); + public static final Holder> CAVE_VINE = FeatureUtils.register( + "allthemodium:cave_vine", + Feature.BLOCK_COLUMN, + new BlockColumnConfiguration( + List.of( + BlockColumnConfiguration.layer( + new WeightedListInt( + SimpleWeightedRandomList + .builder() + .add(UniformInt.of(0, 19), 2) + .add(UniformInt.of(0, 2), 3) + .add(UniformInt.of(0, 6), 10) + .build()), + CAVE_VINES_BODY_PROVIDER), + BlockColumnConfiguration.layer( + ConstantInt.of(1), + CAVE_VINES_HEAD_PROVIDER)), + Direction.DOWN, + BlockPredicate.ONLY_IN_AIR_PREDICATE, + true)); - public static final Holder> PATCH_ANCIENT_HERB = FeatureUtils - .register( - "allthemodium:patch_ancient_herb", - Feature.RANDOM_PATCH, - FeatureUtils.simplePatchConfiguration( - Feature.SIMPLE_BLOCK, - new SimpleBlockConfiguration( - BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get())))); + public static final Holder> PATCH_ANCIENT_HERB = FeatureUtils + .register( + "allthemodium:patch_ancient_herb", + Feature.RANDOM_PATCH, + FeatureUtils.simplePatchConfiguration( + Feature.SIMPLE_BLOCK, + new SimpleBlockConfiguration( + BlockStateProvider.simple(ModRegistry.ANCIENT_HERB.get())))); - private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_0.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_1.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createAncientTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.ANCIENT_LOG_2.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.ANCIENT_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createDemonicTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.DEMONIC_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.DEMONIC_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.ANCIENT_DIRT.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(26, 7, 7), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_1.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulGiantTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(26, 7, 7), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_1.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(17, 5, 5), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_2.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulMediumTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(17, 5, 5), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_2.get().defaultBlockState()))); + } - private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { - return (new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), - new FancyTrunkPlacer(8, 3, 3), - BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), - new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), - new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) - .dirt( - new SimpleStateProvider( - ModRegistry.SOUL_LOG_0.get().defaultBlockState()))); - } + private static TreeConfiguration.TreeConfigurationBuilder createSoulTree() { + return (new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(ModRegistry.SOUL_LOG.get()), + new FancyTrunkPlacer(8, 3, 3), + BlockStateProvider.simple(ModRegistry.SOUL_LEAVES.get()), + new FancyFoliagePlacer(ConstantInt.of(2), ConstantInt.of(4), 4), + new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4))) + .dirt( + new SimpleStateProvider( + ModRegistry.SOUL_LOG_0.get().defaultBlockState()))); + } - public static ConfiguredFeature newConfiguredFeature( - String registryName, - ConfiguredFeature configuredFeature) { - Registry.register( - BuiltinRegistries.CONFIGURED_FEATURE, - new ResourceLocation(Reference.MOD_ID, registryName), - configuredFeature); - return configuredFeature; - } + public static ConfiguredFeature newConfiguredFeature( + String registryName, + ConfiguredFeature configuredFeature) { + Registry.register( + BuiltinRegistries.CONFIGURED_FEATURE, + new ResourceLocation(Reference.MOD_ID, registryName), + configuredFeature); + return configuredFeature; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java index b7a3dabd..31d36d5a 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATMPlacedFeature.java @@ -15,176 +15,176 @@ public class ATMPlacedFeature { - public static final Holder ORE_ALLTHEMODIUM = PlacementUtils.register( - "allthemodium:ore_allthemodium", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(15), - VerticalAnchor.absolute(20)))); - public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = PlacementUtils.register( - "allthemodium:ore_allthemodium_mountain", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - commonOrePlacement( - 10, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(170), - VerticalAnchor.belowTop(20)))); - public static final Holder ORE_ATM_MINING = PlacementUtils.register( - "allthemodium:ore_atm_mining", - ATMConfiguredFeature.ORE_ATM_MINING, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(5), - VerticalAnchor.absolute(20)))); - public static final Holder ORE_VIBRANIUM = PlacementUtils.register( - "allthemodium:ore_vibranium", - ATMConfiguredFeature.ORE_VIBRANIUM, - rareOrePlacement( - 7, - HeightRangePlacement.uniform( - VerticalAnchor.belowTop(28), - VerticalAnchor.belowTop(5)))); - public static final Holder ORE_VIBRANIUM_OTHER = PlacementUtils.register( - "allthemodium:other_vibranium_ore", - ATMConfiguredFeature.OTHER_ORE_VIBRANIUM, - commonOrePlacement( - 2, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(1), - VerticalAnchor.absolute(20)))); + public static final Holder ORE_ALLTHEMODIUM = PlacementUtils.register( + "allthemodium:ore_allthemodium", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(20)))); + public static final Holder ORE_ALLTHEMODIUM_MOUNTAIN = PlacementUtils.register( + "allthemodium:ore_allthemodium_mountain", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + commonOrePlacement( + 10, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(170), + VerticalAnchor.belowTop(20)))); + public static final Holder ORE_ATM_MINING = PlacementUtils.register( + "allthemodium:ore_atm_mining", + ATMConfiguredFeature.ORE_ATM_MINING, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(5), + VerticalAnchor.absolute(20)))); + public static final Holder ORE_VIBRANIUM = PlacementUtils.register( + "allthemodium:ore_vibranium", + ATMConfiguredFeature.ORE_VIBRANIUM, + rareOrePlacement( + 7, + HeightRangePlacement.uniform( + VerticalAnchor.belowTop(28), + VerticalAnchor.belowTop(5)))); + public static final Holder ORE_VIBRANIUM_OTHER = PlacementUtils.register( + "allthemodium:other_vibranium_ore", + ATMConfiguredFeature.OTHER_ORE_VIBRANIUM, + commonOrePlacement( + 2, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(1), + VerticalAnchor.absolute(20)))); - public static final Holder ORE_UNOBTAINIUM = PlacementUtils.register( - "allthemodium:ore_unobtainium", - ATMConfiguredFeature.ORE_UNOBTAINIUM, - rareOrePlacement( - 9, - HeightRangePlacement.uniform( - VerticalAnchor.aboveBottom(15), - VerticalAnchor.absolute(78)))); + public static final Holder ORE_UNOBTAINIUM = PlacementUtils.register( + "allthemodium:ore_unobtainium", + ATMConfiguredFeature.ORE_UNOBTAINIUM, + rareOrePlacement( + 9, + HeightRangePlacement.uniform( + VerticalAnchor.aboveBottom(15), + VerticalAnchor.absolute(78)))); - public static final Holder VOLCANO_CF = PlacementUtils.register( - "allthemodium:volcano", - ATMConfiguredFeature.VOLCANO_CF); - public static final Holder MOD_DELTAS = PlacementUtils.register( - "allthemodium:other_deltas", - ATMConfiguredFeature.MOD_DELTAS); - public static final Holder ANCIENT_TREE = PlacementUtils.register( - "allthemodium:ancient_tree", - ATMConfiguredFeature.ANCIENT_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder ANCIENT_TREE_MEDIUM = PlacementUtils.register( - "allthemodium:ancient_tree_medium", - ATMConfiguredFeature.ANCIENT_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder ANCIENT_TREE_GIANT = PlacementUtils.register( - "allthemodium:ancient_tree_giant", - ATMConfiguredFeature.ANCIENT_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder VOLCANO_CF = PlacementUtils.register( + "allthemodium:volcano", + ATMConfiguredFeature.VOLCANO_CF); + public static final Holder MOD_DELTAS = PlacementUtils.register( + "allthemodium:other_deltas", + ATMConfiguredFeature.MOD_DELTAS); + public static final Holder ANCIENT_TREE = PlacementUtils.register( + "allthemodium:ancient_tree", + ATMConfiguredFeature.ANCIENT_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder ANCIENT_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:ancient_tree_medium", + ATMConfiguredFeature.ANCIENT_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder ANCIENT_TREE_GIANT = PlacementUtils.register( + "allthemodium:ancient_tree_giant", + ATMConfiguredFeature.ANCIENT_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE = PlacementUtils.register( - "allthemodium:demonic_tree", - ATMConfiguredFeature.DEMONIC_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE_MEDIUM = PlacementUtils.register( - "allthemodium:demonic_tree_medium", - ATMConfiguredFeature.DEMONIC_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder DEMONIC_TREE_GIANT = PlacementUtils.register( - "allthemodium:demonic_tree_giant", - ATMConfiguredFeature.DEMONIC_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder DEMONIC_TREE = PlacementUtils.register( + "allthemodium:demonic_tree", + ATMConfiguredFeature.DEMONIC_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder DEMONIC_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:demonic_tree_medium", + ATMConfiguredFeature.DEMONIC_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder DEMONIC_TREE_GIANT = PlacementUtils.register( + "allthemodium:demonic_tree_giant", + ATMConfiguredFeature.DEMONIC_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE = PlacementUtils.register( - "allthemodium:soul_tree", - ATMConfiguredFeature.SOUL_TREE, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE_MEDIUM = PlacementUtils.register( - "allthemodium:soul_tree_medium", - ATMConfiguredFeature.SOUL_TREE_MEDIUM, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder SOUL_TREE_GIANT = PlacementUtils.register( - "allthemodium:soul_tree_giant", - ATMConfiguredFeature.SOUL_TREE_GIANT, - treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder SOUL_TREE = PlacementUtils.register( + "allthemodium:soul_tree", + ATMConfiguredFeature.SOUL_TREE, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder SOUL_TREE_MEDIUM = PlacementUtils.register( + "allthemodium:soul_tree_medium", + ATMConfiguredFeature.SOUL_TREE_MEDIUM, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); + public static final Holder SOUL_TREE_GIANT = PlacementUtils.register( + "allthemodium:soul_tree_giant", + ATMConfiguredFeature.SOUL_TREE_GIANT, + treePlacement(PlacementUtils.countExtra(2, 0.1F, 1))); - public static final Holder CAVE_VINES = PlacementUtils.register( - "allthemodium:cave_vines", - ATMConfiguredFeature.CAVE_VINE, - CountPlacement.of(188), - InSquarePlacement.spread(), - PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, - EnvironmentScanPlacement.scanningFor( - Direction.UP, - BlockPredicate.hasSturdyFace(Direction.DOWN), - BlockPredicate.ONLY_IN_AIR_PREDICATE, - 12), - RandomOffsetPlacement.vertical(ConstantInt.of(-1)), - BiomeFilter.biome()); + public static final Holder CAVE_VINES = PlacementUtils.register( + "allthemodium:cave_vines", + ATMConfiguredFeature.CAVE_VINE, + CountPlacement.of(188), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome()); - public static final Holder CAVE_ATM = PlacementUtils.register( - "allthemodium:cave_ore", - ATMConfiguredFeature.ORE_ALLTHEMODIUM, - CountPlacement.of(50), - InSquarePlacement.spread(), - PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, - EnvironmentScanPlacement.scanningFor( - Direction.UP, - BlockPredicate.hasSturdyFace(Direction.DOWN), - BlockPredicate.ONLY_IN_AIR_PREDICATE, - 12), - RandomOffsetPlacement.vertical(ConstantInt.of(-1)), - BiomeFilter.biome()); + public static final Holder CAVE_ATM = PlacementUtils.register( + "allthemodium:cave_ore", + ATMConfiguredFeature.ORE_ALLTHEMODIUM, + CountPlacement.of(50), + InSquarePlacement.spread(), + PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, + EnvironmentScanPlacement.scanningFor( + Direction.UP, + BlockPredicate.hasSturdyFace(Direction.DOWN), + BlockPredicate.ONLY_IN_AIR_PREDICATE, + 12), + RandomOffsetPlacement.vertical(ConstantInt.of(-1)), + BiomeFilter.biome()); - private static List orePlacement( - PlacementModifier placement, - PlacementModifier placement2) { - return List.of( - placement, - InSquarePlacement.spread(), - placement2, - BiomeFilter.biome()); - } + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome()); + } - private static List commonOrePlacement( - int count, - PlacementModifier pm) { - return orePlacement(CountPlacement.of(count), pm); - } + private static List commonOrePlacement( + int count, + PlacementModifier pm) { + return orePlacement(CountPlacement.of(count), pm); + } - private static List rareOrePlacement( - int rarity, - PlacementModifier pm) { - return orePlacement(RarityFilter.onAverageOnceEvery(rarity), pm); - } + private static List rareOrePlacement( + int rarity, + PlacementModifier pm) { + return orePlacement(RarityFilter.onAverageOnceEvery(rarity), pm); + } - private static ImmutableList.Builder treePlacementBase( - PlacementModifier p_195485_) { - return ImmutableList - .builder() - .add(p_195485_) - .add(InSquarePlacement.spread()) - .add(VegetationPlacements.TREE_THRESHOLD) - .add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE) - .add(BiomeFilter.biome()); - } + private static ImmutableList.Builder treePlacementBase( + PlacementModifier p_195485_) { + return ImmutableList + .builder() + .add(p_195485_) + .add(InSquarePlacement.spread()) + .add(VegetationPlacements.TREE_THRESHOLD) + .add(PlacementUtils.HEIGHTMAP_WORLD_SURFACE) + .add(BiomeFilter.biome()); + } - public static List treePlacement( - PlacementModifier p_195480_) { - return treePlacementBase(p_195480_).build(); - } + public static List treePlacement( + PlacementModifier p_195480_) { + return treePlacementBase(p_195480_).build(); + } - public static List treePlacement( - PlacementModifier p_195482_, - Block p_195483_) { - return treePlacementBase(p_195482_) - .add( - BlockPredicateFilter.forPredicate( - BlockPredicate.wouldSurvive( - p_195483_.defaultBlockState(), - BlockPos.ZERO))) - .build(); - } + public static List treePlacement( + PlacementModifier p_195482_, + Block p_195483_) { + return treePlacementBase(p_195482_) + .add( + BlockPredicateFilter.forPredicate( + BlockPredicate.wouldSurvive( + p_195483_.defaultBlockState(), + BlockPos.ZERO))) + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java index 71b71c21..8aa5a755 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/ATOtherPlacedFeatures.java @@ -9,84 +9,84 @@ public class ATOtherPlacedFeatures { - public static final Holder OTHER_ORE_COAL = PlacementUtils.register( - "allthemodium:ore_coal", - ATOOtherFeatures.OTHER_ORE_COAL, - commonOrePlacement( - 30, - HeightRangePlacement.uniform( - VerticalAnchor.absolute(136), - VerticalAnchor.top()))); - public static final Holder OTHER_ORE_COPPER = PlacementUtils.register( - "allthemodium:ore_copper", - ATOOtherFeatures.OTHER_ORE_COPPER, - commonOrePlacement( - 16, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-16), - VerticalAnchor.absolute(112)))); - public static final Holder OTHER_ORE_DIAMOND = PlacementUtils.register( - "allthemodium:ore_diamond", - ATOOtherFeatures.OTHER_ORE_DIAMOND, - commonOrePlacement( - 14, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-10), - VerticalAnchor.absolute(129)))); - public static final Holder OTHER_ORE_EMERALD = PlacementUtils.register( - "allthemodium:ore_emerald", - ATOOtherFeatures.OTHER_ORE_EMERALD, - commonOrePlacement( - 20, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-16), - VerticalAnchor.absolute(480)))); - public static final Holder OTHER_ORE_GOLD = PlacementUtils.register( - "allthemodium:ore_gold", - ATOOtherFeatures.OTHER_ORE_GOLD, - commonOrePlacement(20, PlacementUtils.RANGE_10_10)); - public static final Holder OTHER_ORE_IRON = PlacementUtils.register( - "allthemodium:ore_iron", - ATOOtherFeatures.OTHER_ORE_IRON, - commonOrePlacement( - 50, - HeightRangePlacement.triangle( - VerticalAnchor.absolute(-24), - VerticalAnchor.absolute(384)))); - public static final Holder OTHER_ORE_LAPIS = PlacementUtils.register( - "allthemodium:ore_lapis", - ATOOtherFeatures.OTHER_ORE_LAPIS, - commonOrePlacement( - 4, - HeightRangePlacement.uniform( - VerticalAnchor.bottom(), - VerticalAnchor.absolute(64)))); - public static final Holder OTHER_ORE_QUARTZ = PlacementUtils.register( - "allthemodium:ore_quartz", - ATOOtherFeatures.OTHER_ORE_QUARTZ, - commonOrePlacement(16, PlacementUtils.RANGE_10_10)); - public static final Holder OTHER_ORE_REDSTONE = PlacementUtils.register( - "allthemodium:ore_redstone", - ATOOtherFeatures.OTHER_ORE_REDSTONE, - commonOrePlacement( - 14, - HeightRangePlacement.uniform( - VerticalAnchor.bottom(), - VerticalAnchor.absolute(15)))); + public static final Holder OTHER_ORE_COAL = PlacementUtils.register( + "allthemodium:ore_coal", + ATOOtherFeatures.OTHER_ORE_COAL, + commonOrePlacement( + 30, + HeightRangePlacement.uniform( + VerticalAnchor.absolute(136), + VerticalAnchor.top()))); + public static final Holder OTHER_ORE_COPPER = PlacementUtils.register( + "allthemodium:ore_copper", + ATOOtherFeatures.OTHER_ORE_COPPER, + commonOrePlacement( + 16, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(112)))); + public static final Holder OTHER_ORE_DIAMOND = PlacementUtils.register( + "allthemodium:ore_diamond", + ATOOtherFeatures.OTHER_ORE_DIAMOND, + commonOrePlacement( + 14, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-10), + VerticalAnchor.absolute(129)))); + public static final Holder OTHER_ORE_EMERALD = PlacementUtils.register( + "allthemodium:ore_emerald", + ATOOtherFeatures.OTHER_ORE_EMERALD, + commonOrePlacement( + 20, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-16), + VerticalAnchor.absolute(480)))); + public static final Holder OTHER_ORE_GOLD = PlacementUtils.register( + "allthemodium:ore_gold", + ATOOtherFeatures.OTHER_ORE_GOLD, + commonOrePlacement(20, PlacementUtils.RANGE_10_10)); + public static final Holder OTHER_ORE_IRON = PlacementUtils.register( + "allthemodium:ore_iron", + ATOOtherFeatures.OTHER_ORE_IRON, + commonOrePlacement( + 50, + HeightRangePlacement.triangle( + VerticalAnchor.absolute(-24), + VerticalAnchor.absolute(384)))); + public static final Holder OTHER_ORE_LAPIS = PlacementUtils.register( + "allthemodium:ore_lapis", + ATOOtherFeatures.OTHER_ORE_LAPIS, + commonOrePlacement( + 4, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(64)))); + public static final Holder OTHER_ORE_QUARTZ = PlacementUtils.register( + "allthemodium:ore_quartz", + ATOOtherFeatures.OTHER_ORE_QUARTZ, + commonOrePlacement(16, PlacementUtils.RANGE_10_10)); + public static final Holder OTHER_ORE_REDSTONE = PlacementUtils.register( + "allthemodium:ore_redstone", + ATOOtherFeatures.OTHER_ORE_REDSTONE, + commonOrePlacement( + 14, + HeightRangePlacement.uniform( + VerticalAnchor.bottom(), + VerticalAnchor.absolute(15)))); - private static List orePlacement( - PlacementModifier placement, - PlacementModifier placement2) { - return List.of( - placement, - InSquarePlacement.spread(), - placement2, - BiomeFilter.biome()); - } + private static List orePlacement( + PlacementModifier placement, + PlacementModifier placement2) { + return List.of( + placement, + InSquarePlacement.spread(), + placement2, + BiomeFilter.biome()); + } - private static List commonOrePlacement( - int count, - PlacementModifier pm) { - return orePlacement(CountPlacement.of(count), pm); - } + private static List commonOrePlacement( + int count, + PlacementModifier pm) { + return orePlacement(CountPlacement.of(count), pm); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java index 5db16ba0..ffbc5833 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/MiningDimSource.java @@ -10,34 +10,34 @@ public class MiningDimSource extends FlatLevelSource { - public static final Codec CODEC = RecordCodecBuilder.create(p_204551_ -> { - return commonCodec(p_204551_) - .and( - FlatLevelGeneratorSettings.CODEC - .fieldOf("settings") - .forGetter(FlatLevelSource::settings)) - .apply(p_204551_, p_204551_.stable(MiningDimSource::new)); - }); - private final FlatLevelGeneratorSettings settings; + public static final Codec CODEC = RecordCodecBuilder.create(p_204551_ -> { + return commonCodec(p_204551_) + .and( + FlatLevelGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(FlatLevelSource::settings)) + .apply(p_204551_, p_204551_.stable(MiningDimSource::new)); + }); + private final FlatLevelGeneratorSettings settings; - public MiningDimSource( - Registry structureSetRegistry, - FlatLevelGeneratorSettings settings) { - super(structureSetRegistry, settings); - this.settings = settings; - } + public MiningDimSource( + Registry structureSetRegistry, + FlatLevelGeneratorSettings settings) { + super(structureSetRegistry, settings); + this.settings = settings; + } - @Override - protected Codec codec() { - return CODEC; - } + @Override + protected Codec codec() { + return CODEC; + } - @Override - public FlatLevelGeneratorSettings settings() { - return this.settings; - } + @Override + public FlatLevelGeneratorSettings settings() { + return this.settings; + } - public int getMinY() { - return -64; - } + public int getMinY() { + return -64; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java index 6f70ed53..11585273 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/TheOtherDimSource.java @@ -12,33 +12,33 @@ public class TheOtherDimSource extends NoiseBasedChunkGenerator { - public static final Codec CODEC = RecordCodecBuilder.create(p_188643_ -> { - return commonCodec(p_188643_) - .and( - p_188643_.group( - RegistryOps - .retrieveRegistry(Registry.NOISE_REGISTRY) - .forGetter(p_188716_ -> { - return p_188716_.noises; - }), - BiomeSource.CODEC - .fieldOf("biome_source") - .forGetter(p_188711_ -> { - return p_188711_.biomeSource; - }), - NoiseGeneratorSettings.CODEC - .fieldOf("settings") - .forGetter(p_204585_ -> { - return p_204585_.settings; - }))) - .apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); - }); + public static final Codec CODEC = RecordCodecBuilder.create(p_188643_ -> { + return commonCodec(p_188643_) + .and( + p_188643_.group( + RegistryOps + .retrieveRegistry(Registry.NOISE_REGISTRY) + .forGetter(p_188716_ -> { + return p_188716_.noises; + }), + BiomeSource.CODEC + .fieldOf("biome_source") + .forGetter(p_188711_ -> { + return p_188711_.biomeSource; + }), + NoiseGeneratorSettings.CODEC + .fieldOf("settings") + .forGetter(p_204585_ -> { + return p_204585_.settings; + }))) + .apply(p_188643_, p_188643_.stable(TheOtherDimSource::new)); + }); - public TheOtherDimSource( - Registry p_224206_, - Registry p_224207_, - BiomeSource p_224208_, - Holder p_224209_) { - super(p_224206_, p_224207_, p_224208_, p_224209_); - } + public TheOtherDimSource( + Registry p_224206_, + Registry p_224207_, + BiomeSource p_224208_, + Holder p_224209_) { + super(p_224206_, p_224207_, p_224208_, p_224209_); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java index 63a86099..6cd39b0a 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/biomes/ATMBiomes.java @@ -16,369 +16,369 @@ @Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ATMBiomes { - public static Biome The_Other = the_other(); - public static Biome Basalt_Deltas = basalt_deltas(); - public static Biome Crimson_Forest = crimson_forest(); - public static Biome Desert = desert(); - public static Biome Desert_Hills = desert_hills(); - public static Biome Soul_Sand_Valley = soul_sand_valley(); - public static Biome Warped_Forest = warped_forest(); + public static Biome The_Other = the_other(); + public static Biome Basalt_Deltas = basalt_deltas(); + public static Biome Crimson_Forest = crimson_forest(); + public static Biome Desert = desert(); + public static Biome Desert_Hills = desert_hills(); + public static Biome Soul_Sand_Valley = soul_sand_valley(); + public static Biome Warped_Forest = warped_forest(); - public static void addDefaultCarvers( - BiomeGenerationSettings.Builder builder) { - builder.addCarver(GenerationStep.Carving.AIR, Carvers.NETHER_CAVE); - builder.addCarver(GenerationStep.Carving.AIR, Carvers.CAVE); - builder.addCarver(GenerationStep.Carving.AIR, Carvers.CANYON); - } + public static void addDefaultCarvers( + BiomeGenerationSettings.Builder builder) { + builder.addCarver(GenerationStep.Carving.AIR, Carvers.NETHER_CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CAVE); + builder.addCarver(GenerationStep.Carving.AIR, Carvers.CANYON); + } - public static Biome mining() { - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(new MobSpawnSettings.Builder().build()) - .temperature(1.0f) - .downfall(0f) - .specialEffects( - new BiomeSpecialEffects.Builder() - .fogColor(12341234) - .waterColor(4159204) - .waterFogColor(329011) - .skyColor(7254527) - .foliageColorOverride(1787717) - .grassColorOverride(9470000) - .build()) - .generationSettings(new BiomeGenerationSettings.Builder().build()) - .build(); - } + public static Biome mining() { + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(new MobSpawnSettings.Builder().build()) + .temperature(1.0f) + .downfall(0f) + .specialEffects( + new BiomeSpecialEffects.Builder() + .fogColor(12341234) + .waterColor(4159204) + .waterFogColor(329011) + .skyColor(7254527) + .foliageColorOverride(1787717) + .grassColorOverride(9470000) + .build()) + .generationSettings(new BiomeGenerationSettings.Builder().build()) + .build(); + } - public static Biome the_other() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome the_other() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.5f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.5f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome basalt_deltas() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(6840176) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addLushCavesVegetationFeatures( - biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.BASALT_BLOBS); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.SMALL_BASALT_COLUMNS); - biomeGenerationSettings.addFeature( - GenerationStep.Decoration.LOCAL_MODIFICATIONS, - NetherPlacements.LARGE_BASALT_COLUMNS); + public static Biome basalt_deltas() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(6840176) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addLushCavesVegetationFeatures( + biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.BASALT_BLOBS); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.SMALL_BASALT_COLUMNS); + biomeGenerationSettings.addFeature( + GenerationStep.Decoration.LOCAL_MODIFICATIONS, + NetherPlacements.LARGE_BASALT_COLUMNS); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.MAGMA_CUBE, - 100, - 5, - 10)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.MAGMA_CUBE, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(2.0f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(2.0f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome crimson_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome crimson_forest() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.BLAZE, - 120, - 3, - 5)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.BLAZE, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.3f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.3f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome desert() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome desert() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.CREATURE, - new MobSpawnSettings.SpawnerData( - EntityType.RABBIT, - 120, - 3, - 5)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.8f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.8f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome desert_hills() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome desert_hills() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.CREATURE, - new MobSpawnSettings.SpawnerData( - EntityType.RABBIT, - 120, - 3, - 5)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.CREATURE, + new MobSpawnSettings.SpawnerData( + EntityType.RABBIT, + 120, + 3, + 5)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.7f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.7f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome soul_sand_valley() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(3343107) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(3343107) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome soul_sand_valley() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(3343107) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(3343107) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.GHAST, - 120, - 3, - 3)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.GHAST, + 120, + 3, + 3)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.1f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.1f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } - public static Biome warped_forest() { - BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() - .fogColor(1705242) - .waterColor(3343107) - .waterFogColor(3343107) - .skyColor(1705242) - .foliageColorOverride(1787717) - .grassColorOverride(1787717) - .build(); - BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); - BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); - addDefaultCarvers(biomeGenerationSettings); + public static Biome warped_forest() { + BiomeSpecialEffects effects = new BiomeSpecialEffects.Builder() + .fogColor(1705242) + .waterColor(3343107) + .waterFogColor(3343107) + .skyColor(1705242) + .foliageColorOverride(1787717) + .grassColorOverride(1787717) + .build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder(); + BiomeDefaultFeatures.addDripstone(biomeGenerationSettings); + addDefaultCarvers(biomeGenerationSettings); - MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.WITHER_SKELETON, - 100, - 5, - 10)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.ENDERMAN, - 160, - 3, - 7)) - .addSpawn( - MobCategory.MONSTER, - new MobSpawnSettings.SpawnerData( - EntityType.PIGLIN_BRUTE, - 140, - 8, - 12)) - .build(); + MobSpawnSettings mobSpawnInfo = (new MobSpawnSettings.Builder()).addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.WITHER_SKELETON, + 100, + 5, + 10)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.ENDERMAN, + 160, + 3, + 7)) + .addSpawn( + MobCategory.MONSTER, + new MobSpawnSettings.SpawnerData( + EntityType.PIGLIN_BRUTE, + 140, + 8, + 12)) + .build(); - return new Biome.BiomeBuilder() - .precipitation(Biome.Precipitation.NONE) - .mobSpawnSettings(mobSpawnInfo) - .temperature(1.2f) - .downfall(0f) - .specialEffects(effects) - .generationSettings(biomeGenerationSettings.build()) - .build(); - } + return new Biome.BiomeBuilder() + .precipitation(Biome.Precipitation.NONE) + .mobSpawnSettings(mobSpawnInfo) + .temperature(1.2f) + .downfall(0f) + .specialEffects(effects) + .generationSettings(biomeGenerationSettings.build()) + .build(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java index ddf7ca68..501844d7 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/AncientTreeGrower.java @@ -11,17 +11,17 @@ public class AncientTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder> getConfiguredFeature(@Nonnull RandomSource random, - boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.ANCIENT_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.ANCIENT_TREE; - } - return ATMConfiguredFeature.ANCIENT_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.ANCIENT_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.ANCIENT_TREE; + } + return ATMConfiguredFeature.ANCIENT_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java index 3e761a5e..2004b494 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/DemonicTreeGrower.java @@ -11,17 +11,17 @@ public class DemonicTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder> getConfiguredFeature(@Nonnull RandomSource random, - boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.DEMONIC_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.DEMONIC_TREE; - } - return ATMConfiguredFeature.DEMONIC_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.DEMONIC_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.DEMONIC_TREE; + } + return ATMConfiguredFeature.DEMONIC_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java index 5e01af31..6fa6862d 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/FastNoiseLite.java @@ -55,4744 +55,4744 @@ public class FastNoiseLite { - public enum NoiseType { - OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, Value, - } - - public enum RotationType3D { - None, ImproveXYPlanes, ImproveXZPlanes, - } - - public enum FractalType { - None, FBm, Ridged, PingPong, DomainWarpProgressive, DomainWarpIndependent, - } - - public enum CellularDistanceFunction { - Euclidean, EuclideanSq, Manhattan, Hybrid, - } - - public enum CellularReturnType { - CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div, - } - - public enum DomainWarpType { - OpenSimplex2, OpenSimplex2Reduced, BasicGrid, - } - - private enum TransformType3D { - None, ImproveXYPlanes, ImproveXZPlanes, DefaultOpenSimplex2, - } - - private int mSeed = 1337; - private float mFrequency = 0.01f; - private NoiseType mNoiseType = NoiseType.OpenSimplex2; - private RotationType3D mRotationType3D = RotationType3D.None; - private TransformType3D mTransformType3D = TransformType3D.DefaultOpenSimplex2; - - private FractalType mFractalType = FractalType.None; - private int mOctaves = 3; - private float mLacunarity = 2.0f; - private float mGain = 0.5f; - private float mWeightedStrength = 0.0f; - private float mPingPongStength = 2.0f; - - private float mFractalBounding = 1 / 1.75f; - - private CellularDistanceFunction mCellularDistanceFunction = CellularDistanceFunction.EuclideanSq; - private CellularReturnType mCellularReturnType = CellularReturnType.Distance; - private float mCellularJitterModifier = 1.0f; - - private DomainWarpType mDomainWarpType = DomainWarpType.OpenSimplex2; - private TransformType3D mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; - private float mDomainWarpAmp = 1.0f; - - /// - /// Create new FastNoise object with default seed - /// - public FastNoiseLite() { - } - - /// - /// Create new FastNoise object with specified seed - /// - public FastNoiseLite(int seed) { - SetSeed(seed); - } - - /// - /// Sets seed used for all noise types - /// - /// - /// Default: 1337 - /// - public void SetSeed(int seed) { - mSeed = seed; - } - - /// - /// Sets frequency for all noise types - /// - /// - /// Default: 0.01 - /// - public void SetFrequency(float frequency) { - mFrequency = frequency; - } - - /// - /// Sets noise algorithm used for GetNoise(...) - /// - /// - /// Default: OpenSimplex2 - /// - public void SetNoiseType(NoiseType noiseType) { - mNoiseType = noiseType; - UpdateTransformType3D(); - } - - /// - /// Sets domain rotation type for 3D Noise and 3D DomainWarp. - /// Can aid in reducing directional artifacts when sampling a 2D plane in 3D - /// - /// - /// Default: None - /// - public void SetRotationType3D(RotationType3D rotationType3D) { - mRotationType3D = rotationType3D; - UpdateTransformType3D(); - UpdateWarpTransformType3D(); - } - - /// - /// Sets method for combining octaves in all fractal noise types - /// - /// - /// Default: None - /// Note: FractalType.DomainWarp... only affects DomainWarp(...) - /// - public void SetFractalType(FractalType fractalType) { - mFractalType = fractalType; - } - - /// - /// Sets octave count for all fractal noise types - /// - /// - /// Default: 3 - /// - public void SetFractalOctaves(int octaves) { - mOctaves = octaves; - CalculateFractalBounding(); - } - - /// - /// Sets octave lacunarity for all fractal noise types - /// - /// - /// Default: 2.0 - /// - public void SetFractalLacunarity(float lacunarity) { - mLacunarity = lacunarity; - } - - /// - /// Sets octave gain for all fractal noise types - /// - /// - /// Default: 0.5 - /// - public void SetFractalGain(float gain) { - mGain = gain; - CalculateFractalBounding(); - } - - /// - /// Sets octave weighting for all none DomainWarp fratal types - /// - /// - /// Default: 0.0 - /// Note: Keep between 0...1 to maintain -1...1 output bounding - /// - public void SetFractalWeightedStrength(float weightedStrength) { - mWeightedStrength = weightedStrength; - } - - /// - /// Sets strength of the fractal ping pong effect - /// - /// - /// Default: 2.0 - /// - public void SetFractalPingPongStrength(float pingPongStrength) { - mPingPongStength = pingPongStrength; - } - - /// - /// Sets distance function used in cellular noise calculations - /// - /// - /// Default: Distance - /// - public void SetCellularDistanceFunction( - CellularDistanceFunction cellularDistanceFunction) { - mCellularDistanceFunction = cellularDistanceFunction; - } - - /// - /// Sets return type from cellular noise calculations - /// - /// - /// Default: EuclideanSq - /// - public void SetCellularReturnType(CellularReturnType cellularReturnType) { - mCellularReturnType = cellularReturnType; - } - - /// - /// Sets the maximum distance a cellular point can move from it's grid position - /// - /// - /// Default: 1.0 - /// Note: Setting this higher than 1 will cause artifacts - /// - public void SetCellularJitter(float cellularJitter) { - mCellularJitterModifier = cellularJitter; - } - - /// - /// Sets the warp algorithm when using DomainWarp(...) - /// - /// - /// Default: OpenSimplex2 - /// - public void SetDomainWarpType(DomainWarpType domainWarpType) { - mDomainWarpType = domainWarpType; - UpdateWarpTransformType3D(); - } - - /// - /// Sets the maximum warp distance from original position when using DomainWarp(...) - /// - /// - /// Default: 1.0 - /// - public void SetDomainWarpAmp(float domainWarpAmp) { - mDomainWarpAmp = domainWarpAmp; - } - - /// - /// 2D noise at given position using current settings - /// - /// - /// Noise output bounded between -1...1 - /// - public float GetNoise(/*FMLdouble*/double x, /*FMLdouble*/double y) { - x *= mFrequency; - y *= mFrequency; - - switch (mNoiseType) { - case OpenSimplex2: - case OpenSimplex2S: { - final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (x + y) * F2; - x += t; - y += t; - } - break; - default: - break; - } - - switch (mFractalType) { - default: - return GenNoiseSingle(mSeed, x, y); - case FBm: - return GenFractalFBm(x, y); - case Ridged: - return GenFractalRidged(x, y); - case PingPong: - return GenFractalPingPong(x, y); - } - } - - /// - /// 3D noise at given position using current settings - /// - /// - /// Noise output bounded between -1...1 - /// - public float GetNoise( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - x *= mFrequency; - y *= mFrequency; - z *= mFrequency; - - switch (mTransformType3D) { - case ImproveXYPlanes: { - /*FMLdouble*/double xy = x + y; - /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; - z *= (/*FMLdouble*/double) 0.577350269189626; - x += s2 - z; - y = y + s2 - z; - z += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: { - /*FMLdouble*/double xz = x + z; - /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; - y *= (/*FMLdouble*/double) 0.577350269189626; - x += s2 - y; - z += s2 - y; - y += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (x + y + z) * R3; // Rotation, not skew - x = r - x; - y = r - y; - z = r - z; - } - break; - default: - break; - } - - switch (mFractalType) { - default: - return GenNoiseSingle(mSeed, x, y, z); - case FBm: - return GenFractalFBm(x, y, z); - case Ridged: - return GenFractalRidged(x, y, z); - case PingPong: - return GenFractalPingPong(x, y, z); - } - } - - /// - /// 2D warps the input position using current domain warp settings - /// - /// - /// Example usage with GetNoise - /// DomainWarp(coord) - /// noise = GetNoise(x, y) - /// - public void DomainWarp(Vector2 coord) { - switch (mFractalType) { - default: - DomainWarpSingle(coord); - break; - case DomainWarpProgressive: - DomainWarpFractalProgressive(coord); - break; - case DomainWarpIndependent: - DomainWarpFractalIndependent(coord); - break; - } - } - - /// - /// 3D warps the input position using current domain warp settings - /// - /// - /// Example usage with GetNoise - /// DomainWarp(coord) - /// noise = GetNoise(x, y, z) - /// - public void DomainWarp(Vector3 coord) { - switch (mFractalType) { - default: - DomainWarpSingle(coord); - break; - case DomainWarpProgressive: - DomainWarpFractalProgressive(coord); - break; - case DomainWarpIndependent: - DomainWarpFractalIndependent(coord); - break; - } - } - - private static final float[] Gradients2D = { - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.608761429008721f, - 0.793353340291235f, - 0.793353340291235f, - 0.608761429008721f, - 0.923879532511287f, - 0.38268343236509f, - 0.99144486137381f, - 0.130526192220051f, - 0.99144486137381f, - -0.130526192220051f, - 0.923879532511287f, - -0.38268343236509f, - 0.793353340291235f, - -0.60876142900872f, - 0.608761429008721f, - -0.793353340291235f, - 0.38268343236509f, - -0.923879532511287f, - 0.130526192220052f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - -0.38268343236509f, - -0.923879532511287f, - -0.608761429008721f, - -0.793353340291235f, - -0.793353340291235f, - -0.608761429008721f, - -0.923879532511287f, - -0.38268343236509f, - -0.99144486137381f, - -0.130526192220052f, - -0.99144486137381f, - 0.130526192220051f, - -0.923879532511287f, - 0.38268343236509f, - -0.793353340291235f, - 0.608761429008721f, - -0.608761429008721f, - 0.793353340291235f, - -0.38268343236509f, - 0.923879532511287f, - -0.130526192220052f, - 0.99144486137381f, - 0.38268343236509f, - 0.923879532511287f, - 0.923879532511287f, - 0.38268343236509f, - 0.923879532511287f, - -0.38268343236509f, - 0.38268343236509f, - -0.923879532511287f, - -0.38268343236509f, - -0.923879532511287f, - -0.923879532511287f, - -0.38268343236509f, - -0.923879532511287f, - 0.38268343236509f, - -0.38268343236509f, - 0.923879532511287f, - }; - - private static final float[] RandVecs2D = { - -0.2700222198f, - -0.9628540911f, - 0.3863092627f, - -0.9223693152f, - 0.04444859006f, - -0.999011673f, - -0.5992523158f, - -0.8005602176f, - -0.7819280288f, - 0.6233687174f, - 0.9464672271f, - 0.3227999196f, - -0.6514146797f, - -0.7587218957f, - 0.9378472289f, - 0.347048376f, - -0.8497875957f, - -0.5271252623f, - -0.879042592f, - 0.4767432447f, - -0.892300288f, - -0.4514423508f, - -0.379844434f, - -0.9250503802f, - -0.9951650832f, - 0.0982163789f, - 0.7724397808f, - -0.6350880136f, - 0.7573283322f, - -0.6530343002f, - -0.9928004525f, - -0.119780055f, - -0.0532665713f, - 0.9985803285f, - 0.9754253726f, - -0.2203300762f, - -0.7665018163f, - 0.6422421394f, - 0.991636706f, - 0.1290606184f, - -0.994696838f, - 0.1028503788f, - -0.5379205513f, - -0.84299554f, - 0.5022815471f, - -0.8647041387f, - 0.4559821461f, - -0.8899889226f, - -0.8659131224f, - -0.5001944266f, - 0.0879458407f, - -0.9961252577f, - -0.5051684983f, - 0.8630207346f, - 0.7753185226f, - -0.6315704146f, - -0.6921944612f, - 0.7217110418f, - -0.5191659449f, - -0.8546734591f, - 0.8978622882f, - -0.4402764035f, - -0.1706774107f, - 0.9853269617f, - -0.9353430106f, - -0.3537420705f, - -0.9992404798f, - 0.03896746794f, - -0.2882064021f, - -0.9575683108f, - -0.9663811329f, - 0.2571137995f, - -0.8759714238f, - -0.4823630009f, - -0.8303123018f, - -0.5572983775f, - 0.05110133755f, - -0.9986934731f, - -0.8558373281f, - -0.5172450752f, - 0.09887025282f, - 0.9951003332f, - 0.9189016087f, - 0.3944867976f, - -0.2439375892f, - -0.9697909324f, - -0.8121409387f, - -0.5834613061f, - -0.9910431363f, - 0.1335421355f, - 0.8492423985f, - -0.5280031709f, - -0.9717838994f, - -0.2358729591f, - 0.9949457207f, - 0.1004142068f, - 0.6241065508f, - -0.7813392434f, - 0.662910307f, - 0.7486988212f, - -0.7197418176f, - 0.6942418282f, - -0.8143370775f, - -0.5803922158f, - 0.104521054f, - -0.9945226741f, - -0.1065926113f, - -0.9943027784f, - 0.445799684f, - -0.8951327509f, - 0.105547406f, - 0.9944142724f, - -0.992790267f, - 0.1198644477f, - -0.8334366408f, - 0.552615025f, - 0.9115561563f, - -0.4111755999f, - 0.8285544909f, - -0.5599084351f, - 0.7217097654f, - -0.6921957921f, - 0.4940492677f, - -0.8694339084f, - -0.3652321272f, - -0.9309164803f, - -0.9696606758f, - 0.2444548501f, - 0.08925509731f, - -0.996008799f, - 0.5354071276f, - -0.8445941083f, - -0.1053576186f, - 0.9944343981f, - -0.9890284586f, - 0.1477251101f, - 0.004856104961f, - 0.9999882091f, - 0.9885598478f, - 0.1508291331f, - 0.9286129562f, - -0.3710498316f, - -0.5832393863f, - -0.8123003252f, - 0.3015207509f, - 0.9534596146f, - -0.9575110528f, - 0.2883965738f, - 0.9715802154f, - -0.2367105511f, - 0.229981792f, - 0.9731949318f, - 0.955763816f, - -0.2941352207f, - 0.740956116f, - 0.6715534485f, - -0.9971513787f, - -0.07542630764f, - 0.6905710663f, - -0.7232645452f, - -0.290713703f, - -0.9568100872f, - 0.5912777791f, - -0.8064679708f, - -0.9454592212f, - -0.325740481f, - 0.6664455681f, - 0.74555369f, - 0.6236134912f, - 0.7817328275f, - 0.9126993851f, - -0.4086316587f, - -0.8191762011f, - 0.5735419353f, - -0.8812745759f, - -0.4726046147f, - 0.9953313627f, - 0.09651672651f, - 0.9855650846f, - -0.1692969699f, - -0.8495980887f, - 0.5274306472f, - 0.6174853946f, - -0.7865823463f, - 0.8508156371f, - 0.52546432f, - 0.9985032451f, - -0.05469249926f, - 0.1971371563f, - -0.9803759185f, - 0.6607855748f, - -0.7505747292f, - -0.03097494063f, - 0.9995201614f, - -0.6731660801f, - 0.739491331f, - -0.7195018362f, - -0.6944905383f, - 0.9727511689f, - 0.2318515979f, - 0.9997059088f, - -0.0242506907f, - 0.4421787429f, - -0.8969269532f, - 0.9981350961f, - -0.061043673f, - -0.9173660799f, - -0.3980445648f, - -0.8150056635f, - -0.5794529907f, - -0.8789331304f, - 0.4769450202f, - 0.0158605829f, - 0.999874213f, - -0.8095464474f, - 0.5870558317f, - -0.9165898907f, - -0.3998286786f, - -0.8023542565f, - 0.5968480938f, - -0.5176737917f, - 0.8555780767f, - -0.8154407307f, - -0.5788405779f, - 0.4022010347f, - -0.9155513791f, - -0.9052556868f, - -0.4248672045f, - 0.7317445619f, - 0.6815789728f, - -0.5647632201f, - -0.8252529947f, - -0.8403276335f, - -0.5420788397f, - -0.9314281527f, - 0.363925262f, - 0.5238198472f, - 0.8518290719f, - 0.7432803869f, - -0.6689800195f, - -0.985371561f, - -0.1704197369f, - 0.4601468731f, - 0.88784281f, - 0.825855404f, - 0.5638819483f, - 0.6182366099f, - 0.7859920446f, - 0.8331502863f, - -0.553046653f, - 0.1500307506f, - 0.9886813308f, - -0.662330369f, - -0.7492119075f, - -0.668598664f, - 0.743623444f, - 0.7025606278f, - 0.7116238924f, - -0.5419389763f, - -0.8404178401f, - -0.3388616456f, - 0.9408362159f, - 0.8331530315f, - 0.5530425174f, - -0.2989720662f, - -0.9542618632f, - 0.2638522993f, - 0.9645630949f, - 0.124108739f, - -0.9922686234f, - -0.7282649308f, - -0.6852956957f, - 0.6962500149f, - 0.7177993569f, - -0.9183535368f, - 0.3957610156f, - -0.6326102274f, - -0.7744703352f, - -0.9331891859f, - -0.359385508f, - -0.1153779357f, - -0.9933216659f, - 0.9514974788f, - -0.3076565421f, - -0.08987977445f, - -0.9959526224f, - 0.6678496916f, - 0.7442961705f, - 0.7952400393f, - -0.6062947138f, - -0.6462007402f, - -0.7631674805f, - -0.2733598753f, - 0.9619118351f, - 0.9669590226f, - -0.254931851f, - -0.9792894595f, - 0.2024651934f, - -0.5369502995f, - -0.8436138784f, - -0.270036471f, - -0.9628500944f, - -0.6400277131f, - 0.7683518247f, - -0.7854537493f, - -0.6189203566f, - 0.06005905383f, - -0.9981948257f, - -0.02455770378f, - 0.9996984141f, - -0.65983623f, - 0.751409442f, - -0.6253894466f, - -0.7803127835f, - -0.6210408851f, - -0.7837781695f, - 0.8348888491f, - 0.5504185768f, - -0.1592275245f, - 0.9872419133f, - 0.8367622488f, - 0.5475663786f, - -0.8675753916f, - -0.4973056806f, - -0.2022662628f, - -0.9793305667f, - 0.9399189937f, - 0.3413975472f, - 0.9877404807f, - -0.1561049093f, - -0.9034455656f, - 0.4287028224f, - 0.1269804218f, - -0.9919052235f, - -0.3819600854f, - 0.924178821f, - 0.9754625894f, - 0.2201652486f, - -0.3204015856f, - -0.9472818081f, - -0.9874760884f, - 0.1577687387f, - 0.02535348474f, - -0.9996785487f, - 0.4835130794f, - -0.8753371362f, - -0.2850799925f, - -0.9585037287f, - -0.06805516006f, - -0.99768156f, - -0.7885244045f, - -0.6150034663f, - 0.3185392127f, - -0.9479096845f, - 0.8880043089f, - 0.4598351306f, - 0.6476921488f, - -0.7619021462f, - 0.9820241299f, - 0.1887554194f, - 0.9357275128f, - -0.3527237187f, - -0.8894895414f, - 0.4569555293f, - 0.7922791302f, - 0.6101588153f, - 0.7483818261f, - 0.6632681526f, - -0.7288929755f, - -0.6846276581f, - 0.8729032783f, - -0.4878932944f, - 0.8288345784f, - 0.5594937369f, - 0.08074567077f, - 0.9967347374f, - 0.9799148216f, - -0.1994165048f, - -0.580730673f, - -0.8140957471f, - -0.4700049791f, - -0.8826637636f, - 0.2409492979f, - 0.9705377045f, - 0.9437816757f, - -0.3305694308f, - -0.8927998638f, - -0.4504535528f, - -0.8069622304f, - 0.5906030467f, - 0.06258973166f, - 0.9980393407f, - -0.9312597469f, - 0.3643559849f, - 0.5777449785f, - 0.8162173362f, - -0.3360095855f, - -0.941858566f, - 0.697932075f, - -0.7161639607f, - -0.002008157227f, - -0.9999979837f, - -0.1827294312f, - -0.9831632392f, - -0.6523911722f, - 0.7578824173f, - -0.4302626911f, - -0.9027037258f, - -0.9985126289f, - -0.05452091251f, - -0.01028102172f, - -0.9999471489f, - -0.4946071129f, - 0.8691166802f, - -0.2999350194f, - 0.9539596344f, - 0.8165471961f, - 0.5772786819f, - 0.2697460475f, - 0.962931498f, - -0.7306287391f, - -0.6827749597f, - -0.7590952064f, - -0.6509796216f, - -0.907053853f, - 0.4210146171f, - -0.5104861064f, - -0.8598860013f, - 0.8613350597f, - 0.5080373165f, - 0.5007881595f, - -0.8655698812f, - -0.654158152f, - 0.7563577938f, - -0.8382755311f, - -0.545246856f, - 0.6940070834f, - 0.7199681717f, - 0.06950936031f, - 0.9975812994f, - 0.1702942185f, - -0.9853932612f, - 0.2695973274f, - 0.9629731466f, - 0.5519612192f, - -0.8338697815f, - 0.225657487f, - -0.9742067022f, - 0.4215262855f, - -0.9068161835f, - 0.4881873305f, - -0.8727388672f, - -0.3683854996f, - -0.9296731273f, - -0.9825390578f, - 0.1860564427f, - 0.81256471f, - 0.5828709909f, - 0.3196460933f, - -0.9475370046f, - 0.9570913859f, - 0.2897862643f, - -0.6876655497f, - -0.7260276109f, - -0.9988770922f, - -0.047376731f, - -0.1250179027f, - 0.992154486f, - -0.8280133617f, - 0.560708367f, - 0.9324863769f, - -0.3612051451f, - 0.6394653183f, - 0.7688199442f, - -0.01623847064f, - -0.9998681473f, - -0.9955014666f, - -0.09474613458f, - -0.81453315f, - 0.580117012f, - 0.4037327978f, - -0.9148769469f, - 0.9944263371f, - 0.1054336766f, - -0.1624711654f, - 0.9867132919f, - -0.9949487814f, - -0.100383875f, - -0.6995302564f, - 0.7146029809f, - 0.5263414922f, - -0.85027327f, - -0.5395221479f, - 0.841971408f, - 0.6579370318f, - 0.7530729462f, - 0.01426758847f, - -0.9998982128f, - -0.6734383991f, - 0.7392433447f, - 0.639412098f, - -0.7688642071f, - 0.9211571421f, - 0.3891908523f, - -0.146637214f, - -0.9891903394f, - -0.782318098f, - 0.6228791163f, - -0.5039610839f, - -0.8637263605f, - -0.7743120191f, - -0.6328039957f, - }; - - private static final float[] Gradients3D = { - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 1, - 0, - -1, - 0, - -1, - 0, - -1, - 0, - 1, - 1, - 0, - 0, - -1, - 1, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - -1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - -1, - 1, - 0, - -1, - 1, - 0, - 0, - 0, - -1, - -1, - 0, - }; - - private static final float[] RandVecs3D = { - -0.7292736885f, - -0.6618439697f, - 0.1735581948f, - 0, - 0.790292081f, - -0.5480887466f, - -0.2739291014f, - 0, - 0.7217578935f, - 0.6226212466f, - -0.3023380997f, - 0, - 0.565683137f, - -0.8208298145f, - -0.0790000257f, - 0, - 0.760049034f, - -0.5555979497f, - -0.3370999617f, - 0, - 0.3713945616f, - 0.5011264475f, - 0.7816254623f, - 0, - -0.1277062463f, - -0.4254438999f, - -0.8959289049f, - 0, - -0.2881560924f, - -0.5815838982f, - 0.7607405838f, - 0, - 0.5849561111f, - -0.662820239f, - -0.4674352136f, - 0, - 0.3307171178f, - 0.0391653737f, - 0.94291689f, - 0, - 0.8712121778f, - -0.4113374369f, - -0.2679381538f, - 0, - 0.580981015f, - 0.7021915846f, - 0.4115677815f, - 0, - 0.503756873f, - 0.6330056931f, - -0.5878203852f, - 0, - 0.4493712205f, - 0.601390195f, - 0.6606022552f, - 0, - -0.6878403724f, - 0.09018890807f, - -0.7202371714f, - 0, - -0.5958956522f, - -0.6469350577f, - 0.475797649f, - 0, - -0.5127052122f, - 0.1946921978f, - -0.8361987284f, - 0, - -0.9911507142f, - -0.05410276466f, - -0.1212153153f, - 0, - -0.2149721042f, - 0.9720882117f, - -0.09397607749f, - 0, - -0.7518650936f, - -0.5428057603f, - 0.3742469607f, - 0, - 0.5237068895f, - 0.8516377189f, - -0.02107817834f, - 0, - 0.6333504779f, - 0.1926167129f, - -0.7495104896f, - 0, - -0.06788241606f, - 0.3998305789f, - 0.9140719259f, - 0, - -0.5538628599f, - -0.4729896695f, - -0.6852128902f, - 0, - -0.7261455366f, - -0.5911990757f, - 0.3509933228f, - 0, - -0.9229274737f, - -0.1782808786f, - 0.3412049336f, - 0, - -0.6968815002f, - 0.6511274338f, - 0.3006480328f, - 0, - 0.9608044783f, - -0.2098363234f, - -0.1811724921f, - 0, - 0.06817146062f, - -0.9743405129f, - 0.2145069156f, - 0, - -0.3577285196f, - -0.6697087264f, - -0.6507845481f, - 0, - -0.1868621131f, - 0.7648617052f, - -0.6164974636f, - 0, - -0.6541697588f, - 0.3967914832f, - 0.6439087246f, - 0, - 0.6993340405f, - -0.6164538506f, - 0.3618239211f, - 0, - -0.1546665739f, - 0.6291283928f, - 0.7617583057f, - 0, - -0.6841612949f, - -0.2580482182f, - -0.6821542638f, - 0, - 0.5383980957f, - 0.4258654885f, - 0.7271630328f, - 0, - -0.5026987823f, - -0.7939832935f, - -0.3418836993f, - 0, - 0.3202971715f, - 0.2834415347f, - 0.9039195862f, - 0, - 0.8683227101f, - -0.0003762656404f, - -0.4959995258f, - 0, - 0.791120031f, - -0.08511045745f, - 0.6057105799f, - 0, - -0.04011016052f, - -0.4397248749f, - 0.8972364289f, - 0, - 0.9145119872f, - 0.3579346169f, - -0.1885487608f, - 0, - -0.9612039066f, - -0.2756484276f, - 0.01024666929f, - 0, - 0.6510361721f, - -0.2877799159f, - -0.7023778346f, - 0, - -0.2041786351f, - 0.7365237271f, - 0.644859585f, - 0, - -0.7718263711f, - 0.3790626912f, - 0.5104855816f, - 0, - -0.3060082741f, - -0.7692987727f, - 0.5608371729f, - 0, - 0.454007341f, - -0.5024843065f, - 0.7357899537f, - 0, - 0.4816795475f, - 0.6021208291f, - -0.6367380315f, - 0, - 0.6961980369f, - -0.3222197429f, - 0.641469197f, - 0, - -0.6532160499f, - -0.6781148932f, - 0.3368515753f, - 0, - 0.5089301236f, - -0.6154662304f, - -0.6018234363f, - 0, - -0.1635919754f, - -0.9133604627f, - -0.372840892f, - 0, - 0.52408019f, - -0.8437664109f, - 0.1157505864f, - 0, - 0.5902587356f, - 0.4983817807f, - -0.6349883666f, - 0, - 0.5863227872f, - 0.494764745f, - 0.6414307729f, - 0, - 0.6779335087f, - 0.2341345225f, - 0.6968408593f, - 0, - 0.7177054546f, - -0.6858979348f, - 0.120178631f, - 0, - -0.5328819713f, - -0.5205125012f, - 0.6671608058f, - 0, - -0.8654874251f, - -0.0700727088f, - -0.4960053754f, - 0, - -0.2861810166f, - 0.7952089234f, - 0.5345495242f, - 0, - -0.04849529634f, - 0.9810836427f, - -0.1874115585f, - 0, - -0.6358521667f, - 0.6058348682f, - 0.4781800233f, - 0, - 0.6254794696f, - -0.2861619734f, - 0.7258696564f, - 0, - -0.2585259868f, - 0.5061949264f, - -0.8227581726f, - 0, - 0.02136306781f, - 0.5064016808f, - -0.8620330371f, - 0, - 0.200111773f, - 0.8599263484f, - 0.4695550591f, - 0, - 0.4743561372f, - 0.6014985084f, - -0.6427953014f, - 0, - 0.6622993731f, - -0.5202474575f, - -0.5391679918f, - 0, - 0.08084972818f, - -0.6532720452f, - 0.7527940996f, - 0, - -0.6893687501f, - 0.0592860349f, - 0.7219805347f, - 0, - -0.1121887082f, - -0.9673185067f, - 0.2273952515f, - 0, - 0.7344116094f, - 0.5979668656f, - -0.3210532909f, - 0, - 0.5789393465f, - -0.2488849713f, - 0.7764570201f, - 0, - 0.6988182827f, - 0.3557169806f, - -0.6205791146f, - 0, - -0.8636845529f, - -0.2748771249f, - -0.4224826141f, - 0, - -0.4247027957f, - -0.4640880967f, - 0.777335046f, - 0, - 0.5257722489f, - -0.8427017621f, - 0.1158329937f, - 0, - 0.9343830603f, - 0.316302472f, - -0.1639543925f, - 0, - -0.1016836419f, - -0.8057303073f, - -0.5834887393f, - 0, - -0.6529238969f, - 0.50602126f, - -0.5635892736f, - 0, - -0.2465286165f, - -0.9668205684f, - -0.06694497494f, - 0, - -0.9776897119f, - -0.2099250524f, - -0.007368825344f, - 0, - 0.7736893337f, - 0.5734244712f, - 0.2694238123f, - 0, - -0.6095087895f, - 0.4995678998f, - 0.6155736747f, - 0, - 0.5794535482f, - 0.7434546771f, - 0.3339292269f, - 0, - -0.8226211154f, - 0.08142581855f, - 0.5627293636f, - 0, - -0.510385483f, - 0.4703667658f, - 0.7199039967f, - 0, - -0.5764971849f, - -0.07231656274f, - -0.8138926898f, - 0, - 0.7250628871f, - 0.3949971505f, - -0.5641463116f, - 0, - -0.1525424005f, - 0.4860840828f, - -0.8604958341f, - 0, - -0.5550976208f, - -0.4957820792f, - 0.667882296f, - 0, - -0.1883614327f, - 0.9145869398f, - 0.357841725f, - 0, - 0.7625556724f, - -0.5414408243f, - -0.3540489801f, - 0, - -0.5870231946f, - -0.3226498013f, - -0.7424963803f, - 0, - 0.3051124198f, - 0.2262544068f, - -0.9250488391f, - 0, - 0.6379576059f, - 0.577242424f, - -0.5097070502f, - 0, - -0.5966775796f, - 0.1454852398f, - -0.7891830656f, - 0, - -0.658330573f, - 0.6555487542f, - -0.3699414651f, - 0, - 0.7434892426f, - 0.2351084581f, - 0.6260573129f, - 0, - 0.5562114096f, - 0.8264360377f, - -0.0873632843f, - 0, - -0.3028940016f, - -0.8251527185f, - 0.4768419182f, - 0, - 0.1129343818f, - -0.985888439f, - -0.1235710781f, - 0, - 0.5937652891f, - -0.5896813806f, - 0.5474656618f, - 0, - 0.6757964092f, - -0.5835758614f, - -0.4502648413f, - 0, - 0.7242302609f, - -0.1152719764f, - 0.6798550586f, - 0, - -0.9511914166f, - 0.0753623979f, - -0.2992580792f, - 0, - 0.2539470961f, - -0.1886339355f, - 0.9486454084f, - 0, - 0.571433621f, - -0.1679450851f, - -0.8032795685f, - 0, - -0.06778234979f, - 0.3978269256f, - 0.9149531629f, - 0, - 0.6074972649f, - 0.733060024f, - -0.3058922593f, - 0, - -0.5435478392f, - 0.1675822484f, - 0.8224791405f, - 0, - -0.5876678086f, - -0.3380045064f, - -0.7351186982f, - 0, - -0.7967562402f, - 0.04097822706f, - -0.6029098428f, - 0, - -0.1996350917f, - 0.8706294745f, - 0.4496111079f, - 0, - -0.02787660336f, - -0.9106232682f, - -0.4122962022f, - 0, - -0.7797625996f, - -0.6257634692f, - 0.01975775581f, - 0, - -0.5211232846f, - 0.7401644346f, - -0.4249554471f, - 0, - 0.8575424857f, - 0.4053272873f, - -0.3167501783f, - 0, - 0.1045223322f, - 0.8390195772f, - -0.5339674439f, - 0, - 0.3501822831f, - 0.9242524096f, - -0.1520850155f, - 0, - 0.1987849858f, - 0.07647613266f, - 0.9770547224f, - 0, - 0.7845996363f, - 0.6066256811f, - -0.1280964233f, - 0, - 0.09006737436f, - -0.9750989929f, - -0.2026569073f, - 0, - -0.8274343547f, - -0.542299559f, - 0.1458203587f, - 0, - -0.3485797732f, - -0.415802277f, - 0.840000362f, - 0, - -0.2471778936f, - -0.7304819962f, - -0.6366310879f, - 0, - -0.3700154943f, - 0.8577948156f, - 0.3567584454f, - 0, - 0.5913394901f, - -0.548311967f, - -0.5913303597f, - 0, - 0.1204873514f, - -0.7626472379f, - -0.6354935001f, - 0, - 0.616959265f, - 0.03079647928f, - 0.7863922953f, - 0, - 0.1258156836f, - -0.6640829889f, - -0.7369967419f, - 0, - -0.6477565124f, - -0.1740147258f, - -0.7417077429f, - 0, - 0.6217889313f, - -0.7804430448f, - -0.06547655076f, - 0, - 0.6589943422f, - -0.6096987708f, - 0.4404473475f, - 0, - -0.2689837504f, - -0.6732403169f, - -0.6887635427f, - 0, - -0.3849775103f, - 0.5676542638f, - 0.7277093879f, - 0, - 0.5754444408f, - 0.8110471154f, - -0.1051963504f, - 0, - 0.9141593684f, - 0.3832947817f, - 0.131900567f, - 0, - -0.107925319f, - 0.9245493968f, - 0.3654593525f, - 0, - 0.377977089f, - 0.3043148782f, - 0.8743716458f, - 0, - -0.2142885215f, - -0.8259286236f, - 0.5214617324f, - 0, - 0.5802544474f, - 0.4148098596f, - -0.7008834116f, - 0, - -0.1982660881f, - 0.8567161266f, - -0.4761596756f, - 0, - -0.03381553704f, - 0.3773180787f, - -0.9254661404f, - 0, - -0.6867922841f, - -0.6656597827f, - 0.2919133642f, - 0, - 0.7731742607f, - -0.2875793547f, - -0.5652430251f, - 0, - -0.09655941928f, - 0.9193708367f, - -0.3813575004f, - 0, - 0.2715702457f, - -0.9577909544f, - -0.09426605581f, - 0, - 0.2451015704f, - -0.6917998565f, - -0.6792188003f, - 0, - 0.977700782f, - -0.1753855374f, - 0.1155036542f, - 0, - -0.5224739938f, - 0.8521606816f, - 0.02903615945f, - 0, - -0.7734880599f, - -0.5261292347f, - 0.3534179531f, - 0, - -0.7134492443f, - -0.269547243f, - 0.6467878011f, - 0, - 0.1644037271f, - 0.5105846203f, - -0.8439637196f, - 0, - 0.6494635788f, - 0.05585611296f, - 0.7583384168f, - 0, - -0.4711970882f, - 0.5017280509f, - -0.7254255765f, - 0, - -0.6335764307f, - -0.2381686273f, - -0.7361091029f, - 0, - -0.9021533097f, - -0.270947803f, - -0.3357181763f, - 0, - -0.3793711033f, - 0.872258117f, - 0.3086152025f, - 0, - -0.6855598966f, - -0.3250143309f, - 0.6514394162f, - 0, - 0.2900942212f, - -0.7799057743f, - -0.5546100667f, - 0, - -0.2098319339f, - 0.85037073f, - 0.4825351604f, - 0, - -0.4592603758f, - 0.6598504336f, - -0.5947077538f, - 0, - 0.8715945488f, - 0.09616365406f, - -0.4807031248f, - 0, - -0.6776666319f, - 0.7118504878f, - -0.1844907016f, - 0, - 0.7044377633f, - 0.312427597f, - 0.637304036f, - 0, - -0.7052318886f, - -0.2401093292f, - -0.6670798253f, - 0, - 0.081921007f, - -0.7207336136f, - -0.6883545647f, - 0, - -0.6993680906f, - -0.5875763221f, - -0.4069869034f, - 0, - -0.1281454481f, - 0.6419895885f, - 0.7559286424f, - 0, - -0.6337388239f, - -0.6785471501f, - -0.3714146849f, - 0, - 0.5565051903f, - -0.2168887573f, - -0.8020356851f, - 0, - -0.5791554484f, - 0.7244372011f, - -0.3738578718f, - 0, - 0.1175779076f, - -0.7096451073f, - 0.6946792478f, - 0, - -0.6134619607f, - 0.1323631078f, - 0.7785527795f, - 0, - 0.6984635305f, - -0.02980516237f, - -0.715024719f, - 0, - 0.8318082963f, - -0.3930171956f, - 0.3919597455f, - 0, - 0.1469576422f, - 0.05541651717f, - -0.9875892167f, - 0, - 0.708868575f, - -0.2690503865f, - 0.6520101478f, - 0, - 0.2726053183f, - 0.67369766f, - -0.68688995f, - 0, - -0.6591295371f, - 0.3035458599f, - -0.6880466294f, - 0, - 0.4815131379f, - -0.7528270071f, - 0.4487723203f, - 0, - 0.9430009463f, - 0.1675647412f, - -0.2875261255f, - 0, - 0.434802957f, - 0.7695304522f, - -0.4677277752f, - 0, - 0.3931996188f, - 0.594473625f, - 0.7014236729f, - 0, - 0.7254336655f, - -0.603925654f, - 0.3301814672f, - 0, - 0.7590235227f, - -0.6506083235f, - 0.02433313207f, - 0, - -0.8552768592f, - -0.3430042733f, - 0.3883935666f, - 0, - -0.6139746835f, - 0.6981725247f, - 0.3682257648f, - 0, - -0.7465905486f, - -0.5752009504f, - 0.3342849376f, - 0, - 0.5730065677f, - 0.810555537f, - -0.1210916791f, - 0, - -0.9225877367f, - -0.3475211012f, - -0.167514036f, - 0, - -0.7105816789f, - -0.4719692027f, - -0.5218416899f, - 0, - -0.08564609717f, - 0.3583001386f, - 0.929669703f, - 0, - -0.8279697606f, - -0.2043157126f, - 0.5222271202f, - 0, - 0.427944023f, - 0.278165994f, - 0.8599346446f, - 0, - 0.5399079671f, - -0.7857120652f, - -0.3019204161f, - 0, - 0.5678404253f, - -0.5495413974f, - -0.6128307303f, - 0, - -0.9896071041f, - 0.1365639107f, - -0.04503418428f, - 0, - -0.6154342638f, - -0.6440875597f, - 0.4543037336f, - 0, - 0.1074204368f, - -0.7946340692f, - 0.5975094525f, - 0, - -0.3595449969f, - -0.8885529948f, - 0.28495784f, - 0, - -0.2180405296f, - 0.1529888965f, - 0.9638738118f, - 0, - -0.7277432317f, - -0.6164050508f, - -0.3007234646f, - 0, - 0.7249729114f, - -0.00669719484f, - 0.6887448187f, - 0, - -0.5553659455f, - -0.5336586252f, - 0.6377908264f, - 0, - 0.5137558015f, - 0.7976208196f, - -0.3160000073f, - 0, - -0.3794024848f, - 0.9245608561f, - -0.03522751494f, - 0, - 0.8229248658f, - 0.2745365933f, - -0.4974176556f, - 0, - -0.5404114394f, - 0.6091141441f, - 0.5804613989f, - 0, - 0.8036581901f, - -0.2703029469f, - 0.5301601931f, - 0, - 0.6044318879f, - 0.6832968393f, - 0.4095943388f, - 0, - 0.06389988817f, - 0.9658208605f, - -0.2512108074f, - 0, - 0.1087113286f, - 0.7402471173f, - -0.6634877936f, - 0, - -0.713427712f, - -0.6926784018f, - 0.1059128479f, - 0, - 0.6458897819f, - -0.5724548511f, - -0.5050958653f, - 0, - -0.6553931414f, - 0.7381471625f, - 0.159995615f, - 0, - 0.3910961323f, - 0.9188871375f, - -0.05186755998f, - 0, - -0.4879022471f, - -0.5904376907f, - 0.6429111375f, - 0, - 0.6014790094f, - 0.7707441366f, - -0.2101820095f, - 0, - -0.5677173047f, - 0.7511360995f, - 0.3368851762f, - 0, - 0.7858573506f, - 0.226674665f, - 0.5753666838f, - 0, - -0.4520345543f, - -0.604222686f, - -0.6561857263f, - 0, - 0.002272116345f, - 0.4132844051f, - -0.9105991643f, - 0, - -0.5815751419f, - -0.5162925989f, - 0.6286591339f, - 0, - -0.03703704785f, - 0.8273785755f, - 0.5604221175f, - 0, - -0.5119692504f, - 0.7953543429f, - -0.3244980058f, - 0, - -0.2682417366f, - -0.9572290247f, - -0.1084387619f, - 0, - -0.2322482736f, - -0.9679131102f, - -0.09594243324f, - 0, - 0.3554328906f, - -0.8881505545f, - 0.2913006227f, - 0, - 0.7346520519f, - -0.4371373164f, - 0.5188422971f, - 0, - 0.9985120116f, - 0.04659011161f, - -0.02833944577f, - 0, - -0.3727687496f, - -0.9082481361f, - 0.1900757285f, - 0, - 0.91737377f, - -0.3483642108f, - 0.1925298489f, - 0, - 0.2714911074f, - 0.4147529736f, - -0.8684886582f, - 0, - 0.5131763485f, - -0.7116334161f, - 0.4798207128f, - 0, - -0.8737353606f, - 0.18886992f, - -0.4482350644f, - 0, - 0.8460043821f, - -0.3725217914f, - 0.3814499973f, - 0, - 0.8978727456f, - -0.1780209141f, - -0.4026575304f, - 0, - 0.2178065647f, - -0.9698322841f, - -0.1094789531f, - 0, - -0.1518031304f, - -0.7788918132f, - -0.6085091231f, - 0, - -0.2600384876f, - -0.4755398075f, - -0.8403819825f, - 0, - 0.572313509f, - -0.7474340931f, - -0.3373418503f, - 0, - -0.7174141009f, - 0.1699017182f, - -0.6756111411f, - 0, - -0.684180784f, - 0.02145707593f, - -0.7289967412f, - 0, - -0.2007447902f, - 0.06555605789f, - -0.9774476623f, - 0, - -0.1148803697f, - -0.8044887315f, - 0.5827524187f, - 0, - -0.7870349638f, - 0.03447489231f, - 0.6159443543f, - 0, - -0.2015596421f, - 0.6859872284f, - 0.6991389226f, - 0, - -0.08581082512f, - -0.10920836f, - -0.9903080513f, - 0, - 0.5532693395f, - 0.7325250401f, - -0.396610771f, - 0, - -0.1842489331f, - -0.9777375055f, - -0.1004076743f, - 0, - 0.0775473789f, - -0.9111505856f, - 0.4047110257f, - 0, - 0.1399838409f, - 0.7601631212f, - -0.6344734459f, - 0, - 0.4484419361f, - -0.845289248f, - 0.2904925424f, - 0, - }; - - private static float FastMin(float a, float b) { - return a < b ? a : b; - } - - private static float FastMax(float a, float b) { - return a > b ? a : b; - } - - private static float FastAbs(float f) { - return f < 0 ? -f : f; - } - - private static float FastSqrt(float f) { - return (float) Math.sqrt(f); - } - - private static int FastFloor(/*FMLdouble*/double f) { - return f >= 0 ? (int) f : (int) f - 1; - } - - private static int FastRound(/*FMLdouble*/double f) { - return f >= 0 ? (int) (f + 0.5f) : (int) (f - 0.5f); - } - - private static float Lerp(float a, float b, float t) { - return a + t * (b - a); - } - - private static float InterpHermite(float t) { - return t * t * (3 - 2 * t); - } - - private static float InterpQuintic(float t) { - return t * t * t * (t * (t * 6 - 15) + 10); - } - - private static float CubicLerp( - float a, - float b, - float c, - float d, - float t) { - float p = (d - c) - (a - b); - return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; - } - - private static float PingPong(float t) { - t -= (int) (t * 0.5f) * 2; - return t < 1 ? t : 2 - t; - } - - private void CalculateFractalBounding() { - float gain = FastAbs(mGain); - float amp = gain; - float ampFractal = 1.0f; - for (int i = 1; i < mOctaves; i++) { - ampFractal += amp; - amp *= gain; - } - mFractalBounding = 1 / ampFractal; - } - - // Hashing - private static final int PrimeX = 501125321; - private static final int PrimeY = 1136930381; - private static final int PrimeZ = 1720413743; - - private static int Hash(int seed, int xPrimed, int yPrimed) { - int hash = seed ^ xPrimed ^ yPrimed; - - hash *= 0x27d4eb2d; - return hash; - } - - private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { - int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed; - - hash *= 0x27d4eb2d; - return hash; - } - - private static float ValCoord(int seed, int xPrimed, int yPrimed) { - int hash = Hash(seed, xPrimed, yPrimed); - - hash *= hash; - hash ^= hash << 19; - return hash * (1 / 2147483648.0f); - } - - private static float ValCoord( - int seed, - int xPrimed, - int yPrimed, - int zPrimed) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - - hash *= hash; - hash ^= hash << 19; - return hash * (1 / 2147483648.0f); - } - - private static float GradCoord( - int seed, - int xPrimed, - int yPrimed, - float xd, - float yd) { - int hash = Hash(seed, xPrimed, yPrimed); - hash ^= hash >> 15; - hash &= 127 << 1; - - float xg = Gradients2D[hash]; - float yg = Gradients2D[hash | 1]; - - return xd * xg + yd * yg; - } - - private static float GradCoord( - int seed, - int xPrimed, - int yPrimed, - int zPrimed, - float xd, - float yd, - float zd) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - hash ^= hash >> 15; - hash &= 63 << 2; - - float xg = Gradients3D[hash]; - float yg = Gradients3D[hash | 1]; - float zg = Gradients3D[hash | 2]; - - return xd * xg + yd * yg + zd * zg; - } - - // Generic noise gen - - private float GenNoiseSingle( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - switch (mNoiseType) { - case OpenSimplex2: - return SingleSimplex(seed, x, y); - case OpenSimplex2S: - return SingleOpenSimplex2S(seed, x, y); - case Cellular: - return SingleCellular(seed, x, y); - case Perlin: - return SinglePerlin(seed, x, y); - case ValueCubic: - return SingleValueCubic(seed, x, y); - case Value: - return SingleValue(seed, x, y); - default: - return 0; - } - } - - private float GenNoiseSingle( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - switch (mNoiseType) { - case OpenSimplex2: - return SingleOpenSimplex2(seed, x, y, z); - case OpenSimplex2S: - return SingleOpenSimplex2S(seed, x, y, z); - case Cellular: - return SingleCellular(seed, x, y, z); - case Perlin: - return SinglePerlin(seed, x, y, z); - case ValueCubic: - return SingleValueCubic(seed, x, y, z); - case Value: - return SingleValue(seed, x, y, z); - default: - return 0; - } - } - - // Noise Coordinate Transforms (frequency, and possible skew or rotation) - - private void UpdateTransformType3D() { - switch (mRotationType3D) { - case ImproveXYPlanes: - mTransformType3D = TransformType3D.ImproveXYPlanes; - break; - case ImproveXZPlanes: - mTransformType3D = TransformType3D.ImproveXZPlanes; - break; - default: - switch (mNoiseType) { - case OpenSimplex2: - case OpenSimplex2S: - mTransformType3D = TransformType3D.DefaultOpenSimplex2; - break; - default: - mTransformType3D = TransformType3D.None; - break; - } - break; - } - } - - private void UpdateWarpTransformType3D() { - switch (mRotationType3D) { - case ImproveXYPlanes: - mWarpTransformType3D = TransformType3D.ImproveXYPlanes; - break; - case ImproveXZPlanes: - mWarpTransformType3D = TransformType3D.ImproveXZPlanes; - break; - default: - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: - mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; - break; - default: - mWarpTransformType3D = TransformType3D.None; - break; - } - break; - } - } - - // Fractal FBm - - private float GenFractalFBm(/*FMLdouble*/double x, /*FMLdouble*/double y) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = GenNoiseSingle(seed++, x, y); - sum += noise * amp; - amp *= Lerp(1.0f, FastMin(noise + 1, 2) * 0.5f, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalFBm( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = GenNoiseSingle(seed++, x, y, z); - sum += noise * amp; - amp *= Lerp(1.0f, (noise + 1) * 0.5f, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Fractal Ridged - - private float GenFractalRidged( - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = FastAbs(GenNoiseSingle(seed++, x, y)); - sum += (noise * -2 + 1) * amp; - amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalRidged( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = FastAbs(GenNoiseSingle(seed++, x, y, z)); - sum += (noise * -2 + 1) * amp; - amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Fractal PingPong - - private float GenFractalPingPong( - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = PingPong( - (GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength); - sum += (noise - 0.5f) * 2 * amp; - amp *= Lerp(1.0f, noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - private float GenFractalPingPong( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int seed = mSeed; - float sum = 0; - float amp = mFractalBounding; - - for (int i = 0; i < mOctaves; i++) { - float noise = PingPong( - (GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength); - sum += (noise - 0.5f) * 2 * amp; - amp *= Lerp(1.0f, noise, mWeightedStrength); - - x *= mLacunarity; - y *= mLacunarity; - z *= mLacunarity; - amp *= mGain; - } - - return sum; - } - - // Simplex/OpenSimplex2 Noise - - private float SingleSimplex( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. - - final float SQRT3 = 1.7320508075688772935274463415059f; - final float G2 = (3 - SQRT3) / 6; - - /* - * --- Skew moved to switch statements before fractal evaluation --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - float t = (xi + yi) * G2; - float x0 = (float) (xi - t); - float y0 = (float) (yi - t); - - i *= PrimeX; - j *= PrimeY; - - float n0, n1, n2; - - float a = 0.5f - x0 * x0 - y0 * y0; - if (a <= 0) - n0 = 0; - else { - n0 = (a * a) * (a * a) * GradCoord(seed, i, j, x0, y0); - } - - float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c <= 0) - n2 = 0; - else { - float x2 = x0 + (2 * (float) G2 - 1); - float y2 = y0 + (2 * (float) G2 - 1); - n2 = (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); - } - - if (y0 > x0) { - float x1 = x0 + (float) G2; - float y1 = y0 + ((float) G2 - 1); - float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) - n1 = 0; - else { - n1 = (b * b) * (b * b) * GradCoord(seed, i, j + PrimeY, x1, y1); - } - } else { - float x1 = x0 + ((float) G2 - 1); - float y1 = y0 + (float) G2; - float b = 0.5f - x1 * x1 - y1 * y1; - if (b <= 0) - n1 = 0; - else { - n1 = (b * b) * (b * b) * GradCoord(seed, i + PrimeX, j, x1, y1); - } - } - - return (n0 + n1 + n2) * 99.83685446303647f; - } - - private float SingleOpenSimplex2( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - // 3D OpenSimplex2 case uses two offset rotated cube grids. - - /* - * --- Rotation moved to switch statements before fractal evaluation --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastRound(x); - int j = FastRound(y); - int k = FastRound(z); - float x0 = (float) (x - i); - float y0 = (float) (y - j); - float z0 = (float) (z - k); - - int xNSign = (int) (-1.0f - x0) | 1; - int yNSign = (int) (-1.0f - y0) | 1; - int zNSign = (int) (-1.0f - z0) | 1; - - float ax0 = xNSign * -x0; - float ay0 = yNSign * -y0; - float az0 = zNSign * -z0; - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - - float value = 0; - float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - - for (int l = 0;; l++) { - if (a > 0) { - value += (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); - } - - if (ax0 >= ay0 && ax0 >= az0) { - float b = a + ax0 + ax0; - if (b > 1) { - b -= 1; - value += (b * b) * - (b * b) * - GradCoord( - seed, - i - xNSign * PrimeX, - j, - k, - x0 + xNSign, - y0, - z0); - } - } else if (ay0 > ax0 && ay0 >= az0) { - float b = a + ay0 + ay0; - if (b > 1) { - b -= 1; - value += (b * b) * - (b * b) * - GradCoord( - seed, - i, - j - yNSign * PrimeY, - k, - x0, - y0 + yNSign, - z0); - } - } else { - float b = a + az0 + az0; - if (b > 1) { - b -= 1; - value += (b * b) * - (b * b) * - GradCoord( - seed, - i, - j, - k - zNSign * PrimeZ, - x0, - y0, - z0 + zNSign); - } - } - - if (l == 1) - break; - - ax0 = 0.5f - ax0; - ay0 = 0.5f - ay0; - az0 = 0.5f - az0; - - x0 = xNSign * ax0; - y0 = yNSign * ay0; - z0 = zNSign * az0; - - a += (0.75f - ax0) - (ay0 + az0); - - i += (xNSign >> 1) & PrimeX; - j += (yNSign >> 1) & PrimeY; - k += (zNSign >> 1) & PrimeZ; - - xNSign = -xNSign; - yNSign = -yNSign; - zNSign = -zNSign; - - seed = ~seed; - } - - return value * 32.69428253173828125f; - } - - // OpenSimplex2S Noise - - private float SingleOpenSimplex2S( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - // 2D OpenSimplex2S case is a modified 2D simplex noise. - - final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double G2 = (3 - SQRT3) / 6; - - /* - * --- Skew moved to TransformNoiseCoordinate method --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - i *= PrimeX; - j *= PrimeY; - int i1 = i + PrimeX; - int j1 = j + PrimeY; - - float t = (xi + yi) * (float) G2; - float x0 = xi - t; - float y0 = yi - t; - - float a0 = (2.0f / 3.0f) - x0 * x0 - y0 * y0; - float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, i, j, x0, y0); - - float a1 = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); - float x1 = x0 - (float) (1 - 2 * G2); - float y1 = y0 - (float) (1 - 2 * G2); - value += (a1 * a1) * (a1 * a1) * GradCoord(seed, i1, j1, x1, y1); - - // Nested conditionals were faster than compact bit logic/arithmetic. - float xmyi = xi - yi; - if (t > G2) { - if (xi + xmyi > 1) { - float x2 = x0 + (float) (3 * G2 - 2); - float y2 = y0 + (float) (3 * G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); - } - } else { - float x2 = x0 + (float) G2; - float y2 = y0 + (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j + PrimeY, x2, y2); - } - } - - if (yi - xmyi > 1) { - float x3 = x0 + (float) (3 * G2 - 1); - float y3 = y0 + (float) (3 * G2 - 2); - float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) { - value += (a3 * a3) * - (a3 * a3) * - GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); - } - } else { - float x3 = x0 + (float) (G2 - 1); - float y3 = y0 + (float) G2; - float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; - if (a3 > 0) { - value += (a3 * a3) * - (a3 * a3) * - GradCoord(seed, i + PrimeX, j, x3, y3); - } - } - } else { - if (xi + xmyi < 0) { - float x2 = x0 + (float) (1 - G2); - float y2 = y0 - (float) G2; - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i - PrimeX, j, x2, y2); - } - } else { - float x2 = x0 + (float) (G2 - 1); - float y2 = y0 + (float) G2; - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i + PrimeX, j, x2, y2); - } - } - - if (yi < xmyi) { - float x2 = x0 - (float) G2; - float y2 = y0 - (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j - PrimeY, x2, y2); - } - } else { - float x2 = x0 + (float) G2; - float y2 = y0 + (float) (G2 - 1); - float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; - if (a2 > 0) { - value += (a2 * a2) * - (a2 * a2) * - GradCoord(seed, i, j + PrimeY, x2, y2); - } - } - } - - return value * 18.24196194486065f; - } - - private float SingleOpenSimplex2S( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - // 3D OpenSimplex2S case uses two offset rotated cube grids. - - /* - * --- Rotation moved to TransformNoiseCoordinate method --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - int k = FastFloor(z); - float xi = (float) (x - i); - float yi = (float) (y - j); - float zi = (float) (z - k); - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - int seed2 = seed + 1293373; - - int xNMask = (int) (-0.5f - xi); - int yNMask = (int) (-0.5f - yi); - int zNMask = (int) (-0.5f - zi); - - float x0 = xi + xNMask; - float y0 = yi + yNMask; - float z0 = zi + zNMask; - float a0 = 0.75f - x0 * x0 - y0 * y0 - z0 * z0; - float value = (a0 * a0) * - (a0 * a0) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (zNMask & PrimeZ), - x0, - y0, - z0); - - float x1 = xi - 0.5f; - float y1 = yi - 0.5f; - float z1 = zi - 0.5f; - float a1 = 0.75f - x1 * x1 - y1 * y1 - z1 * z1; - value += (a1 * a1) * - (a1 * a1) * - GradCoord(seed2, i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); - - float xAFlipMask0 = ((xNMask | 1) << 1) * x1; - float yAFlipMask0 = ((yNMask | 1) << 1) * y1; - float zAFlipMask0 = ((zNMask | 1) << 1) * z1; - float xAFlipMask1 = (-2 - (xNMask << 2)) * x1 - 1.0f; - float yAFlipMask1 = (-2 - (yNMask << 2)) * y1 - 1.0f; - float zAFlipMask1 = (-2 - (zNMask << 2)) * z1 - 1.0f; - - boolean skip5 = false; - float a2 = xAFlipMask0 + a0; - if (a2 > 0) { - float x2 = x0 - (xNMask | 1); - float y2 = y0; - float z2 = z0; - value += (a2 * a2) * - (a2 * a2) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (zNMask & PrimeZ), - x2, - y2, - z2); - } else { - float a3 = yAFlipMask0 + zAFlipMask0 + a0; - if (a3 > 0) { - float x3 = x0; - float y3 = y0 - (yNMask | 1); - float z3 = z0 - (zNMask | 1); - value += (a3 * a3) * - (a3 * a3) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (~zNMask & PrimeZ), - x3, - y3, - z3); - } - - float a4 = xAFlipMask1 + a1; - if (a4 > 0) { - float x4 = (xNMask | 1) + x1; - float y4 = y1; - float z4 = z1; - value += (a4 * a4) * - (a4 * a4) * - GradCoord( - seed2, - i + (xNMask & (PrimeX * 2)), - j + PrimeY, - k + PrimeZ, - x4, - y4, - z4); - skip5 = true; - } - } - - boolean skip9 = false; - float a6 = yAFlipMask0 + a0; - if (a6 > 0) { - float x6 = x0; - float y6 = y0 - (yNMask | 1); - float z6 = z0; - value += (a6 * a6) * - (a6 * a6) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (zNMask & PrimeZ), - x6, - y6, - z6); - } else { - float a7 = xAFlipMask0 + zAFlipMask0 + a0; - if (a7 > 0) { - float x7 = x0 - (xNMask | 1); - float y7 = y0; - float z7 = z0 - (zNMask | 1); - value += (a7 * a7) * - (a7 * a7) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (~zNMask & PrimeZ), - x7, - y7, - z7); - } - - float a8 = yAFlipMask1 + a1; - if (a8 > 0) { - float x8 = x1; - float y8 = (yNMask | 1) + y1; - float z8 = z1; - value += (a8 * a8) * - (a8 * a8) * - GradCoord( - seed2, - i + PrimeX, - j + (yNMask & (PrimeY << 1)), - k + PrimeZ, - x8, - y8, - z8); - skip9 = true; - } - } - - boolean skipD = false; - float aA = zAFlipMask0 + a0; - if (aA > 0) { - float xA = x0; - float yA = y0; - float zA = z0 - (zNMask | 1); - value += (aA * aA) * - (aA * aA) * - GradCoord( - seed, - i + (xNMask & PrimeX), - j + (yNMask & PrimeY), - k + (~zNMask & PrimeZ), - xA, - yA, - zA); - } else { - float aB = xAFlipMask0 + yAFlipMask0 + a0; - if (aB > 0) { - float xB = x0 - (xNMask | 1); - float yB = y0 - (yNMask | 1); - float zB = z0; - value += (aB * aB) * - (aB * aB) * - GradCoord( - seed, - i + (~xNMask & PrimeX), - j + (~yNMask & PrimeY), - k + (zNMask & PrimeZ), - xB, - yB, - zB); - } - - float aC = zAFlipMask1 + a1; - if (aC > 0) { - float xC = x1; - float yC = y1; - float zC = (zNMask | 1) + z1; - value += (aC * aC) * - (aC * aC) * - GradCoord( - seed2, - i + PrimeX, - j + PrimeY, - k + (zNMask & (PrimeZ << 1)), - xC, - yC, - zC); - skipD = true; - } - } - - if (!skip5) { - float a5 = yAFlipMask1 + zAFlipMask1 + a1; - if (a5 > 0) { - float x5 = x1; - float y5 = (yNMask | 1) + y1; - float z5 = (zNMask | 1) + z1; - value += (a5 * a5) * - (a5 * a5) * - GradCoord( - seed2, - i + PrimeX, - j + (yNMask & (PrimeY << 1)), - k + (zNMask & (PrimeZ << 1)), - x5, - y5, - z5); - } - } - - if (!skip9) { - float a9 = xAFlipMask1 + zAFlipMask1 + a1; - if (a9 > 0) { - float x9 = (xNMask | 1) + x1; - float y9 = y1; - float z9 = (zNMask | 1) + z1; - value += (a9 * a9) * - (a9 * a9) * - GradCoord( - seed2, - i + (xNMask & (PrimeX * 2)), - j + PrimeY, - k + (zNMask & (PrimeZ << 1)), - x9, - y9, - z9); - } - } - - if (!skipD) { - float aD = xAFlipMask1 + yAFlipMask1 + a1; - if (aD > 0) { - float xD = (xNMask | 1) + x1; - float yD = (yNMask | 1) + y1; - float zD = z1; - value += (aD * aD) * - (aD * aD) * - GradCoord( - seed2, - i + (xNMask & (PrimeX << 1)), - j + (yNMask & (PrimeY << 1)), - k + PrimeZ, - xD, - yD, - zD); - } - } - - return value * 9.046026385208288f; - } - - // Cellular Noise - - private float SingleCellular( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int xr = FastRound(x); - int yr = FastRound(y); - - float distance0 = Float.MAX_VALUE; - float distance1 = Float.MAX_VALUE; - int closestHash = 0; - - float cellularJitter = 0.43701595f * mCellularJitterModifier; - - int xPrimed = (xr - 1) * PrimeX; - int yPrimedBase = (yr - 1) * PrimeY; - - switch (mCellularDistanceFunction) { - default: - case Euclidean: - case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = vecX * vecX + vecY * vecY; - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = FastAbs(vecX) + FastAbs(vecY); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int hash = Hash(seed, xPrimed, yPrimed); - int idx = hash & (255 << 1); - - float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs2D[idx | 1] * cellularJitter; - - float newDistance = (FastAbs(vecX) + FastAbs(vecY)) + - (vecX * vecX + vecY * vecY); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - } - - if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && - mCellularReturnType != CellularReturnType.CellValue) { - distance0 = FastSqrt(distance0); - - if (mCellularReturnType != CellularReturnType.CellValue) { - distance1 = FastSqrt(distance1); - } - } - - switch (mCellularReturnType) { - case CellValue: - return closestHash * (1 / 2147483648.0f); - case Distance: - return distance0 - 1; - case Distance2: - return distance1 - 1; - case Distance2Add: - return (distance1 + distance0) * 0.5f - 1; - case Distance2Sub: - return distance1 - distance0 - 1; - case Distance2Mul: - return distance1 * distance0 * 0.5f - 1; - case Distance2Div: - return distance0 / distance1 - 1; - default: - return 0; - } - } - - private float SingleCellular( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int xr = FastRound(x); - int yr = FastRound(y); - int zr = FastRound(z); - - float distance0 = Float.MAX_VALUE; - float distance1 = Float.MAX_VALUE; - int closestHash = 0; - - float cellularJitter = 0.39614353f * mCellularJitterModifier; - - int xPrimed = (xr - 1) * PrimeX; - int yPrimedBase = (yr - 1) * PrimeY; - int zPrimedBase = (zr - 1) * PrimeZ; - - switch (mCellularDistanceFunction) { - case Euclidean: - case EuclideanSq: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - case Hybrid: - for (int xi = xr - 1; xi <= xr + 1; xi++) { - int yPrimed = yPrimedBase; - - for (int yi = yr - 1; yi <= yr + 1; yi++) { - int zPrimed = zPrimedBase; - - for (int zi = zr - 1; zi <= zr + 1; zi++) { - int hash = Hash(seed, xPrimed, yPrimed, zPrimed); - int idx = hash & (255 << 2); - - float vecX = (float) (xi - x) + - RandVecs3D[idx] * cellularJitter; - float vecY = (float) (yi - y) + - RandVecs3D[idx | 1] * cellularJitter; - float vecZ = (float) (zi - z) + - RandVecs3D[idx | 2] * cellularJitter; - - float newDistance = (FastAbs(vecX) + - FastAbs(vecY) + - FastAbs(vecZ)) + - (vecX * vecX + vecY * vecY + vecZ * vecZ); - - distance1 = FastMax(FastMin(distance1, newDistance), distance0); - if (newDistance < distance0) { - distance0 = newDistance; - closestHash = hash; - } - zPrimed += PrimeZ; - } - yPrimed += PrimeY; - } - xPrimed += PrimeX; - } - break; - default: - break; - } - - if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && - mCellularReturnType != CellularReturnType.CellValue) { - distance0 = FastSqrt(distance0); - - if (mCellularReturnType != CellularReturnType.CellValue) { - distance1 = FastSqrt(distance1); - } - } - - switch (mCellularReturnType) { - case CellValue: - return closestHash * (1 / 2147483648.0f); - case Distance: - return distance0 - 1; - case Distance2: - return distance1 - 1; - case Distance2Add: - return (distance1 + distance0) * 0.5f - 1; - case Distance2Sub: - return distance1 - distance0 - 1; - case Distance2Mul: - return distance1 * distance0 * 0.5f - 1; - case Distance2Div: - return distance0 / distance1 - 1; - default: - return 0; - } - } - - // Perlin Noise - - private float SinglePerlin( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - - float xd0 = (float) (x - x0); - float yd0 = (float) (y - y0); - float xd1 = xd0 - 1; - float yd1 = yd0 - 1; - - float xs = InterpQuintic(xd0); - float ys = InterpQuintic(yd0); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - float xf0 = Lerp( - GradCoord(seed, x0, y0, xd0, yd0), - GradCoord(seed, x1, y0, xd1, yd0), - xs); - float xf1 = Lerp( - GradCoord(seed, x0, y1, xd0, yd1), - GradCoord(seed, x1, y1, xd1, yd1), - xs); - - return Lerp(xf0, xf1, ys) * 1.4247691104677813f; - } - - private float SinglePerlin( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - int z0 = FastFloor(z); - - float xd0 = (float) (x - x0); - float yd0 = (float) (y - y0); - float zd0 = (float) (z - z0); - float xd1 = xd0 - 1; - float yd1 = yd0 - 1; - float zd1 = zd0 - 1; - - float xs = InterpQuintic(xd0); - float ys = InterpQuintic(yd0); - float zs = InterpQuintic(zd0); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - float xf00 = Lerp( - GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), - GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), - xs); - float xf10 = Lerp( - GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), - GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), - xs); - float xf01 = Lerp( - GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), - GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), - xs); - float xf11 = Lerp( - GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), - GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), - xs); - - float yf0 = Lerp(xf00, xf10, ys); - float yf1 = Lerp(xf01, xf11, ys); - - return Lerp(yf0, yf1, zs) * 0.964921414852142333984375f; - } - - // Value Cubic Noise - - private float SingleValueCubic( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int x1 = FastFloor(x); - int y1 = FastFloor(y); - - float xs = (float) (x - x1); - float ys = (float) (y - y1); - - x1 *= PrimeX; - y1 *= PrimeY; - int x0 = x1 - PrimeX; - int y0 = y1 - PrimeY; - int x2 = x1 + PrimeX; - int y2 = y1 + PrimeY; - int x3 = x1 + (PrimeX << 1); - int y3 = y1 + (PrimeY << 1); - - return (CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0), - ValCoord(seed, x1, y0), - ValCoord(seed, x2, y0), - ValCoord(seed, x3, y0), - xs), - CubicLerp( - ValCoord(seed, x0, y1), - ValCoord(seed, x1, y1), - ValCoord(seed, x2, y1), - ValCoord(seed, x3, y1), - xs), - CubicLerp( - ValCoord(seed, x0, y2), - ValCoord(seed, x1, y2), - ValCoord(seed, x2, y2), - ValCoord(seed, x3, y2), - xs), - CubicLerp( - ValCoord(seed, x0, y3), - ValCoord(seed, x1, y3), - ValCoord(seed, x2, y3), - ValCoord(seed, x3, y3), - xs), - ys) * - (1 / (1.5f * 1.5f))); - } - - private float SingleValueCubic( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int x1 = FastFloor(x); - int y1 = FastFloor(y); - int z1 = FastFloor(z); - - float xs = (float) (x - x1); - float ys = (float) (y - y1); - float zs = (float) (z - z1); - - x1 *= PrimeX; - y1 *= PrimeY; - z1 *= PrimeZ; - - int x0 = x1 - PrimeX; - int y0 = y1 - PrimeY; - int z0 = z1 - PrimeZ; - int x2 = x1 + PrimeX; - int y2 = y1 + PrimeY; - int z2 = z1 + PrimeZ; - int x3 = x1 + (PrimeX << 1); - int y3 = y1 + (PrimeY << 1); - int z3 = z1 + (PrimeZ << 1); - - return (CubicLerp( - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z0), - ValCoord(seed, x1, y0, z0), - ValCoord(seed, x2, y0, z0), - ValCoord(seed, x3, y0, z0), - xs), - CubicLerp( - ValCoord(seed, x0, y1, z0), - ValCoord(seed, x1, y1, z0), - ValCoord(seed, x2, y1, z0), - ValCoord(seed, x3, y1, z0), - xs), - CubicLerp( - ValCoord(seed, x0, y2, z0), - ValCoord(seed, x1, y2, z0), - ValCoord(seed, x2, y2, z0), - ValCoord(seed, x3, y2, z0), - xs), - CubicLerp( - ValCoord(seed, x0, y3, z0), - ValCoord(seed, x1, y3, z0), - ValCoord(seed, x2, y3, z0), - ValCoord(seed, x3, y3, z0), - xs), - ys), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z1), - ValCoord(seed, x1, y0, z1), - ValCoord(seed, x2, y0, z1), - ValCoord(seed, x3, y0, z1), - xs), - CubicLerp( - ValCoord(seed, x0, y1, z1), - ValCoord(seed, x1, y1, z1), - ValCoord(seed, x2, y1, z1), - ValCoord(seed, x3, y1, z1), - xs), - CubicLerp( - ValCoord(seed, x0, y2, z1), - ValCoord(seed, x1, y2, z1), - ValCoord(seed, x2, y2, z1), - ValCoord(seed, x3, y2, z1), - xs), - CubicLerp( - ValCoord(seed, x0, y3, z1), - ValCoord(seed, x1, y3, z1), - ValCoord(seed, x2, y3, z1), - ValCoord(seed, x3, y3, z1), - xs), - ys), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z2), - ValCoord(seed, x1, y0, z2), - ValCoord(seed, x2, y0, z2), - ValCoord(seed, x3, y0, z2), - xs), - CubicLerp( - ValCoord(seed, x0, y1, z2), - ValCoord(seed, x1, y1, z2), - ValCoord(seed, x2, y1, z2), - ValCoord(seed, x3, y1, z2), - xs), - CubicLerp( - ValCoord(seed, x0, y2, z2), - ValCoord(seed, x1, y2, z2), - ValCoord(seed, x2, y2, z2), - ValCoord(seed, x3, y2, z2), - xs), - CubicLerp( - ValCoord(seed, x0, y3, z2), - ValCoord(seed, x1, y3, z2), - ValCoord(seed, x2, y3, z2), - ValCoord(seed, x3, y3, z2), - xs), - ys), - CubicLerp( - CubicLerp( - ValCoord(seed, x0, y0, z3), - ValCoord(seed, x1, y0, z3), - ValCoord(seed, x2, y0, z3), - ValCoord(seed, x3, y0, z3), - xs), - CubicLerp( - ValCoord(seed, x0, y1, z3), - ValCoord(seed, x1, y1, z3), - ValCoord(seed, x2, y1, z3), - ValCoord(seed, x3, y1, z3), - xs), - CubicLerp( - ValCoord(seed, x0, y2, z3), - ValCoord(seed, x1, y2, z3), - ValCoord(seed, x2, y2, z3), - ValCoord(seed, x3, y2, z3), - xs), - CubicLerp( - ValCoord(seed, x0, y3, z3), - ValCoord(seed, x1, y3, z3), - ValCoord(seed, x2, y3, z3), - ValCoord(seed, x3, y3, z3), - xs), - ys), - zs) * - (1 / (1.5f * 1.5f * 1.5f))); - } - - // Value Noise - - private float SingleValue( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - - float xs = InterpHermite((float) (x - x0)); - float ys = InterpHermite((float) (y - y0)); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - float xf0 = Lerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), xs); - float xf1 = Lerp(ValCoord(seed, x0, y1), ValCoord(seed, x1, y1), xs); - - return Lerp(xf0, xf1, ys); - } - - private float SingleValue( - int seed, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - int x0 = FastFloor(x); - int y0 = FastFloor(y); - int z0 = FastFloor(z); - - float xs = InterpHermite((float) (x - x0)); - float ys = InterpHermite((float) (y - y0)); - float zs = InterpHermite((float) (z - z0)); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - float xf00 = Lerp( - ValCoord(seed, x0, y0, z0), - ValCoord(seed, x1, y0, z0), - xs); - float xf10 = Lerp( - ValCoord(seed, x0, y1, z0), - ValCoord(seed, x1, y1, z0), - xs); - float xf01 = Lerp( - ValCoord(seed, x0, y0, z1), - ValCoord(seed, x1, y0, z1), - xs); - float xf11 = Lerp( - ValCoord(seed, x0, y1, z1), - ValCoord(seed, x1, y1, z1), - xs); - - float yf0 = Lerp(xf00, xf10, ys); - float yf1 = Lerp(xf01, xf11, ys); - - return Lerp(yf0, yf1, zs); - } - - // Domain Warp - - private void DoSingleDomainWarp( - int seed, - float amp, - float freq, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord) { - switch (mDomainWarpType) { - case OpenSimplex2: - SingleDomainWarpSimplexGradient( - seed, - amp * 38.283687591552734375f, - freq, - x, - y, - coord, - false); - break; - case OpenSimplex2Reduced: - SingleDomainWarpSimplexGradient( - seed, - amp * 16.0f, - freq, - x, - y, - coord, - true); - break; - case BasicGrid: - SingleDomainWarpBasicGrid(seed, amp, freq, x, y, coord); - break; - } - } - - private void DoSingleDomainWarp( - int seed, - float amp, - float freq, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord) { - switch (mDomainWarpType) { - case OpenSimplex2: - SingleDomainWarpOpenSimplex2Gradient( - seed, - amp * 32.69428253173828125f, - freq, - x, - y, - z, - coord, - false); - break; - case OpenSimplex2Reduced: - SingleDomainWarpOpenSimplex2Gradient( - seed, - amp * 7.71604938271605f, - freq, - x, - y, - z, - coord, - true); - break; - case BasicGrid: - SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, coord); - break; - } - } - - // Domain Warp Single Wrapper - - private void DomainWarpSingle(Vector2 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: { - final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - } - - private void DomainWarpSingle(Vector3 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - } - - // Domain Warp Fractal Progressive - - private void DomainWarpFractalProgressive(Vector2 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: { - final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - private void DomainWarpFractalProgressive(Vector3 coord) { - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - // Domain Warp Fractal Independant - private void DomainWarpFractalIndependent(Vector2 coord) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - switch (mDomainWarpType) { - case OpenSimplex2: - case OpenSimplex2Reduced: { - final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; - final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); - /*FMLdouble*/double t = (xs + ys) * F2; - xs += t; - ys += t; - } - break; - default: - break; - } - - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - private void DomainWarpFractalIndependent(Vector3 coord) { - /*FMLdouble*/double xs = coord.x; - /*FMLdouble*/double ys = coord.y; - /*FMLdouble*/double zs = coord.z; - switch (mWarpTransformType3D) { - case ImproveXYPlanes: { - /*FMLdouble*/double xy = xs + ys; - /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; - zs *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - zs; - ys = ys + s2 - zs; - zs += xy * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case ImproveXZPlanes: { - /*FMLdouble*/double xz = xs + zs; - /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; - ys *= (/*FMLdouble*/double) 0.577350269189626; - xs += s2 - ys; - zs += s2 - ys; - ys += xz * (/*FMLdouble*/double) 0.577350269189626; - } - break; - case DefaultOpenSimplex2: { - final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / - 3.0); - /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew - xs = r - xs; - ys = r - ys; - zs = r - zs; - } - break; - default: - break; - } - - int seed = mSeed; - float amp = mDomainWarpAmp * mFractalBounding; - float freq = mFrequency; - - for (int i = 0; i < mOctaves; i++) { - DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); - - seed++; - amp *= mGain; - freq *= mLacunarity; - } - } - - // Domain Warp Basic Grid - - private void SingleDomainWarpBasicGrid( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord) { - /*FMLdouble*/double xf = x * frequency; - /*FMLdouble*/double yf = y * frequency; - - int x0 = FastFloor(xf); - int y0 = FastFloor(yf); - - float xs = InterpHermite((float) (xf - x0)); - float ys = InterpHermite((float) (yf - y0)); - - x0 *= PrimeX; - y0 *= PrimeY; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - - int hash0 = Hash(seed, x0, y0) & (255 << 1); - int hash1 = Hash(seed, x1, y0) & (255 << 1); - - float lx0x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); - float ly0x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); - - hash0 = Hash(seed, x0, y1) & (255 << 1); - hash1 = Hash(seed, x1, y1) & (255 << 1); - - float lx1x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); - float ly1x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); - - coord.x += Lerp(lx0x, lx1x, ys) * warpAmp; - coord.y += Lerp(ly0x, ly1x, ys) * warpAmp; - } - - private void SingleDomainWarpBasicGrid( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord) { - /*FMLdouble*/double xf = x * frequency; - /*FMLdouble*/double yf = y * frequency; - /*FMLdouble*/double zf = z * frequency; - - int x0 = FastFloor(xf); - int y0 = FastFloor(yf); - int z0 = FastFloor(zf); - - float xs = InterpHermite((float) (xf - x0)); - float ys = InterpHermite((float) (yf - y0)); - float zs = InterpHermite((float) (zf - z0)); - - x0 *= PrimeX; - y0 *= PrimeY; - z0 *= PrimeZ; - int x1 = x0 + PrimeX; - int y1 = y0 + PrimeY; - int z1 = z0 + PrimeZ; - - int hash0 = Hash(seed, x0, y0, z0) & (255 << 2); - int hash1 = Hash(seed, x1, y0, z0) & (255 << 2); - - float lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - float ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - float lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - hash0 = Hash(seed, x0, y1, z0) & (255 << 2); - hash1 = Hash(seed, x1, y1, z0) & (255 << 2); - - float lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - float ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - float lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - float lx0y = Lerp(lx0x, lx1x, ys); - float ly0y = Lerp(ly0x, ly1x, ys); - float lz0y = Lerp(lz0x, lz1x, ys); - - hash0 = Hash(seed, x0, y0, z1) & (255 << 2); - hash1 = Hash(seed, x1, y0, z1) & (255 << 2); - - lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - hash0 = Hash(seed, x0, y1, z1) & (255 << 2); - hash1 = Hash(seed, x1, y1, z1) & (255 << 2); - - lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); - ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); - lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); - - coord.x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * warpAmp; - coord.y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * warpAmp; - coord.z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; - } - - // Domain Warp Simplex/OpenSimplex2 - private void SingleDomainWarpSimplexGradient( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - Vector2 coord, - boolean outGradOnly) { - final float SQRT3 = 1.7320508075688772935274463415059f; - final float G2 = (3 - SQRT3) / 6; - - x *= frequency; - y *= frequency; - - /* - * --- Skew moved to switch statements before fractal evaluation --- - * final FNLfloat F2 = 0.5f * (SQRT3 - 1); - * FNLfloat s = (x + y) * F2; - * x += s; y += s; - */ - - int i = FastFloor(x); - int j = FastFloor(y); - float xi = (float) (x - i); - float yi = (float) (y - j); - - float t = (xi + yi) * G2; - float x0 = (float) (xi - t); - float y0 = (float) (yi - t); - - i *= PrimeX; - j *= PrimeY; - - float vx, vy; - vx = vy = 0; - - float a = 0.5f - x0 * x0 - y0 * y0; - if (a > 0) { - float aaaa = (a * a) * (a * a); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i, j) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i, j); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x0 * xg + y0 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += aaaa * xo; - vy += aaaa * yo; - } - - float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + - ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if (c > 0) { - float x2 = x0 + (2 * (float) G2 - 1); - float y2 = y0 + (2 * (float) G2 - 1); - float cccc = (c * c) * (c * c); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i + PrimeX, j + PrimeY) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i + PrimeX, j + PrimeY); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x2 * xg + y2 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += cccc * xo; - vy += cccc * yo; - } - - if (y0 > x0) { - float x1 = x0 + (float) G2; - float y1 = y0 + ((float) G2 - 1); - float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) { - float bbbb = (b * b) * (b * b); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i, j + PrimeY) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i, j + PrimeY); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x1 * xg + y1 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += bbbb * xo; - vy += bbbb * yo; - } - } else { - float x1 = x0 + ((float) G2 - 1); - float y1 = y0 + (float) G2; - float b = 0.5f - x1 * x1 - y1 * y1; - if (b > 0) { - float bbbb = (b * b) * (b * b); - float xo, yo; - if (outGradOnly) { - int hash = Hash(seed, i + PrimeX, j) & (255 << 1); - xo = RandVecs2D[hash]; - yo = RandVecs2D[hash | 1]; - } else { - int hash = Hash(seed, i + PrimeX, j); - int index1 = hash & (127 << 1); - int index2 = (hash >> 7) & (255 << 1); - float xg = Gradients2D[index1]; - float yg = Gradients2D[index1 | 1]; - float value = x1 * xg + y1 * yg; - float xgo = RandVecs2D[index2]; - float ygo = RandVecs2D[index2 | 1]; - xo = value * xgo; - yo = value * ygo; - } - vx += bbbb * xo; - vy += bbbb * yo; - } - } - - coord.x += vx * warpAmp; - coord.y += vy * warpAmp; - } - - private void SingleDomainWarpOpenSimplex2Gradient( - int seed, - float warpAmp, - float frequency, - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z, - Vector3 coord, - boolean outGradOnly) { - x *= frequency; - y *= frequency; - z *= frequency; - - /* - * --- Rotation moved to switch statements before fractal evaluation --- - * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); - * FNLfloat r = (x + y + z) * R3; // Rotation, not skew - * x = r - x; y = r - y; z = r - z; - */ - - int i = FastRound(x); - int j = FastRound(y); - int k = FastRound(z); - float x0 = (float) x - i; - float y0 = (float) y - j; - float z0 = (float) z - k; - - int xNSign = (int) (-x0 - 1.0f) | 1; - int yNSign = (int) (-y0 - 1.0f) | 1; - int zNSign = (int) (-z0 - 1.0f) | 1; - - float ax0 = xNSign * -x0; - float ay0 = yNSign * -y0; - float az0 = zNSign * -z0; - - i *= PrimeX; - j *= PrimeY; - k *= PrimeZ; - - float vx, vy, vz; - vx = vy = vz = 0; - - float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - for (int l = 0;; l++) { - if (a > 0) { - float aaaa = (a * a) * (a * a); - float xo, yo, zo; - if (outGradOnly) { - int hash = Hash(seed, i, j, k) & (255 << 2); - xo = RandVecs3D[hash]; - yo = RandVecs3D[hash | 1]; - zo = RandVecs3D[hash | 2]; - } else { - int hash = Hash(seed, i, j, k); - int index1 = hash & (63 << 2); - int index2 = (hash >> 6) & (255 << 2); - float xg = Gradients3D[index1]; - float yg = Gradients3D[index1 | 1]; - float zg = Gradients3D[index1 | 2]; - float value = x0 * xg + y0 * yg + z0 * zg; - float xgo = RandVecs3D[index2]; - float ygo = RandVecs3D[index2 | 1]; - float zgo = RandVecs3D[index2 | 2]; - xo = value * xgo; - yo = value * ygo; - zo = value * zgo; - } - vx += aaaa * xo; - vy += aaaa * yo; - vz += aaaa * zo; - } - - float b = a; - int i1 = i; - int j1 = j; - int k1 = k; - float x1 = x0; - float y1 = y0; - float z1 = z0; - - if (ax0 >= ay0 && ax0 >= az0) { - x1 += xNSign; - b = b + ax0 + ax0; - i1 -= xNSign * PrimeX; - } else if (ay0 > ax0 && ay0 >= az0) { - y1 += yNSign; - b = b + ay0 + ay0; - j1 -= yNSign * PrimeY; - } else { - z1 += zNSign; - b = b + az0 + az0; - k1 -= zNSign * PrimeZ; - } - - if (b > 1) { - b -= 1; - float bbbb = (b * b) * (b * b); - float xo, yo, zo; - if (outGradOnly) { - int hash = Hash(seed, i1, j1, k1) & (255 << 2); - xo = RandVecs3D[hash]; - yo = RandVecs3D[hash | 1]; - zo = RandVecs3D[hash | 2]; - } else { - int hash = Hash(seed, i1, j1, k1); - int index1 = hash & (63 << 2); - int index2 = (hash >> 6) & (255 << 2); - float xg = Gradients3D[index1]; - float yg = Gradients3D[index1 | 1]; - float zg = Gradients3D[index1 | 2]; - float value = x1 * xg + y1 * yg + z1 * zg; - float xgo = RandVecs3D[index2]; - float ygo = RandVecs3D[index2 | 1]; - float zgo = RandVecs3D[index2 | 2]; - xo = value * xgo; - yo = value * ygo; - zo = value * zgo; - } - vx += bbbb * xo; - vy += bbbb * yo; - vz += bbbb * zo; - } - - if (l == 1) - break; - - ax0 = 0.5f - ax0; - ay0 = 0.5f - ay0; - az0 = 0.5f - az0; - - x0 = xNSign * ax0; - y0 = yNSign * ay0; - z0 = zNSign * az0; - - a += (0.75f - ax0) - (ay0 + az0); - - i += (xNSign >> 1) & PrimeX; - j += (yNSign >> 1) & PrimeY; - k += (zNSign >> 1) & PrimeZ; - - xNSign = -xNSign; - yNSign = -yNSign; - zNSign = -zNSign; - - seed += 1293373; - } - - coord.x += vx * warpAmp; - coord.y += vy * warpAmp; - coord.z += vz * warpAmp; - } - - public static class Vector2 { - - public /*FMLdouble*/double x; - public /*FMLdouble*/double y; - - public Vector2(/*FMLdouble*/double x, /*FMLdouble*/double y) { - this.x = x; - this.y = y; - } - } - - public static class Vector3 { - - public /*FMLdouble*/double x; - public /*FMLdouble*/double y; - public /*FMLdouble*/double z; - - public Vector3( - /*FMLdouble*/double x, - /*FMLdouble*/double y, - /*FMLdouble*/double z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public static FastNoiseLite createSpongePerlin(int seed) { - FastNoiseLite fnlNoise = new FastNoiseLite(seed); - fnlNoise.SetNoiseType(FastNoiseLite.NoiseType.Perlin); // We will use 3D with a domain rotation to improve the look. - fnlNoise.SetRotationType3D( - FastNoiseLite.RotationType3D.ImproveXZPlanes); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. - fnlNoise.SetFractalType(FastNoiseLite.FractalType.FBm); - fnlNoise.SetFractalOctaves(6); - return fnlNoise; - } - - private static final double SPONGE_COMPATIBILITY_RATIO = (2 * Math.sqrt(3.0)) / 1.7252359327388492; - - public static float getSpongePerlinValue(float noise3) { - noise3 = noise3 * 0.5f + 0.5f; // Rescale to 0 to 1 to match new Sponge - noise3 *= (1.0f + 0.5f + 0.25f + 0.125f + 0.0625 + 0.03125); // Counter FastNoiseLite fractal range rescale. - noise3 *= SPONGE_COMPATIBILITY_RATIO; // Now make it match old Sponge. - return noise3; - } + public enum NoiseType { + OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, Value, + } + + public enum RotationType3D { + None, ImproveXYPlanes, ImproveXZPlanes, + } + + public enum FractalType { + None, FBm, Ridged, PingPong, DomainWarpProgressive, DomainWarpIndependent, + } + + public enum CellularDistanceFunction { + Euclidean, EuclideanSq, Manhattan, Hybrid, + } + + public enum CellularReturnType { + CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div, + } + + public enum DomainWarpType { + OpenSimplex2, OpenSimplex2Reduced, BasicGrid, + } + + private enum TransformType3D { + None, ImproveXYPlanes, ImproveXZPlanes, DefaultOpenSimplex2, + } + + private int mSeed = 1337; + private float mFrequency = 0.01f; + private NoiseType mNoiseType = NoiseType.OpenSimplex2; + private RotationType3D mRotationType3D = RotationType3D.None; + private TransformType3D mTransformType3D = TransformType3D.DefaultOpenSimplex2; + + private FractalType mFractalType = FractalType.None; + private int mOctaves = 3; + private float mLacunarity = 2.0f; + private float mGain = 0.5f; + private float mWeightedStrength = 0.0f; + private float mPingPongStength = 2.0f; + + private float mFractalBounding = 1 / 1.75f; + + private CellularDistanceFunction mCellularDistanceFunction = CellularDistanceFunction.EuclideanSq; + private CellularReturnType mCellularReturnType = CellularReturnType.Distance; + private float mCellularJitterModifier = 1.0f; + + private DomainWarpType mDomainWarpType = DomainWarpType.OpenSimplex2; + private TransformType3D mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + private float mDomainWarpAmp = 1.0f; + + /// + /// Create new FastNoise object with default seed + /// + public FastNoiseLite() { + } + + /// + /// Create new FastNoise object with specified seed + /// + public FastNoiseLite(int seed) { + SetSeed(seed); + } + + /// + /// Sets seed used for all noise types + /// + /// + /// Default: 1337 + /// + public void SetSeed(int seed) { + mSeed = seed; + } + + /// + /// Sets frequency for all noise types + /// + /// + /// Default: 0.01 + /// + public void SetFrequency(float frequency) { + mFrequency = frequency; + } + + /// + /// Sets noise algorithm used for GetNoise(...) + /// + /// + /// Default: OpenSimplex2 + /// + public void SetNoiseType(NoiseType noiseType) { + mNoiseType = noiseType; + UpdateTransformType3D(); + } + + /// + /// Sets domain rotation type for 3D Noise and 3D DomainWarp. + /// Can aid in reducing directional artifacts when sampling a 2D plane in 3D + /// + /// + /// Default: None + /// + public void SetRotationType3D(RotationType3D rotationType3D) { + mRotationType3D = rotationType3D; + UpdateTransformType3D(); + UpdateWarpTransformType3D(); + } + + /// + /// Sets method for combining octaves in all fractal noise types + /// + /// + /// Default: None + /// Note: FractalType.DomainWarp... only affects DomainWarp(...) + /// + public void SetFractalType(FractalType fractalType) { + mFractalType = fractalType; + } + + /// + /// Sets octave count for all fractal noise types + /// + /// + /// Default: 3 + /// + public void SetFractalOctaves(int octaves) { + mOctaves = octaves; + CalculateFractalBounding(); + } + + /// + /// Sets octave lacunarity for all fractal noise types + /// + /// + /// Default: 2.0 + /// + public void SetFractalLacunarity(float lacunarity) { + mLacunarity = lacunarity; + } + + /// + /// Sets octave gain for all fractal noise types + /// + /// + /// Default: 0.5 + /// + public void SetFractalGain(float gain) { + mGain = gain; + CalculateFractalBounding(); + } + + /// + /// Sets octave weighting for all none DomainWarp fratal types + /// + /// + /// Default: 0.0 + /// Note: Keep between 0...1 to maintain -1...1 output bounding + /// + public void SetFractalWeightedStrength(float weightedStrength) { + mWeightedStrength = weightedStrength; + } + + /// + /// Sets strength of the fractal ping pong effect + /// + /// + /// Default: 2.0 + /// + public void SetFractalPingPongStrength(float pingPongStrength) { + mPingPongStength = pingPongStrength; + } + + /// + /// Sets distance function used in cellular noise calculations + /// + /// + /// Default: Distance + /// + public void SetCellularDistanceFunction( + CellularDistanceFunction cellularDistanceFunction) { + mCellularDistanceFunction = cellularDistanceFunction; + } + + /// + /// Sets return type from cellular noise calculations + /// + /// + /// Default: EuclideanSq + /// + public void SetCellularReturnType(CellularReturnType cellularReturnType) { + mCellularReturnType = cellularReturnType; + } + + /// + /// Sets the maximum distance a cellular point can move from it's grid position + /// + /// + /// Default: 1.0 + /// Note: Setting this higher than 1 will cause artifacts + /// + public void SetCellularJitter(float cellularJitter) { + mCellularJitterModifier = cellularJitter; + } + + /// + /// Sets the warp algorithm when using DomainWarp(...) + /// + /// + /// Default: OpenSimplex2 + /// + public void SetDomainWarpType(DomainWarpType domainWarpType) { + mDomainWarpType = domainWarpType; + UpdateWarpTransformType3D(); + } + + /// + /// Sets the maximum warp distance from original position when using DomainWarp(...) + /// + /// + /// Default: 1.0 + /// + public void SetDomainWarpAmp(float domainWarpAmp) { + mDomainWarpAmp = domainWarpAmp; + } + + /// + /// 2D noise at given position using current settings + /// + /// + /// Noise output bounded between -1...1 + /// + public float GetNoise(/*FMLdouble*/double x, /*FMLdouble*/double y) { + x *= mFrequency; + y *= mFrequency; + + switch (mNoiseType) { + case OpenSimplex2: + case OpenSimplex2S: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (x + y) * F2; + x += t; + y += t; + } + break; + default: + break; + } + + switch (mFractalType) { + default: + return GenNoiseSingle(mSeed, x, y); + case FBm: + return GenFractalFBm(x, y); + case Ridged: + return GenFractalRidged(x, y); + case PingPong: + return GenFractalPingPong(x, y); + } + } + + /// + /// 3D noise at given position using current settings + /// + /// + /// Noise output bounded between -1...1 + /// + public float GetNoise( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + x *= mFrequency; + y *= mFrequency; + z *= mFrequency; + + switch (mTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = x + y; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + z *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - z; + y = y + s2 - z; + z += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = x + z; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + y *= (/*FMLdouble*/double) 0.577350269189626; + x += s2 - y; + z += s2 - y; + y += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + } + break; + default: + break; + } + + switch (mFractalType) { + default: + return GenNoiseSingle(mSeed, x, y, z); + case FBm: + return GenFractalFBm(x, y, z); + case Ridged: + return GenFractalRidged(x, y, z); + case PingPong: + return GenFractalPingPong(x, y, z); + } + } + + /// + /// 2D warps the input position using current domain warp settings + /// + /// + /// Example usage with GetNoise + /// DomainWarp(coord) + /// noise = GetNoise(x, y) + /// + public void DomainWarp(Vector2 coord) { + switch (mFractalType) { + default: + DomainWarpSingle(coord); + break; + case DomainWarpProgressive: + DomainWarpFractalProgressive(coord); + break; + case DomainWarpIndependent: + DomainWarpFractalIndependent(coord); + break; + } + } + + /// + /// 3D warps the input position using current domain warp settings + /// + /// + /// Example usage with GetNoise + /// DomainWarp(coord) + /// noise = GetNoise(x, y, z) + /// + public void DomainWarp(Vector3 coord) { + switch (mFractalType) { + default: + DomainWarpSingle(coord); + break; + case DomainWarpProgressive: + DomainWarpFractalProgressive(coord); + break; + case DomainWarpIndependent: + DomainWarpFractalIndependent(coord); + break; + } + } + + private static final float[] Gradients2D = { + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.608761429008721f, + 0.793353340291235f, + 0.793353340291235f, + 0.608761429008721f, + 0.923879532511287f, + 0.38268343236509f, + 0.99144486137381f, + 0.130526192220051f, + 0.99144486137381f, + -0.130526192220051f, + 0.923879532511287f, + -0.38268343236509f, + 0.793353340291235f, + -0.60876142900872f, + 0.608761429008721f, + -0.793353340291235f, + 0.38268343236509f, + -0.923879532511287f, + 0.130526192220052f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + -0.38268343236509f, + -0.923879532511287f, + -0.608761429008721f, + -0.793353340291235f, + -0.793353340291235f, + -0.608761429008721f, + -0.923879532511287f, + -0.38268343236509f, + -0.99144486137381f, + -0.130526192220052f, + -0.99144486137381f, + 0.130526192220051f, + -0.923879532511287f, + 0.38268343236509f, + -0.793353340291235f, + 0.608761429008721f, + -0.608761429008721f, + 0.793353340291235f, + -0.38268343236509f, + 0.923879532511287f, + -0.130526192220052f, + 0.99144486137381f, + 0.38268343236509f, + 0.923879532511287f, + 0.923879532511287f, + 0.38268343236509f, + 0.923879532511287f, + -0.38268343236509f, + 0.38268343236509f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + -0.923879532511287f, + -0.38268343236509f, + -0.923879532511287f, + 0.38268343236509f, + -0.38268343236509f, + 0.923879532511287f, + }; + + private static final float[] RandVecs2D = { + -0.2700222198f, + -0.9628540911f, + 0.3863092627f, + -0.9223693152f, + 0.04444859006f, + -0.999011673f, + -0.5992523158f, + -0.8005602176f, + -0.7819280288f, + 0.6233687174f, + 0.9464672271f, + 0.3227999196f, + -0.6514146797f, + -0.7587218957f, + 0.9378472289f, + 0.347048376f, + -0.8497875957f, + -0.5271252623f, + -0.879042592f, + 0.4767432447f, + -0.892300288f, + -0.4514423508f, + -0.379844434f, + -0.9250503802f, + -0.9951650832f, + 0.0982163789f, + 0.7724397808f, + -0.6350880136f, + 0.7573283322f, + -0.6530343002f, + -0.9928004525f, + -0.119780055f, + -0.0532665713f, + 0.9985803285f, + 0.9754253726f, + -0.2203300762f, + -0.7665018163f, + 0.6422421394f, + 0.991636706f, + 0.1290606184f, + -0.994696838f, + 0.1028503788f, + -0.5379205513f, + -0.84299554f, + 0.5022815471f, + -0.8647041387f, + 0.4559821461f, + -0.8899889226f, + -0.8659131224f, + -0.5001944266f, + 0.0879458407f, + -0.9961252577f, + -0.5051684983f, + 0.8630207346f, + 0.7753185226f, + -0.6315704146f, + -0.6921944612f, + 0.7217110418f, + -0.5191659449f, + -0.8546734591f, + 0.8978622882f, + -0.4402764035f, + -0.1706774107f, + 0.9853269617f, + -0.9353430106f, + -0.3537420705f, + -0.9992404798f, + 0.03896746794f, + -0.2882064021f, + -0.9575683108f, + -0.9663811329f, + 0.2571137995f, + -0.8759714238f, + -0.4823630009f, + -0.8303123018f, + -0.5572983775f, + 0.05110133755f, + -0.9986934731f, + -0.8558373281f, + -0.5172450752f, + 0.09887025282f, + 0.9951003332f, + 0.9189016087f, + 0.3944867976f, + -0.2439375892f, + -0.9697909324f, + -0.8121409387f, + -0.5834613061f, + -0.9910431363f, + 0.1335421355f, + 0.8492423985f, + -0.5280031709f, + -0.9717838994f, + -0.2358729591f, + 0.9949457207f, + 0.1004142068f, + 0.6241065508f, + -0.7813392434f, + 0.662910307f, + 0.7486988212f, + -0.7197418176f, + 0.6942418282f, + -0.8143370775f, + -0.5803922158f, + 0.104521054f, + -0.9945226741f, + -0.1065926113f, + -0.9943027784f, + 0.445799684f, + -0.8951327509f, + 0.105547406f, + 0.9944142724f, + -0.992790267f, + 0.1198644477f, + -0.8334366408f, + 0.552615025f, + 0.9115561563f, + -0.4111755999f, + 0.8285544909f, + -0.5599084351f, + 0.7217097654f, + -0.6921957921f, + 0.4940492677f, + -0.8694339084f, + -0.3652321272f, + -0.9309164803f, + -0.9696606758f, + 0.2444548501f, + 0.08925509731f, + -0.996008799f, + 0.5354071276f, + -0.8445941083f, + -0.1053576186f, + 0.9944343981f, + -0.9890284586f, + 0.1477251101f, + 0.004856104961f, + 0.9999882091f, + 0.9885598478f, + 0.1508291331f, + 0.9286129562f, + -0.3710498316f, + -0.5832393863f, + -0.8123003252f, + 0.3015207509f, + 0.9534596146f, + -0.9575110528f, + 0.2883965738f, + 0.9715802154f, + -0.2367105511f, + 0.229981792f, + 0.9731949318f, + 0.955763816f, + -0.2941352207f, + 0.740956116f, + 0.6715534485f, + -0.9971513787f, + -0.07542630764f, + 0.6905710663f, + -0.7232645452f, + -0.290713703f, + -0.9568100872f, + 0.5912777791f, + -0.8064679708f, + -0.9454592212f, + -0.325740481f, + 0.6664455681f, + 0.74555369f, + 0.6236134912f, + 0.7817328275f, + 0.9126993851f, + -0.4086316587f, + -0.8191762011f, + 0.5735419353f, + -0.8812745759f, + -0.4726046147f, + 0.9953313627f, + 0.09651672651f, + 0.9855650846f, + -0.1692969699f, + -0.8495980887f, + 0.5274306472f, + 0.6174853946f, + -0.7865823463f, + 0.8508156371f, + 0.52546432f, + 0.9985032451f, + -0.05469249926f, + 0.1971371563f, + -0.9803759185f, + 0.6607855748f, + -0.7505747292f, + -0.03097494063f, + 0.9995201614f, + -0.6731660801f, + 0.739491331f, + -0.7195018362f, + -0.6944905383f, + 0.9727511689f, + 0.2318515979f, + 0.9997059088f, + -0.0242506907f, + 0.4421787429f, + -0.8969269532f, + 0.9981350961f, + -0.061043673f, + -0.9173660799f, + -0.3980445648f, + -0.8150056635f, + -0.5794529907f, + -0.8789331304f, + 0.4769450202f, + 0.0158605829f, + 0.999874213f, + -0.8095464474f, + 0.5870558317f, + -0.9165898907f, + -0.3998286786f, + -0.8023542565f, + 0.5968480938f, + -0.5176737917f, + 0.8555780767f, + -0.8154407307f, + -0.5788405779f, + 0.4022010347f, + -0.9155513791f, + -0.9052556868f, + -0.4248672045f, + 0.7317445619f, + 0.6815789728f, + -0.5647632201f, + -0.8252529947f, + -0.8403276335f, + -0.5420788397f, + -0.9314281527f, + 0.363925262f, + 0.5238198472f, + 0.8518290719f, + 0.7432803869f, + -0.6689800195f, + -0.985371561f, + -0.1704197369f, + 0.4601468731f, + 0.88784281f, + 0.825855404f, + 0.5638819483f, + 0.6182366099f, + 0.7859920446f, + 0.8331502863f, + -0.553046653f, + 0.1500307506f, + 0.9886813308f, + -0.662330369f, + -0.7492119075f, + -0.668598664f, + 0.743623444f, + 0.7025606278f, + 0.7116238924f, + -0.5419389763f, + -0.8404178401f, + -0.3388616456f, + 0.9408362159f, + 0.8331530315f, + 0.5530425174f, + -0.2989720662f, + -0.9542618632f, + 0.2638522993f, + 0.9645630949f, + 0.124108739f, + -0.9922686234f, + -0.7282649308f, + -0.6852956957f, + 0.6962500149f, + 0.7177993569f, + -0.9183535368f, + 0.3957610156f, + -0.6326102274f, + -0.7744703352f, + -0.9331891859f, + -0.359385508f, + -0.1153779357f, + -0.9933216659f, + 0.9514974788f, + -0.3076565421f, + -0.08987977445f, + -0.9959526224f, + 0.6678496916f, + 0.7442961705f, + 0.7952400393f, + -0.6062947138f, + -0.6462007402f, + -0.7631674805f, + -0.2733598753f, + 0.9619118351f, + 0.9669590226f, + -0.254931851f, + -0.9792894595f, + 0.2024651934f, + -0.5369502995f, + -0.8436138784f, + -0.270036471f, + -0.9628500944f, + -0.6400277131f, + 0.7683518247f, + -0.7854537493f, + -0.6189203566f, + 0.06005905383f, + -0.9981948257f, + -0.02455770378f, + 0.9996984141f, + -0.65983623f, + 0.751409442f, + -0.6253894466f, + -0.7803127835f, + -0.6210408851f, + -0.7837781695f, + 0.8348888491f, + 0.5504185768f, + -0.1592275245f, + 0.9872419133f, + 0.8367622488f, + 0.5475663786f, + -0.8675753916f, + -0.4973056806f, + -0.2022662628f, + -0.9793305667f, + 0.9399189937f, + 0.3413975472f, + 0.9877404807f, + -0.1561049093f, + -0.9034455656f, + 0.4287028224f, + 0.1269804218f, + -0.9919052235f, + -0.3819600854f, + 0.924178821f, + 0.9754625894f, + 0.2201652486f, + -0.3204015856f, + -0.9472818081f, + -0.9874760884f, + 0.1577687387f, + 0.02535348474f, + -0.9996785487f, + 0.4835130794f, + -0.8753371362f, + -0.2850799925f, + -0.9585037287f, + -0.06805516006f, + -0.99768156f, + -0.7885244045f, + -0.6150034663f, + 0.3185392127f, + -0.9479096845f, + 0.8880043089f, + 0.4598351306f, + 0.6476921488f, + -0.7619021462f, + 0.9820241299f, + 0.1887554194f, + 0.9357275128f, + -0.3527237187f, + -0.8894895414f, + 0.4569555293f, + 0.7922791302f, + 0.6101588153f, + 0.7483818261f, + 0.6632681526f, + -0.7288929755f, + -0.6846276581f, + 0.8729032783f, + -0.4878932944f, + 0.8288345784f, + 0.5594937369f, + 0.08074567077f, + 0.9967347374f, + 0.9799148216f, + -0.1994165048f, + -0.580730673f, + -0.8140957471f, + -0.4700049791f, + -0.8826637636f, + 0.2409492979f, + 0.9705377045f, + 0.9437816757f, + -0.3305694308f, + -0.8927998638f, + -0.4504535528f, + -0.8069622304f, + 0.5906030467f, + 0.06258973166f, + 0.9980393407f, + -0.9312597469f, + 0.3643559849f, + 0.5777449785f, + 0.8162173362f, + -0.3360095855f, + -0.941858566f, + 0.697932075f, + -0.7161639607f, + -0.002008157227f, + -0.9999979837f, + -0.1827294312f, + -0.9831632392f, + -0.6523911722f, + 0.7578824173f, + -0.4302626911f, + -0.9027037258f, + -0.9985126289f, + -0.05452091251f, + -0.01028102172f, + -0.9999471489f, + -0.4946071129f, + 0.8691166802f, + -0.2999350194f, + 0.9539596344f, + 0.8165471961f, + 0.5772786819f, + 0.2697460475f, + 0.962931498f, + -0.7306287391f, + -0.6827749597f, + -0.7590952064f, + -0.6509796216f, + -0.907053853f, + 0.4210146171f, + -0.5104861064f, + -0.8598860013f, + 0.8613350597f, + 0.5080373165f, + 0.5007881595f, + -0.8655698812f, + -0.654158152f, + 0.7563577938f, + -0.8382755311f, + -0.545246856f, + 0.6940070834f, + 0.7199681717f, + 0.06950936031f, + 0.9975812994f, + 0.1702942185f, + -0.9853932612f, + 0.2695973274f, + 0.9629731466f, + 0.5519612192f, + -0.8338697815f, + 0.225657487f, + -0.9742067022f, + 0.4215262855f, + -0.9068161835f, + 0.4881873305f, + -0.8727388672f, + -0.3683854996f, + -0.9296731273f, + -0.9825390578f, + 0.1860564427f, + 0.81256471f, + 0.5828709909f, + 0.3196460933f, + -0.9475370046f, + 0.9570913859f, + 0.2897862643f, + -0.6876655497f, + -0.7260276109f, + -0.9988770922f, + -0.047376731f, + -0.1250179027f, + 0.992154486f, + -0.8280133617f, + 0.560708367f, + 0.9324863769f, + -0.3612051451f, + 0.6394653183f, + 0.7688199442f, + -0.01623847064f, + -0.9998681473f, + -0.9955014666f, + -0.09474613458f, + -0.81453315f, + 0.580117012f, + 0.4037327978f, + -0.9148769469f, + 0.9944263371f, + 0.1054336766f, + -0.1624711654f, + 0.9867132919f, + -0.9949487814f, + -0.100383875f, + -0.6995302564f, + 0.7146029809f, + 0.5263414922f, + -0.85027327f, + -0.5395221479f, + 0.841971408f, + 0.6579370318f, + 0.7530729462f, + 0.01426758847f, + -0.9998982128f, + -0.6734383991f, + 0.7392433447f, + 0.639412098f, + -0.7688642071f, + 0.9211571421f, + 0.3891908523f, + -0.146637214f, + -0.9891903394f, + -0.782318098f, + 0.6228791163f, + -0.5039610839f, + -0.8637263605f, + -0.7743120191f, + -0.6328039957f, + }; + + private static final float[] Gradients3D = { + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + -1, + 1, + 0, + -1, + 1, + 0, + 0, + 0, + -1, + -1, + 0, + }; + + private static final float[] RandVecs3D = { + -0.7292736885f, + -0.6618439697f, + 0.1735581948f, + 0, + 0.790292081f, + -0.5480887466f, + -0.2739291014f, + 0, + 0.7217578935f, + 0.6226212466f, + -0.3023380997f, + 0, + 0.565683137f, + -0.8208298145f, + -0.0790000257f, + 0, + 0.760049034f, + -0.5555979497f, + -0.3370999617f, + 0, + 0.3713945616f, + 0.5011264475f, + 0.7816254623f, + 0, + -0.1277062463f, + -0.4254438999f, + -0.8959289049f, + 0, + -0.2881560924f, + -0.5815838982f, + 0.7607405838f, + 0, + 0.5849561111f, + -0.662820239f, + -0.4674352136f, + 0, + 0.3307171178f, + 0.0391653737f, + 0.94291689f, + 0, + 0.8712121778f, + -0.4113374369f, + -0.2679381538f, + 0, + 0.580981015f, + 0.7021915846f, + 0.4115677815f, + 0, + 0.503756873f, + 0.6330056931f, + -0.5878203852f, + 0, + 0.4493712205f, + 0.601390195f, + 0.6606022552f, + 0, + -0.6878403724f, + 0.09018890807f, + -0.7202371714f, + 0, + -0.5958956522f, + -0.6469350577f, + 0.475797649f, + 0, + -0.5127052122f, + 0.1946921978f, + -0.8361987284f, + 0, + -0.9911507142f, + -0.05410276466f, + -0.1212153153f, + 0, + -0.2149721042f, + 0.9720882117f, + -0.09397607749f, + 0, + -0.7518650936f, + -0.5428057603f, + 0.3742469607f, + 0, + 0.5237068895f, + 0.8516377189f, + -0.02107817834f, + 0, + 0.6333504779f, + 0.1926167129f, + -0.7495104896f, + 0, + -0.06788241606f, + 0.3998305789f, + 0.9140719259f, + 0, + -0.5538628599f, + -0.4729896695f, + -0.6852128902f, + 0, + -0.7261455366f, + -0.5911990757f, + 0.3509933228f, + 0, + -0.9229274737f, + -0.1782808786f, + 0.3412049336f, + 0, + -0.6968815002f, + 0.6511274338f, + 0.3006480328f, + 0, + 0.9608044783f, + -0.2098363234f, + -0.1811724921f, + 0, + 0.06817146062f, + -0.9743405129f, + 0.2145069156f, + 0, + -0.3577285196f, + -0.6697087264f, + -0.6507845481f, + 0, + -0.1868621131f, + 0.7648617052f, + -0.6164974636f, + 0, + -0.6541697588f, + 0.3967914832f, + 0.6439087246f, + 0, + 0.6993340405f, + -0.6164538506f, + 0.3618239211f, + 0, + -0.1546665739f, + 0.6291283928f, + 0.7617583057f, + 0, + -0.6841612949f, + -0.2580482182f, + -0.6821542638f, + 0, + 0.5383980957f, + 0.4258654885f, + 0.7271630328f, + 0, + -0.5026987823f, + -0.7939832935f, + -0.3418836993f, + 0, + 0.3202971715f, + 0.2834415347f, + 0.9039195862f, + 0, + 0.8683227101f, + -0.0003762656404f, + -0.4959995258f, + 0, + 0.791120031f, + -0.08511045745f, + 0.6057105799f, + 0, + -0.04011016052f, + -0.4397248749f, + 0.8972364289f, + 0, + 0.9145119872f, + 0.3579346169f, + -0.1885487608f, + 0, + -0.9612039066f, + -0.2756484276f, + 0.01024666929f, + 0, + 0.6510361721f, + -0.2877799159f, + -0.7023778346f, + 0, + -0.2041786351f, + 0.7365237271f, + 0.644859585f, + 0, + -0.7718263711f, + 0.3790626912f, + 0.5104855816f, + 0, + -0.3060082741f, + -0.7692987727f, + 0.5608371729f, + 0, + 0.454007341f, + -0.5024843065f, + 0.7357899537f, + 0, + 0.4816795475f, + 0.6021208291f, + -0.6367380315f, + 0, + 0.6961980369f, + -0.3222197429f, + 0.641469197f, + 0, + -0.6532160499f, + -0.6781148932f, + 0.3368515753f, + 0, + 0.5089301236f, + -0.6154662304f, + -0.6018234363f, + 0, + -0.1635919754f, + -0.9133604627f, + -0.372840892f, + 0, + 0.52408019f, + -0.8437664109f, + 0.1157505864f, + 0, + 0.5902587356f, + 0.4983817807f, + -0.6349883666f, + 0, + 0.5863227872f, + 0.494764745f, + 0.6414307729f, + 0, + 0.6779335087f, + 0.2341345225f, + 0.6968408593f, + 0, + 0.7177054546f, + -0.6858979348f, + 0.120178631f, + 0, + -0.5328819713f, + -0.5205125012f, + 0.6671608058f, + 0, + -0.8654874251f, + -0.0700727088f, + -0.4960053754f, + 0, + -0.2861810166f, + 0.7952089234f, + 0.5345495242f, + 0, + -0.04849529634f, + 0.9810836427f, + -0.1874115585f, + 0, + -0.6358521667f, + 0.6058348682f, + 0.4781800233f, + 0, + 0.6254794696f, + -0.2861619734f, + 0.7258696564f, + 0, + -0.2585259868f, + 0.5061949264f, + -0.8227581726f, + 0, + 0.02136306781f, + 0.5064016808f, + -0.8620330371f, + 0, + 0.200111773f, + 0.8599263484f, + 0.4695550591f, + 0, + 0.4743561372f, + 0.6014985084f, + -0.6427953014f, + 0, + 0.6622993731f, + -0.5202474575f, + -0.5391679918f, + 0, + 0.08084972818f, + -0.6532720452f, + 0.7527940996f, + 0, + -0.6893687501f, + 0.0592860349f, + 0.7219805347f, + 0, + -0.1121887082f, + -0.9673185067f, + 0.2273952515f, + 0, + 0.7344116094f, + 0.5979668656f, + -0.3210532909f, + 0, + 0.5789393465f, + -0.2488849713f, + 0.7764570201f, + 0, + 0.6988182827f, + 0.3557169806f, + -0.6205791146f, + 0, + -0.8636845529f, + -0.2748771249f, + -0.4224826141f, + 0, + -0.4247027957f, + -0.4640880967f, + 0.777335046f, + 0, + 0.5257722489f, + -0.8427017621f, + 0.1158329937f, + 0, + 0.9343830603f, + 0.316302472f, + -0.1639543925f, + 0, + -0.1016836419f, + -0.8057303073f, + -0.5834887393f, + 0, + -0.6529238969f, + 0.50602126f, + -0.5635892736f, + 0, + -0.2465286165f, + -0.9668205684f, + -0.06694497494f, + 0, + -0.9776897119f, + -0.2099250524f, + -0.007368825344f, + 0, + 0.7736893337f, + 0.5734244712f, + 0.2694238123f, + 0, + -0.6095087895f, + 0.4995678998f, + 0.6155736747f, + 0, + 0.5794535482f, + 0.7434546771f, + 0.3339292269f, + 0, + -0.8226211154f, + 0.08142581855f, + 0.5627293636f, + 0, + -0.510385483f, + 0.4703667658f, + 0.7199039967f, + 0, + -0.5764971849f, + -0.07231656274f, + -0.8138926898f, + 0, + 0.7250628871f, + 0.3949971505f, + -0.5641463116f, + 0, + -0.1525424005f, + 0.4860840828f, + -0.8604958341f, + 0, + -0.5550976208f, + -0.4957820792f, + 0.667882296f, + 0, + -0.1883614327f, + 0.9145869398f, + 0.357841725f, + 0, + 0.7625556724f, + -0.5414408243f, + -0.3540489801f, + 0, + -0.5870231946f, + -0.3226498013f, + -0.7424963803f, + 0, + 0.3051124198f, + 0.2262544068f, + -0.9250488391f, + 0, + 0.6379576059f, + 0.577242424f, + -0.5097070502f, + 0, + -0.5966775796f, + 0.1454852398f, + -0.7891830656f, + 0, + -0.658330573f, + 0.6555487542f, + -0.3699414651f, + 0, + 0.7434892426f, + 0.2351084581f, + 0.6260573129f, + 0, + 0.5562114096f, + 0.8264360377f, + -0.0873632843f, + 0, + -0.3028940016f, + -0.8251527185f, + 0.4768419182f, + 0, + 0.1129343818f, + -0.985888439f, + -0.1235710781f, + 0, + 0.5937652891f, + -0.5896813806f, + 0.5474656618f, + 0, + 0.6757964092f, + -0.5835758614f, + -0.4502648413f, + 0, + 0.7242302609f, + -0.1152719764f, + 0.6798550586f, + 0, + -0.9511914166f, + 0.0753623979f, + -0.2992580792f, + 0, + 0.2539470961f, + -0.1886339355f, + 0.9486454084f, + 0, + 0.571433621f, + -0.1679450851f, + -0.8032795685f, + 0, + -0.06778234979f, + 0.3978269256f, + 0.9149531629f, + 0, + 0.6074972649f, + 0.733060024f, + -0.3058922593f, + 0, + -0.5435478392f, + 0.1675822484f, + 0.8224791405f, + 0, + -0.5876678086f, + -0.3380045064f, + -0.7351186982f, + 0, + -0.7967562402f, + 0.04097822706f, + -0.6029098428f, + 0, + -0.1996350917f, + 0.8706294745f, + 0.4496111079f, + 0, + -0.02787660336f, + -0.9106232682f, + -0.4122962022f, + 0, + -0.7797625996f, + -0.6257634692f, + 0.01975775581f, + 0, + -0.5211232846f, + 0.7401644346f, + -0.4249554471f, + 0, + 0.8575424857f, + 0.4053272873f, + -0.3167501783f, + 0, + 0.1045223322f, + 0.8390195772f, + -0.5339674439f, + 0, + 0.3501822831f, + 0.9242524096f, + -0.1520850155f, + 0, + 0.1987849858f, + 0.07647613266f, + 0.9770547224f, + 0, + 0.7845996363f, + 0.6066256811f, + -0.1280964233f, + 0, + 0.09006737436f, + -0.9750989929f, + -0.2026569073f, + 0, + -0.8274343547f, + -0.542299559f, + 0.1458203587f, + 0, + -0.3485797732f, + -0.415802277f, + 0.840000362f, + 0, + -0.2471778936f, + -0.7304819962f, + -0.6366310879f, + 0, + -0.3700154943f, + 0.8577948156f, + 0.3567584454f, + 0, + 0.5913394901f, + -0.548311967f, + -0.5913303597f, + 0, + 0.1204873514f, + -0.7626472379f, + -0.6354935001f, + 0, + 0.616959265f, + 0.03079647928f, + 0.7863922953f, + 0, + 0.1258156836f, + -0.6640829889f, + -0.7369967419f, + 0, + -0.6477565124f, + -0.1740147258f, + -0.7417077429f, + 0, + 0.6217889313f, + -0.7804430448f, + -0.06547655076f, + 0, + 0.6589943422f, + -0.6096987708f, + 0.4404473475f, + 0, + -0.2689837504f, + -0.6732403169f, + -0.6887635427f, + 0, + -0.3849775103f, + 0.5676542638f, + 0.7277093879f, + 0, + 0.5754444408f, + 0.8110471154f, + -0.1051963504f, + 0, + 0.9141593684f, + 0.3832947817f, + 0.131900567f, + 0, + -0.107925319f, + 0.9245493968f, + 0.3654593525f, + 0, + 0.377977089f, + 0.3043148782f, + 0.8743716458f, + 0, + -0.2142885215f, + -0.8259286236f, + 0.5214617324f, + 0, + 0.5802544474f, + 0.4148098596f, + -0.7008834116f, + 0, + -0.1982660881f, + 0.8567161266f, + -0.4761596756f, + 0, + -0.03381553704f, + 0.3773180787f, + -0.9254661404f, + 0, + -0.6867922841f, + -0.6656597827f, + 0.2919133642f, + 0, + 0.7731742607f, + -0.2875793547f, + -0.5652430251f, + 0, + -0.09655941928f, + 0.9193708367f, + -0.3813575004f, + 0, + 0.2715702457f, + -0.9577909544f, + -0.09426605581f, + 0, + 0.2451015704f, + -0.6917998565f, + -0.6792188003f, + 0, + 0.977700782f, + -0.1753855374f, + 0.1155036542f, + 0, + -0.5224739938f, + 0.8521606816f, + 0.02903615945f, + 0, + -0.7734880599f, + -0.5261292347f, + 0.3534179531f, + 0, + -0.7134492443f, + -0.269547243f, + 0.6467878011f, + 0, + 0.1644037271f, + 0.5105846203f, + -0.8439637196f, + 0, + 0.6494635788f, + 0.05585611296f, + 0.7583384168f, + 0, + -0.4711970882f, + 0.5017280509f, + -0.7254255765f, + 0, + -0.6335764307f, + -0.2381686273f, + -0.7361091029f, + 0, + -0.9021533097f, + -0.270947803f, + -0.3357181763f, + 0, + -0.3793711033f, + 0.872258117f, + 0.3086152025f, + 0, + -0.6855598966f, + -0.3250143309f, + 0.6514394162f, + 0, + 0.2900942212f, + -0.7799057743f, + -0.5546100667f, + 0, + -0.2098319339f, + 0.85037073f, + 0.4825351604f, + 0, + -0.4592603758f, + 0.6598504336f, + -0.5947077538f, + 0, + 0.8715945488f, + 0.09616365406f, + -0.4807031248f, + 0, + -0.6776666319f, + 0.7118504878f, + -0.1844907016f, + 0, + 0.7044377633f, + 0.312427597f, + 0.637304036f, + 0, + -0.7052318886f, + -0.2401093292f, + -0.6670798253f, + 0, + 0.081921007f, + -0.7207336136f, + -0.6883545647f, + 0, + -0.6993680906f, + -0.5875763221f, + -0.4069869034f, + 0, + -0.1281454481f, + 0.6419895885f, + 0.7559286424f, + 0, + -0.6337388239f, + -0.6785471501f, + -0.3714146849f, + 0, + 0.5565051903f, + -0.2168887573f, + -0.8020356851f, + 0, + -0.5791554484f, + 0.7244372011f, + -0.3738578718f, + 0, + 0.1175779076f, + -0.7096451073f, + 0.6946792478f, + 0, + -0.6134619607f, + 0.1323631078f, + 0.7785527795f, + 0, + 0.6984635305f, + -0.02980516237f, + -0.715024719f, + 0, + 0.8318082963f, + -0.3930171956f, + 0.3919597455f, + 0, + 0.1469576422f, + 0.05541651717f, + -0.9875892167f, + 0, + 0.708868575f, + -0.2690503865f, + 0.6520101478f, + 0, + 0.2726053183f, + 0.67369766f, + -0.68688995f, + 0, + -0.6591295371f, + 0.3035458599f, + -0.6880466294f, + 0, + 0.4815131379f, + -0.7528270071f, + 0.4487723203f, + 0, + 0.9430009463f, + 0.1675647412f, + -0.2875261255f, + 0, + 0.434802957f, + 0.7695304522f, + -0.4677277752f, + 0, + 0.3931996188f, + 0.594473625f, + 0.7014236729f, + 0, + 0.7254336655f, + -0.603925654f, + 0.3301814672f, + 0, + 0.7590235227f, + -0.6506083235f, + 0.02433313207f, + 0, + -0.8552768592f, + -0.3430042733f, + 0.3883935666f, + 0, + -0.6139746835f, + 0.6981725247f, + 0.3682257648f, + 0, + -0.7465905486f, + -0.5752009504f, + 0.3342849376f, + 0, + 0.5730065677f, + 0.810555537f, + -0.1210916791f, + 0, + -0.9225877367f, + -0.3475211012f, + -0.167514036f, + 0, + -0.7105816789f, + -0.4719692027f, + -0.5218416899f, + 0, + -0.08564609717f, + 0.3583001386f, + 0.929669703f, + 0, + -0.8279697606f, + -0.2043157126f, + 0.5222271202f, + 0, + 0.427944023f, + 0.278165994f, + 0.8599346446f, + 0, + 0.5399079671f, + -0.7857120652f, + -0.3019204161f, + 0, + 0.5678404253f, + -0.5495413974f, + -0.6128307303f, + 0, + -0.9896071041f, + 0.1365639107f, + -0.04503418428f, + 0, + -0.6154342638f, + -0.6440875597f, + 0.4543037336f, + 0, + 0.1074204368f, + -0.7946340692f, + 0.5975094525f, + 0, + -0.3595449969f, + -0.8885529948f, + 0.28495784f, + 0, + -0.2180405296f, + 0.1529888965f, + 0.9638738118f, + 0, + -0.7277432317f, + -0.6164050508f, + -0.3007234646f, + 0, + 0.7249729114f, + -0.00669719484f, + 0.6887448187f, + 0, + -0.5553659455f, + -0.5336586252f, + 0.6377908264f, + 0, + 0.5137558015f, + 0.7976208196f, + -0.3160000073f, + 0, + -0.3794024848f, + 0.9245608561f, + -0.03522751494f, + 0, + 0.8229248658f, + 0.2745365933f, + -0.4974176556f, + 0, + -0.5404114394f, + 0.6091141441f, + 0.5804613989f, + 0, + 0.8036581901f, + -0.2703029469f, + 0.5301601931f, + 0, + 0.6044318879f, + 0.6832968393f, + 0.4095943388f, + 0, + 0.06389988817f, + 0.9658208605f, + -0.2512108074f, + 0, + 0.1087113286f, + 0.7402471173f, + -0.6634877936f, + 0, + -0.713427712f, + -0.6926784018f, + 0.1059128479f, + 0, + 0.6458897819f, + -0.5724548511f, + -0.5050958653f, + 0, + -0.6553931414f, + 0.7381471625f, + 0.159995615f, + 0, + 0.3910961323f, + 0.9188871375f, + -0.05186755998f, + 0, + -0.4879022471f, + -0.5904376907f, + 0.6429111375f, + 0, + 0.6014790094f, + 0.7707441366f, + -0.2101820095f, + 0, + -0.5677173047f, + 0.7511360995f, + 0.3368851762f, + 0, + 0.7858573506f, + 0.226674665f, + 0.5753666838f, + 0, + -0.4520345543f, + -0.604222686f, + -0.6561857263f, + 0, + 0.002272116345f, + 0.4132844051f, + -0.9105991643f, + 0, + -0.5815751419f, + -0.5162925989f, + 0.6286591339f, + 0, + -0.03703704785f, + 0.8273785755f, + 0.5604221175f, + 0, + -0.5119692504f, + 0.7953543429f, + -0.3244980058f, + 0, + -0.2682417366f, + -0.9572290247f, + -0.1084387619f, + 0, + -0.2322482736f, + -0.9679131102f, + -0.09594243324f, + 0, + 0.3554328906f, + -0.8881505545f, + 0.2913006227f, + 0, + 0.7346520519f, + -0.4371373164f, + 0.5188422971f, + 0, + 0.9985120116f, + 0.04659011161f, + -0.02833944577f, + 0, + -0.3727687496f, + -0.9082481361f, + 0.1900757285f, + 0, + 0.91737377f, + -0.3483642108f, + 0.1925298489f, + 0, + 0.2714911074f, + 0.4147529736f, + -0.8684886582f, + 0, + 0.5131763485f, + -0.7116334161f, + 0.4798207128f, + 0, + -0.8737353606f, + 0.18886992f, + -0.4482350644f, + 0, + 0.8460043821f, + -0.3725217914f, + 0.3814499973f, + 0, + 0.8978727456f, + -0.1780209141f, + -0.4026575304f, + 0, + 0.2178065647f, + -0.9698322841f, + -0.1094789531f, + 0, + -0.1518031304f, + -0.7788918132f, + -0.6085091231f, + 0, + -0.2600384876f, + -0.4755398075f, + -0.8403819825f, + 0, + 0.572313509f, + -0.7474340931f, + -0.3373418503f, + 0, + -0.7174141009f, + 0.1699017182f, + -0.6756111411f, + 0, + -0.684180784f, + 0.02145707593f, + -0.7289967412f, + 0, + -0.2007447902f, + 0.06555605789f, + -0.9774476623f, + 0, + -0.1148803697f, + -0.8044887315f, + 0.5827524187f, + 0, + -0.7870349638f, + 0.03447489231f, + 0.6159443543f, + 0, + -0.2015596421f, + 0.6859872284f, + 0.6991389226f, + 0, + -0.08581082512f, + -0.10920836f, + -0.9903080513f, + 0, + 0.5532693395f, + 0.7325250401f, + -0.396610771f, + 0, + -0.1842489331f, + -0.9777375055f, + -0.1004076743f, + 0, + 0.0775473789f, + -0.9111505856f, + 0.4047110257f, + 0, + 0.1399838409f, + 0.7601631212f, + -0.6344734459f, + 0, + 0.4484419361f, + -0.845289248f, + 0.2904925424f, + 0, + }; + + private static float FastMin(float a, float b) { + return a < b ? a : b; + } + + private static float FastMax(float a, float b) { + return a > b ? a : b; + } + + private static float FastAbs(float f) { + return f < 0 ? -f : f; + } + + private static float FastSqrt(float f) { + return (float) Math.sqrt(f); + } + + private static int FastFloor(/*FMLdouble*/double f) { + return f >= 0 ? (int) f : (int) f - 1; + } + + private static int FastRound(/*FMLdouble*/double f) { + return f >= 0 ? (int) (f + 0.5f) : (int) (f - 0.5f); + } + + private static float Lerp(float a, float b, float t) { + return a + t * (b - a); + } + + private static float InterpHermite(float t) { + return t * t * (3 - 2 * t); + } + + private static float InterpQuintic(float t) { + return t * t * t * (t * (t * 6 - 15) + 10); + } + + private static float CubicLerp( + float a, + float b, + float c, + float d, + float t) { + float p = (d - c) - (a - b); + return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; + } + + private static float PingPong(float t) { + t -= (int) (t * 0.5f) * 2; + return t < 1 ? t : 2 - t; + } + + private void CalculateFractalBounding() { + float gain = FastAbs(mGain); + float amp = gain; + float ampFractal = 1.0f; + for (int i = 1; i < mOctaves; i++) { + ampFractal += amp; + amp *= gain; + } + mFractalBounding = 1 / ampFractal; + } + + // Hashing + private static final int PrimeX = 501125321; + private static final int PrimeY = 1136930381; + private static final int PrimeZ = 1720413743; + + private static int Hash(int seed, int xPrimed, int yPrimed) { + int hash = seed ^ xPrimed ^ yPrimed; + + hash *= 0x27d4eb2d; + return hash; + } + + private static int Hash(int seed, int xPrimed, int yPrimed, int zPrimed) { + int hash = seed ^ xPrimed ^ yPrimed ^ zPrimed; + + hash *= 0x27d4eb2d; + return hash; + } + + private static float ValCoord(int seed, int xPrimed, int yPrimed) { + int hash = Hash(seed, xPrimed, yPrimed); + + hash *= hash; + hash ^= hash << 19; + return hash * (1 / 2147483648.0f); + } + + private static float ValCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + + hash *= hash; + hash ^= hash << 19; + return hash * (1 / 2147483648.0f); + } + + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + float xd, + float yd) { + int hash = Hash(seed, xPrimed, yPrimed); + hash ^= hash >> 15; + hash &= 127 << 1; + + float xg = Gradients2D[hash]; + float yg = Gradients2D[hash | 1]; + + return xd * xg + yd * yg; + } + + private static float GradCoord( + int seed, + int xPrimed, + int yPrimed, + int zPrimed, + float xd, + float yd, + float zd) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + hash ^= hash >> 15; + hash &= 63 << 2; + + float xg = Gradients3D[hash]; + float yg = Gradients3D[hash | 1]; + float zg = Gradients3D[hash | 2]; + + return xd * xg + yd * yg + zd * zg; + } + + // Generic noise gen + + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + switch (mNoiseType) { + case OpenSimplex2: + return SingleSimplex(seed, x, y); + case OpenSimplex2S: + return SingleOpenSimplex2S(seed, x, y); + case Cellular: + return SingleCellular(seed, x, y); + case Perlin: + return SinglePerlin(seed, x, y); + case ValueCubic: + return SingleValueCubic(seed, x, y); + case Value: + return SingleValue(seed, x, y); + default: + return 0; + } + } + + private float GenNoiseSingle( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + switch (mNoiseType) { + case OpenSimplex2: + return SingleOpenSimplex2(seed, x, y, z); + case OpenSimplex2S: + return SingleOpenSimplex2S(seed, x, y, z); + case Cellular: + return SingleCellular(seed, x, y, z); + case Perlin: + return SinglePerlin(seed, x, y, z); + case ValueCubic: + return SingleValueCubic(seed, x, y, z); + case Value: + return SingleValue(seed, x, y, z); + default: + return 0; + } + } + + // Noise Coordinate Transforms (frequency, and possible skew or rotation) + + private void UpdateTransformType3D() { + switch (mRotationType3D) { + case ImproveXYPlanes: + mTransformType3D = TransformType3D.ImproveXYPlanes; + break; + case ImproveXZPlanes: + mTransformType3D = TransformType3D.ImproveXZPlanes; + break; + default: + switch (mNoiseType) { + case OpenSimplex2: + case OpenSimplex2S: + mTransformType3D = TransformType3D.DefaultOpenSimplex2; + break; + default: + mTransformType3D = TransformType3D.None; + break; + } + break; + } + } + + private void UpdateWarpTransformType3D() { + switch (mRotationType3D) { + case ImproveXYPlanes: + mWarpTransformType3D = TransformType3D.ImproveXYPlanes; + break; + case ImproveXZPlanes: + mWarpTransformType3D = TransformType3D.ImproveXZPlanes; + break; + default: + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: + mWarpTransformType3D = TransformType3D.DefaultOpenSimplex2; + break; + default: + mWarpTransformType3D = TransformType3D.None; + break; + } + break; + } + } + + // Fractal FBm + + private float GenFractalFBm(/*FMLdouble*/double x, /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = GenNoiseSingle(seed++, x, y); + sum += noise * amp; + amp *= Lerp(1.0f, FastMin(noise + 1, 2) * 0.5f, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalFBm( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = GenNoiseSingle(seed++, x, y, z); + sum += noise * amp; + amp *= Lerp(1.0f, (noise + 1) * 0.5f, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Fractal Ridged + + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = FastAbs(GenNoiseSingle(seed++, x, y)); + sum += (noise * -2 + 1) * amp; + amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalRidged( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = FastAbs(GenNoiseSingle(seed++, x, y, z)); + sum += (noise * -2 + 1) * amp; + amp *= Lerp(1.0f, 1 - noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Fractal PingPong + + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y) + 1) * mPingPongStength); + sum += (noise - 0.5f) * 2 * amp; + amp *= Lerp(1.0f, noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + private float GenFractalPingPong( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int seed = mSeed; + float sum = 0; + float amp = mFractalBounding; + + for (int i = 0; i < mOctaves; i++) { + float noise = PingPong( + (GenNoiseSingle(seed++, x, y, z) + 1) * mPingPongStength); + sum += (noise - 0.5f) * 2 * amp; + amp *= Lerp(1.0f, noise, mWeightedStrength); + + x *= mLacunarity; + y *= mLacunarity; + z *= mLacunarity; + amp *= mGain; + } + + return sum; + } + + // Simplex/OpenSimplex2 Noise + + private float SingleSimplex( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. + + final float SQRT3 = 1.7320508075688772935274463415059f; + final float G2 = (3 - SQRT3) / 6; + + /* + * --- Skew moved to switch statements before fractal evaluation --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + float t = (xi + yi) * G2; + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); + + i *= PrimeX; + j *= PrimeY; + + float n0, n1, n2; + + float a = 0.5f - x0 * x0 - y0 * y0; + if (a <= 0) + n0 = 0; + else { + n0 = (a * a) * (a * a) * GradCoord(seed, i, j, x0, y0); + } + + float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c <= 0) + n2 = 0; + else { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); + n2 = (c * c) * (c * c) * GradCoord(seed, i + PrimeX, j + PrimeY, x2, y2); + } + + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); + float b = 0.5f - x1 * x1 - y1 * y1; + if (b <= 0) + n1 = 0; + else { + n1 = (b * b) * (b * b) * GradCoord(seed, i, j + PrimeY, x1, y1); + } + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; + float b = 0.5f - x1 * x1 - y1 * y1; + if (b <= 0) + n1 = 0; + else { + n1 = (b * b) * (b * b) * GradCoord(seed, i + PrimeX, j, x1, y1); + } + } + + return (n0 + n1 + n2) * 99.83685446303647f; + } + + private float SingleOpenSimplex2( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + // 3D OpenSimplex2 case uses two offset rotated cube grids. + + /* + * --- Rotation moved to switch statements before fractal evaluation --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastRound(x); + int j = FastRound(y); + int k = FastRound(z); + float x0 = (float) (x - i); + float y0 = (float) (y - j); + float z0 = (float) (z - k); + + int xNSign = (int) (-1.0f - x0) | 1; + int yNSign = (int) (-1.0f - y0) | 1; + int zNSign = (int) (-1.0f - z0) | 1; + + float ax0 = xNSign * -x0; + float ay0 = yNSign * -y0; + float az0 = zNSign * -z0; + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + + float value = 0; + float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + + for (int l = 0;; l++) { + if (a > 0) { + value += (a * a) * (a * a) * GradCoord(seed, i, j, k, x0, y0, z0); + } + + if (ax0 >= ay0 && ax0 >= az0) { + float b = a + ax0 + ax0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i - xNSign * PrimeX, + j, + k, + x0 + xNSign, + y0, + z0); + } + } else if (ay0 > ax0 && ay0 >= az0) { + float b = a + ay0 + ay0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i, + j - yNSign * PrimeY, + k, + x0, + y0 + yNSign, + z0); + } + } else { + float b = a + az0 + az0; + if (b > 1) { + b -= 1; + value += (b * b) * + (b * b) * + GradCoord( + seed, + i, + j, + k - zNSign * PrimeZ, + x0, + y0, + z0 + zNSign); + } + } + + if (l == 1) + break; + + ax0 = 0.5f - ax0; + ay0 = 0.5f - ay0; + az0 = 0.5f - az0; + + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; + + a += (0.75f - ax0) - (ay0 + az0); + + i += (xNSign >> 1) & PrimeX; + j += (yNSign >> 1) & PrimeY; + k += (zNSign >> 1) & PrimeZ; + + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; + + seed = ~seed; + } + + return value * 32.69428253173828125f; + } + + // OpenSimplex2S Noise + + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + // 2D OpenSimplex2S case is a modified 2D simplex noise. + + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double G2 = (3 - SQRT3) / 6; + + /* + * --- Skew moved to TransformNoiseCoordinate method --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + i *= PrimeX; + j *= PrimeY; + int i1 = i + PrimeX; + int j1 = j + PrimeY; + + float t = (xi + yi) * (float) G2; + float x0 = xi - t; + float y0 = yi - t; + + float a0 = (2.0f / 3.0f) - x0 * x0 - y0 * y0; + float value = (a0 * a0) * (a0 * a0) * GradCoord(seed, i, j, x0, y0); + + float a1 = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); + float x1 = x0 - (float) (1 - 2 * G2); + float y1 = y0 - (float) (1 - 2 * G2); + value += (a1 * a1) * (a1 * a1) * GradCoord(seed, i1, j1, x1, y1); + + // Nested conditionals were faster than compact bit logic/arithmetic. + float xmyi = xi - yi; + if (t > G2) { + if (xi + xmyi > 1) { + float x2 = x0 + (float) (3 * G2 - 2); + float y2 = y0 + (float) (3 * G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + (PrimeX << 1), j + PrimeY, x2, y2); + } + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); + } + } + + if (yi - xmyi > 1) { + float x3 = x0 + (float) (3 * G2 - 1); + float y3 = y0 + (float) (3 * G2 - 2); + float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; + if (a3 > 0) { + value += (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j + (PrimeY << 1), x3, y3); + } + } else { + float x3 = x0 + (float) (G2 - 1); + float y3 = y0 + (float) G2; + float a3 = (2.0f / 3.0f) - x3 * x3 - y3 * y3; + if (a3 > 0) { + value += (a3 * a3) * + (a3 * a3) * + GradCoord(seed, i + PrimeX, j, x3, y3); + } + } + } else { + if (xi + xmyi < 0) { + float x2 = x0 + (float) (1 - G2); + float y2 = y0 - (float) G2; + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i - PrimeX, j, x2, y2); + } + } else { + float x2 = x0 + (float) (G2 - 1); + float y2 = y0 + (float) G2; + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i + PrimeX, j, x2, y2); + } + } + + if (yi < xmyi) { + float x2 = x0 - (float) G2; + float y2 = y0 - (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j - PrimeY, x2, y2); + } + } else { + float x2 = x0 + (float) G2; + float y2 = y0 + (float) (G2 - 1); + float a2 = (2.0f / 3.0f) - x2 * x2 - y2 * y2; + if (a2 > 0) { + value += (a2 * a2) * + (a2 * a2) * + GradCoord(seed, i, j + PrimeY, x2, y2); + } + } + } + + return value * 18.24196194486065f; + } + + private float SingleOpenSimplex2S( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + // 3D OpenSimplex2S case uses two offset rotated cube grids. + + /* + * --- Rotation moved to TransformNoiseCoordinate method --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + int k = FastFloor(z); + float xi = (float) (x - i); + float yi = (float) (y - j); + float zi = (float) (z - k); + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + int seed2 = seed + 1293373; + + int xNMask = (int) (-0.5f - xi); + int yNMask = (int) (-0.5f - yi); + int zNMask = (int) (-0.5f - zi); + + float x0 = xi + xNMask; + float y0 = yi + yNMask; + float z0 = zi + zNMask; + float a0 = 0.75f - x0 * x0 - y0 * y0 - z0 * z0; + float value = (a0 * a0) * + (a0 * a0) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x0, + y0, + z0); + + float x1 = xi - 0.5f; + float y1 = yi - 0.5f; + float z1 = zi - 0.5f; + float a1 = 0.75f - x1 * x1 - y1 * y1 - z1 * z1; + value += (a1 * a1) * + (a1 * a1) * + GradCoord(seed2, i + PrimeX, j + PrimeY, k + PrimeZ, x1, y1, z1); + + float xAFlipMask0 = ((xNMask | 1) << 1) * x1; + float yAFlipMask0 = ((yNMask | 1) << 1) * y1; + float zAFlipMask0 = ((zNMask | 1) << 1) * z1; + float xAFlipMask1 = (-2 - (xNMask << 2)) * x1 - 1.0f; + float yAFlipMask1 = (-2 - (yNMask << 2)) * y1 - 1.0f; + float zAFlipMask1 = (-2 - (zNMask << 2)) * z1 - 1.0f; + + boolean skip5 = false; + float a2 = xAFlipMask0 + a0; + if (a2 > 0) { + float x2 = x0 - (xNMask | 1); + float y2 = y0; + float z2 = z0; + value += (a2 * a2) * + (a2 * a2) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (zNMask & PrimeZ), + x2, + y2, + z2); + } else { + float a3 = yAFlipMask0 + zAFlipMask0 + a0; + if (a3 > 0) { + float x3 = x0; + float y3 = y0 - (yNMask | 1); + float z3 = z0 - (zNMask | 1); + value += (a3 * a3) * + (a3 * a3) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x3, + y3, + z3); + } + + float a4 = xAFlipMask1 + a1; + if (a4 > 0) { + float x4 = (xNMask | 1) + x1; + float y4 = y1; + float z4 = z1; + value += (a4 * a4) * + (a4 * a4) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + PrimeZ, + x4, + y4, + z4); + skip5 = true; + } + } + + boolean skip9 = false; + float a6 = yAFlipMask0 + a0; + if (a6 > 0) { + float x6 = x0; + float y6 = y0 - (yNMask | 1); + float z6 = z0; + value += (a6 * a6) * + (a6 * a6) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + x6, + y6, + z6); + } else { + float a7 = xAFlipMask0 + zAFlipMask0 + a0; + if (a7 > 0) { + float x7 = x0 - (xNMask | 1); + float y7 = y0; + float z7 = z0 - (zNMask | 1); + value += (a7 * a7) * + (a7 * a7) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + x7, + y7, + z7); + } + + float a8 = yAFlipMask1 + a1; + if (a8 > 0) { + float x8 = x1; + float y8 = (yNMask | 1) + y1; + float z8 = z1; + value += (a8 * a8) * + (a8 * a8) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + x8, + y8, + z8); + skip9 = true; + } + } + + boolean skipD = false; + float aA = zAFlipMask0 + a0; + if (aA > 0) { + float xA = x0; + float yA = y0; + float zA = z0 - (zNMask | 1); + value += (aA * aA) * + (aA * aA) * + GradCoord( + seed, + i + (xNMask & PrimeX), + j + (yNMask & PrimeY), + k + (~zNMask & PrimeZ), + xA, + yA, + zA); + } else { + float aB = xAFlipMask0 + yAFlipMask0 + a0; + if (aB > 0) { + float xB = x0 - (xNMask | 1); + float yB = y0 - (yNMask | 1); + float zB = z0; + value += (aB * aB) * + (aB * aB) * + GradCoord( + seed, + i + (~xNMask & PrimeX), + j + (~yNMask & PrimeY), + k + (zNMask & PrimeZ), + xB, + yB, + zB); + } + + float aC = zAFlipMask1 + a1; + if (aC > 0) { + float xC = x1; + float yC = y1; + float zC = (zNMask | 1) + z1; + value += (aC * aC) * + (aC * aC) * + GradCoord( + seed2, + i + PrimeX, + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + xC, + yC, + zC); + skipD = true; + } + } + + if (!skip5) { + float a5 = yAFlipMask1 + zAFlipMask1 + a1; + if (a5 > 0) { + float x5 = x1; + float y5 = (yNMask | 1) + y1; + float z5 = (zNMask | 1) + z1; + value += (a5 * a5) * + (a5 * a5) * + GradCoord( + seed2, + i + PrimeX, + j + (yNMask & (PrimeY << 1)), + k + (zNMask & (PrimeZ << 1)), + x5, + y5, + z5); + } + } + + if (!skip9) { + float a9 = xAFlipMask1 + zAFlipMask1 + a1; + if (a9 > 0) { + float x9 = (xNMask | 1) + x1; + float y9 = y1; + float z9 = (zNMask | 1) + z1; + value += (a9 * a9) * + (a9 * a9) * + GradCoord( + seed2, + i + (xNMask & (PrimeX * 2)), + j + PrimeY, + k + (zNMask & (PrimeZ << 1)), + x9, + y9, + z9); + } + } + + if (!skipD) { + float aD = xAFlipMask1 + yAFlipMask1 + a1; + if (aD > 0) { + float xD = (xNMask | 1) + x1; + float yD = (yNMask | 1) + y1; + float zD = z1; + value += (aD * aD) * + (aD * aD) * + GradCoord( + seed2, + i + (xNMask & (PrimeX << 1)), + j + (yNMask & (PrimeY << 1)), + k + PrimeZ, + xD, + yD, + zD); + } + } + + return value * 9.046026385208288f; + } + + // Cellular Noise + + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int xr = FastRound(x); + int yr = FastRound(y); + + float distance0 = Float.MAX_VALUE; + float distance1 = Float.MAX_VALUE; + int closestHash = 0; + + float cellularJitter = 0.43701595f * mCellularJitterModifier; + + int xPrimed = (xr - 1) * PrimeX; + int yPrimedBase = (yr - 1) * PrimeY; + + switch (mCellularDistanceFunction) { + default: + case Euclidean: + case EuclideanSq: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = vecX * vecX + vecY * vecY; + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = FastAbs(vecX) + FastAbs(vecY); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Hybrid: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int hash = Hash(seed, xPrimed, yPrimed); + int idx = hash & (255 << 1); + + float vecX = (float) (xi - x) + RandVecs2D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs2D[idx | 1] * cellularJitter; + + float newDistance = (FastAbs(vecX) + FastAbs(vecY)) + + (vecX * vecX + vecY * vecY); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + } + + if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue) { + distance0 = FastSqrt(distance0); + + if (mCellularReturnType != CellularReturnType.CellValue) { + distance1 = FastSqrt(distance1); + } + } + + switch (mCellularReturnType) { + case CellValue: + return closestHash * (1 / 2147483648.0f); + case Distance: + return distance0 - 1; + case Distance2: + return distance1 - 1; + case Distance2Add: + return (distance1 + distance0) * 0.5f - 1; + case Distance2Sub: + return distance1 - distance0 - 1; + case Distance2Mul: + return distance1 * distance0 * 0.5f - 1; + case Distance2Div: + return distance0 / distance1 - 1; + default: + return 0; + } + } + + private float SingleCellular( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int xr = FastRound(x); + int yr = FastRound(y); + int zr = FastRound(z); + + float distance0 = Float.MAX_VALUE; + float distance1 = Float.MAX_VALUE; + int closestHash = 0; + + float cellularJitter = 0.39614353f * mCellularJitterModifier; + + int xPrimed = (xr - 1) * PrimeX; + int yPrimedBase = (yr - 1) * PrimeY; + int zPrimedBase = (zr - 1) * PrimeZ; + + switch (mCellularDistanceFunction) { + case Euclidean: + case EuclideanSq: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + case Hybrid: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + int yPrimed = yPrimedBase; + + for (int yi = yr - 1; yi <= yr + 1; yi++) { + int zPrimed = zPrimedBase; + + for (int zi = zr - 1; zi <= zr + 1; zi++) { + int hash = Hash(seed, xPrimed, yPrimed, zPrimed); + int idx = hash & (255 << 2); + + float vecX = (float) (xi - x) + + RandVecs3D[idx] * cellularJitter; + float vecY = (float) (yi - y) + + RandVecs3D[idx | 1] * cellularJitter; + float vecZ = (float) (zi - z) + + RandVecs3D[idx | 2] * cellularJitter; + + float newDistance = (FastAbs(vecX) + + FastAbs(vecY) + + FastAbs(vecZ)) + + (vecX * vecX + vecY * vecY + vecZ * vecZ); + + distance1 = FastMax(FastMin(distance1, newDistance), distance0); + if (newDistance < distance0) { + distance0 = newDistance; + closestHash = hash; + } + zPrimed += PrimeZ; + } + yPrimed += PrimeY; + } + xPrimed += PrimeX; + } + break; + default: + break; + } + + if (mCellularDistanceFunction == CellularDistanceFunction.Euclidean && + mCellularReturnType != CellularReturnType.CellValue) { + distance0 = FastSqrt(distance0); + + if (mCellularReturnType != CellularReturnType.CellValue) { + distance1 = FastSqrt(distance1); + } + } + + switch (mCellularReturnType) { + case CellValue: + return closestHash * (1 / 2147483648.0f); + case Distance: + return distance0 - 1; + case Distance2: + return distance1 - 1; + case Distance2Add: + return (distance1 + distance0) * 0.5f - 1; + case Distance2Sub: + return distance1 - distance0 - 1; + case Distance2Mul: + return distance1 * distance0 * 0.5f - 1; + case Distance2Div: + return distance0 / distance1 - 1; + default: + return 0; + } + } + + // Perlin Noise + + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); + float xd1 = xd0 - 1; + float yd1 = yd0 - 1; + + float xs = InterpQuintic(xd0); + float ys = InterpQuintic(yd0); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + float xf0 = Lerp( + GradCoord(seed, x0, y0, xd0, yd0), + GradCoord(seed, x1, y0, xd1, yd0), + xs); + float xf1 = Lerp( + GradCoord(seed, x0, y1, xd0, yd1), + GradCoord(seed, x1, y1, xd1, yd1), + xs); + + return Lerp(xf0, xf1, ys) * 1.4247691104677813f; + } + + private float SinglePerlin( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + + float xd0 = (float) (x - x0); + float yd0 = (float) (y - y0); + float zd0 = (float) (z - z0); + float xd1 = xd0 - 1; + float yd1 = yd0 - 1; + float zd1 = zd0 - 1; + + float xs = InterpQuintic(xd0); + float ys = InterpQuintic(yd0); + float zs = InterpQuintic(zd0); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + float xf00 = Lerp( + GradCoord(seed, x0, y0, z0, xd0, yd0, zd0), + GradCoord(seed, x1, y0, z0, xd1, yd0, zd0), + xs); + float xf10 = Lerp( + GradCoord(seed, x0, y1, z0, xd0, yd1, zd0), + GradCoord(seed, x1, y1, z0, xd1, yd1, zd0), + xs); + float xf01 = Lerp( + GradCoord(seed, x0, y0, z1, xd0, yd0, zd1), + GradCoord(seed, x1, y0, z1, xd1, yd0, zd1), + xs); + float xf11 = Lerp( + GradCoord(seed, x0, y1, z1, xd0, yd1, zd1), + GradCoord(seed, x1, y1, z1, xd1, yd1, zd1), + xs); + + float yf0 = Lerp(xf00, xf10, ys); + float yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs) * 0.964921414852142333984375f; + } + + // Value Cubic Noise + + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x1 = FastFloor(x); + int y1 = FastFloor(y); + + float xs = (float) (x - x1); + float ys = (float) (y - y1); + + x1 *= PrimeX; + y1 *= PrimeY; + int x0 = x1 - PrimeX; + int y0 = y1 - PrimeY; + int x2 = x1 + PrimeX; + int y2 = y1 + PrimeY; + int x3 = x1 + (PrimeX << 1); + int y3 = y1 + (PrimeY << 1); + + return (CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0), + ValCoord(seed, x1, y0), + ValCoord(seed, x2, y0), + ValCoord(seed, x3, y0), + xs), + CubicLerp( + ValCoord(seed, x0, y1), + ValCoord(seed, x1, y1), + ValCoord(seed, x2, y1), + ValCoord(seed, x3, y1), + xs), + CubicLerp( + ValCoord(seed, x0, y2), + ValCoord(seed, x1, y2), + ValCoord(seed, x2, y2), + ValCoord(seed, x3, y2), + xs), + CubicLerp( + ValCoord(seed, x0, y3), + ValCoord(seed, x1, y3), + ValCoord(seed, x2, y3), + ValCoord(seed, x3, y3), + xs), + ys) * + (1 / (1.5f * 1.5f))); + } + + private float SingleValueCubic( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x1 = FastFloor(x); + int y1 = FastFloor(y); + int z1 = FastFloor(z); + + float xs = (float) (x - x1); + float ys = (float) (y - y1); + float zs = (float) (z - z1); + + x1 *= PrimeX; + y1 *= PrimeY; + z1 *= PrimeZ; + + int x0 = x1 - PrimeX; + int y0 = y1 - PrimeY; + int z0 = z1 - PrimeZ; + int x2 = x1 + PrimeX; + int y2 = y1 + PrimeY; + int z2 = z1 + PrimeZ; + int x3 = x1 + (PrimeX << 1); + int y3 = y1 + (PrimeY << 1); + int z3 = z1 + (PrimeZ << 1); + + return (CubicLerp( + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + ValCoord(seed, x2, y0, z0), + ValCoord(seed, x3, y0, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + ValCoord(seed, x2, y1, z0), + ValCoord(seed, x3, y1, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z0), + ValCoord(seed, x1, y2, z0), + ValCoord(seed, x2, y2, z0), + ValCoord(seed, x3, y2, z0), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z0), + ValCoord(seed, x1, y3, z0), + ValCoord(seed, x2, y3, z0), + ValCoord(seed, x3, y3, z0), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + ValCoord(seed, x2, y0, z1), + ValCoord(seed, x3, y0, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + ValCoord(seed, x2, y1, z1), + ValCoord(seed, x3, y1, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z1), + ValCoord(seed, x1, y2, z1), + ValCoord(seed, x2, y2, z1), + ValCoord(seed, x3, y2, z1), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z1), + ValCoord(seed, x1, y3, z1), + ValCoord(seed, x2, y3, z1), + ValCoord(seed, x3, y3, z1), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z2), + ValCoord(seed, x1, y0, z2), + ValCoord(seed, x2, y0, z2), + ValCoord(seed, x3, y0, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z2), + ValCoord(seed, x1, y1, z2), + ValCoord(seed, x2, y1, z2), + ValCoord(seed, x3, y1, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z2), + ValCoord(seed, x1, y2, z2), + ValCoord(seed, x2, y2, z2), + ValCoord(seed, x3, y2, z2), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z2), + ValCoord(seed, x1, y3, z2), + ValCoord(seed, x2, y3, z2), + ValCoord(seed, x3, y3, z2), + xs), + ys), + CubicLerp( + CubicLerp( + ValCoord(seed, x0, y0, z3), + ValCoord(seed, x1, y0, z3), + ValCoord(seed, x2, y0, z3), + ValCoord(seed, x3, y0, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y1, z3), + ValCoord(seed, x1, y1, z3), + ValCoord(seed, x2, y1, z3), + ValCoord(seed, x3, y1, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y2, z3), + ValCoord(seed, x1, y2, z3), + ValCoord(seed, x2, y2, z3), + ValCoord(seed, x3, y2, z3), + xs), + CubicLerp( + ValCoord(seed, x0, y3, z3), + ValCoord(seed, x1, y3, z3), + ValCoord(seed, x2, y3, z3), + ValCoord(seed, x3, y3, z3), + xs), + ys), + zs) * + (1 / (1.5f * 1.5f * 1.5f))); + } + + // Value Noise + + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + float xf0 = Lerp(ValCoord(seed, x0, y0), ValCoord(seed, x1, y0), xs); + float xf1 = Lerp(ValCoord(seed, x0, y1), ValCoord(seed, x1, y1), xs); + + return Lerp(xf0, xf1, ys); + } + + private float SingleValue( + int seed, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + + float xs = InterpHermite((float) (x - x0)); + float ys = InterpHermite((float) (y - y0)); + float zs = InterpHermite((float) (z - z0)); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + float xf00 = Lerp( + ValCoord(seed, x0, y0, z0), + ValCoord(seed, x1, y0, z0), + xs); + float xf10 = Lerp( + ValCoord(seed, x0, y1, z0), + ValCoord(seed, x1, y1, z0), + xs); + float xf01 = Lerp( + ValCoord(seed, x0, y0, z1), + ValCoord(seed, x1, y0, z1), + xs); + float xf11 = Lerp( + ValCoord(seed, x0, y1, z1), + ValCoord(seed, x1, y1, z1), + xs); + + float yf0 = Lerp(xf00, xf10, ys); + float yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs); + } + + // Domain Warp + + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord) { + switch (mDomainWarpType) { + case OpenSimplex2: + SingleDomainWarpSimplexGradient( + seed, + amp * 38.283687591552734375f, + freq, + x, + y, + coord, + false); + break; + case OpenSimplex2Reduced: + SingleDomainWarpSimplexGradient( + seed, + amp * 16.0f, + freq, + x, + y, + coord, + true); + break; + case BasicGrid: + SingleDomainWarpBasicGrid(seed, amp, freq, x, y, coord); + break; + } + } + + private void DoSingleDomainWarp( + int seed, + float amp, + float freq, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord) { + switch (mDomainWarpType) { + case OpenSimplex2: + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 32.69428253173828125f, + freq, + x, + y, + z, + coord, + false); + break; + case OpenSimplex2Reduced: + SingleDomainWarpOpenSimplex2Gradient( + seed, + amp * 7.71604938271605f, + freq, + x, + y, + z, + coord, + true); + break; + case BasicGrid: + SingleDomainWarpBasicGrid(seed, amp, freq, x, y, z, coord); + break; + } + } + + // Domain Warp Single Wrapper + + private void DomainWarpSingle(Vector2 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + } + + private void DomainWarpSingle(Vector3 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + } + + // Domain Warp Fractal Progressive + + private void DomainWarpFractalProgressive(Vector2 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + private void DomainWarpFractalProgressive(Vector3 coord) { + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + // Domain Warp Fractal Independant + private void DomainWarpFractalIndependent(Vector2 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + switch (mDomainWarpType) { + case OpenSimplex2: + case OpenSimplex2Reduced: { + final /*FMLdouble*/double SQRT3 = (/*FMLdouble*/double) 1.7320508075688772935274463415059; + final /*FMLdouble*/double F2 = 0.5f * (SQRT3 - 1); + /*FMLdouble*/double t = (xs + ys) * F2; + xs += t; + ys += t; + } + break; + default: + break; + } + + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + DoSingleDomainWarp(seed, amp, freq, xs, ys, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + private void DomainWarpFractalIndependent(Vector3 coord) { + /*FMLdouble*/double xs = coord.x; + /*FMLdouble*/double ys = coord.y; + /*FMLdouble*/double zs = coord.z; + switch (mWarpTransformType3D) { + case ImproveXYPlanes: { + /*FMLdouble*/double xy = xs + ys; + /*FMLdouble*/double s2 = xy * -(/*FMLdouble*/double) 0.211324865405187; + zs *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - zs; + ys = ys + s2 - zs; + zs += xy * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case ImproveXZPlanes: { + /*FMLdouble*/double xz = xs + zs; + /*FMLdouble*/double s2 = xz * -(/*FMLdouble*/double) 0.211324865405187; + ys *= (/*FMLdouble*/double) 0.577350269189626; + xs += s2 - ys; + zs += s2 - ys; + ys += xz * (/*FMLdouble*/double) 0.577350269189626; + } + break; + case DefaultOpenSimplex2: { + final /*FMLdouble*/double R3 = (/*FMLdouble*/double) (2.0 / + 3.0); + /*FMLdouble*/double r = (xs + ys + zs) * R3; // Rotation, not skew + xs = r - xs; + ys = r - ys; + zs = r - zs; + } + break; + default: + break; + } + + int seed = mSeed; + float amp = mDomainWarpAmp * mFractalBounding; + float freq = mFrequency; + + for (int i = 0; i < mOctaves; i++) { + DoSingleDomainWarp(seed, amp, freq, xs, ys, zs, coord); + + seed++; + amp *= mGain; + freq *= mLacunarity; + } + } + + // Domain Warp Basic Grid + + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); + + x0 *= PrimeX; + y0 *= PrimeY; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + + int hash0 = Hash(seed, x0, y0) & (255 << 1); + int hash1 = Hash(seed, x1, y0) & (255 << 1); + + float lx0x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); + float ly0x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); + + hash0 = Hash(seed, x0, y1) & (255 << 1); + hash1 = Hash(seed, x1, y1) & (255 << 1); + + float lx1x = Lerp(RandVecs2D[hash0], RandVecs2D[hash1], xs); + float ly1x = Lerp(RandVecs2D[hash0 | 1], RandVecs2D[hash1 | 1], xs); + + coord.x += Lerp(lx0x, lx1x, ys) * warpAmp; + coord.y += Lerp(ly0x, ly1x, ys) * warpAmp; + } + + private void SingleDomainWarpBasicGrid( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord) { + /*FMLdouble*/double xf = x * frequency; + /*FMLdouble*/double yf = y * frequency; + /*FMLdouble*/double zf = z * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + int z0 = FastFloor(zf); + + float xs = InterpHermite((float) (xf - x0)); + float ys = InterpHermite((float) (yf - y0)); + float zs = InterpHermite((float) (zf - z0)); + + x0 *= PrimeX; + y0 *= PrimeY; + z0 *= PrimeZ; + int x1 = x0 + PrimeX; + int y1 = y0 + PrimeY; + int z1 = z0 + PrimeZ; + + int hash0 = Hash(seed, x0, y0, z0) & (255 << 2); + int hash1 = Hash(seed, x1, y0, z0) & (255 << 2); + + float lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + float ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + float lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + hash0 = Hash(seed, x0, y1, z0) & (255 << 2); + hash1 = Hash(seed, x1, y1, z0) & (255 << 2); + + float lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + float ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + float lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + float lx0y = Lerp(lx0x, lx1x, ys); + float ly0y = Lerp(ly0x, ly1x, ys); + float lz0y = Lerp(lz0x, lz1x, ys); + + hash0 = Hash(seed, x0, y0, z1) & (255 << 2); + hash1 = Hash(seed, x1, y0, z1) & (255 << 2); + + lx0x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + ly0x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + lz0x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + hash0 = Hash(seed, x0, y1, z1) & (255 << 2); + hash1 = Hash(seed, x1, y1, z1) & (255 << 2); + + lx1x = Lerp(RandVecs3D[hash0], RandVecs3D[hash1], xs); + ly1x = Lerp(RandVecs3D[hash0 | 1], RandVecs3D[hash1 | 1], xs); + lz1x = Lerp(RandVecs3D[hash0 | 2], RandVecs3D[hash1 | 2], xs); + + coord.x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * warpAmp; + coord.y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * warpAmp; + coord.z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; + } + + // Domain Warp Simplex/OpenSimplex2 + private void SingleDomainWarpSimplexGradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + Vector2 coord, + boolean outGradOnly) { + final float SQRT3 = 1.7320508075688772935274463415059f; + final float G2 = (3 - SQRT3) / 6; + + x *= frequency; + y *= frequency; + + /* + * --- Skew moved to switch statements before fractal evaluation --- + * final FNLfloat F2 = 0.5f * (SQRT3 - 1); + * FNLfloat s = (x + y) * F2; + * x += s; y += s; + */ + + int i = FastFloor(x); + int j = FastFloor(y); + float xi = (float) (x - i); + float yi = (float) (y - j); + + float t = (xi + yi) * G2; + float x0 = (float) (xi - t); + float y0 = (float) (yi - t); + + i *= PrimeX; + j *= PrimeY; + + float vx, vy; + vx = vy = 0; + + float a = 0.5f - x0 * x0 - y0 * y0; + if (a > 0) { + float aaaa = (a * a) * (a * a); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i, j) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i, j); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x0 * xg + y0 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += aaaa * xo; + vy += aaaa * yo; + } + + float c = (float) (2 * (1 - 2 * G2) * (1 / G2 - 2)) * t + + ((float) (-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if (c > 0) { + float x2 = x0 + (2 * (float) G2 - 1); + float y2 = y0 + (2 * (float) G2 - 1); + float cccc = (c * c) * (c * c); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i + PrimeX, j + PrimeY) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i + PrimeX, j + PrimeY); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x2 * xg + y2 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += cccc * xo; + vy += cccc * yo; + } + + if (y0 > x0) { + float x1 = x0 + (float) G2; + float y1 = y0 + ((float) G2 - 1); + float b = 0.5f - x1 * x1 - y1 * y1; + if (b > 0) { + float bbbb = (b * b) * (b * b); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i, j + PrimeY) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i, j + PrimeY); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x1 * xg + y1 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += bbbb * xo; + vy += bbbb * yo; + } + } else { + float x1 = x0 + ((float) G2 - 1); + float y1 = y0 + (float) G2; + float b = 0.5f - x1 * x1 - y1 * y1; + if (b > 0) { + float bbbb = (b * b) * (b * b); + float xo, yo; + if (outGradOnly) { + int hash = Hash(seed, i + PrimeX, j) & (255 << 1); + xo = RandVecs2D[hash]; + yo = RandVecs2D[hash | 1]; + } else { + int hash = Hash(seed, i + PrimeX, j); + int index1 = hash & (127 << 1); + int index2 = (hash >> 7) & (255 << 1); + float xg = Gradients2D[index1]; + float yg = Gradients2D[index1 | 1]; + float value = x1 * xg + y1 * yg; + float xgo = RandVecs2D[index2]; + float ygo = RandVecs2D[index2 | 1]; + xo = value * xgo; + yo = value * ygo; + } + vx += bbbb * xo; + vy += bbbb * yo; + } + } + + coord.x += vx * warpAmp; + coord.y += vy * warpAmp; + } + + private void SingleDomainWarpOpenSimplex2Gradient( + int seed, + float warpAmp, + float frequency, + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z, + Vector3 coord, + boolean outGradOnly) { + x *= frequency; + y *= frequency; + z *= frequency; + + /* + * --- Rotation moved to switch statements before fractal evaluation --- + * final FNLfloat R3 = (FNLfloat)(2.0 / 3.0); + * FNLfloat r = (x + y + z) * R3; // Rotation, not skew + * x = r - x; y = r - y; z = r - z; + */ + + int i = FastRound(x); + int j = FastRound(y); + int k = FastRound(z); + float x0 = (float) x - i; + float y0 = (float) y - j; + float z0 = (float) z - k; + + int xNSign = (int) (-x0 - 1.0f) | 1; + int yNSign = (int) (-y0 - 1.0f) | 1; + int zNSign = (int) (-z0 - 1.0f) | 1; + + float ax0 = xNSign * -x0; + float ay0 = yNSign * -y0; + float az0 = zNSign * -z0; + + i *= PrimeX; + j *= PrimeY; + k *= PrimeZ; + + float vx, vy, vz; + vx = vy = vz = 0; + + float a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + for (int l = 0;; l++) { + if (a > 0) { + float aaaa = (a * a) * (a * a); + float xo, yo, zo; + if (outGradOnly) { + int hash = Hash(seed, i, j, k) & (255 << 2); + xo = RandVecs3D[hash]; + yo = RandVecs3D[hash | 1]; + zo = RandVecs3D[hash | 2]; + } else { + int hash = Hash(seed, i, j, k); + int index1 = hash & (63 << 2); + int index2 = (hash >> 6) & (255 << 2); + float xg = Gradients3D[index1]; + float yg = Gradients3D[index1 | 1]; + float zg = Gradients3D[index1 | 2]; + float value = x0 * xg + y0 * yg + z0 * zg; + float xgo = RandVecs3D[index2]; + float ygo = RandVecs3D[index2 | 1]; + float zgo = RandVecs3D[index2 | 2]; + xo = value * xgo; + yo = value * ygo; + zo = value * zgo; + } + vx += aaaa * xo; + vy += aaaa * yo; + vz += aaaa * zo; + } + + float b = a; + int i1 = i; + int j1 = j; + int k1 = k; + float x1 = x0; + float y1 = y0; + float z1 = z0; + + if (ax0 >= ay0 && ax0 >= az0) { + x1 += xNSign; + b = b + ax0 + ax0; + i1 -= xNSign * PrimeX; + } else if (ay0 > ax0 && ay0 >= az0) { + y1 += yNSign; + b = b + ay0 + ay0; + j1 -= yNSign * PrimeY; + } else { + z1 += zNSign; + b = b + az0 + az0; + k1 -= zNSign * PrimeZ; + } + + if (b > 1) { + b -= 1; + float bbbb = (b * b) * (b * b); + float xo, yo, zo; + if (outGradOnly) { + int hash = Hash(seed, i1, j1, k1) & (255 << 2); + xo = RandVecs3D[hash]; + yo = RandVecs3D[hash | 1]; + zo = RandVecs3D[hash | 2]; + } else { + int hash = Hash(seed, i1, j1, k1); + int index1 = hash & (63 << 2); + int index2 = (hash >> 6) & (255 << 2); + float xg = Gradients3D[index1]; + float yg = Gradients3D[index1 | 1]; + float zg = Gradients3D[index1 | 2]; + float value = x1 * xg + y1 * yg + z1 * zg; + float xgo = RandVecs3D[index2]; + float ygo = RandVecs3D[index2 | 1]; + float zgo = RandVecs3D[index2 | 2]; + xo = value * xgo; + yo = value * ygo; + zo = value * zgo; + } + vx += bbbb * xo; + vy += bbbb * yo; + vz += bbbb * zo; + } + + if (l == 1) + break; + + ax0 = 0.5f - ax0; + ay0 = 0.5f - ay0; + az0 = 0.5f - az0; + + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; + + a += (0.75f - ax0) - (ay0 + az0); + + i += (xNSign >> 1) & PrimeX; + j += (yNSign >> 1) & PrimeY; + k += (zNSign >> 1) & PrimeZ; + + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; + + seed += 1293373; + } + + coord.x += vx * warpAmp; + coord.y += vy * warpAmp; + coord.z += vz * warpAmp; + } + + public static class Vector2 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + + public Vector2(/*FMLdouble*/double x, /*FMLdouble*/double y) { + this.x = x; + this.y = y; + } + } + + public static class Vector3 { + + public /*FMLdouble*/double x; + public /*FMLdouble*/double y; + public /*FMLdouble*/double z; + + public Vector3( + /*FMLdouble*/double x, + /*FMLdouble*/double y, + /*FMLdouble*/double z) { + this.x = x; + this.y = y; + this.z = z; + } + } + + public static FastNoiseLite createSpongePerlin(int seed) { + FastNoiseLite fnlNoise = new FastNoiseLite(seed); + fnlNoise.SetNoiseType(FastNoiseLite.NoiseType.Perlin); // We will use 3D with a domain rotation to improve the look. + fnlNoise.SetRotationType3D( + FastNoiseLite.RotationType3D.ImproveXZPlanes); // Make the Perlin look better than Simplex, but only in 2D slices of 3D. + fnlNoise.SetFractalType(FastNoiseLite.FractalType.FBm); + fnlNoise.SetFractalOctaves(6); + return fnlNoise; + } + + private static final double SPONGE_COMPATIBILITY_RATIO = (2 * Math.sqrt(3.0)) / 1.7252359327388492; + + public static float getSpongePerlinValue(float noise3) { + noise3 = noise3 * 0.5f + 0.5f; // Rescale to 0 to 1 to match new Sponge + noise3 *= (1.0f + 0.5f + 0.25f + 0.125f + 0.0625 + 0.03125); // Counter FastNoiseLite fractal range rescale. + noise3 *= SPONGE_COMPATIBILITY_RATIO; // Now make it match old Sponge. + return noise3; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java index 7ef0c8d2..a17f997b 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/SoulTreeGrower.java @@ -11,17 +11,17 @@ public class SoulTreeGrower extends AbstractTreeGrower { - @Nullable - @Override - protected Holder> getConfiguredFeature(@Nonnull RandomSource random, - boolean bool) { - int temp = random.nextInt(10); - if (temp == 1) { - return ATMConfiguredFeature.SOUL_TREE_GIANT; - } - if (temp > 6) { - return ATMConfiguredFeature.SOUL_TREE; - } - return ATMConfiguredFeature.SOUL_TREE_MEDIUM; - } + @Nullable + @Override + protected Holder> getConfiguredFeature(@Nonnull RandomSource random, + boolean bool) { + int temp = random.nextInt(10); + if (temp == 1) { + return ATMConfiguredFeature.SOUL_TREE_GIANT; + } + if (temp > 6) { + return ATMConfiguredFeature.SOUL_TREE; + } + return ATMConfiguredFeature.SOUL_TREE_MEDIUM; + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java index 87d208db..57a2ee2d 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/Volcano.java @@ -15,90 +15,90 @@ public class Volcano extends Feature { - FastNoiseLite fnlPerlin = null; - BlockPos lastPos = new BlockPos(0, 0, 0); + FastNoiseLite fnlPerlin = null; + BlockPos lastPos = new BlockPos(0, 0, 0); - public Volcano(Codec codec) { - super(codec); - } + public Volcano(Codec codec) { + super(codec); + } - @Override - public boolean place( - @Nonnull FeaturePlaceContext p_159749_) { - return place( - p_159749_.level(), - p_159749_.chunkGenerator(), - p_159749_.random(), - p_159749_.origin(), - FeatureConfiguration.NONE); - } + @Override + public boolean place( + @Nonnull FeaturePlaceContext p_159749_) { + return place( + p_159749_.level(), + p_159749_.chunkGenerator(), + p_159749_.random(), + p_159749_.origin(), + FeatureConfiguration.NONE); + } - private boolean place( - WorldGenLevel world, - ChunkGenerator generator, - RandomSource rand, - BlockPos pos, - FeatureConfiguration config) { - setSeed(world.getSeed()); - int landHeight = generator.getSpawnHeight( - world.getChunk(pos).getHeightAccessorForGeneration()); - if (rand.nextFloat() < 0.0005F) { - // pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); + private boolean place( + WorldGenLevel world, + ChunkGenerator generator, + RandomSource rand, + BlockPos pos, + FeatureConfiguration config) { + setSeed(world.getSeed()); + int landHeight = generator.getSpawnHeight( + world.getChunk(pos).getHeightAccessorForGeneration()); + if (rand.nextFloat() < 0.0005F) { + // pos = world.getHeightmapPos(Heightmap.Types.OCEAN_FLOOR_WG, pos); - pos = new BlockPos(pos.getX(), landHeight, pos.getZ()); - BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); + pos = new BlockPos(pos.getX(), landHeight, pos.getZ()); + BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); - double baseRadius = 16; - double lavaLeakage = 0.7; - int volcanoConeSize = 75; - int volcanoStartHeight = volcanoConeSize - 5; - double threshold = 0.5; + double baseRadius = 16; + double lavaLeakage = 0.7; + int volcanoConeSize = 75; + int volcanoStartHeight = volcanoConeSize - 5; + double threshold = 0.5; - for (double x = -volcanoConeSize; x <= volcanoConeSize; x++) { - for (double y = -volcanoConeSize; y <= -15; y++) { - for (double z = -volcanoConeSize; z <= volcanoConeSize; z++) { - mutable - .set(pos) - .move( - (int) x, - (int) y + volcanoStartHeight, - (int) z); - float noise3 = FastNoiseLite.getSpongePerlinValue( - fnlPerlin.GetNoise(mutable.getX(), mutable.getZ())); + for (double x = -volcanoConeSize; x <= volcanoConeSize; x++) { + for (double y = -volcanoConeSize; y <= -15; y++) { + for (double z = -volcanoConeSize; z <= volcanoConeSize; z++) { + mutable + .set(pos) + .move( + (int) x, + (int) y + volcanoStartHeight, + (int) z); + float noise3 = FastNoiseLite.getSpongePerlinValue( + fnlPerlin.GetNoise(mutable.getX(), mutable.getZ())); - double scaledNoise = (noise3 / 11) * - (-(y * baseRadius) / ((x * x) + (z * z))); - if (scaledNoise - lavaLeakage >= threshold) { - if (mutable.getY() <= pos.getY() + (volcanoStartHeight - 19)) { - world.setBlock( - mutable, - BlockRegistry.SOULLAVA_BLOCK - .get() - .defaultBlockState(), - 2); - } - } else if (scaledNoise >= threshold) { - world.setBlock( - mutable, - rand.nextBoolean() - ? Blocks.BASALT.defaultBlockState() - : ModRegistry.ANCIENT_STONE - .get() - .defaultBlockState(), - 2); - } - } - } - } - } + double scaledNoise = (noise3 / 11) * + (-(y * baseRadius) / ((x * x) + (z * z))); + if (scaledNoise - lavaLeakage >= threshold) { + if (mutable.getY() <= pos.getY() + (volcanoStartHeight - 19)) { + world.setBlock( + mutable, + BlockRegistry.SOULLAVA_BLOCK + .get() + .defaultBlockState(), + 2); + } + } else if (scaledNoise >= threshold) { + world.setBlock( + mutable, + rand.nextBoolean() + ? Blocks.BASALT.defaultBlockState() + : ModRegistry.ANCIENT_STONE + .get() + .defaultBlockState(), + 2); + } + } + } + } + } - return true; - } + return true; + } - public void setSeed(long seed) { - if (fnlPerlin == null) { - fnlPerlin = FastNoiseLite.createSpongePerlin((int) seed); - fnlPerlin.SetFrequency(0.2F); - } - } + public void setSeed(long seed) { + if (fnlPerlin == null) { + fnlPerlin = FastNoiseLite.createSpongePerlin((int) seed); + fnlPerlin.SetFrequency(0.2F); + } + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java index 0e0dceeb..9b7cea40 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/features/VolcanoConfig.java @@ -5,12 +5,12 @@ public class VolcanoConfig implements FeatureConfiguration { - public static final Codec CODEC; - public static final VolcanoConfig INSTANCE = new VolcanoConfig(); + public static final Codec CODEC; + public static final VolcanoConfig INSTANCE = new VolcanoConfig(); - static { - CODEC = Codec.unit(() -> { - return INSTANCE; - }); - } + static { + CODEC = Codec.unit(() -> { + return INSTANCE; + }); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java index 67887384..9c2006e9 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/APStructure.java @@ -18,159 +18,159 @@ public class APStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> instance - .group( - APStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> structure.projectStartToHeightmap), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter)) - .apply(instance, APStructure::new)) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + APStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, APStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public APStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public APStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can - * spawn here. This only needs to be overridden if you're adding additional - * spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are - * passed in which allows you to spawn structures only at certain coordinates in - * the world. - * - * Basically, this method is used for determining if the land is at a suitable - * height, if certain other structures are too close or not, or some other - * restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn - * within 10 chunk of a Village. (Bedrock Edition seems to not have the same - * check) - * - * If you are doing Nether structures, you'll probably want to spawn your - * structure on top of ledges. Best way to do that is to use getBaseColumn to - * grab a column of blocks at the structure's x/z position. Then loop through it - * and look for land with air above it and set block pos's Y value to it. Make - * sure to set the final boolean in JigsawPlacement.addPieces to false so that - * the structure spawns at block pos's y value instead of placing the structure - * on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. If you - * do and another mod's dimension is trying to spawn your structure, the locate - * command will make minecraft hang forever and break the game. Use the biome - * tags for where to spawn the structure and users can datapack it to spawn in - * specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. + * + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) + * + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return (context - .chunkGenerator() - .getFirstOccupiedHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 150); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 150); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context) { - // Check if the spot is valid for our structure. This is just as another method for cleanness. - // Returning an empty optional tells the game to skip this spot as it will not generate the structure. - if (!APStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + // Check if the spot is valid for our structure. This is just as another method for cleanness. + // Returning an empty optional tells the game to skip this spot as it will not generate the structure. + if (!APStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - // Set's our spawning block pos's y offset to be 60 blocks up. - // Since we are going to have heightmap/terrain height spawning set to true further down, this will make it so we spawn 60 blocks above terrain. - // If we wanted to spawn on ocean floor, we would set heightmap/terrain height spawning to false and the grab the y value of the terrain with OCEAN_FLOOR_WG heightmap. - int startY = this.startHeight.sample( - context.random(), - new WorldGenerationContext( - context.chunkGenerator(), - context.heightAccessor())); + // Set's our spawning block pos's y offset to be 60 blocks up. + // Since we are going to have heightmap/terrain height spawning set to true further down, this will make it so we spawn 60 blocks above terrain. + // If we wanted to spawn on ocean floor, we would set heightmap/terrain height spawning to false and the grab the y value of the terrain with OCEAN_FLOOR_WG heightmap. + int startY = this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor())); - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner - // of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - startY, - chunkPos.getMinBlockZ()); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner + // of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in block pos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and - * implementation of how the structure should generate. It is tricky but - * extremely powerful if you are doing something that vanilla's jigsaw system - * cannot do. Such as for example, forcing 3 pieces to always spawn every time, - * limiting how often a piece spawns, or remove the intersection limitation of - * pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.ANCIENT_PYRAMID.get(); - } + @Override + public StructureType type() { + return ATMStructures.ANCIENT_PYRAMID.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java index ec1b2b30..cb4f0244 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/ATMStructures.java @@ -8,17 +8,17 @@ public class ATMStructures { - public static final DeferredRegister> STRUCTURES = DeferredRegister.create( - Registry.STRUCTURE_TYPE_REGISTRY, - Reference.MOD_ID); + public static final DeferredRegister> STRUCTURES = DeferredRegister.create( + Registry.STRUCTURE_TYPE_REGISTRY, + Reference.MOD_ID); - public static final RegistryObject> ANCIENT_PYRAMID = STRUCTURES.register( - "ancient_pyramid", - () -> () -> APStructure.CODEC); - public static final RegistryObject> PIGLIN_VILLAGE = STRUCTURES.register( - "piglin_village", - () -> () -> PVStructure.CODEC); - public static final RegistryObject> ANCIENT_DUNGEON = STRUCTURES.register( - "dungeon", - () -> () -> DungeonStructure.CODEC); + public static final RegistryObject> ANCIENT_PYRAMID = STRUCTURES.register( + "ancient_pyramid", + () -> () -> APStructure.CODEC); + public static final RegistryObject> PIGLIN_VILLAGE = STRUCTURES.register( + "piglin_village", + () -> () -> PVStructure.CODEC); + public static final RegistryObject> ANCIENT_DUNGEON = STRUCTURES.register( + "dungeon", + () -> () -> DungeonStructure.CODEC); } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java index f05c66ff..22b82158 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/DungeonStructure.java @@ -18,153 +18,153 @@ public class DungeonStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> instance - .group( - DungeonStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> structure.projectStartToHeightmap), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter)) - .apply(instance, DungeonStructure::new)) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + DungeonStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, DungeonStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public DungeonStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public DungeonStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can - * spawn here. This only needs to be overridden if you're adding additional - * spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are - * passed in which allows you to spawn structures only at certain coordinates in - * the world. - * - * Basically, this method is used for determining if the land is at a suitable - * height, if certain other structures are too close or not, or some other - * restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn - * within 10 chunk of a Village. (Bedrock Edition seems to not have the same - * check) - * - * If you are doing Nether structures, you'll probably want to spawn your - * structure on top of ledges. Best way to do that is to use getBaseColumn to - * grab a column of blocks at the structure's x/z position. Then loop through it - * and look for land with air above it and set block pos's Y value to it. Make - * sure to set the final boolean in JigsawPlacement.addPieces to false so that - * the structure spawns at block pos's y value instead of placing the structure - * on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. If you - * do and another mod's dimension is trying to spawn your structure, the locate - * command will make minecraft hang forever and break the game. Use the biome - * tags for where to spawn the structure and users can datapack it to spawn in - * specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can + * spawn here. This only needs to be overridden if you're adding additional + * spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are + * passed in which allows you to spawn structures only at certain coordinates in + * the world. + * + * Basically, this method is used for determining if the land is at a suitable + * height, if certain other structures are too close or not, or some other + * restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn + * within 10 chunk of a Village. (Bedrock Edition seems to not have the same + * check) + * + * If you are doing Nether structures, you'll probably want to spawn your + * structure on top of ledges. Best way to do that is to use getBaseColumn to + * grab a column of blocks at the structure's x/z position. Then loop through it + * and look for land with air above it and set block pos's Y value to it. Make + * sure to set the final boolean in JigsawPlacement.addPieces to false so that + * the structure spawns at block pos's y value instead of placing the structure + * on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. If you + * do and another mod's dimension is trying to spawn your structure, the locate + * command will make minecraft hang forever and break the game. Use the biome + * tags for where to spawn the structure and users can datapack it to spawn in + * specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return (context - .chunkGenerator() - .getFirstFreeHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 150); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstFreeHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 150); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context) { - if (!DungeonStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + if (!DungeonStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - int startY = this.startHeight.sample( - context.random(), - new WorldGenerationContext( - context.chunkGenerator(), - context.heightAccessor())); + int startY = this.startHeight.sample( + context.random(), + new WorldGenerationContext( + context.chunkGenerator(), + context.heightAccessor())); - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - startY, - chunkPos.getMinBlockZ()); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + startY, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in block pos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in block pos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, block pos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in block pos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and - * implementation of how the structure should generate. It is tricky but - * extremely powerful if you are doing something that vanilla's jigsaw system - * cannot do. Such as for example, forcing 3 pieces to always spawn every time, - * limiting how often a piece spawns, or remove the intersection limitation of - * pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and + * implementation of how the structure should generate. It is tricky but + * extremely powerful if you are doing something that vanilla's jigsaw system + * cannot do. Such as for example, forcing 3 pieces to always spawn every time, + * limiting how often a piece spawns, or remove the intersection limitation of + * pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.ANCIENT_DUNGEON.get(); - } + @Override + public StructureType type() { + return ATMStructures.ANCIENT_DUNGEON.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java index 24f68dd1..d499ef7d 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/PVStructure.java @@ -17,140 +17,140 @@ public class PVStructure extends Structure { - public static final Codec CODEC = RecordCodecBuilder - .mapCodec(instance -> instance - .group( - PVStructure.settingsCodec(instance), - StructureTemplatePool.CODEC - .fieldOf("start_pool") - .forGetter(structure -> structure.startPool), - ResourceLocation.CODEC - .optionalFieldOf("start_jigsaw_name") - .forGetter(structure -> structure.startJigsawName), - Codec - .intRange(0, 30) - .fieldOf("size") - .forGetter(structure -> structure.size), - HeightProvider.CODEC - .fieldOf("start_height") - .forGetter(structure -> structure.startHeight), - Heightmap.Types.CODEC - .optionalFieldOf("project_start_to_heightmap") - .forGetter(structure -> structure.projectStartToHeightmap), - Codec - .intRange(1, 128) - .fieldOf("max_distance_from_center") - .forGetter(structure -> structure.maxDistanceFromCenter)) - .apply(instance, PVStructure::new)) - .codec(); - private final Holder startPool; - private final Optional startJigsawName; - private final int size; - private final HeightProvider startHeight; - private final Optional projectStartToHeightmap; - private final int maxDistanceFromCenter; + public static final Codec CODEC = RecordCodecBuilder + .mapCodec(instance -> instance + .group( + PVStructure.settingsCodec(instance), + StructureTemplatePool.CODEC + .fieldOf("start_pool") + .forGetter(structure -> structure.startPool), + ResourceLocation.CODEC + .optionalFieldOf("start_jigsaw_name") + .forGetter(structure -> structure.startJigsawName), + Codec + .intRange(0, 30) + .fieldOf("size") + .forGetter(structure -> structure.size), + HeightProvider.CODEC + .fieldOf("start_height") + .forGetter(structure -> structure.startHeight), + Heightmap.Types.CODEC + .optionalFieldOf("project_start_to_heightmap") + .forGetter(structure -> structure.projectStartToHeightmap), + Codec + .intRange(1, 128) + .fieldOf("max_distance_from_center") + .forGetter(structure -> structure.maxDistanceFromCenter)) + .apply(instance, PVStructure::new)) + .codec(); + private final Holder startPool; + private final Optional startJigsawName; + private final int size; + private final HeightProvider startHeight; + private final Optional projectStartToHeightmap; + private final int maxDistanceFromCenter; - public PVStructure( - Structure.StructureSettings config, - Holder startPool, - Optional startJigsawName, - int size, - HeightProvider startHeight, - Optional projectStartToHeightmap, - int maxDistanceFromCenter) { - super(config); - this.startPool = startPool; - this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.projectStartToHeightmap = projectStartToHeightmap; - this.maxDistanceFromCenter = maxDistanceFromCenter; - } + public PVStructure( + Structure.StructureSettings config, + Holder startPool, + Optional startJigsawName, + int size, + HeightProvider startHeight, + Optional projectStartToHeightmap, + int maxDistanceFromCenter) { + super(config); + this.startPool = startPool; + this.startJigsawName = startJigsawName; + this.size = size; + this.startHeight = startHeight; + this.projectStartToHeightmap = projectStartToHeightmap; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } - /* - * This is where extra checks can be done to determine if the structure can spawn here. - * This only needs to be overridden if you're adding additional spawn conditions. - * - * Fun fact, if you set your structure separation/spacing to be 0/1, you can use - * extraSpawningChecks to return true only if certain chunk coordinates are passed in - * which allows you to spawn structures only at certain coordinates in the world. - * - * Basically, this method is used for determining if the land is at a suitable height, - * if certain other structures are too close or not, or some other restrictive condition. - * - * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. - * (Bedrock Edition seems to not have the same check) - * - * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. - * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. - * Then loop through it and look for land with air above it and set block pos's Y value to it. - * Make sure to set the final boolean in JigsawPlacement.addPieces to false so - * that the structure spawns at block pos's y value instead of placing the structure on the Bedrock roof! - * - * Also, please for the love of god, do not do dimension checking here. - * If you do and another mod's dimension is trying to spawn your structure, - * the locate command will make minecraft hang forever and break the game. - * Use the biome tags for where to spawn the structure and users can datapack - * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. - */ - private static boolean extraSpawningChecks( - Structure.GenerationContext context) { - // Grabs the chunk position we are at - ChunkPos chunkPos = context.chunkPos(); + /* + * This is where extra checks can be done to determine if the structure can spawn here. + * This only needs to be overridden if you're adding additional spawn conditions. + * + * Fun fact, if you set your structure separation/spacing to be 0/1, you can use + * extraSpawningChecks to return true only if certain chunk coordinates are passed in + * which allows you to spawn structures only at certain coordinates in the world. + * + * Basically, this method is used for determining if the land is at a suitable height, + * if certain other structures are too close or not, or some other restrictive condition. + * + * For example, Pillager Outposts added a check to make sure it cannot spawn within 10 chunk of a Village. + * (Bedrock Edition seems to not have the same check) + * + * If you are doing Nether structures, you'll probably want to spawn your structure on top of ledges. + * Best way to do that is to use getBaseColumn to grab a column of blocks at the structure's x/z position. + * Then loop through it and look for land with air above it and set block pos's Y value to it. + * Make sure to set the final boolean in JigsawPlacement.addPieces to false so + * that the structure spawns at block pos's y value instead of placing the structure on the Bedrock roof! + * + * Also, please for the love of god, do not do dimension checking here. + * If you do and another mod's dimension is trying to spawn your structure, + * the locate command will make minecraft hang forever and break the game. + * Use the biome tags for where to spawn the structure and users can datapack + * it to spawn in specific biomes that aren't in the dimension they don't like if they wish. + */ + private static boolean extraSpawningChecks( + Structure.GenerationContext context) { + // Grabs the chunk position we are at + ChunkPos chunkPos = context.chunkPos(); - // Checks to make sure our structure does not spawn above land that's higher than y = 150 - // to demonstrate how this method is good for checking extra conditions for spawning - return (context - .chunkGenerator() - .getFirstOccupiedHeight( - chunkPos.getMinBlockX(), - chunkPos.getMinBlockZ(), - Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, - context.heightAccessor(), - context.randomState()) < 100); - } + // Checks to make sure our structure does not spawn above land that's higher than y = 150 + // to demonstrate how this method is good for checking extra conditions for spawning + return (context + .chunkGenerator() + .getFirstOccupiedHeight( + chunkPos.getMinBlockX(), + chunkPos.getMinBlockZ(), + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + context.heightAccessor(), + context.randomState()) < 100); + } - @Override - public Optional findGenerationPoint( - @Nonnull Structure.GenerationContext context) { - // Check if the spot is valid for our structure. This is just as another method for cleanness. - // Returning an empty optional tells the game to skip this spot as it will not generate the structure. - if (!PVStructure.extraSpawningChecks(context)) { - return Optional.empty(); - } + @Override + public Optional findGenerationPoint( + @Nonnull Structure.GenerationContext context) { + // Check if the spot is valid for our structure. This is just as another method for cleanness. + // Returning an empty optional tells the game to skip this spot as it will not generate the structure. + if (!PVStructure.extraSpawningChecks(context)) { + return Optional.empty(); + } - // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) - ChunkPos chunkPos = context.chunkPos(); - BlockPos blockPos = new BlockPos( - chunkPos.getMinBlockX(), - 0, - chunkPos.getMinBlockZ()); + // Turns the chunk coordinates into actual coordinates we can use. (Gets corner of that chunk) + ChunkPos chunkPos = context.chunkPos(); + BlockPos blockPos = new BlockPos( + chunkPos.getMinBlockX(), + 0, + chunkPos.getMinBlockZ()); - Optional structurePiecesGenerator = JigsawPlacement.addPieces( - context, // Used for JigsawPlacement to get all the proper behaviors done. - this.startPool, // The starting pool to use to create the structure layout from - this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. - this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) - blockPos, // Where to spawn the structure. - false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. - this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) - // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. - // Set this to false for structure to be place only at the passed in blockpos's Y value instead. - // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. - this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. + Optional structurePiecesGenerator = JigsawPlacement.addPieces( + context, // Used for JigsawPlacement to get all the proper behaviors done. + this.startPool, // The starting pool to use to create the structure layout from + this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this. + this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece) + blockPos, // Where to spawn the structure. + false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always. + this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too) + // Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height. + // Set this to false for structure to be place only at the passed in blockpos's Y value instead. + // Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof. + this.maxDistanceFromCenter); // Maximum limit for how far pieces can spawn from center. You cannot set this bigger than 128 or else pieces gets cutoff. - /* - * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure - * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. - * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. - */ + /* + * Note, you are always free to make your own JigsawPlacement class and implementation of how the structure + * should generate. It is tricky but extremely powerful if you are doing something that vanilla's jigsaw system cannot do. + * Such as for example, forcing 3 pieces to always spawn every time, limiting how often a piece spawns, or remove the intersection limitation of pieces. + */ - // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. - return structurePiecesGenerator; - } + // Return the pieces generator that is now set up so that the game runs it when it needs to create the layout of structure pieces. + return structurePiecesGenerator; + } - @Override - public StructureType type() { - return ATMStructures.PIGLIN_VILLAGE.get(); - } + @Override + public StructureType type() { + return ATMStructures.PIGLIN_VILLAGE.get(); + } } diff --git a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java index 2258f51a..b1d966b9 100644 --- a/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java +++ b/src/main/java/com/thevortex/allthemodium/worldgen/structures/VillagePieces.java @@ -12,18 +12,18 @@ public class VillagePieces { - public static final Holder START = Pools.register( - new StructureTemplatePool( - new ResourceLocation(Reference.MOD_ID, "village/start_pool"), - new ResourceLocation(Reference.MOD_ID, "village/start_pool"), - ImmutableList.of( - Pair.of( - StructurePoolElement.legacy( - Reference.MOD_ID + ":illager_keep", - ProcessorLists.EMPTY), - 1)), - StructureTemplatePool.Projection.RIGID)); + public static final Holder START = Pools.register( + new StructureTemplatePool( + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + new ResourceLocation(Reference.MOD_ID, "village/start_pool"), + ImmutableList.of( + Pair.of( + StructurePoolElement.legacy( + Reference.MOD_ID + ":illager_keep", + ProcessorLists.EMPTY), + 1)), + StructureTemplatePool.Projection.RIGID)); - public static void bootstrap() { - } + public static void bootstrap() { + } } From aae9eefe9fd587afd91d12b4f9697d39e73fc75e Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 12:50:42 -0600 Subject: [PATCH 15/17] Added missing generated files --- .../models/item/allthemodium_apple.json | 6 ++++++ .../models/item/allthemodium_carrot.json | 6 ++++++ .../unobtainium_allthemodium_alloy_dust.json | 6 ++++++ .../unobtainium_allthemodium_alloy_ingot.json | 6 ++++++ .../unobtainium_vibranium_alloy_dust.json | 6 ++++++ .../unobtainium_vibranium_alloy_ingot.json | 6 ++++++ .../vibranium_allthemodium_alloy_dust.json | 6 ++++++ .../vibranium_allthemodium_alloy_ingot.json | 6 ++++++ .../loot_tables/blocks/ancient_door.json | 20 +++++++++++++++++++ .../loot_tables/blocks/ancient_leaves.json | 20 +++++++++++++++++++ .../blocks/ancient_leaves_bottom.json | 20 +++++++++++++++++++ .../loot_tables/blocks/demonic_door.json | 20 +++++++++++++++++++ .../loot_tables/blocks/demonic_leaves.json | 20 +++++++++++++++++++ .../blocks/demonic_leaves_bottom.json | 20 +++++++++++++++++++ .../loot_tables/blocks/soul_door.json | 20 +++++++++++++++++++ .../loot_tables/blocks/soul_leaves.json | 20 +++++++++++++++++++ .../blocks/soul_leaves_bottom.json | 20 +++++++++++++++++++ 17 files changed, 228 insertions(+) create mode 100644 src/generated/resources/assets/allthemodium/models/item/allthemodium_apple.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/allthemodium_carrot.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json create mode 100644 src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_door.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves_bottom.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_door.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves_bottom.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/soul_door.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json create mode 100644 src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves_bottom.json diff --git a/src/generated/resources/assets/allthemodium/models/item/allthemodium_apple.json b/src/generated/resources/assets/allthemodium/models/item/allthemodium_apple.json new file mode 100644 index 00000000..8af8b6e7 --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/allthemodium_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/allthemodium_apple" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/allthemodium_carrot.json b/src/generated/resources/assets/allthemodium/models/item/allthemodium_carrot.json new file mode 100644 index 00000000..127460a5 --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/allthemodium_carrot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/allthemodium_carrot" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json new file mode 100644 index 00000000..d7d81a7f --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/unobtainium_allthemodium_alloy_dust" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json new file mode 100644 index 00000000..53a1a48a --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/unobtainium_allthemodium_alloy_ingot" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json new file mode 100644 index 00000000..56b4871c --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/unobtainium_vibranium_alloy_dust" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json new file mode 100644 index 00000000..a5997c89 --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/unobtainium_vibranium_alloy_ingot" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json new file mode 100644 index 00000000..72628b2e --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/vibranium_allthemodium_alloy_dust" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json new file mode 100644 index 00000000..70f37b87 --- /dev/null +++ b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "allthemodium:item/vibranium_allthemodium_alloy_ingot" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_door.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_door.json new file mode 100644 index 00000000..27bdb29c --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_door.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:ancient_door" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json new file mode 100644 index 00000000..c40a9f36 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:ancient_leaves" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves_bottom.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves_bottom.json new file mode 100644 index 00000000..38fe9914 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/ancient_leaves_bottom.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:air" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_door.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_door.json new file mode 100644 index 00000000..0d002793 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_door.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:demonic_door" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json new file mode 100644 index 00000000..5e1226cf --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:demonic_leaves" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves_bottom.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves_bottom.json new file mode 100644 index 00000000..38fe9914 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/demonic_leaves_bottom.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:air" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_door.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_door.json new file mode 100644 index 00000000..a32909b6 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_door.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:soul_door" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json new file mode 100644 index 00000000..07f3fa24 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "allthemodium:soul_leaves" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves_bottom.json b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves_bottom.json new file mode 100644 index 00000000..38fe9914 --- /dev/null +++ b/src/generated/resources/data/allthemodium/loot_tables/blocks/soul_leaves_bottom.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:air" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file From 65d169da504114a37b4b00fac17b93a1b186324c Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 13:00:21 -0600 Subject: [PATCH 16/17] Removed duplicate resource files --- .../unobtainium_allthemodium_alloy_dust.json | 6 - .../unobtainium_allthemodium_alloy_ingot.json | 6 - .../unobtainium_vibranium_alloy_dust.json | 6 - .../unobtainium_vibranium_alloy_ingot.json | 6 - .../vibranium_allthemodium_alloy_dust.json | 6 - .../vibranium_allthemodium_alloy_ingot.json | 6 - .../models/item/allthemodium_apple.json | 6 - .../models/item/allthemodium_carrot.json | 6 - .../loot_tables/blocks/ancient_door.json | 29 ---- .../loot_tables/blocks/ancient_leaves.json | 135 ------------------ .../loot_tables/blocks/demonic_door.json | 29 ---- .../loot_tables/blocks/demonic_leaves.json | 135 ------------------ .../loot_tables/blocks/soul_door.json | 29 ---- .../loot_tables/blocks/soul_leaves.json | 135 ------------------ 14 files changed, 540 deletions(-) delete mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json delete mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json delete mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json delete mode 100644 src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json delete mode 100644 src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json delete mode 100644 src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json delete mode 100644 src/main/resources/assets/allthemodium/models/item/allthemodium_apple.json delete mode 100644 src/main/resources/assets/allthemodium/models/item/allthemodium_carrot.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/ancient_door.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/demonic_door.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/soul_door.json delete mode 100644 src/main/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json deleted file mode 100644 index d7d81a7f..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_dust.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/unobtainium_allthemodium_alloy_dust" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json deleted file mode 100644 index 53a1a48a..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/unobtainium_allthemodium_alloy_ingot.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/unobtainium_allthemodium_alloy_ingot" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json deleted file mode 100644 index 56b4871c..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_dust.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/unobtainium_vibranium_alloy_dust" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json deleted file mode 100644 index a5997c89..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/unobtainium_vibranium_alloy_ingot.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/unobtainium_vibranium_alloy_ingot" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json deleted file mode 100644 index 72628b2e..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_dust.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/vibranium_allthemodium_alloy_dust" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json b/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json deleted file mode 100644 index 70f37b87..00000000 --- a/src/generated/resources/assets/allthemodium/models/item/vibranium_allthemodium_alloy_ingot.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "allthemodium:item/vibranium_allthemodium_alloy_ingot" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/allthemodium/models/item/allthemodium_apple.json b/src/main/resources/assets/allthemodium/models/item/allthemodium_apple.json deleted file mode 100644 index b087d395..00000000 --- a/src/main/resources/assets/allthemodium/models/item/allthemodium_apple.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "allthemodium:item/allthemodium_apple" - } -} diff --git a/src/main/resources/assets/allthemodium/models/item/allthemodium_carrot.json b/src/main/resources/assets/allthemodium/models/item/allthemodium_carrot.json deleted file mode 100644 index 515487d2..00000000 --- a/src/main/resources/assets/allthemodium/models/item/allthemodium_carrot.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "allthemodium:item/allthemodium_carrot" - } -} diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_door.json b/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_door.json deleted file mode 100644 index ca8d542a..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_door.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "allthemodium:ancient_door", - "properties": { - "half": "lower" - } - } - ], - "name": "allthemodium:ancient_door" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json b/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json deleted file mode 100644 index 0a8d4051..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/ancient_leaves.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ], - "name": "allthemodium:ancient_leaves" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.05, - 0.0625, - 0.083333336, - 0.1 - ] - } - ], - "name": "allthemodium:ancient_sapling" - } - ] - } - ] - }, - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.02, - 0.022222223, - 0.025, - 0.033333335, - 0.1 - ] - } - ], - "functions": [ - { - "function": "minecraft:set_count", - "count": { - "type": "minecraft:uniform", - "min": 1, - "max": 2 - }, - "add": false - }, - { - "function": "minecraft:explosion_decay" - } - ], - "name": "minecraft:stick" - } - ], - "conditions": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_door.json b/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_door.json deleted file mode 100644 index 62092888..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_door.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "allthemodium:demonic_door", - "properties": { - "half": "lower" - } - } - ], - "name": "allthemodium:demonic_door" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json b/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json deleted file mode 100644 index e2966212..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/demonic_leaves.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ], - "name": "allthemodium:demonic_leaves" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.05, - 0.0625, - 0.083333336, - 0.1 - ] - } - ], - "name": "allthemodium:demonic_sapling" - } - ] - } - ] - }, - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.02, - 0.022222223, - 0.025, - 0.033333335, - 0.1 - ] - } - ], - "functions": [ - { - "function": "minecraft:set_count", - "count": { - "type": "minecraft:uniform", - "min": 1, - "max": 2 - }, - "add": false - }, - { - "function": "minecraft:explosion_decay" - } - ], - "name": "minecraft:stick" - } - ], - "conditions": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/soul_door.json b/src/main/resources/data/allthemodium/loot_tables/blocks/soul_door.json deleted file mode 100644 index 695ae4c5..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/soul_door.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "allthemodium:soul_door", - "properties": { - "half": "lower" - } - } - ], - "name": "allthemodium:soul_door" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json b/src/main/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json deleted file mode 100644 index b7551121..00000000 --- a/src/main/resources/data/allthemodium/loot_tables/blocks/soul_leaves.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ], - "name": "allthemodium:soul_leaves" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.05, - 0.0625, - 0.083333336, - 0.1 - ] - } - ], - "name": "allthemodium:soul_sapling" - } - ] - } - ] - }, - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.02, - 0.022222223, - 0.025, - 0.033333335, - 0.1 - ] - } - ], - "functions": [ - { - "function": "minecraft:set_count", - "count": { - "type": "minecraft:uniform", - "min": 1, - "max": 2 - }, - "add": false - }, - { - "function": "minecraft:explosion_decay" - } - ], - "name": "minecraft:stick" - } - ], - "conditions": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - } - ] - } - ] -} \ No newline at end of file From 5526dcdbb36e8b0488affe95ba7423a811d7dfae Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Fri, 13 Sep 2024 15:04:01 -0600 Subject: [PATCH 17/17] Updated naming of vibranium ore item --- .../items/{Vibranium_Ore_Item.java => VibraniumOreItem.java} | 4 ++-- .../java/com/thevortex/allthemodium/registry/ModRegistry.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/main/java/com/thevortex/allthemodium/items/{Vibranium_Ore_Item.java => VibraniumOreItem.java} (93%) diff --git a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/VibraniumOreItem.java similarity index 93% rename from src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java rename to src/main/java/com/thevortex/allthemodium/items/VibraniumOreItem.java index c441de9d..335173f8 100644 --- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java +++ b/src/main/java/com/thevortex/allthemodium/items/VibraniumOreItem.java @@ -14,9 +14,9 @@ import net.minecraft.world.level.block.Block; import net.minecraftforge.server.command.TextComponentHelper; -public class Vibranium_Ore_Item extends BlockItem { +public class VibraniumOreItem extends BlockItem { - public Vibranium_Ore_Item(Block block, Properties properties) { + public VibraniumOreItem(Block block, Properties properties) { super(block, properties); } diff --git a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java index 86ce47ff..f59152ff 100644 --- a/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java +++ b/src/main/java/com/thevortex/allthemodium/registry/ModRegistry.java @@ -1151,12 +1151,12 @@ public class ModRegistry { public static final RegistryObject VIBRANIUM_ORE_ITEM = ITEMS.register( "vibranium_ore", - () -> new Vibranium_Ore_Item( + () -> new VibraniumOreItem( VIBRANIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); public static final RegistryObject OTHER_VIBRANIUM_ORE_ITEM = ITEMS.register( "other_vibranium_ore", - () -> new Vibranium_Ore_Item( + () -> new VibraniumOreItem( OTHER_VIBRANIUM_ORE.get(), new Item.Properties().tab(AllTheModium.GROUP))); public static final RegistryObject UNOBTAINIUM_ORE_ITEM = ITEMS.register(