Yatopia/patches/server/0052-Configurable-enchanting-table-tick.patch
Simon Gardling 0f2c8e806a
Updated Upstream and Sidestream(s) (Paper/Purpur) (#478)
Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
bc7ea673a Add internal channel initialization listeners (#5557)
b28ad17ac Check for world change in MoveEvent API methods
3095c7592 [Auto] Updated Upstream (CraftBukkit)
f56989c97 Add RespawnFlags to PlayerRespawnEvent (#5533)
7579c2667 Add more API to PlayerMoveEvent (#5553)
ef60c01c4 [Auto] Updated Upstream (CraftBukkit)
0256dbea3 [Auto] Updated Upstream (Bukkit/CraftBukkit)
91ef74029 Updated Upstream (Spigot) (#5550)
fdf2a59d5 Updated Upstream (Bukkit/CraftBukkit) (#5549)

Purpur Changes:
97185df [CI-SKIP] Update mcdevimports documentation
1099c24 Config for wither explosion radius (closes #265)
c5c9527 Configurable damage settings for magma blocks (adds #247)
1389b02 Updated Upstream (Paper)  (#300)
79c82d2 Configuration to change the maximum number of bees in a hive (#301)
9fd776e Add configurable minecart speed and move controllable minecart options
2021-04-30 13:16:37 -04:00

47 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Wed, 23 Dec 2020 08:42:18 +0200
Subject: [PATCH] Configurable enchanting table tick
Also don't tick blockentity beehive if there are no bees in it.
This patch is a leftover from the original tile entity optimisations, which was majorly flawed.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
index 3ce6a1b1f75443d1d1c6740d6f3f730f06a34f6a..d79094386a564a44d5a519477309f669ea045876 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
@@ -304,6 +304,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable {
@Override
public void tick() {
+ if (this.bees.size() == 0) { return; } // Yatopia - TE optimizations
if (!this.world.isClientSide) {
this.y();
BlockPosition blockposition = this.getPosition();
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java
index 7d81c45f8b514df1a9dafd3b1294a9ad852251f8..4b1cb089355b455c6210f2df1af797cc363997cf 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java
@@ -50,6 +50,7 @@ public class TileEntityEnchantTable extends TileEntity implements INamableTileEn
@Override
public void tick() {
+ if (!org.yatopiamc.yatopia.server.YatopiaConfig.shouldTickEnchantingTables) { return; } // Yatopia - TE optimizations
this.j = this.i;
this.l = this.k;
EntityHuman entityhuman = this.world.a((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D, 3.0D, false);
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
index 78decc9c7483f42acb65f342f12fc1d644440822..890247fadf69dabce6d1c23ba887f93ae5121e1e 100644
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
@@ -260,4 +260,9 @@ public class YatopiaConfig {
checkVehicleMovedQuickly = getBoolean("settings.checks.vehicle-moved-quickly", checkVehicleMovedQuickly);
checkVehicleMovedWrongly = getBoolean("settings.checks.vehicle-moved-wrongly", checkVehicleMovedWrongly);
}
+
+ public static boolean shouldTickEnchantingTables = false;
+ private static void tickEnchantingTables() {
+ shouldTickEnchantingTables = getBoolean("settings.tick.enchanting-tables", shouldTickEnchantingTables);
+ }
}