Commits
md_5 authored 1aabe506c6b
1 - | From 2111b85535935fe2c00589b3a49107e0880c6f61 Mon Sep 17 00:00:00 2001 |
1 + | From 26a34efb94470873d61322b5ade2a85b32a0e70c Mon Sep 17 00:00:00 2001 |
2 2 | From: md_5 <git@md-5.net> |
3 3 | Date: Tue, 25 Mar 2014 16:10:01 +1100 |
4 4 | Subject: [PATCH] Async Operation Catching |
5 5 | |
6 6 | Catch and throw an exception when a potentially unsafe operation occurs on a thread other than the main server thread. |
7 7 | |
8 8 | diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java |
9 9 | index b544ea0183..7ca61718b0 100644 |
10 10 | --- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java |
11 11 | +++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java |
71 71 | WorldServer.this.players.add(entityplayer); |
72 72 | |
73 73 | } |
74 74 | |
75 75 | public void onTrackingEnd(Entity entity) { |
76 76 | + org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot |
77 77 | WorldServer.this.getChunkSource().removeEntity(entity); |
78 78 | if (entity instanceof EntityPlayer entityplayer) { |
79 79 | WorldServer.this.players.remove(entityplayer); |
80 80 | diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java |
81 - | index de366c90d3..f08c5007dd 100644 |
81 + | index 9b44f3a324..ac53bea157 100644 |
82 82 | --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java |
83 83 | +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java |
84 - | |
84 + | |
85 85 | } |
86 86 | |
87 87 | public boolean addEffect(MobEffect mobeffect, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause) { |
88 88 | + org.spigotmc.AsyncCatcher.catchOp("effect add"); // Spigot |
89 89 | if (isTickingEffects) { |
90 90 | effectsToProcess.add(new ProcessableEffect(mobeffect, cause)); |
91 91 | return true; |
92 92 | diff --git a/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java b/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java |
93 93 | index 28715833f5..09980fd098 100644 |
94 94 | --- a/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java |