mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-02-27 09:42:45 +01:00
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: 0daded2f2 Add more line of sight methods (#5749) 8fd4e70db Improve seed based feature search to not load chunk (#5760) 7ad8498c3 Make item validations configurable (#5775) 3673d6758 Fix Cannot be adventure component serialized when the legacy component is null (#5754) afb0748a2 [Auto] Updated Upstream (Bukkit) 7d751ad8d Fix dangerous end portal logic (#5776) 12716324d Do not tick Chunk TickS for every chunk Tuinity Changes: 2683c77 Use area map for nearby players in mob spawning (#283) Airplane Changes: 2be99de Toggle for DEAR 3485304 Updated Upstream (Tuinity) Empirecraft Changes: 33438474 Refine FurnaceExtractEvent patch Origami Changes: 35c6a27 Re-add removed patch for MC-2025 a19a185 Fix missing particles
48 lines
2.6 KiB
Diff
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 c813077455a463dd558076d1d7474829f76b905a..742d802d63963778454e41e5b19a3d889c544efc 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -577,6 +577,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);
|
|
}
|
|
|
|
@@ -898,7 +899,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 db1f0c57adbe2aacba9422820cf1a8757ea9ad4f..8e87389f2323576e292bcca1730c2c49bf0eadba 100644
|
|
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
@@ -230,4 +230,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);
|
|
+ }
|
|
+
|
|
}
|