From 0346a29ed4a39e30d1a5bc1693661b0e17a87e7e Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Fri, 12 Jan 2024 18:17:20 -0800 Subject: [PATCH] Update copyright, code cleanup, and default world type option --- changelog.md | 1 + .../java/thedarkcolour/exdeorum/ExDeorum.java | 2 +- .../thedarkcolour/exdeorum/asm/ASMHooks.java | 19 ++- .../exdeorum/asm/package-info.java | 21 ++++ .../exdeorum/block/AbstractCrucibleBlock.java | 3 +- .../exdeorum/block/BarrelBlock.java | 9 +- .../thedarkcolour/exdeorum/block/EBlock.java | 4 +- .../exdeorum/block/EndCakeBlock.java | 2 +- .../exdeorum/block/InfestedLeavesBlock.java | 4 +- .../exdeorum/block/LavaCrucibleBlock.java | 2 +- .../exdeorum/block/MechanicalSieveBlock.java | 1 + .../exdeorum/block/SieveBlock.java | 2 +- .../exdeorum/block/UnfiredCrucibleBlock.java | 2 +- .../exdeorum/block/WaterCrucibleBlock.java | 2 +- .../exdeorum/block/WitchWaterBlock.java | 6 +- .../exdeorum/block/package-info.java | 2 +- .../AbstractCrucibleBlockEntity.java | 2 +- .../blockentity/BarrelBlockEntity.java | 108 +++++++++--------- .../exdeorum/blockentity/EBlockEntity.java | 2 +- .../InfestedLeavesBlockEntity.java | 2 +- .../blockentity/LavaCrucibleBlockEntity.java | 4 +- .../blockentity/SieveBlockEntity.java | 2 +- .../blockentity/WaterCrucibleBlockEntity.java | 2 +- .../blockentity/helper/package-info.java | 21 ++++ .../blockentity/logic/SieveLogic.java | 15 --- .../blockentity/logic/package-info.java | 21 ++++ .../exdeorum/blockentity/package-info.java | 2 +- .../exdeorum/client/ClientHandler.java | 5 +- .../exdeorum/client/CompostColors.java | 2 +- .../exdeorum/client/RenderUtil.java | 2 +- .../exdeorum/client/package-info.java | 2 +- .../client/screen/MechanicalSieveScreen.java | 1 - .../exdeorum/client/screen/package-info.java | 2 +- .../exdeorum/client/ter/BarrelRenderer.java | 6 +- .../exdeorum/client/ter/CrucibleRenderer.java | 2 +- .../client/ter/InfestedLeavesRenderer.java | 3 +- .../exdeorum/client/ter/SieveRenderer.java | 2 +- .../exdeorum/client/ter/package-info.java | 21 ++++ .../thedarkcolour/exdeorum/compat/ModIds.java | 4 +- .../exdeorum/compat/PreferredOres.java | 2 +- .../compat/jei/BarrelCompostCategory.java | 2 +- .../compat/jei/BarrelMixingCategory.java | 12 +- .../exdeorum/compat/jei/ClientJeiUtil.java | 6 +- .../exdeorum/compat/jei/CrucibleCategory.java | 2 +- .../compat/jei/CrucibleHeatSourceRecipe.java | 10 +- .../jei/CrucibleHeatSourcesCategory.java | 19 ++- .../compat/jei/ExDeorumJeiPlugin.java | 2 +- .../exdeorum/compat/jei/HammerCategory.java | 2 +- .../exdeorum/compat/jei/OneToOneCategory.java | 8 +- .../exdeorum/compat/jei/SieveCategory.java | 2 +- .../exdeorum/compat/jei/package-info.java | 2 +- .../compat/kubejs/ExDeorumKubeJsBindings.java | 2 +- .../compat/kubejs/ExDeorumKubeJsPlugin.java | 2 +- .../compat/kubejs/SieveMeshFilter.java | 2 +- .../exdeorum/compat/kubejs/package-info.java | 21 ++++ .../exdeorum/compat/package-info.java | 21 ++++ .../compat/top/ExDeorumInfoProvider.java | 2 +- .../compat/top/ExDeorumTopCompat.java | 2 +- .../exdeorum/compat/top/package-info.java | 21 ++++ .../exdeorum/config/EConfig.java | 20 +--- .../exdeorum/config/package-info.java | 21 ++++ .../exdeorum/data/Advancements.java | 2 +- .../exdeorum/data/BlockLoot.java | 6 +- .../exdeorum/data/BlockModels.java | 2 +- .../thedarkcolour/exdeorum/data/Data.java | 2 +- .../thedarkcolour/exdeorum/data/English.java | 2 +- .../exdeorum/data/ItemModels.java | 2 +- .../exdeorum/data/LootTables.java | 2 +- .../exdeorum/data/ModCompatData.java | 2 +- .../thedarkcolour/exdeorum/data/ModTags.java | 2 +- .../exdeorum/data/TranslationKeys.java | 2 +- .../exdeorum/data/package-info.java | 2 +- .../exdeorum/data/recipe/Recipes.java | 3 +- .../exdeorum/data/recipe/SieveRecipes.java | 2 +- .../exdeorum/data/recipe/package-info.java | 21 ++++ .../exdeorum/event/ClientsideCode.java | 4 +- .../exdeorum/event/EventHandler.java | 4 +- .../exdeorum/event/package-info.java | 21 ++++ .../exdeorum/fluid/WitchWaterFluid.java | 2 +- .../exdeorum/fluid/package-info.java | 21 ++++ .../exdeorum/item/CookedSilkWormItem.java | 2 +- .../exdeorum/item/CrookItem.java | 4 +- .../exdeorum/item/GrassSpreaderItem.java | 5 +- .../exdeorum/item/HammerItem.java | 2 +- .../thedarkcolour/exdeorum/item/MeshItem.java | 2 +- .../exdeorum/item/NyliumSpreaderItem.java | 2 +- .../exdeorum/item/PorcelainBucket.java | 6 +- .../exdeorum/item/PorcelainMilkBucket.java | 2 +- .../exdeorum/item/RandomResultItem.java | 2 +- .../exdeorum/item/SculkCoreItem.java | 2 +- .../exdeorum/item/SilkWormItem.java | 3 +- .../exdeorum/item/WateringCanItem.java | 10 +- .../exdeorum/item/WideWateringCanItem.java | 2 +- .../exdeorum/item/WitchWaterBucketItem.java | 2 +- .../exdeorum/item/package-info.java | 2 +- .../exdeorum/loot/CrookLootModifier.java | 2 +- .../exdeorum/loot/HammerLootModifier.java | 2 +- .../exdeorum/loot/InfestedStringFunction.java | 2 +- .../exdeorum/loot/package-info.java | 21 ++++ .../exdeorum/menu/package-info.java | 2 +- .../network/ClientMessageHandler.java | 2 +- .../exdeorum/network/NetworkHandler.java | 3 +- .../exdeorum/network/PlayerDataMessage.java | 2 +- .../exdeorum/network/VoidWorldMessage.java | 2 +- .../exdeorum/network/package-info.java | 21 ++++ .../thedarkcolour/exdeorum/package-info.java | 21 ++++ .../recipe/BarrelFluidMixingRecipeCache.java | 10 +- .../exdeorum/recipe/CodecUtil.java | 10 +- .../exdeorum/recipe/EFinishedRecipe.java | 2 +- .../exdeorum/recipe/ProbabilityRecipe.java | 2 +- .../exdeorum/recipe/RecipeUtil.java | 2 +- .../exdeorum/recipe/SieveRecipeCache.java | 10 +- .../recipe/SingleIngredientRecipe.java | 8 +- .../recipe/SingleIngredientRecipeCache.java | 14 +-- .../exdeorum/recipe/TagResultRecipe.java | 2 +- .../recipe/barrel/BarrelCompostRecipe.java | 4 +- .../barrel/BarrelFluidMixingRecipe.java | 2 +- .../recipe/barrel/BarrelMixingRecipe.java | 6 +- .../barrel/FinishedBarrelCompostRecipe.java | 8 +- .../FinishedBarrelFluidMixingRecipe.java | 2 +- .../barrel/FinishedBarrelMixingRecipe.java | 2 +- .../exdeorum/recipe/barrel/package-info.java | 2 +- .../recipe/crucible/CrucibleRecipe.java | 10 +- .../crucible/FinishedCrucibleRecipe.java | 10 +- .../recipe/crucible/package-info.java | 2 +- .../recipe/hammer/FinishedHammerRecipe.java | 8 +- .../exdeorum/recipe/hammer/HammerRecipe.java | 2 +- .../exdeorum/recipe/hammer/package-info.java | 2 +- .../exdeorum/recipe/package-info.java | 2 +- .../recipe/sieve/FinishedSieveRecipe.java | 3 +- .../exdeorum/recipe/sieve/SieveRecipe.java | 4 +- .../exdeorum/recipe/sieve/package-info.java | 21 ++++ .../exdeorum/registry/EBlockEntities.java | 5 +- .../exdeorum/registry/EBlocks.java | 2 +- .../exdeorum/registry/EChunkGenerators.java | 2 +- .../exdeorum/registry/ECreativeTabs.java | 2 +- .../exdeorum/registry/EFluids.java | 2 +- .../registry/EGlobalLootModifiers.java | 2 +- .../exdeorum/registry/EItems.java | 4 +- .../exdeorum/registry/ELootFunctions.java | 2 +- .../exdeorum/registry/ERecipeSerializers.java | 2 +- .../exdeorum/registry/ERecipeTypes.java | 2 +- .../exdeorum/registry/EWorldPresets.java | 2 +- .../exdeorum/registry/package-info.java | 21 ++++ .../exdeorum/tag/EBiomeTags.java | 2 +- .../exdeorum/tag/EBlockTags.java | 2 +- .../thedarkcolour/exdeorum/tag/EItemTags.java | 2 +- .../exdeorum/tag/EStructureSetTags.java | 2 +- .../exdeorum/tag/package-info.java | 21 ++++ .../voidworld/VoidChunkGenerator.java | 28 ++--- .../exdeorum/voidworld/package-info.java | 21 ++++ src/main/resources/coremods.js | 6 +- 152 files changed, 673 insertions(+), 339 deletions(-) create mode 100644 src/main/java/thedarkcolour/exdeorum/asm/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/blockentity/helper/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/blockentity/logic/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/client/ter/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/compat/kubejs/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/compat/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/compat/top/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/config/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/data/recipe/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/event/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/fluid/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/loot/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/network/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/recipe/sieve/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/registry/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/tag/package-info.java create mode 100644 src/main/java/thedarkcolour/exdeorum/voidworld/package-info.java diff --git a/changelog.md b/changelog.md index 2497c676..d2345ab9 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ - Added `by_hand_only` boolean field to Sieve recipes, which allows modpack makers to add sieve drops that don't drop from the Mechanical Sieve. - Added JEI information telling the player that meshes can be enchanted with Fortune and Efficiency. - Fixed minor rendering bug with infested leaves and Ars Nouveau leaves not rotating properly. +- Fixed bugged config option to disable Void World by default. Now, instead of being two options in the client and server configs, there is one option in the common config file that controls default world type both on the create world screen and in server.properties. - Optimized syncing block entity visual updates from the server to the client. ## Ex Deorum 1.13 diff --git a/src/main/java/thedarkcolour/exdeorum/ExDeorum.java b/src/main/java/thedarkcolour/exdeorum/ExDeorum.java index bec5227b..67f71914 100644 --- a/src/main/java/thedarkcolour/exdeorum/ExDeorum.java +++ b/src/main/java/thedarkcolour/exdeorum/ExDeorum.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/asm/ASMHooks.java b/src/main/java/thedarkcolour/exdeorum/asm/ASMHooks.java index cd3daa86..5940e888 100644 --- a/src/main/java/thedarkcolour/exdeorum/asm/ASMHooks.java +++ b/src/main/java/thedarkcolour/exdeorum/asm/ASMHooks.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,16 @@ package thedarkcolour.exdeorum.asm; import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.levelgen.presets.WorldPreset; +import net.minecraft.world.level.levelgen.presets.WorldPresets; import net.minecraft.world.level.levelgen.structure.Structure; +import thedarkcolour.exdeorum.config.EConfig; +import thedarkcolour.exdeorum.registry.EWorldPresets; import thedarkcolour.exdeorum.voidworld.VoidChunkGenerator; +import java.util.Properties; + @SuppressWarnings("unused") public final class ASMHooks { /** @@ -38,7 +45,7 @@ public final class ASMHooks { /** * Called in {@link net.minecraft.world.level.dimension.end.EndDragonFight#spawnExitPortal(boolean)} - * right before EndPodiumFeature.place is called to fix End Portal not spawning fully, + * right before {@code EndPodiumFeature.place} is called to fix End Portal not spawning fully, * with part of it being generated outside the world in the void. */ public static BlockPos prePlaceEndPodium(BlockPos pos) { @@ -48,4 +55,12 @@ public final class ASMHooks { return pos.immutable(); } } + + /** + * Called in {@link net.minecraft.server.dedicated.DedicatedServerProperties#DedicatedServerProperties(Properties)} + * where {@code WorldPresets.NORMAL} is used in the line that looks like {@code WorldPresets.NORMAL.location().toString()} + */ + public static ResourceKey overrideDefaultWorldPreset() { + return EConfig.COMMON.setVoidWorldAsDefault.get() ? EWorldPresets.VOID_WORLD : WorldPresets.NORMAL; + } } diff --git a/src/main/java/thedarkcolour/exdeorum/asm/package-info.java b/src/main/java/thedarkcolour/exdeorum/asm/package-info.java new file mode 100644 index 00000000..f21ee6c7 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/asm/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.asm; diff --git a/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java b/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java index 4068cf96..a3e62813 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/AbstractCrucibleBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,6 +51,7 @@ public abstract class AbstractCrucibleBlock extends EBlock { return 0; } + @SuppressWarnings("unchecked") @Nullable @Override public BlockEntityTicker getTicker(Level level, BlockState pState, BlockEntityType type) { diff --git a/src/main/java/thedarkcolour/exdeorum/block/BarrelBlock.java b/src/main/java/thedarkcolour/exdeorum/block/BarrelBlock.java index c31e6213..515284c5 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/BarrelBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/BarrelBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,18 +19,13 @@ package thedarkcolour.exdeorum.block; import net.minecraft.core.BlockPos; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -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.Block; -import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; @@ -38,7 +33,6 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import thedarkcolour.exdeorum.blockentity.BarrelBlockEntity; import thedarkcolour.exdeorum.registry.EBlockEntities; -import thedarkcolour.exdeorum.registry.EBlocks; public class BarrelBlock extends EBlock { public static final VoxelShape SHAPE = Shapes.join( @@ -51,6 +45,7 @@ public class BarrelBlock extends EBlock { super(properties, EBlockEntities.BARREL); } + @SuppressWarnings("unchecked") @Nullable @Override public BlockEntityTicker getTicker(Level level, BlockState pState, BlockEntityType type) { diff --git a/src/main/java/thedarkcolour/exdeorum/block/EBlock.java b/src/main/java/thedarkcolour/exdeorum/block/EBlock.java index 8c344a99..7d76378b 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/EBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/EBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ public abstract class EBlock extends Block implements EntityBlock { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return blockEntityType.get().create(pos, state); + return this.blockEntityType.get().create(pos, state); } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/block/EndCakeBlock.java b/src/main/java/thedarkcolour/exdeorum/block/EndCakeBlock.java index 10b09ee9..286ea540 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/EndCakeBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/EndCakeBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java b/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java index fa72e650..14adb076 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ package thedarkcolour.exdeorum.block; 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.entity.player.Player; @@ -37,7 +36,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.fml.loading.FMLEnvironment; import org.jetbrains.annotations.Nullable; import thedarkcolour.exdeorum.blockentity.InfestedLeavesBlockEntity; import thedarkcolour.exdeorum.client.RenderUtil; diff --git a/src/main/java/thedarkcolour/exdeorum/block/LavaCrucibleBlock.java b/src/main/java/thedarkcolour/exdeorum/block/LavaCrucibleBlock.java index 97800d15..5d57d29c 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/LavaCrucibleBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/LavaCrucibleBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/block/MechanicalSieveBlock.java b/src/main/java/thedarkcolour/exdeorum/block/MechanicalSieveBlock.java index c379d9c4..da3e56c3 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/MechanicalSieveBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/MechanicalSieveBlock.java @@ -65,6 +65,7 @@ public class MechanicalSieveBlock extends EBlock { return SHAPE; } + @SuppressWarnings("unchecked") @Nullable @Override public BlockEntityTicker getTicker(Level level, BlockState pState, BlockEntityType type) { diff --git a/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java b/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java index 45f3fc23..37efda92 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/block/UnfiredCrucibleBlock.java b/src/main/java/thedarkcolour/exdeorum/block/UnfiredCrucibleBlock.java index d78116a1..4575a490 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/UnfiredCrucibleBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/UnfiredCrucibleBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/block/WaterCrucibleBlock.java b/src/main/java/thedarkcolour/exdeorum/block/WaterCrucibleBlock.java index 06b4588a..d1f22fc8 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/WaterCrucibleBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/WaterCrucibleBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/block/WitchWaterBlock.java b/src/main/java/thedarkcolour/exdeorum/block/WitchWaterBlock.java index 75b9dea7..2ecf496c 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/WitchWaterBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/WitchWaterBlock.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FlowingFluid; +import net.minecraftforge.event.ForgeEventFactory; import org.jetbrains.annotations.Nullable; import thedarkcolour.exdeorum.config.EConfig; @@ -114,7 +115,6 @@ public class WitchWaterBlock extends LiquidBlock { } } - @SuppressWarnings("deprecation") @Nullable private static T attemptToConvertEntity(Level level, Entity entity, EntityType newType) { if (level.getDifficulty() != Difficulty.PEACEFUL && entity instanceof LivingEntity) { @@ -123,7 +123,7 @@ public class WitchWaterBlock extends LiquidBlock { if (newEntity != null) { var serverLevel = (ServerLevelAccessor) level; newEntity.copyPosition(entity); - newEntity.finalizeSpawn(serverLevel, level.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.CONVERSION, null, null); + ForgeEventFactory.onFinalizeSpawn(newEntity, serverLevel, level.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.CONVERSION, null, null); newEntity.setNoAi(newEntity.isNoAi()); if (entity.hasCustomName()) { diff --git a/src/main/java/thedarkcolour/exdeorum/block/package-info.java b/src/main/java/thedarkcolour/exdeorum/block/package-info.java index 2074503e..bcd5b573 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/block/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java index eead6c77..db7f0485 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java index f5ce5510..d3f2b37f 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,16 +81,16 @@ public class BarrelBlockEntity extends EBlockEntity { super(EBlockEntities.BARREL.get(), pos, state); } - private final LazyOptional itemHandler = LazyOptional.of(() -> item); - private final LazyOptional fluidHandler = LazyOptional.of(() -> tank); + private final LazyOptional itemHandler = LazyOptional.of(() -> this.item); + private final LazyOptional fluidHandler = LazyOptional.of(() -> this.tank); @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { if (cap == ForgeCapabilities.FLUID_HANDLER) { - return fluidHandler.cast(); + return this.fluidHandler.cast(); } else if (cap == ForgeCapabilities.ITEM_HANDLER) { - return itemHandler.cast(); + return this.itemHandler.cast(); } return super.getCapability(cap, side); @@ -107,13 +107,13 @@ public class BarrelBlockEntity extends EBlockEntity { public void saveAdditional(CompoundTag nbt) { super.saveAdditional(nbt); - nbt.put("item", item.serializeNBT()); - nbt.put("tank", tank.writeToNBT(new CompoundTag())); - nbt.putShort("compost", compost); - nbt.putFloat("progress", progress); - nbt.putShort("r", r); - nbt.putShort("g", g); - nbt.putShort("b", b); + nbt.put("item", this.item.serializeNBT()); + nbt.put("tank", this.tank.writeToNBT(new CompoundTag())); + nbt.putShort("compost", this.compost); + nbt.putFloat("progress", this.progress); + nbt.putShort("r", this.r); + nbt.putShort("g", this.g); + nbt.putShort("b", this.b); } @Override @@ -130,25 +130,25 @@ public class BarrelBlockEntity extends EBlockEntity { } public boolean isBrewing() { - return tank.getFluidAmount() == 1000 && progress != 0.0f && !isBurning(); + return this.tank.getFluidAmount() == 1000 && this.progress != 0.0f && !isBurning(); } public boolean isBurning() { - return isHotFluid(tank.getFluid().getFluid().getFluidType()) && progress != 0.0f; + return isHotFluid(this.tank.getFluid().getFluid().getFluidType()) && this.progress != 0.0f; } // Composting is in progress if at 1000. When finished, compost is set back to 0 public boolean isComposting() { - return compost == 1000; + return this.compost == 1000; } // Returns true if there are no solid ingredients (can a fluid be inserted?) public boolean hasNoSolids() { - return compost <= 0 && item.getStackInSlot(0).isEmpty(); + return this.compost <= 0 && this.item.getStackInSlot(0).isEmpty(); } public boolean hasFullWater() { - return tank.getFluidAmount() == 1000 && tank.getFluid().getFluid().is(FluidTags.WATER); + return this.tank.getFluidAmount() == 1000 && this.tank.getFluid().getFluid().is(FluidTags.WATER); } // Burning temp of wood according to google is 300 C or ~575 kelvin @@ -160,18 +160,18 @@ public class BarrelBlockEntity extends EBlockEntity { private void spawnParticlesIfBurning() { if (isBurning()) { BlockPos pos = getBlockPos(); - int burnTicks = (int) (progress * 300); + int burnTicks = (int) (this.progress * 300); if (burnTicks % 30 == 0) { - level.addParticle(ParticleTypes.LARGE_SMOKE, pos.getX() + Math.random(), pos.getY() + 1.2, pos.getZ() + Math.random(), 0.0, 0.0, 0.0); + this.level.addParticle(ParticleTypes.LARGE_SMOKE, pos.getX() + Math.random(), pos.getY() + 1.2, pos.getZ() + Math.random(), 0.0, 0.0, 0.0); } else if (burnTicks % 5 == 0) { - level.addParticle(ParticleTypes.SMOKE, pos.getX() + Math.random(), pos.getY() + 1.2, pos.getZ() + Math.random(), 0.0, 0.0, 0.0); + this.level.addParticle(ParticleTypes.SMOKE, pos.getX() + Math.random(), pos.getY() + 1.2, pos.getZ() + Math.random(), 0.0, 0.0, 0.0); } } } public ItemStack getItem() { - return item.getStackInSlot(0); + return this.item.getStackInSlot(0); } private void setItem(ItemStack item) { @@ -200,8 +200,8 @@ public class BarrelBlockEntity extends EBlockEntity { tryInWorldFluidMixing(); // If the item is a fluid handler, try to transfer fluids - if (wasBurning && !isHotFluid(tank.getFluid().getFluid().getFluidType())) { - progress = 0.0f; + if (wasBurning && !isHotFluid(this.tank.getFluid().getFluid().getFluidType())) { + this.progress = 0.0f; } return InteractionResult.sidedSuccess(level.isClientSide); @@ -213,19 +213,19 @@ public class BarrelBlockEntity extends EBlockEntity { var fluid = new FluidStack(Fluids.WATER, 250); if (playerItem.getItem() == Items.POTION && PotionUtils.getPotion(playerItem) == Potions.WATER) { - if (tank.fill(fluid, IFluidHandler.FluidAction.SIMULATE) > 0) { + if (this.tank.fill(fluid, IFluidHandler.FluidAction.SIMULATE) > 0) { if (!player.getAbilities().instabuild) { player.setItemInHand(hand, new ItemStack(Items.GLASS_BOTTLE)); } - tank.fill(fluid, IFluidHandler.FluidAction.EXECUTE); + this.tank.fill(fluid, IFluidHandler.FluidAction.EXECUTE); level.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.BOTTLE_FILL, SoundSource.NEUTRAL, 1.0F, 1.0F); markUpdated(); return InteractionResult.sidedSuccess(level.isClientSide); } } else if (playerItem.getItem() == Items.GLASS_BOTTLE) { - if (tank.drain(fluid, IFluidHandler.FluidAction.SIMULATE).getAmount() == 250) { - extractWaterBottle(tank, level, player, playerItem, fluid); + if (this.tank.drain(fluid, IFluidHandler.FluidAction.SIMULATE).getAmount() == 250) { + extractWaterBottle(this.tank, level, player, playerItem, fluid); markUpdated(); return InteractionResult.sidedSuccess(level.isClientSide); @@ -238,7 +238,7 @@ public class BarrelBlockEntity extends EBlockEntity { if (itemFluidCap.isPresent()) { var fluidInTank = itemFluidCap.get().getFluidInTank(0); - if (tank.getFluidAmount() >= 1000) { + if (this.tank.getFluidAmount() >= 1000) { if (!level.isClientSide) { tryFluidMixing(fluidInTank.getFluid()); } @@ -253,7 +253,7 @@ public class BarrelBlockEntity extends EBlockEntity { var playerItem = player.getItemInHand(hand); if (!level.isClientSide) { // mix item ingredient into fluid OR turn into compost (delegated to item handler) - var handItem = item.insertItem(0, player.getAbilities().instabuild ? playerItem.copy() : playerItem, false); + var handItem = this.item.insertItem(0, player.getAbilities().instabuild ? playerItem.copy() : playerItem, false); if (!player.getAbilities().instabuild) { player.setItemInHand(hand, handItem); @@ -280,7 +280,7 @@ public class BarrelBlockEntity extends EBlockEntity { // Pops the item out of the barrel (ex. dirt that has finished composting) private InteractionResult giveResultItem(Level level) { if (!level.isClientSide) { - popOutItem(level, this.worldPosition, item.extract(false)); + popOutItem(level, this.worldPosition, this.item.extract(false)); // Empty contents setItem(ItemStack.EMPTY); @@ -306,7 +306,7 @@ public class BarrelBlockEntity extends EBlockEntity { */ private boolean tryCrafting(ItemStack input, boolean simulate) { boolean crafted = false; - if (!tank.isEmpty()) { + if (!this.tank.isEmpty()) { crafted = tryMixing(input, simulate); } else if (!isComposting()) { crafted = tryComposting(input, simulate); @@ -332,15 +332,15 @@ public class BarrelBlockEntity extends EBlockEntity { return false; } - var recipe = RecipeUtil.getBarrelMixingRecipe(level.getRecipeManager(), playerItem, this.tank.getFluid()); + var recipe = RecipeUtil.getBarrelMixingRecipe(this.level.getRecipeManager(), playerItem, this.tank.getFluid()); if (recipe != null) { if (!simulate) { // Empty barrel - tank.drain(recipe.fluidAmount, IFluidHandler.FluidAction.EXECUTE); + this.tank.drain(recipe.fluidAmount, IFluidHandler.FluidAction.EXECUTE); // Replace fluid with result setItem(new ItemStack(recipe.result)); - level.playSound(null, worldPosition, SoundEvents.AMBIENT_UNDERWATER_EXIT, SoundSource.BLOCKS, 0.8f, 0.8f); + this.level.playSound(null, this.worldPosition, SoundEvents.AMBIENT_UNDERWATER_EXIT, SoundSource.BLOCKS, 0.8f, 0.8f); } // Mixing was successful, so return true return true; @@ -364,24 +364,24 @@ public class BarrelBlockEntity extends EBlockEntity { } private void addCompost(ItemStack playerItem, int volume) { - int oldCompost = compost; - compost = (short) Math.min(1000, compost + volume); + int oldCompost = this.compost; + this.compost = (short) Math.min(1000, this.compost + volume); - if (compost != 0) { + if (this.compost != 0) { if (!CompostColors.isLoaded()) { CompostColors.loadColors(); } - float weightNew = (float) (compost - oldCompost) / compost; + float weightNew = (float) (this.compost - oldCompost) / this.compost; float weightOld = 1 - weightNew; var color = CompostColors.COLORS.getOrDefault(playerItem.getItem(), CompostColors.DEFAULT_COLOR); - r = (short) (weightNew * color.x + weightOld * r); - g = (short) (weightNew * color.y + weightOld * g); - b = (short) (weightNew * color.z + weightOld * b); + this.r = (short) (weightNew * color.x + weightOld * this.r); + this.g = (short) (weightNew * color.y + weightOld * this.g); + this.b = (short) (weightNew * color.z + weightOld * this.b); } - level.playSound(null, worldPosition, SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS); + this.level.playSound(null, this.worldPosition, SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS); } /** @@ -391,8 +391,8 @@ public class BarrelBlockEntity extends EBlockEntity { *
  • When the fluid in the barrel changes (see {@link FluidHandler#onContentsChanged()})
  • */ public void tryInWorldFluidMixing() { - if (!tank.isEmpty() && item.getStackInSlot(0).isEmpty()) { - var aboveFluid = level.getBlockState(worldPosition.above()).getFluidState().getType(); + if (!this.tank.isEmpty() && this.item.getStackInSlot(0).isEmpty()) { + var aboveFluid = this.level.getBlockState(this.worldPosition.above()).getFluidState().getType(); if (aboveFluid != Fluids.EMPTY) { tryFluidMixing(aboveFluid); @@ -401,10 +401,10 @@ public class BarrelBlockEntity extends EBlockEntity { } private void tryFluidMixing(Fluid additive) { - BarrelFluidMixingRecipe recipe = RecipeUtil.getFluidMixingRecipe(tank.getFluid(), additive); + BarrelFluidMixingRecipe recipe = RecipeUtil.getFluidMixingRecipe(this.tank.getFluid(), additive); if (recipe != null) { - tank.drain(recipe.baseFluidAmount, IFluidHandler.FluidAction.EXECUTE); + this.tank.drain(recipe.baseFluidAmount, IFluidHandler.FluidAction.EXECUTE); setItem(new ItemStack(recipe.result)); } } @@ -494,14 +494,14 @@ public class BarrelBlockEntity extends EBlockEntity { } private void doCompost() { - progress += getProgressStep(); + this.progress += getProgressStep(); markUpdated(); - if (progress >= 1.0f) { - progress = 0.0f; - compost = 0; + if (this.progress >= 1.0f) { + this.progress = 0.0f; + this.compost = 0; setItem(new ItemStack(Items.DIRT)); - level.playSound(null, worldPosition, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS); + this.level.playSound(null, this.worldPosition, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS); } } @@ -531,14 +531,14 @@ public class BarrelBlockEntity extends EBlockEntity { if (stack.isEmpty()) return ItemStack.EMPTY; validateSlotIndex(slot); - if (!stacks.get(slot).isEmpty()) + if (!this.stacks.get(slot).isEmpty()) return stack; if (tryCrafting(stack, simulate)) { if (stack.getCount() == 1) { return getRemainderItem(stack); } else { - popOutItem(level, worldPosition, getRemainderItem(stack)); + popOutItem(BarrelBlockEntity.this.level, BarrelBlockEntity.this.worldPosition, getRemainderItem(stack)); return ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - 1); } } else { @@ -558,7 +558,7 @@ public class BarrelBlockEntity extends EBlockEntity { @Override protected void onContentsChanged(int slot) { - if (!level.isClientSide) { + if (!BarrelBlockEntity.this.level.isClientSide) { markUpdated(); } } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/EBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/EBlockEntity.java index b47fcb31..4df6d17e 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/EBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/EBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java index 20c3508a..1acf4748 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/LavaCrucibleBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/LavaCrucibleBlockEntity.java index 8aa4049c..2449ece1 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/LavaCrucibleBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/LavaCrucibleBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,7 +93,7 @@ public class LavaCrucibleBlockEntity extends AbstractCrucibleBlockEntity { @Override public int getMeltingRate() { - BlockState state = level.getBlockState(getBlockPos().below()); + BlockState state = this.level.getBlockState(getBlockPos().below()); return HEAT_REGISTRY.getInt(state); } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/SieveBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/SieveBlockEntity.java index 2e822399..3ef676a4 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/SieveBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/SieveBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/WaterCrucibleBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/WaterCrucibleBlockEntity.java index 21b65848..6ee35e5e 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/WaterCrucibleBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/WaterCrucibleBlockEntity.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/package-info.java b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/package-info.java new file mode 100644 index 00000000..8b11a89a --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.blockentity.helper; diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java index c02c8fc2..f2a6780a 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java @@ -199,21 +199,6 @@ public class SieveLogic { this.progress = progress; } - public CompoundTag writeUpdateTag() { - var tag = new CompoundTag(); - tag.putBoolean("logic", true); - tag.putFloat("progress", this.progress); - tag.put("mesh", this.mesh.serializeNBT()); - tag.put("contents", this.contents.serializeNBT()); - return tag; - } - - public void readUpdateTag(CompoundTag nbt) { - this.progress = nbt.getFloat("progress"); - this.mesh = nbt.contains("mesh") ? ItemStack.of(nbt.getCompound("mesh")) : ItemStack.EMPTY; - this.contents = nbt.contains("contents") ? ItemStack.of(nbt.getCompound("contents")) : ItemStack.EMPTY; - } - // implement on the owner of this sieve logic public interface Owner { ServerLevel getServerLevel(); diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/package-info.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/package-info.java new file mode 100644 index 00000000..e8de7280 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.blockentity.logic; diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/package-info.java b/src/main/java/thedarkcolour/exdeorum/blockentity/package-info.java index ff3d2da5..782f7965 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java index 664886ed..1e9a3062 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +58,6 @@ import thedarkcolour.exdeorum.registry.EMenus; import thedarkcolour.exdeorum.registry.EWorldPresets; import java.io.IOException; -import java.text.DecimalFormat; public class ClientHandler { // Used for the composting recipe category in JEI @@ -152,7 +151,7 @@ public class ClientHandler { // Sets Ex Deorum world type as default private static void onScreenOpen(ScreenEvent.Opening event) { - if (EConfig.CLIENT.setVoidWorldAsDefault.get()) { + if (EConfig.CLIENT.setVoidWorldAsDefault.get() && EConfig.COMMON.setVoidWorldAsDefault.get()) { if (event.getNewScreen() instanceof CreateWorldScreen screen) { var ctx = screen.getUiState().getSettings(); screen.getUiState().setWorldType(new WorldCreationUiState.WorldTypeEntry(ctx.worldgenLoadContext().registryOrThrow(Registries.WORLD_PRESET).getHolder(EWorldPresets.VOID_WORLD).orElse(null))); diff --git a/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java b/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java index d7a6be57..a8b4db75 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java +++ b/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java b/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java index 1cc0f0d3..82c36178 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/package-info.java b/src/main/java/thedarkcolour/exdeorum/client/package-info.java index 59702267..c6a581da 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/client/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/screen/MechanicalSieveScreen.java b/src/main/java/thedarkcolour/exdeorum/client/screen/MechanicalSieveScreen.java index c8d682a3..d9a83842 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/screen/MechanicalSieveScreen.java +++ b/src/main/java/thedarkcolour/exdeorum/client/screen/MechanicalSieveScreen.java @@ -18,7 +18,6 @@ package thedarkcolour.exdeorum.client.screen; -import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; diff --git a/src/main/java/thedarkcolour/exdeorum/client/screen/package-info.java b/src/main/java/thedarkcolour/exdeorum/client/screen/package-info.java index f1fe772a..7bd065cb 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/screen/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/client/screen/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java index 0aeba22d..a3113fe5 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,8 +29,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.item.BlockItem; -import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; import net.minecraftforge.client.model.data.ModelData; import net.minecraftforge.common.capabilities.ForgeCapabilities; import thedarkcolour.exdeorum.ExDeorum; @@ -58,7 +56,7 @@ public class BarrelRenderer implements BlockEntityRenderer { stack.translate(2 / 16f, 2 / 16f, 2 / 16f); stack.scale(12 / 16f, 12 / 16f, 12 / 16f); - blockRenderer.renderSingleBlock(state, stack, buffers, light, overlay, ModelData.EMPTY, null); + this.blockRenderer.renderSingleBlock(state, stack, buffers, light, overlay, ModelData.EMPTY, null); stack.popPose(); } else { diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java index 67426080..783b57a2 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/InfestedLeavesRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/InfestedLeavesRenderer.java index 1fbb9d1a..2ff7923a 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/InfestedLeavesRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/InfestedLeavesRenderer.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.world.level.block.Blocks; import net.minecraftforge.client.model.data.ModelData; -import thedarkcolour.exdeorum.ExDeorum; import thedarkcolour.exdeorum.blockentity.InfestedLeavesBlockEntity; import thedarkcolour.exdeorum.client.RenderUtil; import thedarkcolour.exdeorum.config.EConfig; diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java index d6863c52..8812ae51 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/package-info.java b/src/main/java/thedarkcolour/exdeorum/client/ter/package-info.java new file mode 100644 index 00000000..d0a7edd5 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.client.ter; diff --git a/src/main/java/thedarkcolour/exdeorum/compat/ModIds.java b/src/main/java/thedarkcolour/exdeorum/compat/ModIds.java index d35c1701..912f9135 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/ModIds.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/ModIds.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ public class ModIds { public static final String TINKERS_CONSTRUCT = "tconstruct"; public static final String ALL_THE_ORES = "alltheores"; public static final String THERMAL = "thermal"; - public static final String CHEM_LIB = "chemlib"; public static final String OCCULTISM = "occultism"; public static final String RAILCRAFT = "railcraft"; public static final String GREG = "gtceu"; @@ -36,7 +35,6 @@ public class ModIds { public static final String BIOMES_O_PLENTY = "biomesoplenty"; public static final String APPLIED_ENERGISTICS_2 = "ae2"; public static final String ARS_NOUVEAU = "ars_nouveau"; - public static final String MODEST_FLINT_OVERHAUL = "modestflintoverhaul"; public static final String FACTORIUM = "factorium"; public static final String AETHER = "aether"; public static final String BLUE_SKIES = "blue_skies"; diff --git a/src/main/java/thedarkcolour/exdeorum/compat/PreferredOres.java b/src/main/java/thedarkcolour/exdeorum/compat/PreferredOres.java index dfc6b3cc..33bbaa0f 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/PreferredOres.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/PreferredOres.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelCompostCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelCompostCategory.java index 53701e79..30d3de77 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelCompostCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelCompostCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelMixingCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelMixingCategory.java index 51f80ef7..030ff12e 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelMixingCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/BarrelMixingCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,11 +72,11 @@ public abstract class BarrelMixingCategory implements IRecipeCategory { @Override public void draw(T recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics graphics, double mouseX, double mouseY) { - slot.draw(graphics); - plus.draw(graphics, 21, 5); - slot.draw(graphics, 18 + 3 + 3 + 8, 0); - arrow.draw(graphics, 53, 1); - slot.draw(graphics, 78, 0); + this.slot.draw(graphics); + this.plus.draw(graphics, 21, 5); + this.slot.draw(graphics, 18 + 3 + 3 + 8, 0); + this.arrow.draw(graphics, 53, 1); + this.slot.draw(graphics, 78, 0); } public static class Items extends BarrelMixingCategory { diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/ClientJeiUtil.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/ClientJeiUtil.java index 9394cb0b..7523550e 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/ClientJeiUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/ClientJeiUtil.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,8 +24,6 @@ import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.Tesselator; import com.mojang.math.Axis; -import mezz.jei.api.gui.ingredient.IRecipeSlotTooltipCallback; -import mezz.jei.api.gui.ingredient.IRecipeSlotView; import mezz.jei.api.ingredients.IIngredientRenderer; import net.minecraft.ChatFormatting; import net.minecraft.CrashReport; @@ -66,8 +64,6 @@ class ClientJeiUtil { private static final FluidState EMPTY = Fluids.EMPTY.defaultFluidState(); private static final BlockState AIR = Blocks.AIR.defaultBlockState(); - private static final IIngredientRenderer ASTERISK_RENDERER = AsteriskRenderer.INSTANCE; - // https://github.com/way2muchnoise/JustEnoughResources/blob/89ee40ff068c8d6eb6ab103f76381445691cffc9/Common/src/main/java/jeresources/util/RenderHelper.java#L100 static void renderBlock(GuiGraphics guiGraphics, BlockState block, float x, float y, float z, float scale) { Minecraft mc = Minecraft.getInstance(); diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java index 2a0c9d09..c023b6af 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourceRecipe.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourceRecipe.java index 4c9f44df..14482884 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourceRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourceRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,20 +38,20 @@ final class CrucibleHeatSourceRecipe { } public int meltRate() { - return meltRate; + return this.meltRate; } public BlockState blockState() { - return blockState; + return this.blockState; } @Nullable public IIngredientType ingredientType() { - return ingredientType; + return this.ingredientType; } @Nullable public Object ingredient() { - return ingredient; + return this.ingredient; } } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java index 77378589..10be4a80 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,10 +23,8 @@ import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; import mezz.jei.api.gui.drawable.IDrawable; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; -import mezz.jei.api.helpers.IGuiHelper; import mezz.jei.api.helpers.IJeiHelpers; import mezz.jei.api.helpers.IModIdHelper; -import mezz.jei.api.ingredients.IIngredientType; import mezz.jei.api.recipe.IFocusFactory; import mezz.jei.api.recipe.IFocusGroup; import mezz.jei.api.recipe.RecipeIngredientRole; @@ -34,14 +32,11 @@ import mezz.jei.api.recipe.RecipeType; import mezz.jei.api.recipe.category.IRecipeCategory; import mezz.jei.api.runtime.IIngredientManager; import mezz.jei.api.runtime.IRecipesGui; -import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; -import net.minecraftforge.fml.ModContainer; -import net.minecraftforge.fml.ModList; import net.minecraftforge.registries.ForgeRegistries; import thedarkcolour.exdeorum.data.TranslationKeys; import thedarkcolour.exdeorum.registry.EItems; @@ -115,13 +110,13 @@ class CrucibleHeatSourcesCategory implements IRecipeCategory getTooltipStrings(CrucibleHeatSourceRecipe recipe, IRecipeSlotsView recipeSlotsView, double mouseX, double mouseY) { if (44.0 < mouseX && mouseX < 76.0 && 16 < mouseY && mouseY < 48) { if (recipe.ingredientType() != null) { - var tooltip = ingredientManager.getIngredientRenderer(recipe.ingredientType()).getTooltip(recipe.ingredient(), Minecraft.getInstance().options.advancedItemTooltips ? TooltipFlag.ADVANCED : TooltipFlag.NORMAL); - return modIdHelper.addModNameToIngredientTooltip(tooltip, recipe.ingredient(), ingredientManager.getIngredientHelper(recipe.ingredientType())); + var tooltip = this.ingredientManager.getIngredientRenderer(recipe.ingredientType()).getTooltip(recipe.ingredient(), Minecraft.getInstance().options.advancedItemTooltips ? TooltipFlag.ADVANCED : TooltipFlag.NORMAL); + return this.modIdHelper.addModNameToIngredientTooltip(tooltip, recipe.ingredient(), this.ingredientManager.getIngredientHelper(recipe.ingredientType())); } else { var block = recipe.blockState().getBlock(); var modId = ForgeRegistries.BLOCKS.getKey(block).getNamespace(); - return List.of(Component.translatable(block.getDescriptionId()), Component.literal(modIdHelper.getFormattedModNameForModId(modId))); + return List.of(Component.translatable(block.getDescriptionId()), Component.literal(this.modIdHelper.getFormattedModNameForModId(modId))); } } @@ -133,13 +128,13 @@ class CrucibleHeatSourcesCategory implements IRecipeCategory { + this.ingredientManager.createTypedIngredient(recipe.ingredientType(), recipe.ingredient()).ifPresent(ingredient -> { if (Minecraft.getInstance().screen instanceof IRecipesGui recipesGui) { if (input.getValue() == InputConstants.MOUSE_BUTTON_LEFT) { - recipesGui.show(focusFactory.createFocus(RecipeIngredientRole.OUTPUT, ingredient)); + recipesGui.show(this.focusFactory.createFocus(RecipeIngredientRole.OUTPUT, ingredient)); } else { // INPUT + CATALYST - recipesGui.show(List.of(focusFactory.createFocus(RecipeIngredientRole.CATALYST, ingredient), focusFactory.createFocus(RecipeIngredientRole.INPUT, ingredient))); + recipesGui.show(List.of(this.focusFactory.createFocus(RecipeIngredientRole.CATALYST, ingredient), this.focusFactory.createFocus(RecipeIngredientRole.INPUT, ingredient))); } } }); diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java index 368baec2..604150a1 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java index 2483c4bd..a6792e6d 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/OneToOneCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/OneToOneCategory.java index ff626bfb..cc5648b0 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/OneToOneCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/OneToOneCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,8 +73,8 @@ abstract class OneToOneCategory implements IRecipeCategory { @Override public void draw(T recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics graphics, double mouseX, double mouseY) { - slot.draw(graphics); - arrow.draw(graphics, 25, 1); - slot.draw(graphics, 54, 0); + this.slot.draw(graphics); + this.arrow.draw(graphics, 25, 1); + this.slot.draw(graphics, 54, 0); } } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java index e24784f5..9059117d 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/package-info.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/package-info.java index 7565529c..dc3de3d8 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsBindings.java b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsBindings.java index fc575ad7..3442ff48 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsBindings.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsBindings.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsPlugin.java b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsPlugin.java index 4b630cb5..f326795f 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsPlugin.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/ExDeorumKubeJsPlugin.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/SieveMeshFilter.java b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/SieveMeshFilter.java index 3c676e94..19036195 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/SieveMeshFilter.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/SieveMeshFilter.java @@ -28,6 +28,6 @@ import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe; public record SieveMeshFilter(ReplacementMatch match) implements RecipeFilter { @Override public boolean test(RecipeKJS recipe) { - return match instanceof ItemMatch match && recipe instanceof RecipeJS recipeJs && recipeJs.getOriginalRecipe() instanceof SieveRecipe sieveRecipe && match.contains(sieveRecipe.mesh); + return this.match instanceof ItemMatch itemMatch && recipe instanceof RecipeJS recipeJs && recipeJs.getOriginalRecipe() instanceof SieveRecipe sieveRecipe && itemMatch.contains(sieveRecipe.mesh); } } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/kubejs/package-info.java b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/package-info.java new file mode 100644 index 00000000..57fb5071 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/compat/kubejs/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.compat.kubejs; diff --git a/src/main/java/thedarkcolour/exdeorum/compat/package-info.java b/src/main/java/thedarkcolour/exdeorum/compat/package-info.java new file mode 100644 index 00000000..f617e44d --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/compat/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.compat; diff --git a/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumInfoProvider.java b/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumInfoProvider.java index 3da1be8b..679e144f 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumInfoProvider.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumInfoProvider.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumTopCompat.java b/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumTopCompat.java index 78d16218..0b697b3d 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumTopCompat.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/top/ExDeorumTopCompat.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/compat/top/package-info.java b/src/main/java/thedarkcolour/exdeorum/compat/top/package-info.java new file mode 100644 index 00000000..bfd47f24 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/compat/top/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.compat.top; diff --git a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java index 48c65128..86167f7f 100644 --- a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java +++ b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ public class EConfig { .comment("Whether to use a simplified renderer for infested leaves (reduces FPS lag with lots of infested trees)") .define("use_fast_infested_leaves", false); this.setVoidWorldAsDefault = builder - .comment("Whether the Void World type is set as the default world preset in the world creation screen.") + .comment("Whether the Void World type is set as the default world preset. (DEPRECATED - USE THE OPTION IN THE COMMON CONFIG INSTEAD)") .define("set_void_world_as_default", true); builder.pop(); @@ -74,6 +74,7 @@ public class EConfig { public final ConfigValue preferredLithiumOre; public final ConfigValue preferredBoronOre; + public final BooleanValue setVoidWorldAsDefault; public final BooleanValue voidNetherGeneration; public final BooleanValue voidEndGeneration; @@ -103,6 +104,9 @@ public class EConfig { builder.pop(); + this.setVoidWorldAsDefault = builder + .comment("Whether the Void World type is set as the default world preset in world creation screen and server.properties.") + .define("set_void_world_as_default", true); this.voidNetherGeneration = builder .comment("If the Void World type is selected, whether the Nether world generation is overridden to a void world. Changes take effect after reopening the world.") .define("void_nether_generation", true); @@ -122,7 +126,6 @@ public class EConfig { public final BooleanValue automatedSieves; public final DoubleValue barrelProgressStep; public final BooleanValue witchWaterNetherrackGenerator; - public final BooleanValue setVoidWorldAsDefault; public final ConfigValue defaultSpawnTreeFeature; public final BooleanValue useBiomeAppropriateTree; public final BooleanValue limitMossSieveDrops; @@ -130,8 +133,6 @@ public class EConfig { public final BooleanValue allowWitchWaterEntityConversion; public final IntValue mechanicalSieveEnergyStorage; public final IntValue mechanicalSieveEnergyConsumption; - //public final IntValue mechanicalHammerEnergyStorage; - //public final IntValue mechanicalHammerEnergyConsumption; public Server(ForgeConfigSpec.Builder builder) { builder.comment("Server configuration for Ex Deorum").push("server"); @@ -157,9 +158,6 @@ public class EConfig { this.witchWaterNetherrackGenerator = builder .comment("Whether Witch Water forms netherrack when lava flows into it, allowing for a netherrack version of a cobblestone generator.") .define("witch_water_netherrack_generator", true); - this.setVoidWorldAsDefault = builder - .comment("Whether the Void World type is used by default in the \"server.properties\" file when creating a server.") - .define("set_void_world_as_default", true); this.defaultSpawnTreeFeature = builder .comment("The ID of the default tree feature to use when generating a spawn island (or when useBiomeAppropriateTree is true and the biome has no tree set). By default, minecraft:oak_tree_bees_005 is used.") .define("default_spawn_tree_feature", ModIds.MINECRAFT + ":oak_tree_bees_005"); @@ -181,12 +179,6 @@ public class EConfig { this.mechanicalSieveEnergyConsumption = builder .comment("The amount of FE/t a tick consumed by the mechanical sieve when sifting a block.") .defineInRange("mechanical_sieve_energy_consumption", 40, 0, Integer.MAX_VALUE); - //this.mechanicalHammerEnergyStorage = builder - // .comment("The maximum amount of FE the mechanical hammer can have in its energy storage.") - // .defineInRange("mechanical_hammer_energy_storage", 40_000, 0, Integer.MAX_VALUE); - //this.mechanicalHammerEnergyConsumption = builder - // .comment("The amount of FE/t a tick consumed by the mechanical hammer when sifting a block.") - // .defineInRange("mechanical_hammer_energy_consumption", 40, 0, Integer.MAX_VALUE); builder.pop(); } diff --git a/src/main/java/thedarkcolour/exdeorum/config/package-info.java b/src/main/java/thedarkcolour/exdeorum/config/package-info.java new file mode 100644 index 00000000..51eee779 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/config/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.config; diff --git a/src/main/java/thedarkcolour/exdeorum/data/Advancements.java b/src/main/java/thedarkcolour/exdeorum/data/Advancements.java index e23c4511..c4e8d01d 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/Advancements.java +++ b/src/main/java/thedarkcolour/exdeorum/data/Advancements.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java b/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java index 7c5350b0..7b3487a0 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java +++ b/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,12 +69,12 @@ class BlockLoot extends BlockLootSubProvider { @Override protected Iterable getKnownBlocks() { - return added; + return this.added; } @Override protected void add(Block block, LootTable.Builder builder) { super.add(block, builder); - added.add(block); + this.added.add(block); } } diff --git a/src/main/java/thedarkcolour/exdeorum/data/BlockModels.java b/src/main/java/thedarkcolour/exdeorum/data/BlockModels.java index 931f6c3e..f68429b4 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/BlockModels.java +++ b/src/main/java/thedarkcolour/exdeorum/data/BlockModels.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/Data.java b/src/main/java/thedarkcolour/exdeorum/data/Data.java index 82565c38..c7561d51 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/Data.java +++ b/src/main/java/thedarkcolour/exdeorum/data/Data.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/English.java b/src/main/java/thedarkcolour/exdeorum/data/English.java index 298f1729..895cd19d 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/English.java +++ b/src/main/java/thedarkcolour/exdeorum/data/English.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/ItemModels.java b/src/main/java/thedarkcolour/exdeorum/data/ItemModels.java index fd7a84f3..ed3c390b 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/ItemModels.java +++ b/src/main/java/thedarkcolour/exdeorum/data/ItemModels.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/LootTables.java b/src/main/java/thedarkcolour/exdeorum/data/LootTables.java index bc9e52c5..f4940d49 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/LootTables.java +++ b/src/main/java/thedarkcolour/exdeorum/data/LootTables.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/ModCompatData.java b/src/main/java/thedarkcolour/exdeorum/data/ModCompatData.java index 9b9fd76d..a2a3df6f 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/ModCompatData.java +++ b/src/main/java/thedarkcolour/exdeorum/data/ModCompatData.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/ModTags.java b/src/main/java/thedarkcolour/exdeorum/data/ModTags.java index d97b13f9..9e8a28c2 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/ModTags.java +++ b/src/main/java/thedarkcolour/exdeorum/data/ModTags.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java b/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java index 8d685690..120d5a96 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java +++ b/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/package-info.java b/src/main/java/thedarkcolour/exdeorum/data/package-info.java index 7c7d168e..fca73e6d 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/data/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java index d485e6f6..b914ce89 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ package thedarkcolour.exdeorum.data.recipe; -import mcjty.theoneprobe.apiimpl.elements.ElementItemStack; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java index 9081c3d8..740cc1b7 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/package-info.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/package-info.java new file mode 100644 index 00000000..3bd26080 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.data.recipe; diff --git a/src/main/java/thedarkcolour/exdeorum/event/ClientsideCode.java b/src/main/java/thedarkcolour/exdeorum/event/ClientsideCode.java index 3b9b25d2..fb490b75 100644 --- a/src/main/java/thedarkcolour/exdeorum/event/ClientsideCode.java +++ b/src/main/java/thedarkcolour/exdeorum/event/ClientsideCode.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,9 +20,11 @@ package thedarkcolour.exdeorum.event; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.player.Player; +import org.jetbrains.annotations.Nullable; // necessary to avoid EventBus loading LocalPlayer through its ASM transformations class ClientsideCode { + @Nullable static Player getLocalPlayer() { return Minecraft.getInstance().player; } diff --git a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java index 874b8b75..c730d672 100644 --- a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -178,7 +178,7 @@ public final class EventHandler { if (FMLEnvironment.dist == Dist.CLIENT) { // since event code is turned into ASM, we need this to prevent ASM trying to load the LocalPlayer class - Player player = DistExecutor.unsafeCallWhenOn(Dist.CLIENT, () -> ClientsideCode::getLocalPlayer);; + Player player = DistExecutor.unsafeCallWhenOn(Dist.CLIENT, () -> ClientsideCode::getLocalPlayer); if (player == null) { return; } else { diff --git a/src/main/java/thedarkcolour/exdeorum/event/package-info.java b/src/main/java/thedarkcolour/exdeorum/event/package-info.java new file mode 100644 index 00000000..cf8736c9 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/event/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.event; diff --git a/src/main/java/thedarkcolour/exdeorum/fluid/WitchWaterFluid.java b/src/main/java/thedarkcolour/exdeorum/fluid/WitchWaterFluid.java index de30d5ef..aae3b239 100644 --- a/src/main/java/thedarkcolour/exdeorum/fluid/WitchWaterFluid.java +++ b/src/main/java/thedarkcolour/exdeorum/fluid/WitchWaterFluid.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/fluid/package-info.java b/src/main/java/thedarkcolour/exdeorum/fluid/package-info.java new file mode 100644 index 00000000..920d7caf --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/fluid/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.fluid; diff --git a/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java b/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java index a1510abd..7b7f0cbc 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/CrookItem.java b/src/main/java/thedarkcolour/exdeorum/item/CrookItem.java index 08a97960..85c61e41 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/CrookItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/CrookItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ public class CrookItem extends Item { @Override public float getDestroySpeed(ItemStack pStack, BlockState pState) { - return pState.is(BlockTags.LEAVES) ? speed : 1.0f; + return pState.is(BlockTags.LEAVES) ? this.speed : 1.0f; } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java b/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java index 6c87385f..38d488cc 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.animal.Cow; -import net.minecraft.world.entity.animal.MushroomCow; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -52,7 +51,7 @@ public class GrassSpreaderItem extends Item { var pos = ctx.getClickedPos(); var player = ctx.getPlayer(); var state = level.getBlockState(pos); - var grass = grassState.get(); + var grass = this.grassState.get(); if (canSpread(state) && grass != state) { if (!level.isClientSide) { diff --git a/src/main/java/thedarkcolour/exdeorum/item/HammerItem.java b/src/main/java/thedarkcolour/exdeorum/item/HammerItem.java index 0d677521..6014e1f7 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/HammerItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/HammerItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/MeshItem.java b/src/main/java/thedarkcolour/exdeorum/item/MeshItem.java index fbf2f6bf..0e528428 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/MeshItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/MeshItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/NyliumSpreaderItem.java b/src/main/java/thedarkcolour/exdeorum/item/NyliumSpreaderItem.java index 9b599f0d..51b98b76 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/NyliumSpreaderItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/NyliumSpreaderItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/PorcelainBucket.java b/src/main/java/thedarkcolour/exdeorum/item/PorcelainBucket.java index 614a7d39..480c2293 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/PorcelainBucket.java +++ b/src/main/java/thedarkcolour/exdeorum/item/PorcelainBucket.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -159,7 +159,7 @@ public class PorcelainBucket extends Item { private ItemStack getEmptySuccessItem(ItemStack stack, Player player) { if (!player.getAbilities().instabuild) { - if (fluid.get() == Fluids.LAVA) { + if (this.fluid.get() == Fluids.LAVA) { return ItemStack.EMPTY; } else { return new ItemStack(EItems.PORCELAIN_BUCKET.get()); @@ -224,7 +224,7 @@ public class PorcelainBucket extends Item { } protected boolean canBlockContainFluid(Level level, BlockPos pos, BlockState state) { - return state.getBlock() instanceof LiquidBlockContainer block && block.canPlaceLiquid(level, pos, state, fluid.get()); + return state.getBlock() instanceof LiquidBlockContainer block && block.canPlaceLiquid(level, pos, state, this.fluid.get()); } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/item/PorcelainMilkBucket.java b/src/main/java/thedarkcolour/exdeorum/item/PorcelainMilkBucket.java index d6fd93b0..489af0ef 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/PorcelainMilkBucket.java +++ b/src/main/java/thedarkcolour/exdeorum/item/PorcelainMilkBucket.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/RandomResultItem.java b/src/main/java/thedarkcolour/exdeorum/item/RandomResultItem.java index 4aecc950..6064ec18 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/RandomResultItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/RandomResultItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java b/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java index 98cd174c..ee10eb45 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java b/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java index 3352d375..75a0a672 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.LeavesBlock; -import thedarkcolour.exdeorum.block.EBlock; import thedarkcolour.exdeorum.blockentity.InfestedLeavesBlockEntity; import thedarkcolour.exdeorum.registry.EBlocks; diff --git a/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java b/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java index 8592ab76..a7ac8c9d 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +103,7 @@ public class WateringCanItem extends Item { @Override public boolean isBarVisible(ItemStack stack) { - return renewing ? stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(handler -> handler.getFluidInTank(0).getAmount() < capacity).orElse(true) : true; + return this.renewing ? stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(handler -> handler.getFluidInTank(0).getAmount() < this.capacity).orElse(true) : true; } @Override @@ -114,7 +114,7 @@ public class WateringCanItem extends Item { @Override public int getBarWidth(ItemStack stack) { return stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(fluidHandler -> { - return Math.round((float) fluidHandler.getFluidInTank(0).getAmount() * 13.0F / (float) capacity); + return Math.round((float) fluidHandler.getFluidInTank(0).getAmount() * 13.0F / (float) this.capacity); }).orElse(0); } @@ -132,7 +132,7 @@ public class WateringCanItem extends Item { public void appendHoverText(ItemStack stack, @Nullable Level pLevel, List tooltip, TooltipFlag pIsAdvanced) { stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluidHandler -> { // use the block name which is guaranteed to have a vanilla translation - tooltip.add(Component.translatable("block.minecraft.water").append(Component.translatable(TranslationKeys.FRACTION_DISPLAY, fluidHandler.getFluidInTank(0).getAmount(), capacity)).withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.translatable("block.minecraft.water").append(Component.translatable(TranslationKeys.FRACTION_DISPLAY, fluidHandler.getFluidInTank(0).getAmount(), this.capacity)).withStyle(ChatFormatting.GRAY)); }); } @@ -193,7 +193,7 @@ public class WateringCanItem extends Item { if (useTicks % WATERING_INTERVAL == 0) { tryWatering((ServerLevel) level, pos, state); - if (!this.renewing || fluidHandler.getFluidInTank(0).getAmount() != capacity) { + if (!this.renewing || fluidHandler.getFluidInTank(0).getAmount() != this.capacity) { if (!(living instanceof Player player && player.getAbilities().instabuild)) { ((CapabilityProvider) fluidHandler).drain(); } diff --git a/src/main/java/thedarkcolour/exdeorum/item/WideWateringCanItem.java b/src/main/java/thedarkcolour/exdeorum/item/WideWateringCanItem.java index bd87db66..04866725 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/WideWateringCanItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/WideWateringCanItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java b/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java index e66190ab..fafac51a 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/item/package-info.java b/src/main/java/thedarkcolour/exdeorum/item/package-info.java index fd802d4f..64675718 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/item/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/loot/CrookLootModifier.java b/src/main/java/thedarkcolour/exdeorum/loot/CrookLootModifier.java index d3759d11..1afc676f 100644 --- a/src/main/java/thedarkcolour/exdeorum/loot/CrookLootModifier.java +++ b/src/main/java/thedarkcolour/exdeorum/loot/CrookLootModifier.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/loot/HammerLootModifier.java b/src/main/java/thedarkcolour/exdeorum/loot/HammerLootModifier.java index e903ddf3..e639fae8 100644 --- a/src/main/java/thedarkcolour/exdeorum/loot/HammerLootModifier.java +++ b/src/main/java/thedarkcolour/exdeorum/loot/HammerLootModifier.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/loot/InfestedStringFunction.java b/src/main/java/thedarkcolour/exdeorum/loot/InfestedStringFunction.java index db9fae36..6738f98e 100644 --- a/src/main/java/thedarkcolour/exdeorum/loot/InfestedStringFunction.java +++ b/src/main/java/thedarkcolour/exdeorum/loot/InfestedStringFunction.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/loot/package-info.java b/src/main/java/thedarkcolour/exdeorum/loot/package-info.java new file mode 100644 index 00000000..811eb6e6 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/loot/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.loot; diff --git a/src/main/java/thedarkcolour/exdeorum/menu/package-info.java b/src/main/java/thedarkcolour/exdeorum/menu/package-info.java index 571d7361..2be60dd5 100644 --- a/src/main/java/thedarkcolour/exdeorum/menu/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/menu/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/network/ClientMessageHandler.java b/src/main/java/thedarkcolour/exdeorum/network/ClientMessageHandler.java index 814b899f..a9658ac2 100644 --- a/src/main/java/thedarkcolour/exdeorum/network/ClientMessageHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/network/ClientMessageHandler.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/network/NetworkHandler.java b/src/main/java/thedarkcolour/exdeorum/network/NetworkHandler.java index 47a7a5d9..e540869d 100644 --- a/src/main/java/thedarkcolour/exdeorum/network/NetworkHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/network/NetworkHandler.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,6 @@ import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import thedarkcolour.exdeorum.ExDeorum; -import thedarkcolour.exdeorum.blockentity.EBlockEntity; import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/src/main/java/thedarkcolour/exdeorum/network/PlayerDataMessage.java b/src/main/java/thedarkcolour/exdeorum/network/PlayerDataMessage.java index f9be33c7..217a2a2d 100644 --- a/src/main/java/thedarkcolour/exdeorum/network/PlayerDataMessage.java +++ b/src/main/java/thedarkcolour/exdeorum/network/PlayerDataMessage.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/network/VoidWorldMessage.java b/src/main/java/thedarkcolour/exdeorum/network/VoidWorldMessage.java index 4e1f29d8..aa89b0ff 100644 --- a/src/main/java/thedarkcolour/exdeorum/network/VoidWorldMessage.java +++ b/src/main/java/thedarkcolour/exdeorum/network/VoidWorldMessage.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/network/package-info.java b/src/main/java/thedarkcolour/exdeorum/network/package-info.java new file mode 100644 index 00000000..073bf7df --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/network/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.network; diff --git a/src/main/java/thedarkcolour/exdeorum/package-info.java b/src/main/java/thedarkcolour/exdeorum/package-info.java new file mode 100644 index 00000000..76a56f06 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum; diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/BarrelFluidMixingRecipeCache.java b/src/main/java/thedarkcolour/exdeorum/recipe/BarrelFluidMixingRecipeCache.java index 196101e9..ba26f04f 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/BarrelFluidMixingRecipeCache.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/BarrelFluidMixingRecipeCache.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,10 +39,10 @@ public class BarrelFluidMixingRecipeCache { @Nullable public BarrelFluidMixingRecipe getRecipe(Fluid baseFluid, Fluid additive) { - if (recipes == null) { + if (this.recipes == null) { buildRecipes(); } - var recipesForBase = recipes.get(baseFluid); + var recipesForBase = this.recipes.get(baseFluid); if (recipesForBase != null) { return recipesForBase.get(additive); } @@ -50,10 +50,10 @@ public class BarrelFluidMixingRecipeCache { } private void buildRecipes() { - var recipes = new HashMap>(); + this.recipes = new HashMap<>(); for (var recipe : this.recipeManager.byType(ERecipeTypes.BARREL_FLUID_MIXING.get()).values()) { - recipes.computeIfAbsent(recipe.baseFluid, key -> new HashMap<>()).put(recipe.additiveFluid, recipe); + this.recipes.computeIfAbsent(recipe.baseFluid, key -> new HashMap<>()).put(recipe.additiveFluid, recipe); } this.recipeManager = null; diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/CodecUtil.java b/src/main/java/thedarkcolour/exdeorum/recipe/CodecUtil.java index 9645493e..6a17309e 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/CodecUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/CodecUtil.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,12 +33,4 @@ public class CodecUtil { public static T decode(Codec codec, JsonElement json) { return codec.parse(JsonOps.INSTANCE, json).result().get(); } - - public static Tag encodeNbt(Codec codec, T object) { - return codec.encodeStart(NbtOps.INSTANCE, object).result().get(); - } - - public static T decodeNbt(Codec codec, Tag json) { - return codec.parse(NbtOps.INSTANCE, json).result().get(); - } } diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/EFinishedRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/EFinishedRecipe.java index 31c91ada..3140448e 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/EFinishedRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/EFinishedRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/ProbabilityRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/ProbabilityRecipe.java index 5691e063..8bfe0bd4 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/ProbabilityRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/ProbabilityRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java index 94091a2d..423d42b8 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/SieveRecipeCache.java b/src/main/java/thedarkcolour/exdeorum/recipe/SieveRecipeCache.java index 17f8a6b3..5679ae51 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/SieveRecipeCache.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/SieveRecipeCache.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,17 +41,17 @@ public class SieveRecipeCache { } public List getRecipe(Item mesh, ItemStack input) { - if (meshCaches == null) { + if (this.meshCaches == null) { buildRecipes(); } - var meshCache = meshCaches.get(mesh); + var meshCache = this.meshCaches.get(mesh); return meshCache == null ? List.of() : meshCache.getRecipes(input); } private void buildRecipes() { // Group recipes based on their mesh var tempMap = new HashMap>(); - for (var recipe : recipeManager.byType(ERecipeTypes.SIEVE.get()).values()) { + for (var recipe : this.recipeManager.byType(ERecipeTypes.SIEVE.get()).values()) { tempMap.computeIfAbsent(recipe.mesh, k -> new ArrayList<>()).add(recipe); } this.meshCaches = new HashMap<>(); @@ -85,7 +85,7 @@ public class SieveRecipeCache { } public List getRecipes(ItemStack input) { - var result = simpleRecipes.get(input.getItem()); + var result = this.simpleRecipes.get(input.getItem()); return result == null ? List.of() : result; } } diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipe.java index 03ffd526..1d993d44 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,12 +45,12 @@ public abstract class SingleIngredientRecipe implements Recipe { } public Ingredient getIngredient() { - return ingredient; + return this.ingredient; } @Override public boolean matches(Container inventory, Level level) { - return ingredient.test(inventory.getItem(0)); + return this.ingredient.test(inventory.getItem(0)); } @Override @@ -65,7 +65,7 @@ public abstract class SingleIngredientRecipe implements Recipe { @Override public ResourceLocation getId() { - return id; + return this.id; } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipeCache.java b/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipeCache.java index 1ae2bc44..eed4ec7c 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipeCache.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/SingleIngredientRecipeCache.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,15 +59,15 @@ public class SingleIngredientRecipeCache { @Nullable public T getRecipe(ItemStack item) { - if (simpleRecipes == null) { + if (this.simpleRecipes == null) { buildRecipes(); } // simpleRecipes is guaranteed not null - var recipe = simpleRecipes.get(item.getItem()); + var recipe = this.simpleRecipes.get(item.getItem()); // if there are complex recipes, test each one - if (recipe == null && complexRecipes != null) { - for (var complexRecipe : complexRecipes) { + if (recipe == null && this.complexRecipes != null) { + for (var complexRecipe : this.complexRecipes) { if (complexRecipe.getIngredient().test(item)) { return complexRecipe; } @@ -102,14 +102,14 @@ public class SingleIngredientRecipeCache { this.simpleRecipes = new HashMap<>(); var complexRecipes = ImmutableList.builder(); - var allRecipes = this.recipeManager.byType(recipeType.get()).values(); + var allRecipes = this.recipeManager.byType(this.recipeType.get()).values(); for (var recipe : allRecipes) { var ingredient = recipe.getIngredient(); if (ingredient.isSimple()) { for (var item : ingredient.getItems()) { - simpleRecipes.put(item.getItem(), recipe); + this.simpleRecipes.put(item.getItem(), recipe); } } else { complexRecipes.add(recipe); diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/TagResultRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/TagResultRecipe.java index 25abdf26..39c09e3f 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/TagResultRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/TagResultRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelCompostRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelCompostRecipe.java index c175d89b..f0da9e26 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelCompostRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelCompostRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ public class BarrelCompostRecipe extends SingleIngredientRecipe { } public int getVolume() { - return volume; + return this.volume; } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelFluidMixingRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelFluidMixingRecipe.java index e9ef260c..da30e017 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelFluidMixingRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelFluidMixingRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelMixingRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelMixingRecipe.java index 9d45f6b6..4409ba1c 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelMixingRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/BarrelMixingRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ public class BarrelMixingRecipe extends SingleIngredientRecipe { } public boolean matches(ItemStack item, FluidStack fluid) { - return ingredient.test(item) && fluid.getFluid() == this.fluid && fluid.getAmount() >= fluidAmount; + return this.ingredient.test(item) && fluid.getFluid() == this.fluid && fluid.getAmount() >= this.fluidAmount; } @Override @@ -81,7 +81,7 @@ public class BarrelMixingRecipe extends SingleIngredientRecipe { @Override public BarrelMixingRecipe fromJson(ResourceLocation id, JsonObject json) { Ingredient ingredient = RecipeUtil.readIngredient(json, "ingredient"); - Fluid fluid = RecipeUtil.readFluid(json, "fluid");; + Fluid fluid = RecipeUtil.readFluid(json, "fluid"); int fluidAmount = GsonHelper.getAsInt(json, "fluid_amount"); Item result = RecipeUtil.readItem(json, "result"); diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelCompostRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelCompostRecipe.java index b982a112..677baa23 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelCompostRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelCompostRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,13 +38,13 @@ public class FinishedBarrelCompostRecipe implements EFinishedRecipe { @Override public void serializeRecipeData(JsonObject json) { - json.add("ingredient", ingredient.toJson()); - json.addProperty("volume", volume); + json.add("ingredient", this.ingredient.toJson()); + json.addProperty("volume", this.volume); } @Override public ResourceLocation getId() { - return id; + return this.id; } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelFluidMixingRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelFluidMixingRecipe.java index f2ab2a30..508cae2f 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelFluidMixingRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelFluidMixingRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelMixingRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelMixingRecipe.java index e1d23ced..37322ac1 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelMixingRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/FinishedBarrelMixingRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/package-info.java b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/package-info.java index 6893e45d..6f9d42d2 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/barrel/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/barrel/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/CrucibleRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/CrucibleRecipe.java index 26045f7e..781f86ac 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/CrucibleRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/CrucibleRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ public class CrucibleRecipe extends SingleIngredientRecipe { } public FluidStack getResult() { - return result; + return this.result; } @Override @@ -57,7 +57,7 @@ public class CrucibleRecipe extends SingleIngredientRecipe { @Override public RecipeType getType() { - return type; + return this.type; } public static class Serializer implements RecipeSerializer { @@ -72,13 +72,13 @@ public class CrucibleRecipe extends SingleIngredientRecipe { Ingredient ingredient = RecipeUtil.readIngredient(json, "ingredient"); FluidStack stack = CodecUtil.decode(FluidStack.CODEC, json.get("fluid")); - return new CrucibleRecipe(id, type, ingredient, stack); + return new CrucibleRecipe(id, this.type, ingredient, stack); } @Nullable @Override public CrucibleRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf buffer) { - return new CrucibleRecipe(id, type, Ingredient.fromNetwork(buffer), FluidStack.readFromPacket(buffer)); + return new CrucibleRecipe(id, this.type, Ingredient.fromNetwork(buffer), FluidStack.readFromPacket(buffer)); } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/FinishedCrucibleRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/FinishedCrucibleRecipe.java index f8a0204f..14df4005 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/FinishedCrucibleRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/FinishedCrucibleRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,17 +47,17 @@ public class FinishedCrucibleRecipe implements EFinishedRecipe { @Override public void serializeRecipeData(JsonObject json) { - json.add("ingredient", ingredient.toJson()); - json.add("fluid", CodecUtil.encode(FluidStack.CODEC, fluidStack)); + json.add("ingredient", this.ingredient.toJson()); + json.add("fluid", CodecUtil.encode(FluidStack.CODEC, this.fluidStack)); } @Override public ResourceLocation getId() { - return id; + return this.id; } @Override public RecipeSerializer getType() { - return serializer; + return this.serializer; } } diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/package-info.java b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/package-info.java index ed0dae49..256fc0f0 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/crucible/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/crucible/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/FinishedHammerRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/FinishedHammerRecipe.java index 80ef84c5..3e6b38e3 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/FinishedHammerRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/FinishedHammerRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,14 +44,14 @@ public class FinishedHammerRecipe implements EFinishedRecipe { @Override public void serializeRecipeData(JsonObject object) { - object.add("ingredient", ingredient.toJson()); + object.add("ingredient", this.ingredient.toJson()); object.addProperty("result", ForgeRegistries.ITEMS.getKey(this.result).toString()); - object.add("result_amount", LootDataType.PREDICATE.parser().toJsonTree(resultAmount)); + object.add("result_amount", LootDataType.PREDICATE.parser().toJsonTree(this.resultAmount)); } @Override public ResourceLocation getId() { - return id; + return this.id; } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/HammerRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/HammerRecipe.java index e67196a2..4c97fe16 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/HammerRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/HammerRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/package-info.java b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/package-info.java index a6070afc..1ba32f86 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/hammer/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/hammer/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/package-info.java b/src/main/java/thedarkcolour/exdeorum/recipe/package-info.java index 5ca3d7d3..70acc42f 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/package-info.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/package-info.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java index b0def25e..40ab2056 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,6 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.storage.loot.LootDataType; import net.minecraft.world.level.storage.loot.providers.number.NumberProvider; -import net.minecraftforge.common.util.Lazy; import net.minecraftforge.registries.ForgeRegistries; import thedarkcolour.exdeorum.recipe.EFinishedRecipe; import thedarkcolour.exdeorum.registry.ERecipeSerializers; diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java index c122186a..8a272197 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ package thedarkcolour.exdeorum.recipe.sieve; import com.google.gson.JsonObject; -import com.google.gson.JsonSyntaxException; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.FriendlyByteBuf; @@ -27,7 +26,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.util.GsonHelper; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/package-info.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/package-info.java new file mode 100644 index 00000000..6cb1746f --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.recipe.sieve; diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java index edcab94f..d8da56c8 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import thedarkcolour.exdeorum.ExDeorum; import thedarkcolour.exdeorum.blockentity.BarrelBlockEntity; -import thedarkcolour.exdeorum.blockentity.CompressedSieveBlockEntity; import thedarkcolour.exdeorum.blockentity.InfestedLeavesBlockEntity; import thedarkcolour.exdeorum.blockentity.LavaCrucibleBlockEntity; import thedarkcolour.exdeorum.blockentity.MechanicalSieveBlockEntity; @@ -34,7 +33,7 @@ import thedarkcolour.exdeorum.blockentity.WaterCrucibleBlockEntity; public class EBlockEntities { public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, ExDeorum.ID); - public static final RegistryObject> INFESTED_LEAVES = BLOCK_ENTITIES.register("infested_leaves", () -> BlockEntityType.Builder.of(InfestedLeavesBlockEntity::new, EBlocks.INFESTED_LEAVES.get()).build(null)); + public static final RegistryObject> INFESTED_LEAVES = BLOCK_ENTITIES.register("infested_leaves", () -> BlockEntityType.Builder.of(InfestedLeavesBlockEntity::new, EBlocks.INFESTED_LEAVES.get()).build(null)); public static final RegistryObject> LAVA_CRUCIBLE = BLOCK_ENTITIES.register("lava_crucible", () -> BlockEntityType.Builder.of(LavaCrucibleBlockEntity::new, EBlocks.WARPED_CRUCIBLE.get(), EBlocks.CRIMSON_CRUCIBLE.get(), diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java index e55b0cd4..b300b0bf 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EChunkGenerators.java b/src/main/java/thedarkcolour/exdeorum/registry/EChunkGenerators.java index 1a898ef4..ac10775d 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EChunkGenerators.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EChunkGenerators.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ECreativeTabs.java b/src/main/java/thedarkcolour/exdeorum/registry/ECreativeTabs.java index e7566426..b4096d2e 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/ECreativeTabs.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/ECreativeTabs.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EFluids.java b/src/main/java/thedarkcolour/exdeorum/registry/EFluids.java index 8577fd18..42e0e207 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EFluids.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EFluids.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EGlobalLootModifiers.java b/src/main/java/thedarkcolour/exdeorum/registry/EGlobalLootModifiers.java index c302e512..55bbb174 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EGlobalLootModifiers.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EGlobalLootModifiers.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index 10e2004c..03df6a7b 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,8 +32,6 @@ import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import thedarkcolour.exdeorum.ExDeorum; -import thedarkcolour.exdeorum.block.EBlock; -import thedarkcolour.exdeorum.block.SieveBlock; import thedarkcolour.exdeorum.compat.ModIds; import thedarkcolour.exdeorum.item.*; import thedarkcolour.exdeorum.recipe.RecipeUtil; diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ELootFunctions.java b/src/main/java/thedarkcolour/exdeorum/registry/ELootFunctions.java index 5912d288..4e73645a 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/ELootFunctions.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/ELootFunctions.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java index 74e4514c..28b0762d 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java index 782ffcf9..e7892780 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EWorldPresets.java b/src/main/java/thedarkcolour/exdeorum/registry/EWorldPresets.java index 648f0c6a..c6049cff 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EWorldPresets.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EWorldPresets.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/registry/package-info.java b/src/main/java/thedarkcolour/exdeorum/registry/package-info.java new file mode 100644 index 00000000..45938215 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/registry/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.registry; diff --git a/src/main/java/thedarkcolour/exdeorum/tag/EBiomeTags.java b/src/main/java/thedarkcolour/exdeorum/tag/EBiomeTags.java index 2b5dd825..bf84143c 100644 --- a/src/main/java/thedarkcolour/exdeorum/tag/EBiomeTags.java +++ b/src/main/java/thedarkcolour/exdeorum/tag/EBiomeTags.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/tag/EBlockTags.java b/src/main/java/thedarkcolour/exdeorum/tag/EBlockTags.java index 081668bf..4dbd57d4 100644 --- a/src/main/java/thedarkcolour/exdeorum/tag/EBlockTags.java +++ b/src/main/java/thedarkcolour/exdeorum/tag/EBlockTags.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/tag/EItemTags.java b/src/main/java/thedarkcolour/exdeorum/tag/EItemTags.java index 7cd152b5..b7dfbca1 100644 --- a/src/main/java/thedarkcolour/exdeorum/tag/EItemTags.java +++ b/src/main/java/thedarkcolour/exdeorum/tag/EItemTags.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/tag/EStructureSetTags.java b/src/main/java/thedarkcolour/exdeorum/tag/EStructureSetTags.java index ec795bf5..8a062372 100644 --- a/src/main/java/thedarkcolour/exdeorum/tag/EStructureSetTags.java +++ b/src/main/java/thedarkcolour/exdeorum/tag/EStructureSetTags.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/thedarkcolour/exdeorum/tag/package-info.java b/src/main/java/thedarkcolour/exdeorum/tag/package-info.java new file mode 100644 index 00000000..55cd9145 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/tag/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.tag; diff --git a/src/main/java/thedarkcolour/exdeorum/voidworld/VoidChunkGenerator.java b/src/main/java/thedarkcolour/exdeorum/voidworld/VoidChunkGenerator.java index fa1c86b4..1d726470 100644 --- a/src/main/java/thedarkcolour/exdeorum/voidworld/VoidChunkGenerator.java +++ b/src/main/java/thedarkcolour/exdeorum/voidworld/VoidChunkGenerator.java @@ -1,6 +1,6 @@ /* * Ex Deorum - * Copyright (c) 2023 thedarkcolour + * Copyright (c) 2024 thedarkcolour * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +81,7 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { @Override public void applyCarvers(WorldGenRegion pLevel, long pSeed, RandomState pRandom, BiomeManager pBiomeManager, StructureManager pStructureManager, ChunkAccess pChunk, GenerationStep.Carving pStep) { - if (generateNormal) { + if (this.generateNormal) { super.applyCarvers(pLevel, pSeed, pRandom, pBiomeManager, pStructureManager, pChunk, pStep); } } @@ -89,26 +89,26 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { // Filter structures @Override public ChunkGeneratorStructureState createState(HolderLookup lookup, RandomState pRandomState, long pSeed) { - return generateNormal ? super.createState(lookup, pRandomState, pSeed) : super.createState(new FilteredLookup(lookup, allowedStructureSets), pRandomState, pSeed); + return this.generateNormal ? super.createState(lookup, pRandomState, pSeed) : super.createState(new FilteredLookup(lookup, this.allowedStructureSets), pRandomState, pSeed); } @Override public void buildSurface(WorldGenRegion pLevel, StructureManager pStructureManager, RandomState pRandom, ChunkAccess pChunk) { - if (generateNormal) { + if (this.generateNormal) { super.buildSurface(pLevel, pStructureManager, pRandom, pChunk); } } @Override public void spawnOriginalMobs(WorldGenRegion pLevel) { - if (generateNormal) { + if (this.generateNormal) { super.spawnOriginalMobs(pLevel); } } @Override public CompletableFuture fillFromNoise(Executor pExecutor, Blender pBlender, RandomState pRandom, StructureManager pStructureManager, ChunkAccess chunk) { - if (generateNormal) { + if (this.generateNormal) { return super.fillFromNoise(pExecutor, pBlender, pRandom, pStructureManager, chunk); } else { return CompletableFuture.completedFuture(chunk); @@ -117,7 +117,7 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { @Override public int getBaseHeight(int pX, int pZ, Heightmap.Types pType, LevelHeightAccessor pLevel, RandomState pRandom) { - if (generateNormal) { + if (this.generateNormal) { return super.getBaseHeight(pX, pZ, pType, pLevel, pRandom); } else { return getMinY(); @@ -126,7 +126,7 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { @Override public NoiseColumn getBaseColumn(int pX, int pZ, LevelHeightAccessor pHeight, RandomState pRandom) { - if (generateNormal) { + if (this.generateNormal) { return super.getBaseColumn(pX, pZ, pHeight, pRandom); } else { return new NoiseColumn(0, new BlockState[0]); @@ -135,27 +135,27 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { @Override public void addDebugScreenInfo(List pInfo, RandomState pRandom, BlockPos pPos) { - if (generateNormal) { + if (this.generateNormal) { super.addDebugScreenInfo(pInfo, pRandom, pPos); } } @Override public void createReferences(WorldGenLevel level, StructureManager pStructureManager, ChunkAccess pChunk) { - if (generateNormal || hasStructures(level.registryAccess())) { + if (this.generateNormal || hasStructures(level.registryAccess())) { super.createReferences(level, pStructureManager, pChunk); } } @Override public void createStructures(RegistryAccess registries, ChunkGeneratorStructureState pStructureState, StructureManager pStructureManager, ChunkAccess pChunk, StructureTemplateManager pStructureTemplateManager) { - if (generateNormal || hasStructures(registries)) { + if (this.generateNormal || hasStructures(registries)) { super.createStructures(registries, pStructureState, pStructureManager, pChunk, pStructureTemplateManager); } } private boolean hasStructures(RegistryAccess registries) { - return registries.registryOrThrow(Registries.STRUCTURE_SET).getTagOrEmpty(allowedStructureSets).iterator().hasNext(); + return registries.registryOrThrow(Registries.STRUCTURE_SET).getTagOrEmpty(this.allowedStructureSets).iterator().hasNext(); } private static class FilteredLookup extends HolderLookup.Delegate { @@ -168,12 +168,12 @@ public class VoidChunkGenerator extends NoiseBasedChunkGenerator { @Override public Optional> get(ResourceKey key) { - return this.parent.get(key).filter(obj -> obj.is(allowedValues)); + return this.parent.get(key).filter(obj -> obj.is(this.allowedValues)); } @Override public Stream> listElements() { - return this.parent.listElements().filter(obj -> obj.is(allowedValues)); + return this.parent.listElements().filter(obj -> obj.is(this.allowedValues)); } } } diff --git a/src/main/java/thedarkcolour/exdeorum/voidworld/package-info.java b/src/main/java/thedarkcolour/exdeorum/voidworld/package-info.java new file mode 100644 index 00000000..70b49a2f --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/voidworld/package-info.java @@ -0,0 +1,21 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@net.minecraft.MethodsReturnNonnullByDefault +@javax.annotation.ParametersAreNonnullByDefault +package thedarkcolour.exdeorum.voidworld; diff --git a/src/main/resources/coremods.js b/src/main/resources/coremods.js index 1fb99f85..c278fde0 100644 --- a/src/main/resources/coremods.js +++ b/src/main/resources/coremods.js @@ -42,7 +42,7 @@ function initializeCoreMod() { return method; } }, - // Redirects a field access in the constructor of DedicatedServerProperties from WorldPresets.NORMAL to EWorldPresets.VOID_WORLD + // Redirects a field access in the constructor of DedicatedServerProperties from WorldPresets.NORMAL to ASMHooks.overrideDefaultWorldPreset() 'DedicatedServerPropertiesPatch': { 'target': { 'type': 'METHOD', @@ -57,8 +57,8 @@ function initializeCoreMod() { var insn = insnList.get(i); if (insn.getOpcode() === Opcodes.GETSTATIC && (insn.name.equals('f_226437_') || insn.name.equals('NORMAL'))) { - insn.owner = 'thedarkcolour/exdeorum/registry/EWorldPresets'; - insn.name = 'VOID_WORLD'; + var newInsn = new MethodInsnNode(Opcodes.INVOKESTATIC, 'thedarkcolour/exdeorum/asm/ASMHooks', 'overrideDefaultWorldPreset', '()Lnet/minecraft/resources/ResourceKey;', false) + insnList.set(insn, newInsn); ASMAPI.log('INFO', 'Successfully patched server.properties to use void world type by default'); return method;