Search in sources :

Example 16 with EntityArmorStand

use of net.minecraft.entity.item.EntityArmorStand in project VapuLite by VapuClient.

the class BowAimBot method getClosestEntity.

EntityLivingBase getClosestEntity() {
    EntityLivingBase closestEntity = null;
    for (Entity o : Aimbot.getEntityList()) {
        EntityLivingBase entity;
        if (!(o instanceof EntityLivingBase) || o instanceof EntityArmorStand || !this.check(entity = (EntityLivingBase) o) || closestEntity != null && !(mc.thePlayer.getDistanceToEntity(entity) < mc.thePlayer.getDistanceToEntity(closestEntity)))
            continue;
        closestEntity = entity;
    }
    return closestEntity;
}
Also used : Entity(net.minecraft.entity.Entity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityArmorStand(net.minecraft.entity.item.EntityArmorStand)

Example 17 with EntityArmorStand

use of net.minecraft.entity.item.EntityArmorStand in project BapeClient by BapeDeveloperTeam.

the class BowAimBot method getClosestEntity.

EntityLivingBase getClosestEntity() {
    EntityLivingBase closestEntity = null;
    for (Entity o : Aimbot.getEntityList()) {
        EntityLivingBase entity;
        if (!(o instanceof EntityLivingBase) || o instanceof EntityArmorStand || !this.check(entity = (EntityLivingBase) o) || closestEntity != null && !(mc.thePlayer.getDistanceToEntity(entity) < mc.thePlayer.getDistanceToEntity(closestEntity)))
            continue;
        closestEntity = entity;
    }
    return closestEntity;
}
Also used : Entity(net.minecraft.entity.Entity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityArmorStand(net.minecraft.entity.item.EntityArmorStand)

Example 18 with EntityArmorStand

use of net.minecraft.entity.item.EntityArmorStand in project Lands-of-Icaria by Axanthic-Game-Studios.

the class ModelArmorBase method setRotationAngles.

@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
    if (entityIn instanceof EntityArmorStand) {
        EntityArmorStand entityarmorstand = (EntityArmorStand) entityIn;
        float x = 0.017453292F;
        this.setRotateAngle(this.bipedHead, x * entityarmorstand.getHeadRotation().getX(), x * entityarmorstand.getHeadRotation().getY(), x * entityarmorstand.getHeadRotation().getZ());
        this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F);
        this.setRotateAngle(this.bipedBody, x * entityarmorstand.getBodyRotation().getX(), x * entityarmorstand.getBodyRotation().getY(), x * entityarmorstand.getBodyRotation().getZ());
        this.setRotateAngle(this.bipedLeftArm, x * entityarmorstand.getLeftArmRotation().getX(), x * entityarmorstand.getLeftArmRotation().getY(), x * entityarmorstand.getLeftArmRotation().getZ());
        this.setRotateAngle(this.bipedRightArm, x * entityarmorstand.getRightArmRotation().getX(), x * entityarmorstand.getRightArmRotation().getY(), x * entityarmorstand.getRightArmRotation().getZ());
        this.setRotateAngle(this.bipedLeftLeg, x * entityarmorstand.getLeftLegRotation().getX(), x * entityarmorstand.getLeftLegRotation().getY(), x * entityarmorstand.getLeftLegRotation().getZ());
        this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F);
        this.setRotateAngle(this.bipedRightLeg, x * entityarmorstand.getRightLegRotation().getX(), x * entityarmorstand.getRightLegRotation().getY(), x * entityarmorstand.getRightLegRotation().getZ());
        this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F);
        copyModelAngles(this.bipedHead, this.bipedHeadwear);
    } else
        super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
}
Also used : EntityArmorStand(net.minecraft.entity.item.EntityArmorStand)

Example 19 with EntityArmorStand

use of net.minecraft.entity.item.EntityArmorStand in project Wynntils by Wynntils.

the class ClientEvents method findLabels.

