mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 0514fc4e2 Add missing effects 8f5d9effd Add getMainThreadExecutor to BukkitScheduler 313b5020b Allow adding items to BlockDropItemEvent (#5093) 9a556d9da [CI-SKIP] [Auto] Rebuild Patches 72b2768ad Inline shift fields in EnumDirection (#5082) ffff53fa7 added option to disable pathfinding updates on block changes (#5123) b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112) 3eefafbaf Fix javadoc build 0081ed1c4 Add javadoc step to GH Actions 01082503e Add dropLeash variable to EntityUnleashEvent (#5130) 31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091 8ac27aa38 [Auto] Updated Upstream (CraftBukkit) c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit) d0477d326 [Auto] Updated Upstream (CraftBukkit) d9f5f7018 EntityMoveEvent (#4614)
59 lines
3.1 KiB
Diff
59 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Mon, 19 Oct 2020 15:14:01 -0500
|
|
Subject: [PATCH] Infinite fuel furnace
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
|
index e75e676d196d9f5a3409ec50645fab611b0afdad..76ea1d003b43d822e2b85eec3b8740155efd531a 100644
|
|
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
|
@@ -278,6 +278,22 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
|
if (!this.world.isClientSide) {
|
|
ItemStack itemstack = (ItemStack) this.items.get(1);
|
|
|
|
+ // Purpur start
|
|
+ boolean infiniteFuel = false;
|
|
+ if (world.purpurConfig.furnaceInfiniteFuel && !isBurning() && itemstack.isEmpty() && !items.get(0).isEmpty() && world.getTime() % 20 == 0) {
|
|
+ BlockPosition pos = getPosition().down();
|
|
+ IBlockData iblockdata = world.getTypeIfLoaded(pos);
|
|
+ if (iblockdata != null && iblockdata.equals(Blocks.LAVA)) {
|
|
+ Fluid fluid = iblockdata.getFluid();
|
|
+ if (fluid != null && fluid.isSource()) {
|
|
+ world.setTypeAndData(pos, Blocks.AIR.getBlockData(), 3);
|
|
+ itemstack = Items.LAVA_BUCKET.createItemStack();
|
|
+ infiniteFuel = true;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
if (!this.isBurning() && (itemstack.isEmpty() || ((ItemStack) this.items.get(0)).isEmpty())) {
|
|
if (!this.isBurning() && this.cookTime > 0) {
|
|
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
|
|
@@ -331,6 +347,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
|
flag1 = true;
|
|
this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, this.isBurning()), 3);
|
|
}
|
|
+
|
|
+ if (infiniteFuel) this.items.set(1, ItemStack.NULL_ITEM); // Purpur
|
|
}
|
|
|
|
if (flag1) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 4143e6d4900e1a774804e2ef69a820274cd36af1..ac6db65af48222bb3d5c2234e42eb57ef2c1588d 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -351,6 +351,11 @@ public class PurpurWorldConfig {
|
|
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
|
}
|
|
|
|
+ public boolean furnaceInfiniteFuel = false;
|
|
+ private void furnaceSettings() {
|
|
+ furnaceInfiniteFuel = getBoolean("blocks.furnace.infinite-fuel", furnaceInfiniteFuel);
|
|
+ }
|
|
+
|
|
public boolean lavaInfinite = false;
|
|
public int lavaInfiniteRequiredSources = 2;
|
|
public int lavaSpeedNether = 10;
|