Skip to content

Commit

Permalink
- fixed: Minecraft did not load correctly with a registered bucket. (…
Browse files Browse the repository at this point in the history
…Fabric)

- fixed: No bucket remained in crafting table after using a filled bucket in a crafting recipe. (NeoForge)
- fixed: There was no sound while drinking a milk bucket.
  • Loading branch information
cech12 committed Jan 28, 2025
1 parent 0520fd3 commit 6300318
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.21.3-4.2.0.3] - 2025-01-28
### Fixed
- Minecraft did not load correctly with a registered bucket. (Fabric)
- No bucket remained in crafting table after using a filled bucket in a crafting recipe. (NeoForge)
- There was no sound while drinking a milk bucket.

## [1.21.3-4.2.0.2] - 2025-01-28
### Fixed
- added ResourceKey parameter to constructor of UniversalBucketItem to be compatible with MC 1.21.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.minecraft.world.item.ItemUseAnimation;
import net.minecraft.world.item.ItemUtils;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.component.Consumables;
import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.item.crafting.RecipeType;
Expand Down Expand Up @@ -383,15 +384,22 @@ public ItemUseAnimation getUseAnimation(@Nonnull ItemStack itemStack) {
return super.getUseAnimation(itemStack);
}

//@Override //overrides the (neo)forge implementation
public boolean hasCraftingRemainingItem(ItemStack stack) {
@Override
public void onUseTick(@Nonnull Level level, @Nonnull LivingEntity livingEntity, @Nonnull ItemStack itemStack, int useRemainingTicks) {
if (BucketLibUtil.containsMilk(itemStack) && Consumables.MILK_BUCKET.shouldEmitParticlesAndSounds(useRemainingTicks)) {
Consumables.MILK_BUCKET.emitParticlesAndSounds(level.getRandom(), livingEntity, itemStack, 5);
}
super.onUseTick(level, livingEntity, itemStack, useRemainingTicks);
}

public boolean hasCraftingRemainder(ItemStack stack) {
//for using a filled bucket as fuel or in crafting recipes, an empty bucket should remain
return !BucketLibUtil.isEmpty(stack) && !this.isCracked(stack);
}

//@Override //overrides the (neo)forge implementation
public ItemStack getCraftingRemainingItem(ItemStack itemStack) {
if (!hasCraftingRemainingItem(itemStack)) {
public ItemStack getCraftingRemainder(ItemStack itemStack) {
if (!hasCraftingRemainder(itemStack)) {
return ItemStack.EMPTY;
}
if (BucketLibUtil.isAffectedByInfinityEnchantment(itemStack)) {
Expand All @@ -415,7 +423,7 @@ public ItemStack getCraftingRemainingItem(ItemStack itemStack) {

//@Override //overrides the fabric implementation
public ItemStack getRecipeRemainder(ItemStack itemStack) {
return getCraftingRemainingItem(itemStack);
return getCraftingRemainder(itemStack);
}

private boolean getBooleanProperty(Supplier<Boolean> config, boolean defaultValue) {
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"description": {
"text": "${mod_id} resources"
},
"pack_format": 15
"pack_format": 57
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public ResourceLocation getParentLocation() {
@Nonnull
@Override
public BlockModel getRootModel() {
//resolveDependencies(BucketLibClientMod::getModel);
if (this.parent == null) {
return this;
}
Expand All @@ -122,8 +121,9 @@ public BlockModel getRootModel() {
@Override
public BakedModel bake(@Nonnull ModelBaker modelBaker, @Nonnull Function<Material, TextureAtlasSprite> spriteGetter, @Nonnull ModelState modelState) {
//resolve parents to use their defined materials, too
resolveDependencies(BucketLibClientMod::getModel);

if (this.parent == null) {
resolveDependencies(BucketLibClientMod::getModel);
}
Material particleLocation = this.getMaterial("particle");
TextureAtlasSprite particleSprite = null;
if (isValid(particleLocation)) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Project
group=de.cech12.bucketlib
mod_version=4.2.0.2
mod_version=4.2.0.3
mod_id=bucketlib
mod_name=BucketLib
mod_author=Cech12
Expand Down

0 comments on commit 6300318

Please sign in to comment.