@SubscribeEvent
public void findLabels(PacketEvent<SPacketEntityMetadata> e) {
    // makes this method always be called in main thread
    if (!McIf.mc().isCallingFromMinecraftThread()) {
        McIf.mc().addScheduledTask(() -> findLabels(e));
        return;
    }
    if (e.getPacket().getDataManagerEntries() == null || e.getPacket().getDataManagerEntries().isEmpty())
        return;
    Entity i = McIf.world().getEntityByID(e.getPacket().getEntityId());
    if (i == null)
        return;
    if (i instanceof EntityItemFrame) {
        ItemStack item = Utils.getItemFromMetadata(e.getPacket().getDataManagerEntries());
        if (item.hasDisplayName()) {
            FrameworkManager.getEventBus().post(new LocationEvent.LabelFoundEvent(item.getDisplayName(), new Location(i), i));
        }
    } else if (i instanceof EntityLiving) {
        boolean visible = Utils.isNameVisibleFromMetadata(e.getPacket().getDataManagerEntries());
        if (!visible)
            return;
        String value = Utils.getNameFromMetadata(e.getPacket().getDataManagerEntries());
        if (value == null || value.isEmpty())
            return;
        FrameworkManager.getEventBus().post(new LocationEvent.EntityLabelFoundEvent(value, new Location(i), (EntityLiving) i));
    } else if (i instanceof EntityArmorStand) {
        boolean visible = Utils.isNameVisibleFromMetadata(e.getPacket().getDataManagerEntries());
        if (!visible)
            return;
        String value = Utils.getNameFromMetadata(e.getPacket().getDataManagerEntries());
        if (value == null || value.isEmpty())
            return;
        FrameworkManager.getEventBus().post(new LocationEvent.LabelFoundEvent(value, new Location(i), i));
    }
}
Also used : Entity(net.minecraft.entity.Entity) EntityItemFrame(net.minecraft.entity.item.EntityItemFrame) EntityLiving(net.minecraft.entity.EntityLiving) EntityArmorStand(net.minecraft.entity.item.EntityArmorStand) ItemStack(net.minecraft.item.ItemStack) Location(com.wynntils.core.utils.objects.Location) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 20 with EntityArmorStand

use of net.minecraft.entity.item.EntityArmorStand in project ElementalSorcery by Yuzunyannn.

the class VillageESHall method addComponentParts.

