diff --git a/build.gradle b/build.gradle index 827b3714..c822aabf 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'org.spongepowered.mixin' version '0.7.+' } -version = '1.21' +version = '1.24' group = 'thedarkcolour.exdeorum' base { archivesName = 'exdeorum' diff --git a/changelog.md b/changelog.md index 898fb6ad..bb8b66e9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,17 @@ +## Ex Deorum 1.24 +- Fixed water crucibles filling infinitely with rainwater. (PR #54 by CPearl0) +- Add option (disabled by default) to make dirt from flowing water and witch water +- Fix Infested Leaves not showing in REI composite mode + +## Ex Deorum 1.23 +- Fixed rendering crash with crucibles +- Added recipes to upgrade meshes to the next tier + +## Ex Deorum 1.22 +- Fixed behavior of Porcelain Milk Bucket when the milk fluid is enabled +- Fixed barrel not rendering flat item contents like Magma Cream +- Fixed Infested Leaves not dropping any string or silkworms + ## Ex Deorum 1.21 - Added Crook recipes. It is now possible to add drops to the crook, for example, you could make it so that using a Crook on tall grass would have a 1% chance of dropping a diamond. - Added Crucible Heat Source recipes. Instead of using KubeJS, crucible heat sources can now be added with datapacks. Old KubeJS scripts will still work fine. diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 8421ea36..65c26790 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.20.1 2024-02-09T12:37:53.8355693 Loot Tables +// 1.20.1 2024-02-12T09:38:22.3873783 Loot Tables 105d8a61ea7145d7798146d385d4aad24fd1588d data/exdeorum/loot_tables/blocks/acacia_barrel.json 1e77127a82cbba0937bb02694f65cf1893aeffcb data/exdeorum/loot_tables/blocks/acacia_crucible.json fcc00910a8cc94bed6339d6833fcec53c501a0d7 data/exdeorum/loot_tables/blocks/acacia_sieve.json @@ -51,6 +51,7 @@ b3b8c57f4614b036263f1e107bb1e0acf4a69122 data/exdeorum/loot_tables/blocks/green_ 32602e363024f1bbd0a174a19c61b4cb0e4f3b2c data/exdeorum/loot_tables/blocks/hellbark_barrel.json cbf36cffd7f38d618435ca03142ded5e74f217aa data/exdeorum/loot_tables/blocks/hellbark_crucible.json bf41c8c33133269ddde2c6b098aca056acd7e4ea data/exdeorum/loot_tables/blocks/hellbark_sieve.json +3b759445e6d4ee6dd1690aaa792bb070e19cde4f data/exdeorum/loot_tables/blocks/infested_leaves.json ce4254c53a4ce6c2712775708415f14e63f21b67 data/exdeorum/loot_tables/blocks/jacaranda_barrel.json b23b0494ef9f535744f7390f74a35527442aee6f data/exdeorum/loot_tables/blocks/jacaranda_crucible.json 1817eb94fb9656a3ad853f2cca138c1cd012bd26 data/exdeorum/loot_tables/blocks/jacaranda_sieve.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 29042778..3aa35b8b 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.20.1 2024-02-09T20:14:05.875864 Recipes +// 1.20.1 2024-02-13T15:52:36.681433 Recipes e37b64428f17e304e91539ac0513456d7ce40cd1 data/exdeorum/advancements/recipes/building_blocks/sponge.json 5ad481a0c376c1a1785a5d3b992064d0ec0bf3b0 data/exdeorum/advancements/recipes/food/end_cake.json 25dd027e844a72b03c95dbe5e3c3dd8c738ceb00 data/exdeorum/advancements/recipes/misc/acacia_barrel.json @@ -30,12 +30,16 @@ cf30753819f21a29082554871fa4617a060eb11c data/exdeorum/advancements/recipes/misc 6fa805a246c424ea651fff9003e11f3c8632cd3c data/exdeorum/advancements/recipes/misc/dark_oak_crucible.json ce387be36edacdb259a5ea4564ad4b14ccec7950 data/exdeorum/advancements/recipes/misc/dark_oak_sieve.json 05ed034071a2c7df228c235fa1104052aca23ebc data/exdeorum/advancements/recipes/misc/diamond_mesh.json +e2d8907fddf4e1cfce8264ecb4f64e8a0a740864 data/exdeorum/advancements/recipes/misc/diamond_mesh_from_golden_mesh.json 7a521fa3d4d9c602a1135e22ef63d5e407f3262a data/exdeorum/advancements/recipes/misc/diorite.json fd152bac09d1c3bbe67302f13c2135428d6ef48e data/exdeorum/advancements/recipes/misc/flint_mesh.json +c53bfdee553d63b3e96194991a4b14dfd7bcb083 data/exdeorum/advancements/recipes/misc/flint_mesh_from_string_mesh.json f3d25fad0818f06ed341008daa157732a41702f0 data/exdeorum/advancements/recipes/misc/golden_mesh.json +2ad83bb51d746348b7be8a3a50c6a96d07d58c9e data/exdeorum/advancements/recipes/misc/golden_mesh_from_iron_mesh.json 8e0b91838f1597f97158c6d6c1d5d4dd1da3ceb7 data/exdeorum/advancements/recipes/misc/gold_ore.json 13e1a8346dc49decee9de11f6d589f0b033aa65d data/exdeorum/advancements/recipes/misc/granite.json 6b6169e1c93c990cdac051f6b96849a4cf1850ad data/exdeorum/advancements/recipes/misc/iron_mesh.json +2bc30374479baadb359411edd929ebf0fb1e9a37 data/exdeorum/advancements/recipes/misc/iron_mesh_from_flint_mesh.json 2f2e4e3f4893390b7248a1fd9fd405d628aaa69c data/exdeorum/advancements/recipes/misc/iron_ore.json 13ae44cb8da590953fc295c730e3606ab8c8ef7e data/exdeorum/advancements/recipes/misc/jungle_barrel.json 4e23fd62963a608c73565d61966cd700537b48a7 data/exdeorum/advancements/recipes/misc/jungle_crucible.json @@ -231,6 +235,7 @@ b14283dd10c79ddb507aa849a9a432266b615f19 data/exdeorum/recipes/dark_oak_sieve.js 49db33903b6892db0f17ce50e9a3ca78aef007ed data/exdeorum/recipes/dead_sieve.json 0558034d3940e2bd4046ad2af07c42068852dc76 data/exdeorum/recipes/diamond_hammer.json 4bb1b1df247eaa495b18df77893ac6cfaaa9477a data/exdeorum/recipes/diamond_mesh.json +e8b0389a7d980e745bc8df86c2d3d35b0792cad4 data/exdeorum/recipes/diamond_mesh_from_golden_mesh.json 8244864c8c0fb88af380c18bb593a8cb3982abbd data/exdeorum/recipes/diamond_watering_can.json 596e6fb9a4c633938b7b3c778baad53cdd9fd2ed data/exdeorum/recipes/diorite.json 44da784210aab9a5035b77cb1fa71761b025ef62 data/exdeorum/recipes/dusk_barrel.json @@ -241,11 +246,13 @@ a3b9f47a73b9cbb4d908ac0b8ad90b308271c04c data/exdeorum/recipes/fir_barrel.json 7f7a034824513701aa0493267f7f8219d8fdef89 data/exdeorum/recipes/fir_crucible.json 8821d420a2f1dae54a0276cf33f94b5689eda056 data/exdeorum/recipes/fir_sieve.json fafeef8c11df81d877166ba0d4add3823515dad3 data/exdeorum/recipes/flint_mesh.json +31d74ecb43dbcc5b40a1ef4694974166d21f4781 data/exdeorum/recipes/flint_mesh_from_string_mesh.json c778aaf0af19417cab77cc60852725c871190ad3 data/exdeorum/recipes/frostbright_barrel.json 3023dca367b5b56ef41c2819c9169bb961f0c9a8 data/exdeorum/recipes/frostbright_crucible.json 500a5175a3660f37899b652a3c18c3d867f7c504 data/exdeorum/recipes/frostbright_sieve.json 4adddee39d6ff6ee58dedfdeb32265a051f9a722 data/exdeorum/recipes/golden_hammer.json a32f858ab7b6b5d5546b8474175a44a93d85f8bc data/exdeorum/recipes/golden_mesh.json +58896fb67b08a41479546cd64f6e97ea9afbe013 data/exdeorum/recipes/golden_mesh_from_iron_mesh.json a119064052e4bb6873c6dc10c50b36e52e9dc58c data/exdeorum/recipes/golden_oak_crucible.json e77acbd0878f662f441d590287e71e66593ef928 data/exdeorum/recipes/golden_watering_can.json 44ed0e97591833c39e32847f22edf333ae551b22 data/exdeorum/recipes/gold_ore.json @@ -282,6 +289,7 @@ f6b16e8168c798bc433e19edf5ede3a7703865f5 data/exdeorum/recipes/hammer/wood_chipp 2995ec75979bfb8b0415b8a1da7db7001b9ae433 data/exdeorum/recipes/hellbark_sieve.json 3067ccffd037b6d16ba09ae181813be6471d2050 data/exdeorum/recipes/iron_hammer.json f046e0fa73b12cea658363a082ad0da48e21e85d data/exdeorum/recipes/iron_mesh.json +a1a0885f28b2cbe72251d6db69df22a4e8e47d97 data/exdeorum/recipes/iron_mesh_from_flint_mesh.json 6f06b4d91979afc8000988cd20519379152a373b data/exdeorum/recipes/iron_ore.json f4ea515ec72c867b9c0b54df162bd07c62e1a7ce data/exdeorum/recipes/iron_watering_can.json 4d7d68580f0271eea4728062fa608b87aa04570f data/exdeorum/recipes/jacaranda_barrel.json diff --git a/src/generated/resources/.cache/fc2b6ffd874afaa6f2f20b450921dbfbbc8b86bd b/src/generated/resources/.cache/fc2b6ffd874afaa6f2f20b450921dbfbbc8b86bd index f3d7bef9..b3207d84 100644 --- a/src/generated/resources/.cache/fc2b6ffd874afaa6f2f20b450921dbfbbc8b86bd +++ b/src/generated/resources/.cache/fc2b6ffd874afaa6f2f20b450921dbfbbc8b86bd @@ -1,4 +1,4 @@ -// 1.20.1 2024-01-25T14:16:46.2347562 ModKit Item Models for mod 'exdeorum' +// 1.20.1 2024-02-15T19:28:58.9458068 ModKit Item Models for mod 'exdeorum' 4ba3bb2c6174ac3728a4b85e34681f118ec8eb34 assets/exdeorum/models/item/acacia_barrel.json c03ce41f7c071498fcbd5f5225e91dcb2f365fbb assets/exdeorum/models/item/acacia_crucible.json 3b4f1d45c0d9c4cd1d9a5cdf6ddc8d2c9791bca5 assets/exdeorum/models/item/acacia_sieve.json @@ -76,6 +76,7 @@ a117ad0a6e1d193ee65c0a2af1a88f7f5be444fd assets/exdeorum/models/item/green_archw b0d0d1ec41f465872243ea5b59a22caeadc1b81a assets/exdeorum/models/item/hellbark_barrel.json 4de47af7d2a66a6e18ce93c9e3a1582b33073a6b assets/exdeorum/models/item/hellbark_crucible.json c3a5bdc2c3e8b12b41e9c3aae44839a331a5d238 assets/exdeorum/models/item/hellbark_sieve.json +53eb28442e7df2970b24a79fe0830c41c2388487 assets/exdeorum/models/item/infested_leaves.json abd9901aa00893690461a6c6e276bb6bc96a60bb assets/exdeorum/models/item/iridium_ore_chunk.json b91a19335ff248805cf0861cae82b93d71a9e805 assets/exdeorum/models/item/iron_hammer.json 3398985db718bd990d9f7cfdf4bacf67a858b906 assets/exdeorum/models/item/iron_mesh.json diff --git a/src/generated/resources/assets/exdeorum/models/item/infested_leaves.json b/src/generated/resources/assets/exdeorum/models/item/infested_leaves.json new file mode 100644 index 00000000..3d93d0b0 --- /dev/null +++ b/src/generated/resources/assets/exdeorum/models/item/infested_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "exdeorum:block/infested_leaves" +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/advancements/recipes/misc/diamond_mesh_from_golden_mesh.json b/src/generated/resources/data/exdeorum/advancements/recipes/misc/diamond_mesh_from_golden_mesh.json new file mode 100644 index 00000000..2609813c --- /dev/null +++ b/src/generated/resources/data/exdeorum/advancements/recipes/misc/diamond_mesh_from_golden_mesh.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:gems/diamond" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "exdeorum:diamond_mesh_from_golden_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "exdeorum:diamond_mesh_from_golden_mesh" + ] + }, + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/advancements/recipes/misc/flint_mesh_from_string_mesh.json b/src/generated/resources/data/exdeorum/advancements/recipes/misc/flint_mesh_from_string_mesh.json new file mode 100644 index 00000000..25b76677 --- /dev/null +++ b/src/generated/resources/data/exdeorum/advancements/recipes/misc/flint_mesh_from_string_mesh.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:flint" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "exdeorum:flint_mesh_from_string_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "exdeorum:flint_mesh_from_string_mesh" + ] + }, + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/advancements/recipes/misc/golden_mesh_from_iron_mesh.json b/src/generated/resources/data/exdeorum/advancements/recipes/misc/golden_mesh_from_iron_mesh.json new file mode 100644 index 00000000..0af0b5a8 --- /dev/null +++ b/src/generated/resources/data/exdeorum/advancements/recipes/misc/golden_mesh_from_iron_mesh.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:ingots/gold" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "exdeorum:golden_mesh_from_iron_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "exdeorum:golden_mesh_from_iron_mesh" + ] + }, + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/advancements/recipes/misc/iron_mesh_from_flint_mesh.json b/src/generated/resources/data/exdeorum/advancements/recipes/misc/iron_mesh_from_flint_mesh.json new file mode 100644 index 00000000..63dd8b93 --- /dev/null +++ b/src/generated/resources/data/exdeorum/advancements/recipes/misc/iron_mesh_from_flint_mesh.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:ingots/iron" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "exdeorum:iron_mesh_from_flint_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "exdeorum:iron_mesh_from_flint_mesh" + ] + }, + "sends_telemetry_event": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/loot_tables/blocks/infested_leaves.json b/src/generated/resources/data/exdeorum/loot_tables/blocks/infested_leaves.json new file mode 100644 index 00000000..88065a5b --- /dev/null +++ b/src/generated/resources/data/exdeorum/loot_tables/blocks/infested_leaves.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [], + "rolls": 1.0 + } + ], + "random_sequence": "exdeorum:blocks/infested_leaves" +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/recipes/diamond_mesh_from_golden_mesh.json b/src/generated/resources/data/exdeorum/recipes/diamond_mesh_from_golden_mesh.json new file mode 100644 index 00000000..94c15ad7 --- /dev/null +++ b/src/generated/resources/data/exdeorum/recipes/diamond_mesh_from_golden_mesh.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "forge:gems/diamond" + }, + "M": { + "item": "exdeorum:golden_mesh" + } + }, + "pattern": [ + " # ", + "#M#", + " # " + ], + "result": { + "item": "exdeorum:diamond_mesh" + }, + "show_notification": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/recipes/flint_mesh_from_string_mesh.json b/src/generated/resources/data/exdeorum/recipes/flint_mesh_from_string_mesh.json new file mode 100644 index 00000000..f27759d8 --- /dev/null +++ b/src/generated/resources/data/exdeorum/recipes/flint_mesh_from_string_mesh.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "minecraft:flint" + }, + "M": { + "item": "exdeorum:string_mesh" + } + }, + "pattern": [ + " # ", + "#M#", + " # " + ], + "result": { + "item": "exdeorum:flint_mesh" + }, + "show_notification": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/recipes/golden_mesh_from_iron_mesh.json b/src/generated/resources/data/exdeorum/recipes/golden_mesh_from_iron_mesh.json new file mode 100644 index 00000000..4ddda303 --- /dev/null +++ b/src/generated/resources/data/exdeorum/recipes/golden_mesh_from_iron_mesh.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "forge:ingots/gold" + }, + "M": { + "item": "exdeorum:iron_mesh" + } + }, + "pattern": [ + " # ", + "#M#", + " # " + ], + "result": { + "item": "exdeorum:golden_mesh" + }, + "show_notification": true +} \ No newline at end of file diff --git a/src/generated/resources/data/exdeorum/recipes/iron_mesh_from_flint_mesh.json b/src/generated/resources/data/exdeorum/recipes/iron_mesh_from_flint_mesh.json new file mode 100644 index 00000000..75ad28ad --- /dev/null +++ b/src/generated/resources/data/exdeorum/recipes/iron_mesh_from_flint_mesh.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "forge:ingots/iron" + }, + "M": { + "item": "exdeorum:flint_mesh" + } + }, + "pattern": [ + " # ", + "#M#", + " # " + ], + "result": { + "item": "exdeorum:iron_mesh" + }, + "show_notification": true +} \ No newline at end of file diff --git a/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java b/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java index 14adb076..2eb570f3 100644 --- a/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java +++ b/src/main/java/thedarkcolour/exdeorum/block/InfestedLeavesBlock.java @@ -21,8 +21,10 @@ package thedarkcolour.exdeorum.block; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; @@ -56,6 +58,23 @@ public class InfestedLeavesBlock extends LeavesBlock implements EntityBlock { builder.add(FULLY_INFESTED); } + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + if (ctx.getPlayer() != null) { + return defaultBlockState().setValue(FULLY_INFESTED, true); + } + return super.getStateForPlacement(ctx); + } + + @Override + public void setPlacedBy(Level level, BlockPos pos, BlockState pState, @Nullable LivingEntity player, ItemStack pStack) { + if (player != null) { + if (!level.isClientSide && level.getBlockEntity(pos) instanceof InfestedLeavesBlockEntity leaves) { + leaves.setProgress(1.0f); + } + } + } + @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java index c34295f8..a1f4d57a 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java @@ -52,6 +52,7 @@ import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.registries.ForgeRegistries; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import thedarkcolour.exdeorum.blockentity.helper.FluidHelper; import thedarkcolour.exdeorum.config.EConfig; import thedarkcolour.exdeorum.recipe.crucible.CrucibleRecipe; import thedarkcolour.exdeorum.registry.EBlockEntities; @@ -291,7 +292,7 @@ public abstract class AbstractCrucibleBlockEntity extends EBlockEntity { } } - private static class FluidHandler extends FluidTank { + private static class FluidHandler extends FluidHelper { public FluidHandler() { super(4_000); } @@ -362,7 +363,8 @@ public abstract class AbstractCrucibleBlockEntity extends EBlockEntity { if (crucible.tank.isEmpty()) { crucible.tank.setFluid(new FluidStack(Fluids.WATER, 1)); crucible.markUpdated(); - } else if (crucible.tank.getFluid().getFluid() == Fluids.WATER) { + } else if (crucible.tank.getFluid().getFluid() == Fluids.WATER && + crucible.tank.getFluidAmount() < crucible.tank.getCapacity()) { crucible.tank.getFluid().grow(1); crucible.markUpdated(); } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java index 72b43a2c..1132e01c 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java @@ -51,12 +51,12 @@ import net.minecraftforge.fluids.FluidType; import net.minecraftforge.fluids.FluidUtil; import net.minecraftforge.fluids.IFluidTank; import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; import thedarkcolour.exdeorum.block.BarrelBlock; +import thedarkcolour.exdeorum.blockentity.helper.FluidHelper; import thedarkcolour.exdeorum.client.CompostColors; import thedarkcolour.exdeorum.config.EConfig; import thedarkcolour.exdeorum.material.BarrelMaterial; @@ -608,7 +608,7 @@ public class BarrelBlockEntity extends EBlockEntity { } // Inner class - private class FluidHandler extends FluidTank { + private class FluidHandler extends FluidHelper { public FluidHandler() { super(1000); } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java index 1acf4748..afc51ce0 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java @@ -119,6 +119,10 @@ public class InfestedLeavesBlockEntity extends EBlockEntity { return this.progress; } + public void setProgress(float progress) { + this.progress = progress; + } + public BlockState getMimic() { return this.mimic; } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/EnergyHelper.java b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/EnergyHelper.java index ad208e05..6a6516b8 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/EnergyHelper.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/EnergyHelper.java @@ -25,18 +25,6 @@ public class EnergyHelper extends EnergyStorage { super(capacity); } - public EnergyHelper(int capacity, int maxTransfer) { - super(capacity, maxTransfer); - } - - public EnergyHelper(int capacity, int maxReceive, int maxExtract) { - super(capacity, maxReceive, maxExtract); - } - - public EnergyHelper(int capacity, int maxReceive, int maxExtract, int energy) { - super(capacity, maxReceive, maxExtract, energy); - } - public void setStoredEnergy(int energy) { this.energy = energy; } diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/FluidHelper.java b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/FluidHelper.java new file mode 100644 index 00000000..7462e08d --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/FluidHelper.java @@ -0,0 +1,37 @@ +/* + * 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 . + */ + +package thedarkcolour.exdeorum.blockentity.helper; + +import net.minecraft.nbt.CompoundTag; +import net.minecraftforge.fluids.capability.templates.FluidTank; + +// Only changed behavior from FluidTank is that fluid stacks read from NBT are clamped and removed validator predicate. +public class FluidHelper extends FluidTank { + public FluidHelper(int capacity) { + super(capacity); + } + + @Override + public FluidTank readFromNBT(CompoundTag nbt) { + super.readFromNBT(nbt); + this.fluid.setAmount(Math.min(this.capacity, this.fluid.getAmount())); + + return this; + } +} diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/ItemHelper.java b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/ItemHelper.java index 85aeb1a1..0914eac4 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/helper/ItemHelper.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/helper/ItemHelper.java @@ -24,6 +24,7 @@ import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.SlotItemHandler; import org.jetbrains.annotations.NotNull; +// Has same behavior as ItemStackHandler but is more customizable. public class ItemHelper extends ItemStackHandler { public ItemHelper(int size) { super(size); diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java index 783b57a2..ca5f8053 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/CrucibleRenderer.java @@ -23,6 +23,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.util.Mth; +import net.minecraft.world.level.block.Block; import net.minecraftforge.common.capabilities.ForgeCapabilities; import thedarkcolour.exdeorum.blockentity.AbstractCrucibleBlockEntity; import thedarkcolour.exdeorum.client.RenderUtil; @@ -51,15 +52,20 @@ public class CrucibleRenderer implements BlockEntityRenderer> 16) & 0xff, (color >> 8) & 0xff, color & 0xff, fluid); } if (solids != 0) { - // LastMelted is not null if solids is nonzero - @SuppressWarnings("DataFlowIssue") - var face = RenderUtil.getTopFaceOrDefault(crucible.getLastMelted(), crucible.getDefaultMeltBlock()); + // eating my words rn :( + var lastMelted = crucible.getLastMelted(); + if (lastMelted == null) { + lastMelted = crucible.getDefaultMeltBlock(); + } - var color = Minecraft.getInstance().getBlockColors().getColor(crucible.getLastMelted().defaultBlockState(), level, pos, 0); + var face = RenderUtil.getTopFaceOrDefault(lastMelted, crucible.getDefaultMeltBlock()); + + var color = Minecraft.getInstance().getBlockColors().getColor(lastMelted.defaultBlockState(), level, pos, 0); if (color == -1) color = 0xffffff; face.renderFlatSpriteLerp(buffers, stack, solids, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff, light, 2.0f, 4.0f, 14.0f); + } } }); diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java index 41a4602a..15735402 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/ExDeorumJeiPlugin.java @@ -143,7 +143,7 @@ public class ExDeorumJeiPlugin implements IModPlugin { @Override public void registerRecipes(IRecipeRegistration registration) { - registration.addItemStackInfo(new ItemStack(EItems.SILK_WORM.get()), Component.translatable(TranslationKeys.SILK_WORM_JEI_INFO)); + registration.addItemStackInfo(List.of(new ItemStack(EItems.INFESTED_LEAVES.get()), new ItemStack(EItems.SILK_WORM.get())), Component.translatable(TranslationKeys.SILK_WORM_JEI_INFO)); registration.addItemStackInfo(List.of(new ItemStack(EBlocks.OAK_SIEVE.get()), new ItemStack(EBlocks.SPRUCE_SIEVE.get()), new ItemStack(EBlocks.BIRCH_SIEVE.get()), new ItemStack(EBlocks.JUNGLE_SIEVE.get()), new ItemStack(EBlocks.ACACIA_SIEVE.get()), new ItemStack(EBlocks.DARK_OAK_SIEVE.get()), new ItemStack(EBlocks.MANGROVE_SIEVE.get()), new ItemStack(EBlocks.CHERRY_SIEVE.get()), new ItemStack(EBlocks.BAMBOO_SIEVE.get()), new ItemStack(EBlocks.CRIMSON_SIEVE.get()), new ItemStack(EBlocks.WARPED_SIEVE.get())), Component.translatable(TranslationKeys.SIEVE_JEI_INFO)); registration.addItemStackInfo(List.of(new ItemStack(EItems.STRING_MESH.get()), new ItemStack(EItems.STRING_MESH.get()), new ItemStack(EItems.FLINT_MESH.get()), new ItemStack(EItems.IRON_MESH.get()), new ItemStack(EItems.GOLDEN_MESH.get()), new ItemStack(EItems.DIAMOND_MESH.get()), new ItemStack(EItems.NETHERITE_MESH.get())), Component.translatable(TranslationKeys.SIEVE_MESH_JEI_INFO)); registration.addItemStackInfo(List.of(WateringCanItem.getFull(EItems.WOODEN_WATERING_CAN), WateringCanItem.getFull(EItems.STONE_WATERING_CAN), WateringCanItem.getFull(EItems.IRON_WATERING_CAN), WateringCanItem.getFull(EItems.GOLDEN_WATERING_CAN), WateringCanItem.getFull(EItems.DIAMOND_WATERING_CAN), WateringCanItem.getFull(EItems.NETHERITE_WATERING_CAN)), Component.translatable(TranslationKeys.WATERING_CAN_JEI_INFO)); diff --git a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java index 76fd968d..5275394f 100644 --- a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java +++ b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java @@ -125,6 +125,7 @@ public class EConfig { public final IntValue simultaneousSieveUsageRange; public final BooleanValue automatedSieves; public final DoubleValue barrelProgressStep; + public final BooleanValue witchWaterDirtGenerator; public final BooleanValue witchWaterNetherrackGenerator; public final ConfigValue defaultSpawnTreeFeature; public final BooleanValue useBiomeAppropriateTree; @@ -158,6 +159,9 @@ public class EConfig { this.barrelProgressStep = builder .comment("The progress to increment by each tick for barrel composting.") .defineInRange("barrel_progress_step", 0.004, 0.0f, 1.0f); + this.witchWaterDirtGenerator = builder + .comment("Whether Witch Water forms dirt when water flows into it, allowing for a dirt version of a cobblestone generator.") + .define("witch_water_dirt_generator", false); 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); diff --git a/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java b/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java index 0d022b78..b5374570 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java +++ b/src/main/java/thedarkcolour/exdeorum/data/BlockLoot.java @@ -51,6 +51,8 @@ class BlockLoot extends BlockLootSubProvider { } }); + add(EBlocks.INFESTED_LEAVES.get(), noDrop().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1)))); + machineDrop(EBlocks.MECHANICAL_HAMMER.get()); machineDrop(EBlocks.MECHANICAL_SIEVE.get()); } diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java index 689c597e..97267fa7 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java @@ -249,10 +249,14 @@ public class Recipes { // Meshes recipes.grid3x3(EItems.STRING_MESH.get(), ingredient(Tags.Items.STRING)); - mesh(recipes, EItems.FLINT_MESH.get(), ingredient(Items.FLINT)); - mesh(recipes, EItems.IRON_MESH.get(), ingredient(Tags.Items.INGOTS_IRON)); - mesh(recipes, EItems.GOLDEN_MESH.get(), ingredient(Tags.Items.INGOTS_GOLD)); - mesh(recipes, EItems.DIAMOND_MESH.get(), ingredient(Tags.Items.GEMS_DIAMOND)); + mesh(recipes, EItems.FLINT_MESH, ingredient(Items.FLINT)); + mesh(recipes, EItems.IRON_MESH, ingredient(Tags.Items.INGOTS_IRON)); + mesh(recipes, EItems.GOLDEN_MESH, ingredient(Tags.Items.INGOTS_GOLD)); + mesh(recipes, EItems.DIAMOND_MESH, ingredient(Tags.Items.GEMS_DIAMOND)); + meshUpgrade(recipes, EItems.FLINT_MESH, EItems.STRING_MESH, ingredient(Items.FLINT)); + meshUpgrade(recipes, EItems.IRON_MESH, EItems.FLINT_MESH, ingredient(Tags.Items.INGOTS_IRON)); + meshUpgrade(recipes, EItems.GOLDEN_MESH, EItems.IRON_MESH, ingredient(Tags.Items.INGOTS_GOLD)); + meshUpgrade(recipes, EItems.DIAMOND_MESH, EItems.GOLDEN_MESH, ingredient(Tags.Items.GEMS_DIAMOND)); recipes.netheriteUpgrade(RecipeCategory.MISC, ingredient(EItems.DIAMOND_MESH), EItems.NETHERITE_MESH.get()); // Watering cans @@ -382,8 +386,8 @@ public class Recipes { }); } - private static void mesh(MKRecipeProvider recipes, Item result, Ingredient ingredient) { - recipes.shapedCrafting(RecipeCategory.MISC, result, recipe -> { + private static void mesh(MKRecipeProvider recipes, Supplier result, Ingredient ingredient) { + recipes.shapedCrafting(RecipeCategory.MISC, result.get(), recipe -> { recipe.define('#', ingredient); recipe.define('S', ingredient(Tags.Items.STRING)); recipe.pattern("S#S"); @@ -392,6 +396,16 @@ public class Recipes { }); } + private static void meshUpgrade(MKRecipeProvider recipes, RegistryObject newMesh, RegistryObject previousMesh, Ingredient ingredient) { + recipes.shapedCrafting(newMesh.getId().getPath() + "_from_" + previousMesh.getId().getPath(), RecipeCategory.MISC, newMesh.get(), recipe -> { + recipe.define('#', ingredient); + recipe.define('M', previousMesh.get()); + recipe.pattern(" # "); + recipe.pattern("#M#"); + recipe.pattern(" # "); + }); + } + private static void wateringCan(MKRecipeProvider recipes, Supplier result, Ingredient shell) { recipes.shapedCrafting(RecipeCategory.TOOLS, result.get(), recipe -> { recipe.define('#', shell); diff --git a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java index a77963d2..85479d57 100644 --- a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java @@ -18,6 +18,7 @@ package thedarkcolour.exdeorum.event; +import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; @@ -28,12 +29,15 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.RandomSource; import net.minecraft.util.Unit; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.GameRules; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.XoroshiroRandomSource; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; @@ -171,6 +175,13 @@ public final class EventHandler { EFluids.WITCH_WATER_TYPE.get(), fluidState -> fluidState.isSource() ? Blocks.OBSIDIAN.defaultBlockState() : (EConfig.SERVER.witchWaterNetherrackGenerator.get() ? Blocks.NETHERRACK.defaultBlockState() : Blocks.COBBLESTONE.defaultBlockState()) )); + var dirtVariants = new BlockState[]{Blocks.DIRT.defaultBlockState(), Blocks.PODZOL.defaultBlockState(), Blocks.COARSE_DIRT.defaultBlockState()}; + var rng = RandomSource.create(); + FluidInteractionRegistry.addInteraction(EFluids.WITCH_WATER_TYPE.get(), new FluidInteractionRegistry.InteractionInformation( + (level, pos, relative, state) -> level.getFluidState(relative).getFluidType() == ForgeMod.WATER_TYPE.get() && EConfig.SERVER.witchWaterDirtGenerator.get(), + fluidState -> Util.getRandom(dirtVariants, rng) + )); + BarrelMaterial.loadTransparentBlocks(); }); } @@ -232,7 +243,6 @@ public final class EventHandler { if (ModList.get().isLoaded(ModIds.THE_ONE_PROBE)) { InterModComms.sendTo(ModIds.THE_ONE_PROBE, "getTheOneProbe", ExDeorumTopCompat::new); } - // todo instead of doing this, figure out the real reason sorting voids items if (ModList.get().isLoaded(ModIds.INVENTORY_SORTER)) { InterModComms.sendTo(ModIds.INVENTORY_SORTER, "slotblacklist", ItemHelper.Slot.class::getName); } diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java index d4798c27..5ddf3599 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java @@ -135,7 +135,7 @@ public class EBlocks { public static final RegistryObject MAPLE_CRUCIBLE = registerWaterCrucible("maple_crucible"); // Misc - public static final RegistryObject INFESTED_LEAVES = BLOCKS.register("infested_leaves", () -> new InfestedLeavesBlock(copy(Blocks.OAK_LEAVES).noLootTable())); + public static final RegistryObject INFESTED_LEAVES = BLOCKS.register("infested_leaves", () -> new InfestedLeavesBlock(copy(Blocks.OAK_LEAVES))); public static final RegistryObject WITCH_WATER = BLOCKS.register("witch_water", () -> new WitchWaterBlock(EFluids.WITCH_WATER, copy(Blocks.WATER).mapColor(MapColor.COLOR_PURPLE))); public static final RegistryObject END_CAKE = BLOCKS.register("end_cake", () -> new EndCakeBlock(of().noLootTable().mapColor(MapColor.COLOR_BLACK).forceSolidOn().strength(0.5F).sound(SoundType.WOOL).pushReaction(PushReaction.BLOCK))); diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index f9c72668..02e68abf 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -238,6 +238,8 @@ public class EItems { public static final RegistryObject MAPLE_CRUCIBLE = registerItemBlock(EBlocks.MAPLE_CRUCIBLE); public static final RegistryObject END_CAKE = registerItemBlock(EBlocks.END_CAKE); + public static final RegistryObject INFESTED_LEAVES = registerItemBlock(EBlocks.INFESTED_LEAVES); + public static void addItemsToMainTab(CreativeModeTab.Output output) { boolean biomesOPlenty = ModList.get().isLoaded(ModIds.BIOMES_O_PLENTY);