Fixed furnaces consuming buckets

master
Wynd 2023-04-13 22:49:00 +03:00
parent 6a3de4f59d
commit 0e3132549c
5 changed files with 43 additions and 6 deletions

View File

@ -171,10 +171,20 @@ After:
<details><summary>Fixes saddled pigs not dropping their saddles on death</summary> <details><summary>Fixes saddled pigs not dropping their saddles on death</summary>
Before: Before:
![pig not dropping its saddle on death](https://i.imgur.com/PVLRNn5.mp4) <video controls src="https://i.imgur.com/PVLRNn5.mp4"/>
After: After:
![pig dropping its saddle on death](https://i.imgur.com/0yHHfxB.mp4) <video controls src="https://i.imgur.com/0yHHfxB.mp4" />
</details>
<details><summary>Fixes furnaces consuming the buckets as well when using lava buckets</summary>
Before:
<video controls src="https://i.imgur.com/BY0t3iG.mp4"/>
After:
<video controls src="https://i.imgur.com/4O7Fo8V.mp4" />
</details> </details>

View File

@ -24,9 +24,9 @@ public class WyHelper {
Random rand = new Random(); Random rand = new Random();
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); // player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
// player.dropItem(new ItemInstance(ItemType.saddle, 1), false);
// player.dropItem(new ItemInstance(ItemType.pickaxeGold, 1), false); // player.dropItem(new ItemInstance(ItemType.pickaxeGold, 1), false);
// // player.dropItem(new ItemInstance(Tile.GOLD_ORE, 64), false);
// player.dropItem(new ItemInstance(ItemType.bow, 1), false); // player.dropItem(new ItemInstance(ItemType.bow, 1), false);
// player.dropItem(new ItemInstance(ItemType.arrow, 64), false); // player.dropItem(new ItemInstance(ItemType.arrow, 64), false);
// player.dropItem(new ItemInstance(Tile.STONE, 64), false); // player.dropItem(new ItemInstance(Tile.STONE, 64), false);

View File

@ -0,0 +1,26 @@
package xyz.pixelatedw.finalbeta.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.entity.FurnaceEntity;
import net.minecraft.item.ItemInstance;
import net.minecraft.item.ItemType;
@Mixin(FurnaceEntity.class)
public class FurnaceEntityMixin {
@Shadow
private ItemInstance[] contents;
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/FurnaceEntity;getFuelTime(Lnet/minecraft/item/ItemInstance;)I", shift = At.Shift.BY, by = 5), cancellable = true)
public void tick(CallbackInfo ci) {
if(this.contents[1] != null && this.contents[1].itemId == ItemType.bucketLava.id) {
ci.cancel();
this.contents[1] = new ItemInstance(ItemType.bucket);
}
}
}

View File

@ -57,7 +57,7 @@ public class MinecartMixin {
} }
if (speed >= 0.01D && ModConfig.ADD_MORE_SOUNDS.get()) { if (speed >= 0.01D && ModConfig.ADD_MORE_SOUNDS.get()) {
if (minecart.field_1645 % 34 == 1) { if (minecart.field_1645 % 33 == 1) {
minecart.level.playSound(x, y, z, "minecart.base", volume, pitch); minecart.level.playSound(x, y, z, "minecart.base", volume, pitch);
} }
} }

View File

@ -23,7 +23,8 @@
"LivingEntityRendererMixin", "LivingEntityRendererMixin",
"FishHookMixin", "FishHookMixin",
"TileRendererMixin", "TileRendererMixin",
"LivingEntityMixin" "LivingEntityMixin",
"FurnaceEntityMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1