diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java index 4cb2f07..7da6ad2 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/UkrainianDelight.java @@ -6,7 +6,7 @@ import com.megatrex4.ukrainian_dlight.block.entity.ModBlockEntities; //import com.megatrex4.ukrainian_dlight.compat.patchouli.CustomBrewingRecipeProcessor; import com.megatrex4.ukrainian_dlight.config.ModConfig; -import com.megatrex4.ukrainian_dlight.initialize.Initialise; +import com.megatrex4.ukrainian_dlight.initialize.CustomizeLootTables; import com.megatrex4.ukrainian_dlight.item.ModItemGroups; import com.megatrex4.ukrainian_dlight.item.ModItems; import com.megatrex4.ukrainian_dlight.item.ToolTipHelper; @@ -15,9 +15,7 @@ import com.megatrex4.ukrainian_dlight.screen.ModScreenHandlers; import com.megatrex4.ukrainian_dlight.screen.ModScreens; import net.fabricmc.api.ModInitializer; -import net.minecraft.client.MinecraftClient; import net.minecraft.entity.damage.DamageType; -import net.minecraft.item.ItemStack; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.text.MutableText; @@ -53,7 +51,7 @@ public void onInitialize() { ModRecipes.registerRecipes(); ModScreens.registerScreens(); ModConfig.loadConfig(); - Initialise.register(); + CustomizeLootTables.register(); LOGGER.info("Hello Fabric world it's " + MOD_ID + "!"); } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java index 0492007..7fee69a 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/custom/BrewingKegBlock.java @@ -28,6 +28,7 @@ import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.Registries; import net.minecraft.screen.NamedScreenHandlerFactory; +import net.minecraft.screen.ScreenHandler; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; @@ -186,13 +187,11 @@ public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockSt // Save BlockEntity data to NBT NbtCompound tag = new NbtCompound(); brewingKegEntity.writeNbt(tag); - System.out.println("Saved BlockEntityTag: " + tag.toString()); // Debug line itemStack.setSubNbt("BlockEntityTag", tag); // Save DisplaySlot to NBT NbtCompound displaySlotTag = new NbtCompound(); brewingKegEntity.getStack(DRINKS_DISPLAY_SLOT).writeNbt(displaySlotTag); - System.out.println("Saved DisplaySlot: " + displaySlotTag.toString()); // Debug line itemStack.setSubNbt("DisplaySlot", displaySlotTag); // Spawn the item entity with the BlockEntityTag and DisplaySlot NBT @@ -204,7 +203,6 @@ public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockSt } } - public static void spawnParticles(World world, BlockPos pos, BlockState state) { Random random = world.random; if (world != null) { @@ -220,7 +218,6 @@ public static void spawnParticles(World world, BlockPos pos, BlockState state) { } } - @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { ItemStack heldStack = player.getStackInHand(hand); @@ -258,9 +255,6 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt return ActionResult.SUCCESS; } - - - private boolean giveItemToPlayerOrDrop(World world, PlayerEntity player, ItemStack itemStack) { if (!player.getInventory().insertStack(itemStack)) { ItemEntity itemEntity = new ItemEntity(world, player.getX(), player.getY(), player.getZ(), itemStack); @@ -284,4 +278,17 @@ public BlockEntityTicker getTicker(World world, Block FACING = Properties.HORIZONTAL_FACING; } + @Override + public boolean hasComparatorOutput(BlockState state) { + return true; + } + + @Override + public int getComparatorOutput(BlockState state, World world, BlockPos pos) { + BlockEntity blockEntity = world.getBlockEntity(pos); + if (blockEntity instanceof BrewingKegBlockEntity) { + return ((BrewingKegBlockEntity) blockEntity).calculateComparatorOutput(); + } + return super.getComparatorOutput(state, world, pos); + } } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java index 678c704..2d50d2a 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/block/entity/BrewingKegBlockEntity.java @@ -6,6 +6,7 @@ import com.megatrex4.ukrainian_dlight.networking.ModMessages; import com.megatrex4.ukrainian_dlight.recipe.BrewingRecipe; import com.megatrex4.ukrainian_dlight.recipe.ModRecipes; +import com.megatrex4.ukrainian_dlight.registry.ModTags; import com.megatrex4.ukrainian_dlight.screen.BrewingKegScreenHandler; import com.megatrex4.ukrainian_dlight.util.CompoundTagUtils; import com.megatrex4.ukrainian_dlight.util.FluidStack; @@ -38,6 +39,7 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Recipe; +import net.minecraft.registry.tag.ItemTags; import net.minecraft.screen.PropertyDelegate; import net.minecraft.screen.ScreenHandler; import net.minecraft.server.network.ServerPlayerEntity; @@ -53,6 +55,8 @@ import java.util.*; +import static com.megatrex4.ukrainian_dlight.block.custom.BrewingKegBlock.FACING; + public class BrewingKegBlockEntity extends BlockEntity implements ExtendedScreenHandlerFactory, ImplementedInventory { private final DefaultedList inventory = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY); @@ -68,27 +72,21 @@ public class BrewingKegBlockEntity extends BlockEntity implements ExtendedScreen public static final int INVENTORY_SIZE = OUTPUT_SLOT + 1; - - // Define OUTPUT_SLOTS and ALL_SLOTS_EXCEPT_INGREDIENTS private static final int[] OUTPUT_SLOTS = {OUTPUT_SLOT}; private static final int[] ALL_SLOTS_EXCEPT_INGREDIENTS = {CONTAINER_SLOT, WATER_SLOT, DRINKS_DISPLAY_SLOT, OUTPUT_SLOT}; - protected final PropertyDelegate propertyDelegate; private final Object2IntOpenHashMap experienceTracker; private int progress; - private int maxProgress = 200; // Adjusted to match the brewing time in the JSON + private int maxProgress = 200; private Text customName; private ItemStack drinkContainer; - - @Override public DefaultedList getItems() { return this.inventory; } - public final SingleVariantStorage fluidStorage = new SingleVariantStorage() { @Override protected FluidVariant getBlankVariant() { @@ -97,7 +95,7 @@ protected FluidVariant getBlankVariant() { @Override protected long getCapacity(FluidVariant variant) { - return FluidStack.convertMbToDroplets(ModConfig.getBrewingKegCapacity()); // 20k mB + return FluidStack.convertMbToDroplets(ModConfig.getBrewingKegCapacity()); } @Override @@ -109,7 +107,6 @@ protected void onFinalCommit() { } }; - public BrewingKegBlockEntity(BlockPos pos, BlockState state) { super(ModBlockEntities.BREWING_KEG_BLOCK_ENTITY, pos, state); drinkContainer = ItemStack.EMPTY; @@ -141,37 +138,40 @@ public int size() { }; } - public long getMaxWaterLevel() { return fluidStorage.getCapacity(); } - @Override - public int[] getAvailableSlots(Direction side) { - return side == Direction.DOWN ? OUTPUT_SLOTS : ALL_SLOTS_EXCEPT_INGREDIENTS; - } @Override public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir) { - if (slot == DRINKS_DISPLAY_SLOT || slot == OUTPUT_SLOT) { - return false; - } + Direction facing = getCachedState().get(FACING); - // Allow water buckets to be inserted into WATER_SLOT - if (slot == WATER_SLOT && stack.getItem() == Items.WATER_BUCKET) { - return true; - } + Direction right = facing.rotateYClockwise(); + Direction left = facing.rotateYCounterclockwise(); + Direction back = facing.getOpposite(); + if (dir == Direction.UP) { + return Arrays.stream(INGREDIENT_SLOTS).anyMatch(s -> s == slot); + } else if (dir == right) { + return slot == CONTAINER_SLOT; + } else if (dir == left) { + return slot == CONTAINER_SLOT; + } else if (dir == back) { + return slot == WATER_SLOT; + } return false; } + + + @Override public boolean canExtract(int slot, ItemStack stack, Direction dir) { - if (slot == OUTPUT_SLOT) { - return true; - } - if (slot == WATER_SLOT && stack.getItem() == Items.BUCKET) { - return true; + Direction facing = getCachedState().get(FACING); + + if (dir == Direction.DOWN) { + return slot == OUTPUT_SLOT || (slot == WATER_SLOT && stack.getItem() == Items.BUCKET); } return false; } @@ -181,7 +181,6 @@ public ItemStack getDrink() { return getStack(DRINKS_DISPLAY_SLOT); } - public Text getName() { return customName != null ? customName : Text.translatable("gui.ukrainian_delight.brewing_keg"); } @@ -201,7 +200,6 @@ public void writeNbt(NbtCompound tag) { Inventories.writeNbt(tag, inventory); tag.putInt("progress", progress); - // Save DRINKS_DISPLAY_SLOT NbtCompound displaySlotTag = new NbtCompound(); ItemStack displayStack = getStack(DRINKS_DISPLAY_SLOT); if (!displayStack.isEmpty()) { @@ -213,9 +211,6 @@ public void writeNbt(NbtCompound tag) { NbtCompound containerTag = new NbtCompound(); drinkContainer.writeNbt(containerTag); tag.put("DrinkContainer", containerTag); - System.out.println("BrewingKegBlockEntity: writeNbt drinkContainer: " + drinkContainer.getItem() + " " + drinkContainer.getName().getString()); - } else { - System.out.println("BrewingKegBlockEntity: writeNbt drinkContainer: EMPTY"); } writeInventoryNbt(tag); @@ -223,7 +218,6 @@ public void writeNbt(NbtCompound tag) { experienceTracker.forEach((identifier, craftedAmount) -> compoundRecipes.putInt(identifier.toString(), craftedAmount)); tag.put(TAG_KEY_BREWING_RECIPES_USED, compoundRecipes); - // Save water NbtCompound tankContent = new NbtCompound(); NbtCompound variant = fluidStorage.variant.toNbt(); tankContent.put("Variant", variant); @@ -232,8 +226,6 @@ public void writeNbt(NbtCompound tag) { tag.put("TankContent", tankContent); } - - @Override public void readNbt(NbtCompound tag) { super.readNbt(tag); @@ -243,21 +235,15 @@ public void readNbt(NbtCompound tag) { if (tag.contains("DrinkContainer", NbtType.COMPOUND)) { NbtCompound containerTag = tag.getCompound("DrinkContainer"); drinkContainer = ItemStack.fromNbt(containerTag); - System.out.println("BrewingKegBlockEntity: readNbt drinkContainer: " + drinkContainer.getItem() + " " + drinkContainer.getName().getString()); - } else { - drinkContainer = ItemStack.EMPTY; - System.out.println("BrewingKegBlockEntity: readNbt drinkContainer: EMPTY"); } - // Load DRINKS_DISPLAY_SLOT if (tag.contains("DisplaySlot", NbtType.COMPOUND)) { NbtCompound displaySlotTag = tag.getCompound("DisplaySlot"); setStack(DRINKS_DISPLAY_SLOT, ItemStack.fromNbt(displaySlotTag)); } else { - setStack(DRINKS_DISPLAY_SLOT, ItemStack.EMPTY); // Ensure it's clear if no DisplaySlot is found + setStack(DRINKS_DISPLAY_SLOT, ItemStack.EMPTY); } - // Load water if (tag.contains("TankContent", NbtType.COMPOUND)) { NbtCompound tankContent = tag.getCompound("TankContent"); fluidStorage.variant = FluidVariant.fromNbt(tankContent.getCompound("Variant")); @@ -289,16 +275,11 @@ public NbtCompound writeDrink(NbtCompound tag) { return tag; } - - - @Override public void writeScreenOpeningData(ServerPlayerEntity player, PacketByteBuf buf) { buf.writeBlockPos(this.pos); } - - @Nullable @Override public ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) { @@ -309,16 +290,19 @@ public ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, Pla public void tick(World world, BlockPos pos, BlockState state, BrewingKegBlockEntity blockEntity) { boolean dirty = false; + boolean isPowered = world.isReceivingRedstonePower(pos); + if (isPowered) { + return; + } + handleWaterBucket(); boolean enoughFluid = hasEnoughFluid(); - // Check if all required slots are filled correctly if (blockEntity.hasInput() && enoughFluid) { Optional match = getCurrentRecipe(); if (match.isPresent()) { BrewingRecipe recipe = match.get(); if (blockEntity.canCook(recipe)) { - // Process brewing only if recipe is correct dirty = blockEntity.processBrewing(recipe); } else { blockEntity.progress = 0; @@ -328,8 +312,10 @@ public void tick(World world, BlockPos pos, BlockState state, BrewingKegBlockEnt blockEntity.progress = MathHelper.clamp(blockEntity.progress - 2, 0, blockEntity.maxProgress); } + ItemStack containerInput = getStack(CONTAINER_SLOT); + ItemStack drink = blockEntity.getDrink(); - if (!blockEntity.isEmpty()) { + if (!blockEntity.isEmpty() && isContainerValid(containerInput)) { if (!blockEntity.doesDrinkHaveContainer(drink)) { blockEntity.moveDrinkToOutput(); dirty = true; @@ -344,7 +330,6 @@ public void tick(World world, BlockPos pos, BlockState state, BrewingKegBlockEnt } } - private boolean hasInput() { for (int i = 0; i < DRINKS_DISPLAY_SLOT; ++i) { if (i != WATER_SLOT && i != CONTAINER_SLOT && !getStack(i).isEmpty()) { @@ -354,6 +339,10 @@ private boolean hasInput() { return false; } + private void playSoundBrewing() { + float randompitch = 0.9F + 0.2F * (float) (Math.random() - 0.5D); + world.playSound(null, getPos(), SoundEvents.BLOCK_BREWING_STAND_BREW, SoundCategory.BLOCKS, 0.5F, randompitch); + } protected boolean canCook(Recipe recipeIn) { if (hasInput() && recipeIn != null) { @@ -362,7 +351,6 @@ protected boolean canCook(Recipe recipeIn) { return false; } - // Check that all required ingredients are present and no extra items are there for (int i = 0; i < DRINKS_DISPLAY_SLOT; ++i) { if (i == WATER_SLOT || i == CONTAINER_SLOT) continue; ItemStack stack = getStack(i); @@ -386,8 +374,6 @@ protected boolean canCook(Recipe recipeIn) { } } - - private boolean processBrewing(BrewingRecipe recipe) { if (world == null || recipe == null) return false; @@ -397,7 +383,6 @@ private boolean processBrewing(BrewingRecipe recipe) { return false; } - // Complete the brewing process progress = 0; drinkContainer = recipe.getContainer(); ItemStack recipeOutput = recipe.getOutput(world.getRegistryManager()); @@ -408,16 +393,16 @@ private boolean processBrewing(BrewingRecipe recipe) { currentOutput.increment(recipeOutput.getCount()); } trackRecipeExperience(recipe); + playSoundBrewing(); this.extractFluid(recipe.getWaterAmount()); - // Consume ingredients and handle recipe remainder for (int i = 0; i < DRINKS_DISPLAY_SLOT; ++i) { if (i == WATER_SLOT || i == CONTAINER_SLOT) continue; ItemStack itemStack = getStack(i); if (!itemStack.isEmpty()) { if (itemStack.getItem().hasRecipeRemainder()) { - Direction direction = getCachedState().get(BrewingKegBlock.FACING).rotateYCounterclockwise(); + Direction direction = getCachedState().get(FACING).rotateYCounterclockwise(); double dropX = pos.getX() + .5d + (direction.getOffsetX() * .25d); double dropY = pos.getY() + .7d; double dropZ = pos.getZ() + .5d + (direction.getOffsetZ() * .25d); @@ -426,15 +411,13 @@ private boolean processBrewing(BrewingRecipe recipe) { world.spawnEntity(entity); } - itemStack.decrement(1); // Consume the item + itemStack.decrement(1); } } return true; } - - private void useStoredContainersOnDrink() { ItemStack drinkDisplay = getStack(DRINKS_DISPLAY_SLOT); ItemStack containerInput = getStack(CONTAINER_SLOT); @@ -454,7 +437,6 @@ private void useStoredContainersOnDrink() { } } - private boolean doesDrinkHaveContainer(ItemStack drink) { return !drinkContainer.isEmpty() || drink.getItem().hasRecipeRemainder(); } @@ -465,11 +447,11 @@ public ItemStack getDrinkContainer() { } else { ItemStack drink = getDrink(); if (drink.isEmpty()) { - return ItemStack.EMPTY; // Return an empty ItemStack if there is no drink + return ItemStack.EMPTY; } ItemConvertible item = drink.getItem().getRecipeRemainder(); if (item == null) { - return ItemStack.EMPTY; // Return an empty ItemStack if there is no recipe remainder + return ItemStack.EMPTY; } return new ItemStack(item); } @@ -477,42 +459,32 @@ public ItemStack getDrinkContainer() { private void setDrinkContainer(ItemStack container) { this.drinkContainer = container; - markDirty(); // Ensure that the block entity state is updated + markDirty(); } - - public ItemStack useHeldItemOnDrink(ItemStack container) { if (isContainerValid(container) && !getDrink().isEmpty()) { ItemStack drink = getDrink().split(1); - // Update the drink container to reflect the new state setDrinkContainer(container); return drink; } return ItemStack.EMPTY; } - - - public void handleWaterBucket() { ItemStack waterBucketStack = this.getStack(WATER_SLOT); if (waterBucketStack.getItem() == Items.WATER_BUCKET) { - boolean success = this.addWater(1000); // 1000 mb equals one bucket + boolean success = this.addWater(1000); if (success) { - // Successfully added water, replace the bucket with an empty one this.setStack(WATER_SLOT, new ItemStack(Items.BUCKET)); markDirty(); - } else { - // Handle failure case (e.g., log an error) - System.err.println("Failed to add water to the brewing keg."); } + markDirty(); } } - public boolean addWater(long WaterAmountAdd) { try (Transaction transaction = Transaction.openOuter()) { long dropletsToAdd = FluidStack.convertMbToDroplets(WaterAmountAdd); @@ -520,13 +492,12 @@ public boolean addWater(long WaterAmountAdd) { if (insertedAmount == dropletsToAdd) { transaction.commit(); - return true; // Successfully added water + return true; } } - return false; // Failed to add water + return false; } - private boolean hasEnoughFluid() { Optional match = getCurrentRecipe(); if (match.isPresent()) { @@ -545,7 +516,6 @@ public long getWaterCapacity() { return FluidStack.convertDropletsToMb(fluidStorage.getCapacity()); } - private void sendFluidPacket() { PacketByteBuf data = PacketByteBufs.create(); fluidStorage.variant.toPacket(data); @@ -562,13 +532,11 @@ public void setFluidLevel(FluidVariant fluidVariant, long fluidLevel) { this.fluidStorage.amount = fluidLevel; } - private Optional getCurrentRecipe() { if (world == null) return Optional.empty(); return world.getRecipeManager().getFirstMatch(ModRecipes.BREWING, this, world); } - public boolean isContainerValid(ItemStack containerItem) { if (containerItem.isEmpty()) { return false; @@ -580,8 +548,6 @@ public boolean isContainerValid(ItemStack containerItem) { } } - - private void extractFluid(int amount) { try (Transaction transaction = Transaction.openOuter()) { this.fluidStorage.extract(FluidVariant.of(Fluids.WATER), FluidStack.convertMbToDroplets(amount), transaction); @@ -589,7 +555,6 @@ private void extractFluid(int amount) { } } - public void syncFluidToClient() { if (this.world != null && !this.world.isClient) { PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer()); @@ -609,17 +574,15 @@ public void markDirty() { syncFluidToClient(); } - private void moveDrinkToOutput() { ItemStack drinkDisplay = getStack(DRINKS_DISPLAY_SLOT); ItemStack finalOutput = getStack(OUTPUT_SLOT); - ItemStack containerStack = getStack(CONTAINER_SLOT); // Get the stack from CONTAINER_SLOT + ItemStack containerStack = getStack(CONTAINER_SLOT); if (containerStack.isEmpty()) { - return; // Exit the method if CONTAINER_SLOT is empty + return; } - int drinkCount = Math.min(drinkDisplay.getCount(), drinkDisplay.getMaxCount() - finalOutput.getCount()); if (finalOutput.isEmpty()) { setStack(OUTPUT_SLOT, drinkDisplay.split(drinkCount)); @@ -629,16 +592,10 @@ private void moveDrinkToOutput() { } } - public ItemStack getLastUsedContainer() { - // Ensure the container is updated correctly return drinkContainer; } - - - - public void trackRecipeExperience(@Nullable Recipe recipe) { if (recipe != null) { Identifier recipeID = recipe.getId(); @@ -671,5 +628,13 @@ private static void splitAndSpawnExperience(World world, Vec3d pos, int craftedA } } - + public int calculateComparatorOutput() { + ItemStack comparatorOutput = getStack(DRINKS_DISPLAY_SLOT); + if (!comparatorOutput.isEmpty()) { + int count = comparatorOutput.getCount(); + int maxStackSize = comparatorOutput.getMaxCount(); + return Math.min(15, (int) ((count / (float) maxStackSize) * 15)); + } + return 0; + } } diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/initialize/Initialise.java b/src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java similarity index 94% rename from src/main/java/com/megatrex4/ukrainian_dlight/initialize/Initialise.java rename to src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java index 866b490..e086445 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/initialize/Initialise.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/initialize/CustomizeLootTables.java @@ -9,7 +9,7 @@ import net.minecraft.loot.provider.number.ConstantLootNumberProvider; import net.minecraft.util.Identifier; -public class Initialise { +public class CustomizeLootTables { public static final Identifier CHERRY_TREE_LOOT_TABLE_ID = new Identifier("minecraft", "blocks/cherry_leaves"); @@ -19,7 +19,7 @@ public static void register() { if (id.equals(CHERRY_TREE_LOOT_TABLE_ID)) { LootPool.Builder poolBuilder = LootPool.builder() .with(ItemEntry.builder(ModItems.CHERRY_BERRY)) - .conditionally(RandomChanceLootCondition.builder(0.2f)) // 20% chance + .conditionally(RandomChanceLootCondition.builder(0.12f)) // 20% chance .apply(SetCountLootFunction.builder(ConstantLootNumberProvider.create(1)).build()); tableBuilder.pool(poolBuilder.build()); diff --git a/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java index b13400b..fdf0304 100644 --- a/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java +++ b/src/main/java/com/megatrex4/ukrainian_dlight/registry/ModTags.java @@ -13,6 +13,8 @@ public class ModTags { public static final TagKey MID_DRINK; public static final TagKey STRONG_DRINK; + public static final TagKey CONTAINER; + private static TagKey create(String pathName, RegistryKey> registry) { return TagKey.of(registry, new Identifier(UkrainianDelight.MOD_ID, pathName)); } @@ -22,5 +24,7 @@ private static TagKey create(String pathName, RegistryKey= this.slots.size()) { @@ -194,15 +187,6 @@ else if (!this.insertItem(slotItemStack, 11, Math.min(47, this.slots.size()), fa return itemStack; } - - - - - - - - - @Override public boolean canUse(PlayerEntity player) { return this.tileEntity.canPlayerUse(player); diff --git a/src/main/resources/data/ukrainian_delight/loot_tables/blocks/cherry_leaves.json b/src/main/resources/data/ukrainian_delight/loot_tables/blocks/cherry_leaves.json deleted file mode 100644 index 65ec369..0000000 --- a/src/main/resources/data/ukrainian_delight/loot_tables/blocks/cherry_leaves.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:loot_table", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "ukrainian_delight:cherry_berries", - "functions": [ - { - "function": "minecraft:set_count", - "count": { - "type": "minecraft:constant", - "value": 1 - } - } - ], - "conditions": [ - { - "condition": "minecraft:random_chance", - "chance": 0.2 - } - ] - } - ] - } - ] -}