Fixes MC-120780
This commit is contained in:
@@ -12,7 +12,6 @@ import net.minecraft.server.ItemMonsterEgg;
|
||||
|
||||
@Mixin(value = ItemMonsterEgg.class, remap = false)
|
||||
public class MonsterEggGuardian {
|
||||
|
||||
@Redirect(method = "a", at = @At(
|
||||
value = "FIELD",
|
||||
target = "net/minecraft/server/Blocks.MOB_SPAWNER:Lnet/minecraft/server/Block;",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package io.akarin.server.mixin.optimization;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import io.akarin.api.Akari;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.PlayerChunk;
|
||||
|
||||
@Mixin(value = PlayerChunk.class, remap = false)
|
||||
public class MixinPlayerChunk {
|
||||
@Shadow @Final public List<EntityPlayer> c; // PAIL: players
|
||||
|
||||
@Inject(method = "b", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/server/PacketPlayOutMapChunk.<init>(Lnet/minecraft/server/Chunk;I)V",
|
||||
opcode = Opcodes.INVOKESPECIAL,
|
||||
shift = Shift.BEFORE
|
||||
))
|
||||
private void beforeCreateChunkPacket(CallbackInfo ci) {
|
||||
if (c.isEmpty()) ci.cancel(); // Akarin - Fixes MC-120780
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Expose private members<br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* 2) Expose private members<br>
|
||||
* @author cakoyo
|
||||
*/
|
||||
public class Chunk {
|
||||
|
||||
Reference in New Issue
Block a user