Remove unnecessary AsyncCatcher callers
The AsyncCatcher will check threads and cost extra performance, and since it only works for bad plugins, just removed unnecessary callers that won't save data to disk to save these performance.
This commit is contained in:
@@ -406,12 +406,12 @@ public class Block implements IMaterial {
|
||||
|
||||
@Deprecated
|
||||
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "block onPlace"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "block onPlace"); // Spigot // Akarin
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "block remove"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "block remove"); // Spigot // Akarin
|
||||
}
|
||||
|
||||
public int a(IBlockData iblockdata, Random random) {
|
||||
|
||||
@@ -750,7 +750,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
public boolean addEffect(MobEffect mobeffect, EntityPotionEffectEvent.Cause cause) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "effect add"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "effect add"); // Spigot // Akarin
|
||||
if (isTickingEffects) {
|
||||
effectsToProcess.add(new ProcessableEffect(mobeffect, cause));
|
||||
return true;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class EntityTracker {
|
||||
}
|
||||
|
||||
public void addEntity(Entity entity, int originalRange, int j, boolean flag) { // Spigot
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot // Akarin
|
||||
int i = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, originalRange); // Spigot
|
||||
try {
|
||||
if (this.trackedEntities.b(entity.getId())) {
|
||||
@@ -144,7 +144,7 @@ public class EntityTracker {
|
||||
}
|
||||
|
||||
public void untrackEntity(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity untrack"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity untrack"); // Spigot // Akarin
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
Iterator iterator = this.c.iterator();
|
||||
|
||||
@@ -356,7 +356,7 @@ public class EntityTrackerEntry {
|
||||
}
|
||||
|
||||
public void updatePlayer(EntityPlayer entityplayer) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "player tracker update"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "player tracker update"); // Spigot // Akarin
|
||||
if (entityplayer != this.tracker) {
|
||||
if (this.c(entityplayer)) {
|
||||
if (!this.trackedPlayers.contains(entityplayer) && (this.e(entityplayer) || this.tracker.attachedToPlayer)) {
|
||||
@@ -642,7 +642,7 @@ public class EntityTrackerEntry {
|
||||
}
|
||||
|
||||
public void clear(EntityPlayer entityplayer) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "player tracker clear"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "player tracker clear"); // Spigot // Akarin
|
||||
if (this.trackedPlayers.contains(entityplayer)) {
|
||||
this.trackedPlayers.remove(entityplayer);
|
||||
this.tracker.c(entityplayer);
|
||||
|
||||
@@ -118,7 +118,7 @@ public final class MCUtil {
|
||||
* @return
|
||||
*/
|
||||
public static void ensureMain(String reason, Runnable run) {
|
||||
if (AsyncCatcher.enabled && !ThreadAssertion.isMainThread() && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { // Akarin
|
||||
if (/*AsyncCatcher.enabled*/ && !ThreadAssertion.isMainThread() && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { // Akarin
|
||||
if (reason != null) {
|
||||
new IllegalStateException("Asynchronous " + reason + "!").printStackTrace();
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public final class MCUtil {
|
||||
* @return
|
||||
*/
|
||||
public static <T> T ensureMain(String reason, Supplier<T> run) {
|
||||
if (AsyncCatcher.enabled && !ThreadAssertion.isMainThread() && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { // Akarin
|
||||
if (/*AsyncCatcher.enabled &&*/ !ThreadAssertion.isMainThread() && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { // Akarin
|
||||
if (reason != null) {
|
||||
new IllegalStateException("Asynchronous " + reason + "! Blocking thread until it returns ").printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1088,7 +1088,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
return regionLimited.addEntity(entity, spawnReason);
|
||||
}
|
||||
// Paper end
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot // Akarin
|
||||
if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
|
||||
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
|
||||
return false;
|
||||
@@ -1149,7 +1149,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
}
|
||||
|
||||
public void kill(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity kill"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity kill"); // Spigot // Akarin
|
||||
if (entity.isVehicle()) {
|
||||
entity.ejectPassengers();
|
||||
}
|
||||
@@ -1190,7 +1190,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
}
|
||||
|
||||
public void removeEntity(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity remove"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity remove"); // Spigot // Akarin
|
||||
entity.b(false);
|
||||
entity.die();
|
||||
if (entity instanceof EntityHuman) {
|
||||
@@ -2542,7 +2542,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
||||
public void addChunkEntities(Stream<Entity> collection) { a(collection); } // Paper - OBFHELPER
|
||||
public void a(Stream<Entity> stream) {
|
||||
org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot
|
||||
//org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot // Akarin
|
||||
stream.forEach((entity) -> {
|
||||
if (entity == null || entity.dead || entity.valid) { // Paper - prevent adding already added or dead entities
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user