Added config for lava buckets fix

master
Wynd 2023-04-13 22:53:39 +03:00
parent 0e3132549c
commit cd9eff8f8a
2 changed files with 8 additions and 3 deletions

View File

@ -33,6 +33,8 @@ public class ModConfig {
"Fixes axes not being effective agaist certain blocks that it should be effective on");
public static final Option<Boolean> FIX_SADDLES_NOT_DROPPING = make("Fix saddles not dropping", true,
"Fixes saddles not dropping when killing saddled pigs");
public static final Option<Boolean> FIX_FURNACE_LAVA_BUCKET = make("Fix furnace lava bucket", true,
"Fixes furnaces consuming the bucket when using lava buckets as fuel");
private static ModConfig instance = new ModConfig();
public static final ModConfig instance() {

View File

@ -9,6 +9,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.entity.FurnaceEntity;
import net.minecraft.item.ItemInstance;
import net.minecraft.item.ItemType;
import xyz.pixelatedw.finalbeta.ModConfig;
@Mixin(FurnaceEntity.class)
public class FurnaceEntityMixin {
@ -18,9 +19,11 @@ public class FurnaceEntityMixin {
@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);
if(ModConfig.FIX_FURNACE_LAVA_BUCKET.get()) {
if(this.contents[1] != null && this.contents[1].itemId == ItemType.bucketLava.id) {
ci.cancel();
this.contents[1] = new ItemInstance(ItemType.bucket);
}
}
}
}