Super lock track method - Resolves GH-23
This commit is contained in:
@@ -60,7 +60,6 @@ public abstract class MixinMinecraftServer {
|
|||||||
TileEntityHopper.skipHopperEvents = world.paperConfig.disableHopperMoveEvents || InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0;
|
TileEntityHopper.skipHopperEvents = world.paperConfig.disableHopperMoveEvents || InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0;
|
||||||
}
|
}
|
||||||
AkarinSlackScheduler.boot();
|
AkarinSlackScheduler.boot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Overwrite
|
@Overwrite
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package io.akarin.server.mixin.core;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
import net.minecraft.server.Entity;
|
||||||
|
import net.minecraft.server.EntityPlayer;
|
||||||
|
import net.minecraft.server.WorldManager;
|
||||||
|
import net.minecraft.server.WorldServer;
|
||||||
|
|
||||||
|
@Mixin(value = WorldManager.class, remap = false)
|
||||||
|
public abstract class MixinWorldManager {
|
||||||
|
@Shadow @Final private WorldServer world;
|
||||||
|
|
||||||
|
@Overwrite
|
||||||
|
public void a(Entity entity) {
|
||||||
|
this.world.getTracker().entriesLock.lock(); // Akarin
|
||||||
|
this.world.getTracker().track(entity);
|
||||||
|
this.world.getTracker().entriesLock.unlock(); // Akarin
|
||||||
|
|
||||||
|
if (entity instanceof EntityPlayer) {
|
||||||
|
this.world.worldProvider.a((EntityPlayer) entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -745,7 +745,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
WorldServer worldServer = (WorldServer) entity.getWorld();
|
WorldServer worldServer = (WorldServer) entity.getWorld();
|
||||||
worldServer.tracker.untrackEntity(this);
|
worldServer.tracker.untrackEntity(this);
|
||||||
|
worldServer.tracker.entriesLock.lock(); // Akarin
|
||||||
worldServer.tracker.track(this);
|
worldServer.tracker.track(this);
|
||||||
|
worldServer.tracker.entriesLock.unlock(); // Akarin
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"core.MixinCommandKick",
|
"core.MixinCommandKick",
|
||||||
"core.MixinCraftServer",
|
"core.MixinCraftServer",
|
||||||
"core.MixinWorldServer",
|
"core.MixinWorldServer",
|
||||||
|
"core.MixinWorldManager",
|
||||||
"core.MixinCommandBanIp",
|
"core.MixinCommandBanIp",
|
||||||
"core.MixinChunkSection",
|
"core.MixinChunkSection",
|
||||||
"core.MixinAsyncCatcher",
|
"core.MixinAsyncCatcher",
|
||||||
|
|||||||
Reference in New Issue
Block a user