This commit is contained in:
Jesse Boyd 2018-01-07 23:47:47 +11:00
parent e1e31beff0
commit bb7b1cb736
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -31,14 +31,6 @@ public class ChunkListener implements Listener {
public ChunkListener() { public ChunkListener() {
if (Settings.IMP.TICK_LIMITER.ENABLED) { if (Settings.IMP.TICK_LIMITER.ENABLED) {
Bukkit.getPluginManager().registerEvents(ChunkListener.this, Fawe.<FaweBukkit>imp().getPlugin()); Bukkit.getPluginManager().registerEvents(ChunkListener.this, Fawe.<FaweBukkit>imp().getPlugin());
TaskManager.IMP.repeat(new Runnable() {
@Override
public void run() {
physSkip = 0;
physCancelPair = Long.MIN_VALUE;
physCancel = false;
}
}, 1);
TaskManager.IMP.repeat(new Runnable() { TaskManager.IMP.repeat(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -46,6 +38,9 @@ public class ChunkListener implements Listener {
physicsFreeze = false; physicsFreeze = false;
itemFreeze = false; itemFreeze = false;
lastZ = Integer.MIN_VALUE; lastZ = Integer.MIN_VALUE;
physSkip = 0;
physCancelPair = Long.MIN_VALUE;
physCancel = false;
counter.clear(); counter.clear();
for (Long2ObjectMap.Entry<Boolean> entry : badChunks.long2ObjectEntrySet()) { for (Long2ObjectMap.Entry<Boolean> entry : badChunks.long2ObjectEntrySet()) {
@ -211,8 +206,10 @@ public class ChunkListener implements Listener {
for (int frame = start; frame < depth; frame++) { for (int frame = start; frame < depth; frame++) {
StackTraceElement elem = SharedSecrets.getJavaLangAccess().getStackTraceElement(e, frame); StackTraceElement elem = SharedSecrets.getJavaLangAccess().getStackTraceElement(e, frame);
String fileName = elem.getFileName(); String className = elem.getClassName();
if (fileName.charAt(0) == 'E' && fileName.equals("EntityFireworks.java")) { int len = className.length();
if (className != null) {
if (className.charAt(len - 15) == 'E' && className.endsWith("EntityFireworks")) {
int chunkRange = 2; int chunkRange = 2;
for (int ocx = -chunkRange; ocx <= chunkRange; ocx++) { for (int ocx = -chunkRange; ocx <= chunkRange; ocx++) {
for (int ocz = -chunkRange; ocz <= chunkRange; ocz++) { for (int ocz = -chunkRange; ocz <= chunkRange; ocz++) {
@ -234,6 +231,7 @@ public class ChunkListener implements Listener {
} }
} }
} }
}
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) { public void onItemSpawn(ItemSpawnEvent event) {