Search in sources :

Example 1 with TileEntityMannequin

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin in project Armourers-Workshop by RiskyKen.

the class MessageClientGuiBipedRotations method onMessage.

@Override
public IMessage onMessage(MessageClientGuiBipedRotations message, MessageContext ctx) {
    EntityPlayerMP player = ctx.getServerHandler().playerEntity;
    if (player == null) {
        return null;
    }
    Container container = player.openContainer;
    if (container != null && container instanceof ContainerMannequin) {
        TileEntityMannequin tileEntity = ((ContainerMannequin) container).getTileEntity();
        tileEntity.setBipedRotations(message.bipedRotations);
    }
    return null;
}
Also used : ContainerMannequin(riskyken.armourersWorkshop.common.inventory.ContainerMannequin) Container(net.minecraft.inventory.Container) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)

Example 2 with TileEntityMannequin

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin in project Armourers-Workshop by RiskyKen.

the class BlockDoll method getPickBlock.

@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
    ItemStack stack = new ItemStack(ModBlocks.doll, 1);
    int meta = world.getBlockMetadata(x, y, z);
    int yOffset = 0;
    if (meta == 1) {
        yOffset = -1;
    }
    TileEntity te = world.getTileEntity(x, y + yOffset, z);
    ;
    if (te != null && te instanceof TileEntityMannequin) {
        TileEntityMannequin teMan = (TileEntityMannequin) te;
        if (teMan.getGameProfile() != null) {
            NBTTagCompound profileTag = new NBTTagCompound();
            NBTUtil.func_152460_a(profileTag, teMan.getGameProfile());
            stack.setTagCompound(new NBTTagCompound());
            stack.getTagCompound().setTag(TAG_OWNER, profileTag);
        }
    }
    return stack;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)

Example 3 with TileEntityMannequin

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin in project Armourers-Workshop by RiskyKen.

the class BlockDoll method rotateBlock.

@Override
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
    if (world.isRemote) {
        return false;
    }
    TileEntity te = world.getTileEntity(x, y, z);
    if (te != null && te instanceof TileEntityMannequin) {
        int rotation = ((TileEntityMannequin) te).getRotation();
        rotation++;
        if (rotation > 15) {
            rotation = 0;
        }
        ((TileEntityMannequin) te).setRotation(rotation);
    }
    return true;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)

Example 4 with TileEntityMannequin

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin in project Armourers-Workshop by RiskyKen.

the class BlockMannequin method getDebugHoverText.

@Override
public void getDebugHoverText(World world, int x, int y, int z, ArrayList<String> textLines) {
    textLines.add("top=" + isTopOfMannequin(world, x, y, z));
    TileEntityMannequin te = getMannequinTileEntity(world, x, y, z);
    if (te != null && te.getGameProfile() != null) {
        textLines.add("profile=" + te.getGameProfile().getName() + ":" + te.getGameProfile().getId());
    } else {
        textLines.add("profile=null");
    }
}
Also used : TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)

Example 5 with TileEntityMannequin

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin in project Armourers-Workshop by RiskyKen.

the class BlockMannequin method onEntityCollidedWithBlock.

@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
    super.onEntityCollidedWithBlock(world, x, y, z, entity);
    if (world.isRemote) {
        return;
    }
    if (!(entity instanceof EntityLivingBase)) {
        return;
    }
    EntityLivingBase entityLiving = (EntityLivingBase) entity;
    int meta = world.getBlockMetadata(x, y, z);
    if (meta != 1) {
        return;
    }
    if (entityLiving.posY != y + (double) 0.9F) {
        return;
    }
    if (entityLiving.posX < x + 0.2F | entityLiving.posX > x + 0.8F) {
        return;
    }
    if (entityLiving.posZ < z + 0.2F | entityLiving.posZ > z + 0.8F) {
        return;
    }
    TileEntity te = world.getTileEntity(x, y - 1, z);
    if (te != null && te instanceof TileEntityMannequin) {
        TileEntityMannequin teMan = (TileEntityMannequin) te;
        if (teMan.getGameProfile() != null) {
            if (teMan.getGameProfile().getName().equals("victorious3")) {
                entityLiving.attackEntityFrom(victoriousDamage, 2.0F);
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)

Aggregations

TileEntityMannequin (riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin)19 TileEntity (net.minecraft.tileentity.TileEntity)14 ItemStack (net.minecraft.item.ItemStack)5 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)5 Block (net.minecraft.block.Block)3 GameProfile (com.mojang.authlib.GameProfile)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 EntityFX (net.minecraft.client.particle.EntityFX)2 EntitySpellParticleFX (net.minecraft.client.particle.EntitySpellParticleFX)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 Container (net.minecraft.inventory.Container)2 Contributor (riskyken.armourersWorkshop.common.Contributors.Contributor)2 ContainerMannequin (riskyken.armourersWorkshop.common.inventory.ContainerMannequin)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 IPantable (riskyken.armourersWorkshop.api.common.painting.IPantable)1 IPantableBlock (riskyken.armourersWorkshop.api.common.painting.IPantableBlock)1 BlockLocation (riskyken.armourersWorkshop.common.blocks.BlockLocation)1 BlockMannequin (riskyken.armourersWorkshop.common.blocks.BlockMannequin)1 BipedRotations (riskyken.armourersWorkshop.common.data.BipedRotations)1 ItemBlockMannequin (riskyken.armourersWorkshop.common.items.block.ItemBlockMannequin)1