mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-02-18 05:11:20 +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: 0514fc4e2 Add missing effects 8f5d9effd Add getMainThreadExecutor to BukkitScheduler 313b5020b Allow adding items to BlockDropItemEvent (#5093) 9a556d9da [CI-SKIP] [Auto] Rebuild Patches 72b2768ad Inline shift fields in EnumDirection (#5082) ffff53fa7 added option to disable pathfinding updates on block changes (#5123) b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112) 3eefafbaf Fix javadoc build 0081ed1c4 Add javadoc step to GH Actions 01082503e Add dropLeash variable to EntityUnleashEvent (#5130) 31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091 8ac27aa38 [Auto] Updated Upstream (CraftBukkit) c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit) d0477d326 [Auto] Updated Upstream (CraftBukkit) d9f5f7018 EntityMoveEvent (#4614) Purpur Changes: e581a73 Updated Upstream (Paper) AirplaneLite Changes: 10c5810 Updated Upstream (Tuinity) Origami Changes: 45d89cc Update Paper 578ef16 Automatically disable online-mode if bungeecord is enabled de51baa Update Paper 5986aef Import Purpur patch to not send useless entity packets
48 lines
2.5 KiB
Diff
48 lines
2.5 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/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
index 9013e8655d6e09f830adda8001567ab889a22479..53f72db8abbfdd60d4491169f53a4c84c9763983 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
@@ -436,6 +436,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);
|
|
}
|
|
|
|
@@ -766,7 +767,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);
|
|
+ }
|
|
+
|
|
}
|