Fixes MC-103516
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
package io.akarin.server.mixin.core;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
import net.minecraft.server.AxisAlignedBB;
|
||||||
|
import net.minecraft.server.Entity;
|
||||||
|
import net.minecraft.server.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fixes MC-103516(https://bugs.mojang.com/browse/MC-103516)
|
||||||
|
*/
|
||||||
|
@Mixin(value = World.class, remap = false)
|
||||||
|
public abstract class MixinWorld {
|
||||||
|
@Shadow public abstract List<Entity> getEntities(@Nullable Entity entity, AxisAlignedBB box);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity
|
||||||
|
*/
|
||||||
|
public boolean a(AxisAlignedBB box, @Nullable Entity target) { // PAIL: checkNoEntityCollision
|
||||||
|
List<Entity> list = this.getEntities(null, box);
|
||||||
|
|
||||||
|
for (Entity each : list) {
|
||||||
|
if (!each.dead && each.i && each != target && (target == null || !each.x(target))) { // PAIL: preventEntitySpawning - isRidingSameEntity
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,7 +34,7 @@ import net.minecraft.server.IChunkProvider;
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.World;
|
import net.minecraft.server.World;
|
||||||
|
|
||||||
@Mixin(value = World.class, remap = false)
|
@Mixin(value = World.class, remap = false, priority = 1001)
|
||||||
public abstract class MixinWorld {
|
public abstract class MixinWorld {
|
||||||
@Shadow protected IChunkProvider chunkProvider;
|
@Shadow protected IChunkProvider chunkProvider;
|
||||||
@Shadow int[] J; // PAIL: lightUpdateBlockList
|
@Shadow int[] J; // PAIL: lightUpdateBlockList
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"bootstrap.MetricsBootstrap",
|
"bootstrap.MetricsBootstrap",
|
||||||
"bootstrap.MixinRestartCommand",
|
"bootstrap.MixinRestartCommand",
|
||||||
|
|
||||||
|
"core.MixinWorld",
|
||||||
"core.MixinMCUtil",
|
"core.MixinMCUtil",
|
||||||
"core.MixinCommandBan",
|
"core.MixinCommandBan",
|
||||||
"core.MixinCommandKick",
|
"core.MixinCommandKick",
|
||||||
|
|||||||
Reference in New Issue
Block a user