mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-02-02 13:31:27 +01:00
0f2c8e806a
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
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 4ec18d28c0022614b0ef6900774ddd4bda814308..f4b0bcf4e5fdfd4381e1410a929ed3a166ce4d00 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -569,6 +569,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);
|
|
}
|
|
|
|
@@ -899,7 +900,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);
|
|
+ }
|
|
+
|
|
}
|