Added config for lava buckets fix
parent
0e3132549c
commit
cd9eff8f8a
|
@ -33,6 +33,8 @@ public class ModConfig {
|
||||||
"Fixes axes not being effective agaist certain blocks that it should be effective on");
|
"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,
|
public static final Option<Boolean> FIX_SADDLES_NOT_DROPPING = make("Fix saddles not dropping", true,
|
||||||
"Fixes saddles not dropping when killing saddled pigs");
|
"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();
|
private static ModConfig instance = new ModConfig();
|
||||||
public static final ModConfig instance() {
|
public static final ModConfig instance() {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import net.minecraft.entity.FurnaceEntity;
|
import net.minecraft.entity.FurnaceEntity;
|
||||||
import net.minecraft.item.ItemInstance;
|
import net.minecraft.item.ItemInstance;
|
||||||
import net.minecraft.item.ItemType;
|
import net.minecraft.item.ItemType;
|
||||||
|
import xyz.pixelatedw.finalbeta.ModConfig;
|
||||||
|
|
||||||
@Mixin(FurnaceEntity.class)
|
@Mixin(FurnaceEntity.class)
|
||||||
public class FurnaceEntityMixin {
|
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)
|
@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) {
|
public void tick(CallbackInfo ci) {
|
||||||
if(this.contents[1] != null && this.contents[1].itemId == ItemType.bucketLava.id) {
|
if(ModConfig.FIX_FURNACE_LAVA_BUCKET.get()) {
|
||||||
ci.cancel();
|
if(this.contents[1] != null && this.contents[1].itemId == ItemType.bucketLava.id) {
|
||||||
this.contents[1] = new ItemInstance(ItemType.bucket);
|
ci.cancel();
|
||||||
|
this.contents[1] = new ItemInstance(ItemType.bucket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue