Fixes MC-120780
This commit is contained in:
@@ -12,7 +12,6 @@ import net.minecraft.server.ItemMonsterEgg;
|
|||||||
|
|
||||||
@Mixin(value = ItemMonsterEgg.class, remap = false)
|
@Mixin(value = ItemMonsterEgg.class, remap = false)
|
||||||
public class MonsterEggGuardian {
|
public class MonsterEggGuardian {
|
||||||
|
|
||||||
@Redirect(method = "a", at = @At(
|
@Redirect(method = "a", at = @At(
|
||||||
value = "FIELD",
|
value = "FIELD",
|
||||||
target = "net/minecraft/server/Blocks.MOB_SPAWNER:Lnet/minecraft/server/Block;",
|
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>
|
* <b>Akarin Changes Note</b><br>
|
||||||
* <br>
|
* <br>
|
||||||
* 1) Expose private members<br>
|
* 1) Add volatile to fields<br>
|
||||||
|
* 2) Expose private members<br>
|
||||||
* @author cakoyo
|
* @author cakoyo
|
||||||
*/
|
*/
|
||||||
public class Chunk {
|
public class Chunk {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"lighting.MixinChunkProviderServer",
|
"lighting.MixinChunkProviderServer",
|
||||||
|
|
||||||
"optimization.WeakBigTree",
|
"optimization.WeakBigTree",
|
||||||
|
"optimization.MixinPlayerChunk",
|
||||||
"optimization.WeakEnchantmentManager",
|
"optimization.WeakEnchantmentManager",
|
||||||
"optimization.MixinEntityHorseAbstract",
|
"optimization.MixinEntityHorseAbstract",
|
||||||
"optimization.MixinEntityTameableAnimal",
|
"optimization.MixinEntityTameableAnimal",
|
||||||
|
|||||||
Reference in New Issue
Block a user