Yatopia/patches/server/0048-Configurable-criterion-triggers.patch
Simon Gardling 76a75f866b
upstream (#455)
* Updated Upstream and Sidestream(s) (Paper)

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:
d15161114 [Auto] Updated Upstream (Spigot)
e8889e96a [Auto] Updated Upstream (CraftBukkit)
3bc888ba6 [Auto] Updated Upstream (CraftBukkit)

* Updated Upstream and Sidestream(s) (Paper)

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:
3fea87edb [Auto] Updated Upstream (CraftBukkit)
a111b1365 Send post ChatEvent messages as MessageType.CHAT

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur)

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:
3db3aaf39 [Auto] Updated Upstream (CraftBukkit)
c953e51dd [Auto] Updated Upstream (CraftBukkit/Spigot)
dc529c7a9 Fix PlayerEditBookEvent (#5463)

Tuinity Changes:
a0aa5ab Do not load 1 radius neighbours for lighting
5ccfa52 Fix terrible patch times
af53d70 Stop large move vectors in player packet handling from killing the server
6e56ee7 Fix OBFHELPER for flushHeader in RegionFile
995d05c Do not update TE's in generating chunks

Purpur Changes:
2e66f83 [ci-skip] Fix typo
6cbe4fc Change Logo Tuinity to Purpur
5e89d23 Updated Upstream (Paper & Airplane)

* Updated Upstream and Sidestream(s) (Paper)

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:
304a216ba [CI-SKIP] Ignore gitignore when adding files in automation
d8e384a16 [CI-SKIP] Drop `Allow PlayerEditBookEvent to fire for off hand` (#5471)

* fix kotlin-stdlib dependency

* update dependencies

* how did that happen...

* Updated Upstream and Sidestream(s) (Paper)

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:
de138fac4 [Auto] Updated Upstream (Bukkit)

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane)

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:
4492bc4cc remove l4j class no longer in existence from preload list
be1370517 Updated Upstream (CraftBukkit) (#5484)
d560151ec Bump mysql-connector-java to 8.0.23 (Fixes #5473) (#5474)
61f400f11 Update log4j to 2.11.2 for JDK 9+ compat (#5400)
a98196585 Updated Upstream (Bukkit/CraftBukkit)

Tuinity Changes:
d5261ad Do not load chunks for getCubes by default
da9cf98 Don't read neighbour chunk data off disk when converting chunks

Airplane Changes:
8de8e82 Updated Upstream (Tuinity)
2021-04-12 13:27:14 -04:00

48 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mykyta Komarnytskyy <nkomarn@hotmail.com>
Date: Sat, 24 Oct 2020 21:08:17 -0500
Subject: [PATCH] Configurable criterion triggers
This patch adds toggles for three criterion triggers that are called every tick. These can be very unnecessary, and especially in the case of CriterionTriggerEnterBlock, quite heavy.
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index b8c63c25d2ad9692475e8c7cb307f45853b86ca4..a33cbd6504fd0d5c5e50aa63009d70533c01f686 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -571,6 +571,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
protected void a(IBlockData iblockdata) {
+ if (org.yatopiamc.yatopia.server.YatopiaConfig.criterionTriggerEnterBlock) // Yatopia
CriterionTriggers.d.a(this, iblockdata);
}
@@ -901,7 +902,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel));
}
- if (this.ticksLived % 20 == 0) {
+ if (org.yatopiamc.yatopia.server.YatopiaConfig.criterionTriggerLocation && this.ticksLived % 20 == 0) { // Yatopia
CriterionTriggers.p.a(this);
}
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
index 045ace1444b4db8fa5fab09f970de7a696c56ab8..2100ac9c1f4d0df75347579cc5d58255b77ec252 100644
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
@@ -235,4 +235,14 @@ public class YatopiaConfig {
private static void intervals() {
playerTimeStatisticsInterval = Math.max(1, getInt("settings.intervals.player-time-statistics", 1));
}
+
+ public static boolean criterionTriggerLocation = true;
+ public static boolean criterionTriggerEnterBlock = true;
+ public static boolean criterionTriggerTick = true;
+ private static void criterionTriggers() {
+ criterionTriggerLocation = getBoolean("settings.criterion-triggers.location", true);
+ criterionTriggerEnterBlock = getBoolean("settings.criterion-triggers.enter-block", true);
+ criterionTriggerTick = getBoolean("settings.criterion-triggers.tick", true);
+ }
+
}