mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 5b20df6bf added PlayerNameEntityEvent ff9c82444 Add worldborder events 616b1f3cd consider enchants for destroy speed aaef1d5cc fix file conversion 674d8f7f7 Make discovered maps config work in treasure maps from loot tables too be1687914 stop firing pressure plate EntityInteractEvent for ignored entities (fixes #4962) 7d56f38ed Do not use the bukkit singleton for the GUI (Fixes #5301) 4c9bdf53a Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5299) 8647bd130 Improve ServerGUI fcc6d3359 Throw proper exception on empty JsonList file 17d2e1291 Fix interact event in adventure mode 964e0bf42 MC-29274: Fix Wither hostility towards players 9e24a5213 Fixed furnace cook-speed multiplier losing precision when calculating cook time c7e42faa3 Do not create unnecessary copies of the passenger list 40881ad67 added tnt minecarts to the tnt height nerf 26be708f4 Remove streams from SensorNearest 5b5989b21 fix nullability of playerlist header/footer, closes #5290 45bc531dd Fix Material#getTranslationKey for Block Materials (#5294)
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 bc2fbdda5777b35291490a6eea038f429521a6ab..77a18faeef0fd2e086827535470c957198c60df4 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 0b58a2e99a2f89d450d7980eb4837172e8a10dba..0cae636df21d73f88acc4dbbf7563cf8a44c5a58 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;
|