From 01ab639493c4469180a7fa57f986f88956242b9d Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 15:45:36 -0600 Subject: [PATCH 01/10] Fixed #45 Shift-click into Roaster inventory works --- .../cellar/screen/container/RoasterMenu.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/growthcraft/cellar/screen/container/RoasterMenu.java b/src/main/java/growthcraft/cellar/screen/container/RoasterMenu.java index 7b137134..f5b998b9 100644 --- a/src/main/java/growthcraft/cellar/screen/container/RoasterMenu.java +++ b/src/main/java/growthcraft/cellar/screen/container/RoasterMenu.java @@ -14,13 +14,13 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.SlotItemHandler; +import org.jetbrains.annotations.NotNull; public class RoasterMenu extends AbstractContainerMenu { private final RoasterBlockEntity blockEntity; private final RoasterBlock block; private final Level level; - private final ContainerData data; public RoasterMenu(int containerId, Inventory inventory, FriendlyByteBuf extraData) { this(containerId, inventory, inventory.player.level().getBlockEntity(extraData.readBlockPos()), new SimpleContainerData(2)); @@ -32,7 +32,6 @@ public RoasterMenu(int containerId, Inventory inventory, BlockEntity blockEntity this.blockEntity = (RoasterBlockEntity) blockEntity; this.block = (RoasterBlock) inventory.player.level().getBlockEntity(this.blockEntity.getBlockPos()).getBlockState().getBlock(); this.level = inventory.player.level(); - this.data = data; addPlayerInventory(inventory); addPlayerHotbar(inventory); @@ -43,7 +42,7 @@ public RoasterMenu(int containerId, Inventory inventory, BlockEntity blockEntity this.addSlot(new SlotItemHandler(handler, 1, 106, 42)); }); - addDataSlots(this.data); + addDataSlots(data); } @@ -73,12 +72,12 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 2; // must be the number of slots you have! @Override - public ItemStack quickMoveStack(Player playerIn, int index) { + public @NotNull ItemStack quickMoveStack(@NotNull Player playerIn, int index) { Slot sourceSlot = slots.get(index); - if (sourceSlot == null || !sourceSlot.hasItem()) return ItemStack.EMPTY; //EMPTY_ITEM + if (!sourceSlot.hasItem()) return ItemStack.EMPTY; //EMPTY_ITEM ItemStack sourceStack = sourceSlot.getItem(); ItemStack copyOfSourceStack = sourceStack.copy(); @@ -109,7 +108,7 @@ public ItemStack quickMoveStack(Player playerIn, int index) { } @Override - public boolean stillValid(Player player) { + public boolean stillValid(@NotNull Player player) { return stillValid( ContainerLevelAccess.create( this.level, From 2ada41def068ebebef4db159000bf71d39a6ef3b Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 15:47:46 -0600 Subject: [PATCH 02/10] Progress #53 Shift-click into Fruit Press inventory works --- .../growthcraft/cellar/screen/container/FruitPressMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/growthcraft/cellar/screen/container/FruitPressMenu.java b/src/main/java/growthcraft/cellar/screen/container/FruitPressMenu.java index f02d5818..c2d30e41 100644 --- a/src/main/java/growthcraft/cellar/screen/container/FruitPressMenu.java +++ b/src/main/java/growthcraft/cellar/screen/container/FruitPressMenu.java @@ -94,7 +94,7 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 1; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { From befc9e9f710edef0c4ac4f395003ab5b053485e1 Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 15:54:23 -0600 Subject: [PATCH 03/10] Fixed #53 Shift-click inventory is works on all Growthcraft inventory blocks. --- .../growthcraft/cellar/screen/container/BrewKettleMenu.java | 2 +- .../growthcraft/cellar/screen/container/CultureJarMenu.java | 2 +- .../cellar/screen/container/FermentationBarrelMenu.java | 2 +- src/main/java/growthcraft/milk/screen/container/ChurnMenu.java | 2 +- .../java/growthcraft/milk/screen/container/MixingVatMenu.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/growthcraft/cellar/screen/container/BrewKettleMenu.java b/src/main/java/growthcraft/cellar/screen/container/BrewKettleMenu.java index 24a05fbb..c46b68ab 100644 --- a/src/main/java/growthcraft/cellar/screen/container/BrewKettleMenu.java +++ b/src/main/java/growthcraft/cellar/screen/container/BrewKettleMenu.java @@ -89,7 +89,7 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 3; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { diff --git a/src/main/java/growthcraft/cellar/screen/container/CultureJarMenu.java b/src/main/java/growthcraft/cellar/screen/container/CultureJarMenu.java index c7fd9093..26ee4b28 100644 --- a/src/main/java/growthcraft/cellar/screen/container/CultureJarMenu.java +++ b/src/main/java/growthcraft/cellar/screen/container/CultureJarMenu.java @@ -101,7 +101,7 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 1; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { diff --git a/src/main/java/growthcraft/cellar/screen/container/FermentationBarrelMenu.java b/src/main/java/growthcraft/cellar/screen/container/FermentationBarrelMenu.java index 13f25eeb..8ece8a64 100644 --- a/src/main/java/growthcraft/cellar/screen/container/FermentationBarrelMenu.java +++ b/src/main/java/growthcraft/cellar/screen/container/FermentationBarrelMenu.java @@ -94,7 +94,7 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 1; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { diff --git a/src/main/java/growthcraft/milk/screen/container/ChurnMenu.java b/src/main/java/growthcraft/milk/screen/container/ChurnMenu.java index 41fc79b2..c83bb9ab 100644 --- a/src/main/java/growthcraft/milk/screen/container/ChurnMenu.java +++ b/src/main/java/growthcraft/milk/screen/container/ChurnMenu.java @@ -96,7 +96,7 @@ public int getProgressionScaled(int size) { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 1; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { diff --git a/src/main/java/growthcraft/milk/screen/container/MixingVatMenu.java b/src/main/java/growthcraft/milk/screen/container/MixingVatMenu.java index 8ce46f31..c4a4efbc 100644 --- a/src/main/java/growthcraft/milk/screen/container/MixingVatMenu.java +++ b/src/main/java/growthcraft/milk/screen/container/MixingVatMenu.java @@ -75,7 +75,7 @@ public BlockEntity getBlockEntity() { private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; - private static final int TE_INVENTORY_SLOT_COUNT = 0; // must be the number of slots you have! + private static final int TE_INVENTORY_SLOT_COUNT = 4; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int index) { From c57f6b5f120801b63a5f10da31051fd74f25e254 Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 16:03:32 -0600 Subject: [PATCH 04/10] Progress #45 Player can no longer place items in the Roaster output slot. --- .../growthcraft/cellar/block/entity/RoasterBlockEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java index 03615681..1e36deca 100644 --- a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java +++ b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java @@ -58,6 +58,11 @@ public class RoasterBlockEntity extends BlockEntity implements BlockEntityTicker protected void onContentsChanged(int slot) { setChanged(); } + + @Override + public boolean isItemValid(int slot, @NotNull ItemStack stack) { + return slot != 1; + } }; private LazyOptional itemHandlerLazyOptional = LazyOptional.empty(); From fa95828a511aa875b2db133eaa3c53aad0a4fe23 Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 18:12:55 -0600 Subject: [PATCH 05/10] Added Mekanism for testing pipes. --- build.gradle | 4 ++++ gradle.properties | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/build.gradle b/build.gradle index ad4d4f26..c604ff57 100644 --- a/build.gradle +++ b/build.gradle @@ -86,13 +86,17 @@ repositories { dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" + // JEI is required for custom recipe lookup. compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")) compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")) + // Runtime mods for testing runtimeOnly fg.deobf("curse.maven:theoneprobe-${curseforge_theoneprobe}") runtimeOnly fg.deobf("curse.maven:jei-${curseforge_jei}") runtimeOnly fg.deobf("curse.maven:patchouli-${curseforge_patchouli}") runtimeOnly fg.deobf("curse.maven:appleskin-${curseforge_appleskin}") + runtimeOnly fg.deobf("curse.maven:mekanism-${curseforge_mekanism}") + } // This block of code expands all declared replace properties in the specified resource targets. diff --git a/gradle.properties b/gradle.properties index 5aebb833..9b4cc266 100644 --- a/gradle.properties +++ b/gradle.properties @@ -45,3 +45,7 @@ curseforge_patchouli=306770:4636277 # AppleSkin https://www.curseforge.com/minecraft/mc-mods/appleskin/files curseforge_appleskin=248787:4770828 # ------------------------------------------------ +# Mekansim, for testing pipes +curseforge_mekanism=268560:4807067 +# ------------------------------------------------ + From 776c416ebfcf13d7180e7429aeaee37a46b85c5d Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 19:25:13 -0600 Subject: [PATCH 06/10] Fixed #45 Roaster has sided inventory for pipes. --- .../block/entity/RoasterBlockEntity.java | 56 +++++++++++++++- .../block/entity/handler/WrappedHandler.java | 64 +++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/main/java/growthcraft/lib/noeppi/block/entity/handler/WrappedHandler.java diff --git a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java index 1e36deca..6218dd98 100644 --- a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java +++ b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java @@ -4,6 +4,7 @@ import growthcraft.cellar.init.GrowthcraftCellarBlockEntities; import growthcraft.cellar.recipe.RoasterRecipe; import growthcraft.cellar.screen.container.RoasterMenu; +import growthcraft.lib.noeppi.block.entity.handler.WrappedHandler; import growthcraft.lib.utils.BlockStateUtils; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -39,6 +40,7 @@ import javax.annotation.ParametersAreNonnullByDefault; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import static growthcraft.cellar.block.RoasterBlock.*; @@ -63,10 +65,45 @@ protected void onContentsChanged(int slot) { public boolean isItemValid(int slot, @NotNull ItemStack stack) { return slot != 1; } + }; private LazyOptional itemHandlerLazyOptional = LazyOptional.empty(); + private final Map> itemHandlerLazyDirectionalMap = + Map.of( + Direction.UP, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (i) -> i == 0, + (i, stack) -> this.tickClock == 0 && itemStackHandler.isItemValid(0, stack)) + ), + Direction.DOWN, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (i) -> i == 0, + (i, stack) -> this.tickClock == 0 && itemStackHandler.isItemValid(0, stack)) + ), + Direction.NORTH, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (index) -> index == 1, + (index, stack) -> false) + ), + Direction.SOUTH, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (i) -> i == 1, + (i, s) -> false) + ), + Direction.EAST, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (i) -> i == 1, + (index, stack) -> false) + ), + Direction.WEST, LazyOptional.of( + () -> new WrappedHandler(itemStackHandler, + (index) -> index == 0 || index == 1, + (index, stack) -> false) + ) + ); + public RoasterBlockEntity(BlockPos blockPos, BlockState blockState) { this(GrowthcraftCellarBlockEntities.ROASTER_BLOCK_ENTITY.get(), blockPos, blockState); } @@ -281,7 +318,24 @@ public void invalidateCaps() { @Override public @NotNull LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { if (cap == ForgeCapabilities.ITEM_HANDLER) { - return itemHandlerLazyOptional.cast(); + if (side == null) { + return itemHandlerLazyOptional.cast(); + } + + if (itemHandlerLazyDirectionalMap.containsKey(side)) { + Direction localDir = this.getBlockState().getValue(RoasterBlock.FACING); + + if (side == Direction.UP || side == Direction.DOWN) { + return itemHandlerLazyDirectionalMap.get(side).cast(); + } + + return switch (localDir) { + default -> itemHandlerLazyDirectionalMap.get(side.getOpposite()).cast(); + case EAST -> itemHandlerLazyDirectionalMap.get(side.getClockWise()).cast(); + case SOUTH -> itemHandlerLazyDirectionalMap.get(side).cast(); + case WEST -> itemHandlerLazyDirectionalMap.get(side.getCounterClockWise()).cast(); + }; + } } return super.getCapability(cap, side); } diff --git a/src/main/java/growthcraft/lib/noeppi/block/entity/handler/WrappedHandler.java b/src/main/java/growthcraft/lib/noeppi/block/entity/handler/WrappedHandler.java new file mode 100644 index 00000000..138a689d --- /dev/null +++ b/src/main/java/growthcraft/lib/noeppi/block/entity/handler/WrappedHandler.java @@ -0,0 +1,64 @@ +package growthcraft.lib.noeppi.block.entity.handler; + +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.items.IItemHandlerModifiable; + +import javax.annotation.Nonnull; +import java.util.function.BiPredicate; +import java.util.function.Predicate; + +/* + * WrappedHandler by noeppi_noeppi + * under https://github.com/ModdingX/LibX/blob/1.19/LICENSE + * + */ +public class WrappedHandler implements IItemHandlerModifiable { + private final IItemHandlerModifiable handler; + private final Predicate extract; + private final BiPredicate insert; + + public WrappedHandler(IItemHandlerModifiable handler, Predicate extract, + BiPredicate insert) { + this.handler = handler; + this.extract = extract; + this.insert = insert; + } + + @Override + public void setStackInSlot(int slot, @Nonnull ItemStack stack) { + this.handler.setStackInSlot(slot, stack); + } + + @Override + public int getSlots() { + return this.handler.getSlots(); + } + + @Nonnull + @Override + public ItemStack getStackInSlot(int slot) { + return this.handler.getStackInSlot(slot); + } + + @Nonnull + @Override + public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + return this.insert.test(slot, stack) ? this.handler.insertItem(slot, stack, simulate) : stack; + } + + @Nonnull + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return this.extract.test(slot) ? this.handler.extractItem(slot, amount, simulate) : ItemStack.EMPTY; + } + + @Override + public int getSlotLimit(int slot) { + return this.handler.getSlotLimit(slot); + } + + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + return this.insert.test(slot, stack) && this.handler.isItemValid(slot, stack); + } +} \ No newline at end of file From 0d2fa1bce04b8926cd542ee3768335c965b07a55 Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 19:26:48 -0600 Subject: [PATCH 07/10] Fixed #45 Roaster has sided inventory for pipes. --- .../growthcraft/cellar/block/entity/RoasterBlockEntity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java index 6218dd98..a33bbd9e 100644 --- a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java +++ b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java @@ -99,7 +99,7 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) { ), Direction.WEST, LazyOptional.of( () -> new WrappedHandler(itemStackHandler, - (index) -> index == 0 || index == 1, + (index) -> index == 1, (index, stack) -> false) ) ); @@ -138,7 +138,6 @@ public int getCount() { }; } - public boolean isHeated() { boolean heated = BlockStateUtils.isHeated(this.level, this.getBlockPos()); // Only change the blockstate if it is different. From a5e46b3bbaf23c4504605affd4cf247936d60366 Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 19:34:08 -0600 Subject: [PATCH 08/10] Shift+Empty Hand no longer needed to open Roaster inventory --- .../cellar/block/RoasterBlock.java | 20 +++++++++---------- .../block/entity/RoasterBlockEntity.java | 8 ++++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/main/java/growthcraft/cellar/block/RoasterBlock.java b/src/main/java/growthcraft/cellar/block/RoasterBlock.java index 99af8e3c..b70ed4eb 100644 --- a/src/main/java/growthcraft/cellar/block/RoasterBlock.java +++ b/src/main/java/growthcraft/cellar/block/RoasterBlock.java @@ -10,8 +10,6 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvents; -import net.minecraft.sounds.SoundSource; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -131,12 +129,19 @@ public BlockEntityTicker getTicker(Level level, Block @Override public InteractionResult use(BlockState state, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult hitResult) { if (!level.isClientSide) { - if (player.isCrouching()) { + if (player.getItemInHand(hand).is(GrowthcraftTags.Items.ROASTER_WRENCH)) { + // Then cycle the roaster level + RoasterBlockEntity blockEntity = (RoasterBlockEntity) level.getBlockEntity(blockPos); + // If the tick current is 0 then we are not currently processing anything. + if (blockEntity.getTickClock("current") == 0) { + blockEntity.incrementRoastingLevel(); + } + } else { // Open the GUI try { // Play sound - level.playSound(player, blockPos, SoundEvents.IRON_DOOR_OPEN, SoundSource.BLOCKS, 1.0F, 1.0F); RoasterBlockEntity blockEntity = (RoasterBlockEntity) level.getBlockEntity(blockPos); + blockEntity.playSound("open"); NetworkHooks.openScreen(((ServerPlayer) player), blockEntity, blockPos); } catch (Exception ex) { GrowthcraftCellar.LOGGER.error(String.format("%s unable to open RoasterBlockEntity GUI at %s.", player.getDisplayName().getString(), blockPos)); @@ -144,13 +149,6 @@ public InteractionResult use(BlockState state, Level level, BlockPos blockPos, P GrowthcraftCellar.LOGGER.error(ex.fillInStackTrace()); } return InteractionResult.SUCCESS; - } else if (player.getItemInHand(hand).is(GrowthcraftTags.Items.ROASTER_WRENCH)) { - // Then cycle the roaster level - RoasterBlockEntity blockEntity = (RoasterBlockEntity) level.getBlockEntity(blockPos); - // If the tick current is 0 then we are not currently processing anything. - if (blockEntity.getTickClock("current") == 0) { - blockEntity.incrementRoastingLevel(); - } } } diff --git a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java index a33bbd9e..b48a4e22 100644 --- a/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java +++ b/src/main/java/growthcraft/cellar/block/entity/RoasterBlockEntity.java @@ -14,6 +14,8 @@ import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.util.RandomSource; import net.minecraft.world.Containers; import net.minecraft.world.MenuProvider; @@ -378,4 +380,10 @@ public int getPercentProgress() { return Math.round(percentage); } + + public void playSound(String sound) { + if (Objects.equals(sound, "open") && this.level != null) { + this.level.playSound(null, this.getBlockPos(), SoundEvents.IRON_DOOR_OPEN, SoundSource.BLOCKS); + } + } } From f43c608b24082dc34d639b1e023d11d5a92e53ae Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 19:59:34 -0600 Subject: [PATCH 09/10] Fixed Casu Marzu Hanging Curds loot table --- ...{cazu_marzu_cheese_curds.json => casu_marzu_cheese_curds.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/data/growthcraft_milk/loot_tables/blocks/{cazu_marzu_cheese_curds.json => casu_marzu_cheese_curds.json} (100%) diff --git a/src/main/resources/data/growthcraft_milk/loot_tables/blocks/cazu_marzu_cheese_curds.json b/src/main/resources/data/growthcraft_milk/loot_tables/blocks/casu_marzu_cheese_curds.json similarity index 100% rename from src/main/resources/data/growthcraft_milk/loot_tables/blocks/cazu_marzu_cheese_curds.json rename to src/main/resources/data/growthcraft_milk/loot_tables/blocks/casu_marzu_cheese_curds.json From d5b44facc5d3c3d5a9abfe018cf4ab8d39ff6e9e Mon Sep 17 00:00:00 2001 From: Alatyami Date: Sun, 22 Oct 2023 20:07:48 -0600 Subject: [PATCH 10/10] Updated in-game changelog. --- .../growthcraft/en_us/entries/core/change_log.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json b/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json index c299198d..6fa1fecb 100644 --- a/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json +++ b/src/main/resources/assets/growthcraft/patchouli_books/growthcraft/en_us/entries/core/change_log.json @@ -8,6 +8,11 @@ "type": "patchouli:text", "text": "9.1.1 - Oct 22, 2023$(br)9.1.0 - Oct 9, 2023$(br)9.0.6 - Sep 10, 2023$(br)9.0.5 - Sep 3, 2023$(br)9.0.4 - Aug 21, 2023$(br)9.0.3 - Aug 11, 2023$(br)9.0.2 - Aug 6, 2023$(br)9.0.1 - Jul 29, 2023$(br)9.0.0 - Jul 26, 2023" }, + { + "type": "patchouli:text", + "title": "9.1.1", + "text": "$(li)Fixed shift click inventory$(li)Fixed Honey Mead recipe$(li)Fixed Brew Kettle processing$(li)Update in-game entries$(li)Fixed Roaster sided inventory$(li)Fixed Bees Wax recipe$(br2)Updated the Brew Kettle and Roaster inventory open. Shift+Empty Hand is no longer needed." + }, { "type": "patchouli:text", "title": "9.1.0",