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
diff --git a/README.md b/README.md
index e69de29b..8b137891 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1 @@
+
diff --git a/build.gradle b/build.gradle
index 79c4ad5a..ddc6a26c 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,27 @@ 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 {
+ eclipse().configFile('eclipse-formatter.xml')
+ }
+ json {
+ target 'resources/**/*.json'
+ prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0'])
+ .config(['parser': 'json', 'tabWidth': 4, 'plugins': ['prettier-plugin-java']])
+ }
+}
diff --git a/eclipse-formatter.xml b/eclipse-formatter.xml
new file mode 100644
index 00000000..e027c297
--- /dev/null
+++ b/eclipse-formatter.xml
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/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
diff --git a/src/main/java/com/thevortex/allthemodium/AllTheModium.java b/src/main/java/com/thevortex/allthemodium/AllTheModium.java
index 2a89014e..0134a7da 100644
--- a/src/main/java/com/thevortex/allthemodium/AllTheModium.java
+++ b/src/main/java/com/thevortex/allthemodium/AllTheModium.java
@@ -1,144 +1,158 @@
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;
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;
-
-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.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()); }
- };
+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
-
- 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.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);
-
- 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();
- 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 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 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..97dbf297 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,31 @@
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 +53,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..c296f32f
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumBlock.java
@@ -0,0 +1,30 @@
+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..bf26b4cb
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/AllthemodiumOre.java
@@ -0,0 +1,126 @@
+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 ffb9836a..00000000
--- a/src/main/java/com/thevortex/allthemodium/blocks/Allthemodium_Ore.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.thevortex.allthemodium.blocks;
-
-import java.util.Random;
-
-import com.thevortex.allthemodium.registry.ModRegistry;
-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(-1.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)) {
- 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.getBlock() == ModRegistry.ALLTHEMODIUM_ORE.get())) { return false; }
-
- 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..256b84ec 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,10 @@ 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..c0268818 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,97 @@
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..0f3023c0 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,80 @@
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..ada87ff3 100644
--- a/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java
+++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientDirt.java
@@ -4,18 +4,22 @@
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..666055d4 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,174 @@
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..5655377c
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/AncientGrass.java
@@ -0,0 +1,43 @@
+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..73e37263 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,32 @@
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..ebfacff6 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,9 +22,8 @@
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;
@@ -36,52 +34,81 @@ public class AncientLeaves extends LeavesBlock {
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 +117,20 @@ 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 +143,52 @@ 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..63c10e66 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,81 @@
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;
- 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 +105,20 @@ 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 +131,50 @@ 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..860e9ba4 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,128 @@
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) {
- if (!p_56004_.isAreaLoaded(p_56005_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
+ @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..adcc3cd1 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,9 +25,8 @@
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;
@@ -36,56 +36,100 @@ public class DemonicLeaves extends LeavesBlock {
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 +138,20 @@ 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 +164,52 @@ 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..ed9efec7 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,81 @@
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;
- 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 +105,20 @@ 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 +131,50 @@ 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/Raw_VIB.java b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java
similarity index 50%
rename from src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java
rename to src/main/java/com/thevortex/allthemodium/blocks/RawATM.java
index 48aa13bc..9a88b780 100644
--- a/src/main/java/com/thevortex/allthemodium/blocks/Raw_VIB.java
+++ b/src/main/java/com/thevortex/allthemodium/blocks/RawATM.java
@@ -1,5 +1,4 @@
package com.thevortex.allthemodium.blocks;
-public class Raw_VIB extends Vibranium_Ore {
-
+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..eee9d013
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/RawUNO.java
@@ -0,0 +1,4 @@
+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..84015a11
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/RawVIB.java
@@ -0,0 +1,4 @@
+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/SoulLava.java b/src/main/java/com/thevortex/allthemodium/blocks/SoulLava.java
index 27c82bee..8c98d11a 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,189 @@
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 extends FlowingFluid> 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 extends FlowingFluid> 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..b02c8cf5 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,9 +26,8 @@
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;
@@ -37,56 +38,100 @@ public class SoulLeaves extends LeavesBlock {
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 +140,20 @@ 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 +166,52 @@ 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..8dbb6660 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,81 @@
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;
- 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 +105,20 @@ 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 +131,50 @@ 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..fb9c0b03 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,296 @@
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..56880afa
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/UAAlloyBlock.java
@@ -0,0 +1,30 @@
+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..f1916981
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/UVAlloyBlock.java
@@ -0,0 +1,30 @@
+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..bebd1eb7
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumBlock.java
@@ -0,0 +1,30 @@
+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..ddd51bac
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/UnobtainiumOre.java
@@ -0,0 +1,74 @@
+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 b98d82f7..00000000
--- a/src/main/java/com/thevortex/allthemodium/blocks/Unobtainium_Ore.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.thevortex.allthemodium.blocks;
-
-import com.thevortex.allthemodium.registry.ModRegistry;
-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(-1.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)) {
- 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.getBlock() == ModRegistry.UNOBTAINIUM_ORE.get())) { return false; }
- 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..db028351
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/VAAlloyBlock.java
@@ -0,0 +1,30 @@
+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..887aa95b
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumBlock.java
@@ -0,0 +1,30 @@
+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..bc6ac119
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/blocks/VibraniumOre.java
@@ -0,0 +1,73 @@
+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 5253d155..00000000
--- a/src/main/java/com/thevortex/allthemodium/blocks/Vibranium_Ore.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.thevortex.allthemodium.blocks;
-
-import com.thevortex.allthemodium.registry.ModRegistry;
-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(-1.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)) {
- 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.getBlock() == ModRegistry.VIBRANIUM_ORE.get())) { return false; }
- 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
new file mode 100644
index 00000000..9b0c9e86
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/config/AllthemodiumServerConfigs.java
@@ -0,0 +1,40 @@
+package com.thevortex.allthemodium.config;
+
+import net.minecraftforge.common.ForgeConfigSpec;
+
+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();
+ }
+}
diff --git a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java
index 111668da..7986e78e 100644
--- a/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java
+++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMCraftingSetup.java
@@ -1,28 +1,21 @@
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 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..6e4b58c4 100644
--- a/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java
+++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMRecipeSerializer.java
@@ -1,38 +1,43 @@
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..7c81f60b 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,104 @@
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..abd735f5 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,85 @@
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..f3290dbd 100644
--- a/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java
+++ b/src/main/java/com/thevortex/allthemodium/crafting/ATMShapelessRecipeSerializer.java
@@ -1,43 +1,52 @@
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..01f0a96f 100644
--- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java
+++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapedRecipe.java
@@ -1,10 +1,11 @@
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..a702df4a 100644
--- a/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java
+++ b/src/main/java/com/thevortex/allthemodium/crafting/IATMShapelessRecipe.java
@@ -1,10 +1,11 @@
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..fe3890be 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,11 +12,11 @@
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() {}
+
+ private DataGenerators() {
+ }
@SubscribeEvent
public static void gatherData(GatherDataEvent event) throws IOException {
@@ -23,19 +24,25 @@ 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..d4d6f967 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,57 @@
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());
- ItemPredicate predicate = ItemPredicate.Builder.item().of(ancientstone).build();
+ 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 +94,126 @@ 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))
+ Optional
+ .ofNullable(pieces.get(Slot.BOOKSHELF))
.map(this::bookshelf)
.map(this::addBookCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.TRAPDOOR))
+ Optional
+ .ofNullable(pieces.get(Slot.TRAPDOOR))
.map(this::trapdoor)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.WALL))
+ Optional
+ .ofNullable(pieces.get(Slot.WALL))
.map(this::wall)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.BRICK))
+ Optional
+ .ofNullable(pieces.get(Slot.BRICK))
.map(this::brick)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.SLAB))
+ Optional
+ .ofNullable(pieces.get(Slot.SLAB))
.map(this::slab)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.DOOR))
+ Optional
+ .ofNullable(pieces.get(Slot.DOOR))
.map(this::door)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.STAIRS))
+ Optional
+ .ofNullable(pieces.get(Slot.STAIRS))
.map(this::stairs)
.map(this::addCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.FENCE))
+ Optional
+ .ofNullable(pieces.get(Slot.FENCE))
.map(this::fence)
.map(this::addStickCriterion)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.FENCEGATE))
+ 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)
+ 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)
+ .define('a', ancientStone)
.unlockedBy(criteriaName, criterion);
}
+
private ShapedRecipeBuilder addStickCriterion(ShapedRecipeBuilder builder) {
return builder
- .define('a', ancientstone)
+ .define('a', ancientStone)
.define('s', Items.STICK)
.unlockedBy(criteriaName, criterion);
}
+
private ShapedRecipeBuilder addBookCriterion(ShapedRecipeBuilder builder) {
return builder
- .define('a', ancientstone)
+ .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..bac9c7b1 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,12 +17,6 @@
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 {
@@ -35,24 +31,23 @@ 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();
+ 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 +68,63 @@ 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);
- 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);
+ 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);
+ 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..b614a449 100644
--- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java
+++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedBlockBuilder.java
@@ -1,46 +1,45 @@
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;
+
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();
+ ItemPredicate predicate = ItemPredicate.Builder
+ .item()
+ .of(ingot)
+ .build();
this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate);
}
@@ -48,103 +47,88 @@ 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))
+ Optional
+ .ofNullable(pieces.get(Slot.BLOCK))
.map(this::block)
.map(this::addCriterionIngot)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.GEAR))
+ Optional
+ .ofNullable(pieces.get(Slot.GEAR))
.map(this::gear)
.map(this::addCriterionIngot)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.ROD))
+ Optional
+ .ofNullable(pieces.get(Slot.ROD))
.map(this::rod)
.map(this::addCriterionIngot)
.ifPresent(register);
- Optional.ofNullable(pieces.get(Slot.PLATE))
+ 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..00b7ae32 100644
--- a/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java
+++ b/src/main/java/com/thevortex/allthemodium/datagen/builder/ShapedIngotBuilder.java
@@ -2,44 +2,44 @@
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();
+ ItemPredicate predicate = ItemPredicate.Builder
+ .item()
+ .of(nugget)
+ .build();
this.criterion = InventoryChangeTrigger.TriggerInstance.hasItems(predicate);
}
@@ -47,46 +47,39 @@ 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);
- Optional.ofNullable(pieces.get(Slot.INGOT))
- .map(this::ingot)
- .map(this::addCriterionNugget)
- .ifPresent(register);
-
+ 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..12c62606 100644
--- a/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java
+++ b/src/main/java/com/thevortex/allthemodium/datagen/client/BlockStates.java
@@ -1,129 +1,273 @@
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)
- .filter(block -> !(block instanceof GrassBlock))
- .filter(block -> !(block instanceof LiquidBlock))
- .collect(Collectors.toList());
+ 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
- * @param block the block
+ * 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);
@@ -131,5 +275,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..46190695 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,143 +21,245 @@ 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()
- .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("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"));
+ // 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(
+ "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..6676e381 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,97 @@
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..450e9ca4 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,27 @@
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,194 +30,343 @@ 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()
+ 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());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
- ModRegistry.SHAPED_BLOCKS.getEntries().stream()
+ ModRegistry.SHAPED_BLOCKS
+ .getEntries()
+ .stream()
.forEach(blockRegistryObject -> {
- tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
- ModRegistry.STAIRBLOCKS.getEntries().stream()
+ ModRegistry.STAIR_BLOCKS
+ .getEntries()
+ .stream()
.forEach(blockRegistryObject -> {
- tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
- ModRegistry.SLABBLOCKS.getEntries().stream()
+ ModRegistry.SLAB_BLOCKS
+ .getEntries()
+ .stream()
.forEach(blockRegistryObject -> {
- tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
- ModRegistry.WALLBLOCKS.getEntries().stream()
+ ModRegistry.WALL_BLOCKS
+ .getEntries()
+ .stream()
.forEach(blockRegistryObject -> {
- tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
- ModRegistry.PILLARBLOCKS.getEntries().stream()
+ ModRegistry.PILLAR_BLOCKS
+ .getEntries()
+ .stream()
.forEach(blockRegistryObject -> {
- tag(TagRegistry.OTHER_PROTECTION).add(blockRegistryObject.get());
+ tag(TagRegistry.OTHER_PROTECTION)
+ .add(blockRegistryObject.get());
});
tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SAND);
tag(TagRegistry.OTHER_PROTECTION).add(Blocks.SANDSTONE);
@@ -230,49 +377,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 +443,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..1ac113ac 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,47 +20,48 @@
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())
+ .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_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_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);
+ 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")
@@ -68,7 +69,13 @@ protected void buildCraftingRecipes(Consumer consumer) {
.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()))
+ .unlockedBy(
+ "has_allthemodium_nugget",
+ RecipeProvider.inventoryTrigger(
+ ItemPredicate.Builder
+ .item()
+ .of(TagRegistry.ALLTHEMODIUM_NUGGET)
+ .build()))
.save(consumer);
shaped(ModRegistry.ALLTHEMODIUM_CARROT.get())
@@ -77,7 +84,13 @@ protected void buildCraftingRecipes(Consumer consumer) {
.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()))
+ .unlockedBy(
+ "has_allthemodium_nugget",
+ RecipeProvider.inventoryTrigger(
+ ItemPredicate.Builder
+ .item()
+ .of(TagRegistry.ALLTHEMODIUM_NUGGET)
+ .build()))
.save(consumer);
shaped(ModRegistry.TELEPORT_PAD_ITEM.get())
@@ -86,20 +99,33 @@ protected void buildCraftingRecipes(Consumer consumer) {
.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()))
+ .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);
-
-
+ .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 ")
@@ -107,48 +133,64 @@ 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_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()))
+ .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()))
+ .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()))
+ .unlockedBy(
+ "has_allthemodium_rod",
+ RecipeProvider.inventoryTrigger(
+ ItemPredicate.Builder
+ .item()
+ .of(TagRegistry.ALLTHEMODIUM_ROD)
+ .build()))
.save(consumer);
+ // final String hasCondition = "has_item";
- final String hasCondition = "has_item";
-
- ShapedAncientStones.builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM)
+ ShapedAncientStones
+ .builder(TagRegistry.DEMONIC_WOODEN_PLANKS_ITEM)
.setBookShelf(ModRegistry.DEMONIC_BOOKSHELF_ITEM)
.setDoor(ModRegistry.DEMONIC_DOOR_ITEM)
.setTrapDoor(ModRegistry.DEMONIC_TRAP_DOOR_ITEM)
@@ -158,7 +200,8 @@ protected void buildCraftingRecipes(Consumer consumer) {
.setSlab(ModRegistry.DEMONIC_WOODEN_SLABS_ITEM)
.build(consumer);
- ShapedAncientStones.builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM)
+ ShapedAncientStones
+ .builder(TagRegistry.SOUL_WOODEN_PLANKS_ITEM)
.setBookShelf(ModRegistry.SOUL_BOOKSHELF_ITEM)
.setDoor(ModRegistry.SOUL_DOOR_ITEM)
.setTrapDoor(ModRegistry.SOUL_TRAP_DOOR_ITEM)
@@ -168,7 +211,8 @@ protected void buildCraftingRecipes(Consumer consumer) {
.setSlab(ModRegistry.SOUL_WOODEN_SLABS_ITEM)
.build(consumer);
- ShapedAncientStones.builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM)
+ ShapedAncientStones
+ .builder(TagRegistry.ANCIENT_WOODEN_PLANKS_ITEM)
.setBookShelf(ModRegistry.ANCIENT_BOOKSHELF_ITEM)
.setTrapDoor(ModRegistry.ANCIENT_TRAP_DOOR_ITEM)
.setDoor(ModRegistry.ANCIENT_DOOR_ITEM)
@@ -178,91 +222,106 @@ protected void buildCraftingRecipes(Consumer consumer) {
.setSlab(ModRegistry.ANCIENT_WOODEN_SLABS_ITEM)
.build(consumer);
- ShapedAncientStones.builder(TagRegistry.ANCIENT_STONE_BRICKS_ITEM)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ ShapedBlockBuilder
+ .builder(TagRegistry.UNOBTAINIUM_INGOT)
.setBlock(ModRegistry.UNOBTAINIUM_BLOCK_ITEM)
- .setGear(ModRegistry.ONOB_GEAR)
- .setPlate(ModRegistry.ONOB_PLATE)
- .setRod(ModRegistry.ONOB_ROD)
+ .setGear(ModRegistry.UNOB_GEAR)
+ .setPlate(ModRegistry.UNOB_PLATE)
+ .setRod(ModRegistry.UNOB_ROD)
.build(consumer);
- ShapedBlockBuilder.builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT)
+ ShapedBlockBuilder
+ .builder(TagRegistry.UNOBTAINIUM_ALLTHEMODIUM_INGOT)
.setBlock(ModRegistry.UA_ALLOY_ITEM)
.build(consumer);
- ShapedBlockBuilder.builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT)
+ ShapedBlockBuilder
+ .builder(TagRegistry.UNOBTAINIUM_VIBRANIUM_INGOT)
.setBlock(ModRegistry.UV_ALLOY_ITEM)
.build(consumer);
- ShapedBlockBuilder.builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT)
+ ShapedBlockBuilder
+ .builder(TagRegistry.VIBRANIUM_ALLTHEMODIUM_INGOT)
.setBlock(ModRegistry.VA_ALLOY_ITEM)
.build(consumer);
- ShapedIngotBuilder.builder(TagRegistry.ALLTHEMODIUM_NUGGET)
+ ShapedIngotBuilder
+ .builder(TagRegistry.ALLTHEMODIUM_NUGGET)
.setIngot(ModRegistry.ALLTHEMODIUM_INGOT)
.build(consumer);
- ShapedIngotBuilder.builder(TagRegistry.VIBRANIUM_NUGGET)
+ ShapedIngotBuilder
+ .builder(TagRegistry.VIBRANIUM_NUGGET)
.setIngot(ModRegistry.VIBRANIUM_INGOT)
.build(consumer);
- ShapedIngotBuilder.builder(TagRegistry.UNOBTAINIUM_NUGGET)
+ 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..307992b1 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,31 @@
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..7fefdf21 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,66 @@
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 +86,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 +134,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 +175,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..82c45fbf 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) {
@@ -38,95 +36,116 @@ public LootTables(DataGenerator generator) {
@Override
protected List>>, LootContextParamSet>> getTables() {
return ImmutableList.of(
- Pair.of(BlockLoots::new, LootContextParamSets.BLOCK)
- );
+ 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 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())
+ 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)
+ return ModRegistry.STAIR_BLOCKS
+ .getEntries()
+ .stream()
+ .map(RegistryObject::get)
.collect(Collectors.toList());
-
}
+
protected Iterable getKnownSlabs() {
- return ModRegistry.SLABBLOCKS.getEntries()
- .stream().map(RegistryObject::get)
+ return ModRegistry.SLAB_BLOCKS
+ .getEntries()
+ .stream()
+ .map(RegistryObject::get)
.collect(Collectors.toList());
-
}
protected Iterable getKnownWalls() {
- return ModRegistry.WALLBLOCKS.getEntries()
- .stream().map(RegistryObject::get)
+ 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..b965d26e 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,268 @@
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)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.DEMONIC_LOG_ITEM.get()))
+ .save(consumer, recipeDir("demonic_planks", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.SOUL_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.SOUL_LOG_ITEM.get()))
+ .save(consumer, recipeDir("soul_planks", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.SOUL_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.SOUL_LOG_0_ITEM.get()))
+ .save(consumer, recipeDir("soul_planks_0", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.SOUL_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.SOUL_LOG_1_ITEM.get()))
+ .save(consumer, recipeDir("soul_planks_1", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.SOUL_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.SOUL_LOG_2_ITEM.get()))
+ .save(consumer, recipeDir("soul_planks_2", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.ANCIENT_LOG_0_ITEM.get()))
+ .save(consumer, recipeDir("ancient_planks", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.ANCIENT_LOG_1_ITEM.get()))
+ .save(consumer, recipeDir("ancient_planks_1", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.ANCIENT_LOG_2_ITEM.get()))
+ .save(consumer, recipeDir("ancient_planks_2", "shapelesscrafting"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ANCIENT_PLANKS.get(),4)
+ .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"));
+ .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)
+ .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"));
+ .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)
+ .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"));
-
+ .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)
+ .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"));
+ .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)
+ .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"));
+ .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)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.RAW_ALLTHEMODIUM.get()))
+ .save(consumer, recipeDir("allthemodium_dust", "ore_crushing"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ALLTHEMODIUM_INGOT.get(),9)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.ALLTHEMODIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("allthemodium_ingot", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(),9)
+ .shapeless(ModRegistry.ALLTHEMODIUM_NUGGET.get(), 9)
.requires(TagRegistry.ALLTHEMODIUM_INGOT)
- .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get()))
- .save(consumer,recipeDir("allthemodium_nugget","ingot"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.ALLTHEMODIUM_INGOT.get()))
+ .save(consumer, recipeDir("allthemodium_nugget", "ingot"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.VIBRANIUM_DUST.get(),2)
+ .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"));
-
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.RAW_VIBRANIUM.get()))
+ .save(consumer, recipeDir("vibranium_dust", "ore_crushing"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.UNOBTAINIUM_DUST.get(),2)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM.get()))
+ .save(consumer, recipeDir("unobtainium_dust", "ore_crushing"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.VIBRANIUM_INGOT.get(),9)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.VIBRANIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("vibranium_ingot", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(),9)
+ .shapeless(ModRegistry.VIBRANIUM_NUGGET.get(), 9)
.requires(TagRegistry.VIBRANIUM_INGOT)
- .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get()))
- .save(consumer,recipeDir("vibranium_nugget","ingot"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.VIBRANIUM_INGOT.get()))
+ .save(consumer, recipeDir("vibranium_nugget", "ingot"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.UNOBTAINIUM_INGOT.get(),9)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.UNOBTAINIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("unobtainium_ingot", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(),9)
+ .shapeless(ModRegistry.UNOBTAINIUM_NUGGET.get(), 9)
.requires(TagRegistry.UNOBTAINIUM_INGOT)
- .unlockedBy(hasCondition,RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get()))
- .save(consumer,recipeDir("unobtainium_nugget","ingot"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.UNOBTAINIUM_INGOT.get()))
+ .save(consumer, recipeDir("unobtainium_nugget", "ingot"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.RAW_ALLTHEMODIUM.get(),9)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(
+ ModRegistry.RAW_ALLTHEMODIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("raw_allthemodium", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.RAW_VIBRANIUM.get(),9)
+ .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"));
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.RAW_VIBRANIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("raw_vibranium", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.RAW_UNOBTAINIUM.get(),9)
+ .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"));
-
+ .unlockedBy(
+ hasCondition,
+ RecipeProvider.has(ModRegistry.RAW_UNOBTAINIUM_BLOCK_ITEM.get()))
+ .save(consumer, recipeDir("raw_unobtainium", "block"));
ShapelessRecipeBuilder
- .shapeless(ModRegistry.UNOBTAINIUM_ALLTHEMODIUM_ALLOY.get(),9)
+ .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"));
+ .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)
+ .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"));
+ .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)
+ .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"));
-
-
-}
+ .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..bf98c039 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,97 @@
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..a7a7f599 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,176 @@
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 extends Piglin> 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 +211,23 @@ 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 +242,19 @@ 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 +262,65 @@ 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 +333,19 @@ 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 +355,77 @@ 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 +433,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..b95ad3c2 100644
--- a/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java
+++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichModel.java
@@ -1,96 +1,365 @@
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() {
- }
+ }
+ @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..f38f914d 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,99 @@
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 +117,20 @@ 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 +140,69 @@ 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..5969ed1f 100644
--- a/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java
+++ b/src/main/java/com/thevortex/allthemodium/entity/PiglichRenderer.java
@@ -3,36 +3,47 @@
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..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
@@ -8,10 +8,20 @@
import net.minecraft.world.level.Level;
public class ATMShulkerEntity extends Shulker {
- public ATMShulkerEntity(EntityType extends Shulker> p_33404_, Level p_33405_) {
+
+ public ATMShulkerEntity(
+ EntityType extends Shulker> 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..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
@@ -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,22 @@
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 +35,57 @@ 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..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
@@ -2,24 +2,46 @@
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..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
@@ -8,10 +8,20 @@
import net.minecraft.world.level.Level;
public class UNOBShulkerEntity extends Shulker {
- public UNOBShulkerEntity(EntityType extends Shulker> p_33404_, Level p_33405_) {
+
+ public UNOBShulkerEntity(
+ EntityType extends Shulker> 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..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
@@ -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,16 @@
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 +35,57 @@ 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..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
@@ -2,24 +2,46 @@
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> {
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..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
@@ -8,10 +8,20 @@
import net.minecraft.world.level.Level;
public class VIBShulkerEntity extends Shulker {
- public VIBShulkerEntity(EntityType extends Shulker> p_33404_, Level p_33405_) {
+
+ public VIBShulkerEntity(
+ EntityType extends Shulker> 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..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
@@ -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,16 @@
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 +35,57 @@ 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..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
@@ -2,24 +2,46 @@
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..ac823ef8 100644
--- a/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java
+++ b/src/main/java/com/thevortex/allthemodium/events/ArmorEvents.java
@@ -1,68 +1,68 @@
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 e42cc34a..5c673e15 100644
--- a/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java
+++ b/src/main/java/com/thevortex/allthemodium/events/BlockBreak.java
@@ -1,54 +1,57 @@
package com.thevortex.allthemodium.events;
-
-import com.thevortex.allthemodium.AllTheModium;
-import com.thevortex.allthemodium.reference.Reference;
+import com.thevortex.allthemodium.config.AllthemodiumServerConfigs;
import com.thevortex.allthemodium.registry.TagRegistry;
-import net.minecraft.core.Registry;
-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; }
-
- if((event.getState().is(TagRegistry.OTHER_PROTECTION)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null)) && 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()))) {
-
- event.setCanceled(true);
- return;
- }
-
- if((event.getState().is(TagRegistry.VIBRANIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty()))) {
-
- event.setCanceled(true);
- return;
- }
- if((event.getState().is(TagRegistry.UNOBTAINIUM_ORE)) && ((event.getPlayer() instanceof FakePlayer) || (event.getPlayer() == null) || (event.getPlayer().getMainHandItem().isEmpty()))) {
-
- event.setCanceled(true);
- return;
- }
- if(event.getPlayer() instanceof FakePlayer) {
-
- 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;
+ }
+
+ 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..5d62e8b8 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;
@@ -16,51 +16,103 @@
@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..481cfe6e 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,168 @@
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..8588f447 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,168 @@
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..03277ab7 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,168 @@
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..3a76b94f 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,168 @@
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..f6b418cc 100644
--- a/src/main/java/com/thevortex/allthemodium/init/ModFoods.java
+++ b/src/main/java/com/thevortex/allthemodium/init/ModFoods.java
@@ -1,19 +1,32 @@
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..e9713dd3
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumApple.java
@@ -0,0 +1,60 @@
+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..8a4197dc
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumCarrot.java
@@ -0,0 +1,59 @@
+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..20bca7e1
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/AllthemodiumOreItem.java
@@ -0,0 +1,46 @@
+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 ef26489e..00000000
--- a/src/main/java/com/thevortex/allthemodium/items/Allthemodium_Ore_Item.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.thevortex.allthemodium.items;
-
-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));
- 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..45a7bd34 100644
--- a/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java
+++ b/src/main/java/com/thevortex/allthemodium/items/SoulBerries.java
@@ -1,36 +1,38 @@
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..ddadbb0d 100644
--- a/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java
+++ b/src/main/java/com/thevortex/allthemodium/items/SoulBucket.java
@@ -1,33 +1,31 @@
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 extends Fluid> supplier, Properties builder) {
- super(supplier, builder);
- }
+ public SoulBucket(Supplier extends Fluid> 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..b7f5c246
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/UnobtainiumOreItem.java
@@ -0,0 +1,46 @@
+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 61dbe3e4..00000000
--- a/src/main/java/com/thevortex/allthemodium/items/Unobtainium_Ore_Item.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.thevortex.allthemodium.items;
-
-
-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));
- 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/VibraniumOreItem.java b/src/main/java/com/thevortex/allthemodium/items/VibraniumOreItem.java
new file mode 100644
index 00000000..335173f8
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/VibraniumOreItem.java
@@ -0,0 +1,46 @@
+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 VibraniumOreItem extends BlockItem {
+
+ public VibraniumOreItem(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/Vibranium_Ore_Item.java b/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java
deleted file mode 100644
index 139a9112..00000000
--- a/src/main/java/com/thevortex/allthemodium/items/Vibranium_Ore_Item.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.thevortex.allthemodium.items;
-
-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 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));
- 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/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..4714f03e 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,37 @@
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..a1d55067
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumChestplate.java
@@ -0,0 +1,33 @@
+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..a60f5db2
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumHelmet.java
@@ -0,0 +1,47 @@
+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..ea6b6ff3
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/AllthemodiumLeggings.java
@@ -0,0 +1,33 @@
+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..c7d5f88b
--- /dev/null
+++ b/src/main/java/com/thevortex/allthemodium/items/toolitems/armor/models/AllthemodiumHelmetModel.java
@@ -0,0 +1,173 @@
+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..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
@@ -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,62 @@
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)
- {
- if (state.is(BlockTags.MINEABLE_WITH_AXE)) return speed;
+ 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)
- {
+ public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
if (state.is(BlockTags.MINEABLE_WITH_AXE))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLOY_TIER,
+ state);
if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ 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..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
@@ -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,86 @@
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) {
+ 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 (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 +112,208 @@ 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)
- {
+ public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
if (state.is(BlockTags.MINEABLE_WITH_PICKAXE))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLTHEMODIUM_TIER,
+ state);
if (state.is(BlockTags.MINEABLE_WITH_HOE))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLTHEMODIUM_TIER,
+ state);
if (state.is(BlockTags.MINEABLE_WITH_SHOVEL))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLTHEMODIUM_TIER,
+ state);
if (state.is(BlockTags.MINEABLE_WITH_AXE))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLTHEMODIUM_TIER,
+ state);
if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLTHEMODIUM_TIER, state);
+ 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..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
@@ -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,66 @@
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)
- {
- if (state.is(BlockTags.MINEABLE_WITH_PICKAXE)) return speed;
+ 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)
- {
+ public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
if (state.is(BlockTags.MINEABLE_WITH_PICKAXE))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLOY_TIER,
+ state);
if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ 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..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
@@ -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,66 @@
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)
- {
- if (state.is(BlockTags.MINEABLE_WITH_SHOVEL)) return speed;
+ 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)
- {
+ public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
if (state.is(BlockTags.MINEABLE_WITH_SHOVEL))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ return TierSortingRegistry.isCorrectTierForDrops(
+ ToolTiers.ALLOY_TIER,
+ state);
if (state.is(ToolTiers.ALLTHEMODIUM_TOOL_TAG))
- return TierSortingRegistry.isCorrectTierForDrops(ToolTiers.ALLOY_TIER, state);
+ 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..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
@@ -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,44 @@
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..6d29f5b1 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,88 @@
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..22c9b3e4 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,37 @@
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