package darkevilmac.movingworld.asm.mixin.core.entity;

import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
 * Override minecraft's move methods so we can tell it how to handle collision.
 */
@Mixin(Entity.class)
public class MixinEntity {

    @Inject(method = "moveEntity(DDD)V", at = @At("HEAD"), cancellable = true)
    public void onMoveEntity(double x, double y, double z, CallbackInfo ci) {
        // Does nothing currently.
    }

}

@@ -85,16 +85,91 @@
 Entity;%0A
+import net.minecraft.util.AxisAlignedBB;%0Aimport net.minecraft.world.World;%0A
 import o
@@ -373,16 +373,40 @@
 kInfo;%0A%0A
+import java.util.List;%0A%0A
 /**%0A * O
@@ -413,17 +413,17 @@
 verride 
-m
+M
 inecraft
@@ -589,12 +589,14 @@
 At(%22
-HEAD
+INVOKE
 %22), 
@@ -705,34 +705,619 @@
     
-// Does nothing currently.
+Entity thisEntity = (Entity) (Object) this;%0A        World worldObj = thisEntity.worldObj;%0A%0A        // If this entity is in noClip just let the method do it's stuff.%0A        if (thisEntity.noClip)%0A            return;%0A%0A        AxisAlignedBB boundingBox = new AxisAlignedBB(thisEntity.posX - 3, thisEntity.posY - 5, thisEntity.posZ - 3,%0A                thisEntity.posX + 3, thisEntity.posY + 5, thisEntity.posZ + 3);%0A        List%3CEntity%3E movingWorldsInBox = worldObj.getEntitiesWithinAABBExcludingEntity(thisEntity, boundingBox);%0A%0A        if (movingWorldsInBox != null && !movingWorldsInBox.isEmpty()) %7B%0A%0A        %7D
 %0A   

Add nearby ship detection to moveEntity