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;
}
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;
}
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;
}
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");
}
}
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);
}
}
}
}
Aggregations