This commit is contained in:
Sotr
2018-07-06 20:47:20 +08:00
parent 9e06a9fe5c
commit d596840e83
3 changed files with 1 additions and 36 deletions

View File

@@ -1,34 +0,0 @@
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;
}
}

View File

@@ -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, priority = 1001) @Mixin(value = World.class, remap = false)
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

View File

@@ -13,7 +13,6 @@
"bootstrap.MetricsBootstrap", "bootstrap.MetricsBootstrap",
"bootstrap.MixinRestartCommand", "bootstrap.MixinRestartCommand",
"core.MixinWorld",
"core.MixinMCUtil", "core.MixinMCUtil",
"core.MixinPlayerList", "core.MixinPlayerList",
"core.MixinCommandBan", "core.MixinCommandBan",