<commit_before>package darkevilmac.movingworld.asm.mixin.core.entity;

import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
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;

import java.util.List;

/**
 * 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("INVOKE"), cancellable = true)
    public void onMoveEntity(double x, double y, double z, CallbackInfo ci) {
        Entity thisEntity = (Entity) (Object) this;
        World worldObj = thisEntity.worldObj;

        // If this entity is in noClip just let the method do it's stuff.
        if (thisEntity.noClip)
            return;

        AxisAlignedBB boundingBox = new AxisAlignedBB(thisEntity.posX - 3, thisEntity.posY - 5, thisEntity.posZ - 3,
                thisEntity.posX + 3, thisEntity.posY + 5, thisEntity.posZ + 3);
        List<Entity> movingWorldsInBox = worldObj.getEntitiesWithinAABBExcludingEntity(thisEntity, boundingBox);

        if (movingWorldsInBox != null && !movingWorldsInBox.isEmpty()) {

        }
    }

}<commit_msg>Change method to find nearby moving worlds.<commit_after>package darkevilmac.movingworld.asm.mixin.core.entity;

import darkevilmac.movingworld.entity.EntityMovingWorld;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
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;

import java.util.List;

/**
 * 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("INVOKE"), cancellable = true)
    public void onMoveEntity(double x, double y, double z, CallbackInfo ci) {
        Entity thisEntity = (Entity) (Object) this;
        World worldObj = thisEntity.worldObj;

        // If this entity is in noClip just let the method do it's stuff.
        if (thisEntity.noClip)
            return;

        AxisAlignedBB boundingBox = new AxisAlignedBB(thisEntity.posX - 3, thisEntity.posY - 5, thisEntity.posZ - 3,
                thisEntity.posX + 3, thisEntity.posY + 5, thisEntity.posZ + 3);
        List<Entity> movingWorldsInBox = worldObj.getEntitiesWithinAABB(EntityMovingWorld.class, boundingBox);

        if (movingWorldsInBox != null && !movingWorldsInBox.isEmpty()) {

        }
    }

}
{'fraction_non_alphanumeric': 0.10518783542039356, 'fraction_numerical': 0.004293381037567084, 'mean_word_length': 3.66, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3439120', 'n_tokens_mistral': 921, 'n_tokens_neox': 869, 'n_words': 204}