public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) {
    if (this.averageGroundLvl < 0) {
        this.averageGroundLvl = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn);
        if (this.averageGroundLvl < 0) {
            return true;
        }
        this.boundingBox.offset(0, this.averageGroundLvl - this.boundingBox.maxY + 6 - 1, 0);
    }
    IBlockState blockStone = this.getBiomeSpecificBlockState(Blocks.COBBLESTONE.getDefaultState());
    IBlockState blockLog = this.getBiomeSpecificBlockState(Blocks.LOG.getDefaultState());
    IBlockState blockLogX = this.getBiomeSpecificBlockState(Blocks.LOG.getDefaultState().withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
    IBlockState blockPlanks = this.getBiomeSpecificBlockState(Blocks.PLANKS.getDefaultState());
    IBlockState blockGlassPane = this.getBiomeSpecificBlockState(Blocks.GLASS_PANE.getDefaultState());
    IBlockState blockGlass = this.getBiomeSpecificBlockState(Blocks.GLASS.getDefaultState());
    IBlockState blockStair = this.getBiomeSpecificBlockState(Blocks.STONE_STAIRS.getDefaultState());
    IBlockState blockWoodStair = this.getBiomeSpecificBlockState(Blocks.OAK_STAIRS.getDefaultState()).withProperty(BlockStairs.FACING, EnumFacing.SOUTH);
    IBlockState blockSlab = this.getBiomeSpecificBlockState(Blocks.STONE_SLAB.getDefaultState());
    IBlockState blockCarpet = this.getBiomeSpecificBlockState(Blocks.CARPET.getDefaultState());
    // 底板,墙
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 12, 0, 10, blockPlanks, blockPlanks, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 1, 4, 10, blockStone, blockStone, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 1, 12, 4, 10, blockStone, blockStone, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 10, 12, 4, 10, blockStone, blockStone, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 10, 12, 4, 10, blockStone, blockStone, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 10, 10, 3, 10, blockPlanks, blockPlanks, false);
    // 地毯
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 11, 1, 9, blockCarpet, blockCarpet, false);
    // 房顶
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 1, 12, 4, 10, blockStone, blockStone, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 12, 5, 1, blockSlab, blockSlab, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 10, 12, 5, 10, blockSlab, blockSlab, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 1, 5, 10, blockSlab, blockSlab, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 5, 1, 12, 5, 10, blockSlab, blockSlab, false);
    // 玻璃
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 4, 4, 9, 4, 6, blockGlass, blockGlass, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 1, 4, 3, 1, blockGlassPane, blockGlassPane, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 2, 1, 11, 3, 1, blockGlassPane, blockGlassPane, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 4, 1, 3, 6, blockGlassPane, blockGlassPane, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 2, 4, 12, 3, 6, blockGlassPane, blockGlassPane, false);
    // 原木柱子
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 1, 4, 1, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 0, 1, 12, 4, 1, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 10, 1, 4, 10, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 0, 10, 12, 4, 10, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 1, 5, 4, 1, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 1, 8, 4, 1, blockLog, blockLog, false);
    // 内部结构
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 7, 10, 1, 7, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 3, 7, 11, 3, 7, blockGlassPane, blockLog, false);
    this.setBlockState(worldIn, blockLog, 3, 2, 7, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockLog, 7, 2, 7, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockLog, 10, 2, 7, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockGlassPane, 4, 2, 7, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockGlassPane, 6, 2, 7, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockGlassPane, 8, 2, 7, structureBoundingBoxIn);
    this.createVillageDoor(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 7, EnumFacing.NORTH);
    this.createVillageDoor(worldIn, structureBoundingBoxIn, randomIn, 11, 1, 7, EnumFacing.NORTH);
    // 一排座位
    this.setBlockState(worldIn, blockWoodStair.withProperty(BlockStairs.FACING, EnumFacing.WEST), 2, 1, 2, structureBoundingBoxIn);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 4, 1, 2, blockWoodStair, blockWoodStair, false);
    this.setBlockState(worldIn, blockWoodStair.withProperty(BlockStairs.FACING, EnumFacing.EAST), 5, 1, 2, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockWoodStair.withProperty(BlockStairs.FACING, EnumFacing.WEST), 8, 1, 2, structureBoundingBoxIn);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 2, 10, 1, 2, blockWoodStair, blockWoodStair, false);
    this.setBlockState(worldIn, blockWoodStair.withProperty(BlockStairs.FACING, EnumFacing.EAST), 11, 1, 2, structureBoundingBoxIn);
    // 窗口座位
    this.setBlockState(worldIn, blockWoodStair, 5, 1, 5, structureBoundingBoxIn);
    this.setBlockState(worldIn, blockWoodStair, 9, 1, 5, structureBoundingBoxIn);
    // 箱子
    ResourceLocation loot = LootRegister.ES_VILLAGE_HALL;
    this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 11, 1, 9, loot);
    // 原木横条
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 1, 4, 1, 1, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 1, 11, 1, 1, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 4, 1, 1, 6, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 4, 12, 1, 6, blockLog, blockLog, false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 1, 7, 3, 1, blockLogX, blockLogX, false);
    // 石横条
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 4, 1, 11, 4, 1, blockStone, blockStone, false);
    // 门
    if (!this.isZombieInfested) {
        IBlockState doorState = this.biomeDoor().getDefaultState().withProperty(BlockDoor.FACING, EnumFacing.NORTH);
        this.setBlockState(worldIn, doorState, 6, 1, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, doorState.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 6, 1 + 1, 1, structureBoundingBoxIn);
        doorState = doorState.withProperty(BlockDoor.HINGE, BlockDoor.EnumHingePosition.RIGHT);
        this.setBlockState(worldIn, doorState, 7, 1, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, doorState.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 7, 1 + 1, 1, structureBoundingBoxIn);
    }
    // 火把
    this.placeTorch(worldIn, EnumFacing.SOUTH, 5, 3, 0, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.SOUTH, 8, 3, 0, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.SOUTH, 1, 4, 0, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.SOUTH, 12, 4, 0, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.WEST, 0, 4, 1, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.EAST, 13, 4, 1, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.SOUTH, 3, 3, 9, structureBoundingBoxIn);
    this.placeTorch(worldIn, EnumFacing.SOUTH, 10, 3, 9, structureBoundingBoxIn);
    // 村民
    this.spawnVillagers(worldIn, structureBoundingBoxIn, 5, 1, 8, 1);
    this.spawnVillagers(worldIn, structureBoundingBoxIn, 9, 1, 8, 2);
    // 武器架子
    EntityArmorStand armorStand = this.setArmorStand(2, 1, 9, worldIn);
    this.randomArmor(armorStand, randomIn, worldIn);
    // 楼梯
    if (this.getBlockStateFromPos(worldIn, 6, 0, 0, structureBoundingBoxIn).getMaterial() == Material.AIR && this.getBlockStateFromPos(worldIn, 6, -1, 0, structureBoundingBoxIn).getMaterial() != Material.AIR) {
        this.setBlockState(worldIn, blockStair, 6, 0, 0, structureBoundingBoxIn);
        if (this.getBlockStateFromPos(worldIn, 6, -1, 0, structureBoundingBoxIn).getBlock() == Blocks.GRASS_PATH) {
            this.setBlockState(worldIn, Blocks.GRASS.getDefaultState(), 6, -1, 0, structureBoundingBoxIn);
        }
    }
    if (this.getBlockStateFromPos(worldIn, 7, 0, 0, structureBoundingBoxIn).getMaterial() == Material.AIR && this.getBlockStateFromPos(worldIn, 7, -1, 0, structureBoundingBoxIn).getMaterial() != Material.AIR) {
        this.setBlockState(worldIn, blockStair, 7, 0, 0, structureBoundingBoxIn);
        if (this.getBlockStateFromPos(worldIn, 7, -1, 0, structureBoundingBoxIn).getBlock() == Blocks.GRASS_PATH) {
            this.setBlockState(worldIn, Blocks.GRASS.getDefaultState(), 7, -1, 0, structureBoundingBoxIn);
        }
    }
    // 清理天空和地面
    for (int k = 0; k < 14; ++k) {
        for (int j = 0; j < 12; ++j) {
            this.clearCurrentPositionBlocksUpwards(worldIn, k, 6, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, blockStone, k, -1, j, structureBoundingBoxIn);
        }
    }
    return true;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) ResourceLocation(net.minecraft.util.ResourceLocation) EntityArmorStand(net.minecraft.entity.item.EntityArmorStand)

Aggregations

EntityArmorStand (net.minecraft.entity.item.EntityArmorStand)36 Entity (net.minecraft.entity.Entity)13 BlockPos (net.minecraft.util.math.BlockPos)8 ArrayList (java.util.ArrayList)7 EntityItemFrame (net.minecraft.entity.item.EntityItemFrame)7 ItemStack (net.minecraft.item.ItemStack)7 EntityFallingBlock (net.minecraft.entity.item.EntityFallingBlock)6 EntityLivingBase (net.minecraft.entity.EntityLivingBase)5 EntityBoat (net.minecraft.entity.item.EntityBoat)5 EntityPig (net.minecraft.entity.passive.EntityPig)5 TileEntity (net.minecraft.tileentity.TileEntity)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 Location (com.wynntils.core.utils.objects.Location)3 Matcher (java.util.regex.Matcher)3 EntityLightningBolt (net.minecraft.entity.effect.EntityLightningBolt)3 EntityEnderPearl (net.minecraft.entity.item.EntityEnderPearl)3 EntityItem (net.minecraft.entity.item.EntityItem)3 RayTraceResult (net.minecraft.util.math.RayTraceResult)3 Iterator (java.util.Iterator)2