Java Code Examples for net.minecraft.block.state.IBlockState.getBlock()

The following are Jave code examples for showing how to use getBlock() of the net.minecraft.block.state.IBlockState class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: BaseClient   File: ItemSlab.java   View Source Code Vote up 6 votes
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack)
{
    BlockPos blockpos = pos;
    IProperty iproperty = this.singleSlab.getVariantProperty();
    Object object = this.singleSlab.getVariant(stack);
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() == this.singleSlab)
    {
        boolean flag = iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP;

        if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && object == iblockstate.getValue(iproperty))
        {
            return true;
        }
    }

    pos = pos.offset(side);
    IBlockState iblockstate1 = worldIn.getBlockState(pos);
    return iblockstate1.getBlock() == this.singleSlab && object == iblockstate1.getValue(iproperty) ? true : super.canPlaceBlockOnSide(worldIn, blockpos, side, player, stack);
}
 
Example 2
Project: BaseClient   File: BlockDoor.java   View Source Code Vote up 6 votes
public void toggleDoor(World worldIn, BlockPos pos, boolean open)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() == this)
    {
        BlockPos blockpos = iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down();
        IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos);

        if (iblockstate1.getBlock() == this && ((Boolean)iblockstate1.getValue(OPEN)).booleanValue() != open)
        {
            worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 2);
            worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
            worldIn.playAuxSFXAtEntity((EntityPlayer)null, open ? 1003 : 1006, pos, 0);
        }
    }
}
 
Example 3
Project: DecompiledMinecraft   File: BlockDoor.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (this.blockMaterial == Material.iron)
    {
        return true;
    }
    else
    {
        BlockPos blockpos = state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down();
        IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos);

        if (iblockstate.getBlock() != this)
        {
            return false;
        }
        else
        {
            state = iblockstate.cycleProperty(OPEN);
            worldIn.setBlockState(blockpos, state, 2);
            worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
            worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0);
            return true;
        }
    }
}
 
Example 4
Project: DecompiledMinecraft   File: BlockTripWire.java   View Source Code Vote up 6 votes
public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing direction)
{
    BlockPos blockpos = pos.offset(direction);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    Block block = iblockstate.getBlock();

    if (block == Blocks.tripwire_hook)
    {
        EnumFacing enumfacing = direction.getOpposite();
        return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing;
    }
    else if (block == Blocks.tripwire)
    {
        boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue();
        boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue();
        return flag == flag1;
    }
    else
    {
        return false;
    }
}
 
Example 5
Project: DecompiledMinecraft   File: EntityEnderman.java   View Source Code Vote up 6 votes
public void updateTask()
{
    Random random = this.enderman.getRNG();
    World world = this.enderman.worldObj;
    int i = MathHelper.floor_double(this.enderman.posX - 2.0D + random.nextDouble() * 4.0D);
    int j = MathHelper.floor_double(this.enderman.posY + random.nextDouble() * 3.0D);
    int k = MathHelper.floor_double(this.enderman.posZ - 2.0D + random.nextDouble() * 4.0D);
    BlockPos blockpos = new BlockPos(i, j, k);
    IBlockState iblockstate = world.getBlockState(blockpos);
    Block block = iblockstate.getBlock();

    if (EntityEnderman.carriableBlocks.contains(block))
    {
        this.enderman.setHeldBlockState(iblockstate);
        world.setBlockState(blockpos, Blocks.air.getDefaultState());
    }
}
 
Example 6
Project: uniquecrops   File: RenderCraftItem.java   View Source Code Vote up 5 votes
@Override
public void renderTileEntityAt(@Nonnull TileArtisia te, double x, double y, double z, float partialTicks, int digProgress) {
	
	IBlockState state = te.getWorld().getBlockState(te.getPos());
	if (state != null && state.getBlock() == UCBlocks.cropArtisia) {
		ItemStack stack = te.getItem();
		if (stack != null) {
			GlStateManager.pushMatrix();
			GlStateManager.translate((float)x + 0.5F, (float)y + 1.25F, (float)z + 0.5F);
			renderItem(stack);
			GlStateManager.popMatrix();
		}
	}
}
 
Example 7
Project: Backmemed   File: BlockDoublePlant.java   View Source Code Vote up 5 votes
/**
 * Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
 */
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() != this)
    {
        return true;
    }
    else
    {
        BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)iblockstate.getActualState(worldIn, pos).getValue(VARIANT);
        return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN || blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS;
    }
}
 
Example 8
Project: BaseClient   File: BlockPistonMoving.java   View Source Code Vote up 5 votes
/**
 * Called when a player destroys this Block
 */
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)
{
    BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());
    IBlockState iblockstate = worldIn.getBlockState(blockpos);

    if (iblockstate.getBlock() instanceof BlockPistonBase && ((Boolean)iblockstate.getValue(BlockPistonBase.EXTENDED)).booleanValue())
    {
        worldIn.setBlockToAir(blockpos);
    }
}
 
Example 9
Project: ExPetrum   File: ExPHandlerServer.java   View Source Code Vote up 5 votes
@SubscribeEvent
public void onRightClick(PlayerInteractEvent.RightClickBlock event)
{
	if (!event.getWorld().isRemote)
	{
		EntityPlayer player = event.getEntityPlayer();
		IExPPlayer data = IExPPlayer.of(player);
		if (data.getThirst() < data.getMaxThirst(true) - 200)
		{
			RayTraceResult rtr = event.getWorld().rayTraceBlocks(player.getPositionEyes(1), player.getPositionEyes(1).add(player.getLook(1).scale(3)), true, false, false);
			if (rtr != null && rtr.typeOfHit == Type.BLOCK)
			{
				BlockPos pos = rtr.getBlockPos();
				IBlockState hit = event.getWorld().getBlockState(pos);
				if (hit.getBlock() instanceof IWater && !((IWater)hit.getBlock()).isSalt(event.getWorld(), pos))
				{
					int level = hit.getValue(BlockFluidBase.LEVEL);
					if (level > 0)
					{
						event.getWorld().setBlockState(pos, hit.withProperty(BlockFluidBase.LEVEL, level - 1));
					}
					else
					{
						event.getWorld().setBlockToAir(pos);
					}
					
					data.setThirst(data.getThirst() + 200, true);
					event.getWorld().playSound(null, pos, SoundEvents.ENTITY_GENERIC_DRINK, SoundCategory.PLAYERS, 1, 1);
				}
			}
		}
	}
}
 
Example 10
Project: BaseClient   File: BlockDoublePlant.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
    if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
    {
        return worldIn.getBlockState(pos.down()).getBlock() == this;
    }
    else
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.up());
        return iblockstate.getBlock() == this && super.canBlockStay(worldIn, pos, iblockstate);
    }
}
 
Example 11
Project: DecompiledMinecraft   File: BlockLadder.java   View Source Code Vote up 5 votes
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() == this)
    {
        float f = 0.125F;

        switch ((EnumFacing)iblockstate.getValue(FACING))
        {
            case NORTH:
                this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
                break;

            case SOUTH:
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
                break;

            case WEST:
                this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
                break;

            case EAST:
            default:
                this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
        }
    }
}
 
Example 12
Project: CustomWorldGen   File: Template.java   View Source Code Vote up 5 votes
public Map<BlockPos, String> getDataBlocks(BlockPos pos, PlacementSettings placementIn)
{
    Map<BlockPos, String> map = Maps.<BlockPos, String>newHashMap();
    StructureBoundingBox structureboundingbox = placementIn.getBoundingBox();

    for (Template.BlockInfo template$blockinfo : this.blocks)
    {
        BlockPos blockpos = transformedBlockPos(placementIn, template$blockinfo.pos).add(pos);

        if (structureboundingbox == null || structureboundingbox.isVecInside(blockpos))
        {
            IBlockState iblockstate = template$blockinfo.blockState;

            if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK && template$blockinfo.tileentityData != null)
            {
                TileEntityStructure.Mode tileentitystructure$mode = TileEntityStructure.Mode.valueOf(template$blockinfo.tileentityData.getString("mode"));

                if (tileentitystructure$mode == TileEntityStructure.Mode.DATA)
                {
                    map.put(blockpos, template$blockinfo.tileentityData.getString("metadata"));
                }
            }
        }
    }

    return map;
}
 
Example 13
Project: BaseClient   File: BlockMushroom.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
    if (pos.getY() >= 0 && pos.getY() < 256)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.down());
        return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && this.canPlaceBlockOn(iblockstate.getBlock()));
    }
    else
    {
        return false;
    }
}
 
Example 14
Project: CustomWorldGen   File: WorldClient.java   View Source Code Vote up 5 votes
public void showBarrierParticles(int p_184153_1_, int p_184153_2_, int p_184153_3_, int p_184153_4_, Random random, boolean p_184153_6_, BlockPos.MutableBlockPos pos)
{
    int i = p_184153_1_ + this.rand.nextInt(p_184153_4_) - this.rand.nextInt(p_184153_4_);
    int j = p_184153_2_ + this.rand.nextInt(p_184153_4_) - this.rand.nextInt(p_184153_4_);
    int k = p_184153_3_ + this.rand.nextInt(p_184153_4_) - this.rand.nextInt(p_184153_4_);
    pos.setPos(i, j, k);
    IBlockState iblockstate = this.getBlockState(pos);
    iblockstate.getBlock().randomDisplayTick(iblockstate, this, pos, random);

    if (p_184153_6_ && iblockstate.getBlock() == Blocks.BARRIER)
    {
        this.spawnParticle(EnumParticleTypes.BARRIER, (double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
 
Example 15
Project: Mods   File: BlockLauncher.java   View Source Code Vote up 4 votes
public static float damageBlock(BlockPos pos, EntityLivingBase living, World world, float damage) {
	IBlockState state = world.getBlockState(pos);
	Block block = state.getBlock();
	if (block.isAir(state, world, pos) || state.getMaterial() == Material.WATER || state.getMaterial() == Material.LAVA || state.getBlockHardness(world, pos) < 0)
		return damage;

	DestroyBlockEntry finalEntry = null;
	int entryId = 0;
	int emptyId = -1;
	for (int i = 0; i < BlockEventBus.destroyProgress.size(); i++) {
		DestroyBlockEntry entry = BlockEventBus.destroyProgress.get(i);
		if (emptyId == -1 && entry == null)
			emptyId = i;
		if (entry != null && entry.world == world && entry.pos.equals(pos)) {
			finalEntry = entry;
			entryId = i;
			break;
		}
	}
	if (finalEntry == null) {
		finalEntry = new DestroyBlockEntry(pos, world);
		if (emptyId != -1) {
			 BlockEventBus.destroyProgress.set(emptyId, finalEntry);
			entryId = emptyId;
		} else {
			 BlockEventBus.destroyProgress.add(finalEntry);
			entryId =  BlockEventBus.destroyProgress.size() - 1;
		}

	}

	/*if (block instanceof BlockChest) {
		((TileEntityChest) world.getTileEntity(pos)).setLootTable(LootTableList.CHESTS_NETHER_BRIDGE, living.getRNG().nextLong());
	}*/
	float hardness = BlockLauncher.getHardness(state, world);

	finalEntry.curDamage += damage;

	if (living != null)
		world.sendBlockBreakProgress(Math.min(Integer.MAX_VALUE, 0xFFFF + entryId), pos, (int) ((finalEntry.curDamage / hardness) * 10));

	if (finalEntry.curDamage >= hardness) {
		if (living != null && living instanceof EntityPlayer)
			block.harvestBlock(world, (EntityPlayer) living, pos, state, null, ItemStack.EMPTY);
		else {
			block.dropBlockAsItem(world, pos, state, 0);
		}
		BlockEventBus.destroyProgress.remove(finalEntry);

		boolean flag = (living == null || !(living instanceof EntityPlayer) && world.isAirBlock(pos)) || block.removedByPlayer(state, world, pos, (EntityPlayer) living, true);

		if (flag) {
			if (living != null) {
				world.playEvent(2001, pos, Block.getStateId(state));
				world.sendBlockBreakProgress(Math.min(Integer.MAX_VALUE, 0xFFFF + entryId), pos, -1);
			}
			block.onBlockDestroyedByPlayer(world, pos, state);

		}
		return finalEntry.curDamage - hardness;
	}
	return 0;
}
 
Example 16
Project: DecompiledMinecraft   File: BlockTrapDoor.java   View Source Code Vote up 4 votes
public void setBounds(IBlockState state)
{
    if (state.getBlock() == this)
    {
        boolean flag = state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP;
        Boolean obool = (Boolean)state.getValue(OPEN);
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        float f = 0.1875F;

        if (flag)
        {
            this.setBlockBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F);
        }
        else
        {
            this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1875F, 1.0F);
        }

        if (obool.booleanValue())
        {
            if (enumfacing == EnumFacing.NORTH)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.8125F, 1.0F, 1.0F, 1.0F);
            }

            if (enumfacing == EnumFacing.SOUTH)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.1875F);
            }

            if (enumfacing == EnumFacing.WEST)
            {
                this.setBlockBounds(0.8125F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
            }

            if (enumfacing == EnumFacing.EAST)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1875F, 1.0F, 1.0F);
            }
        }
    }
}
 
Example 17
Project: Firma   File: Util.java   View Source Code Vote up 4 votes
public static IBlockState getSparseGrass(IBlockState in) {
	int meta = in.getBlock().getMetaFromState(in);
	Block b = in.getBlock();
	return isRockEnum1(b) ? FirmaMod.grasss.getStateFromMeta(meta) : FirmaMod.grasss2.getStateFromMeta(meta);
}
 
Example 18
Project: Firma   File: FirmaOreTileEntity.java   View Source Code Vote up 4 votes
@Override
public boolean shouldRefresh(World inWorld, BlockPos inPos, IBlockState oldState, IBlockState newState) {
	return oldState.getBlock() != newState.getBlock();
}
 
Example 19
Project: EndermanEvolution   File: LayerHeldBlock3.java   View Source Code Vote up 4 votes
@Override
public void doRenderLayer(EntityFrienderman frienderman, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
	IBlockState iblockstate = frienderman.getHeldBlockState();
	ItemStack stack = frienderman.getHeldItemStack();

	if (iblockstate != null) {
		if (iblockstate.getBlock() == Blocks.RED_FLOWER) {
			GlStateManager.enableRescaleNormal();
			GlStateManager.pushMatrix();
			GlStateManager.translate(-0.04F, 0.6875F + -0.085F, -1.0F);
			GlStateManager.rotate(220.0F, 1.0F, 0.0F, 0.0F);
			GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
			Minecraft.getMinecraft().getItemRenderer().renderItem(frienderman, new ItemStack(Blocks.RED_FLOWER), ItemCameraTransforms.TransformType.NONE);
			GlStateManager.popMatrix();
			GlStateManager.disableRescaleNormal();
		}
		else {
			BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
			GlStateManager.enableRescaleNormal();
			GlStateManager.pushMatrix();
			GlStateManager.translate(0.0F, 0.6875F, -0.75F);
			GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
			GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
			GlStateManager.translate(0.25F, 0.1875F, 0.25F);
			GlStateManager.scale(-0.5F, -0.5F, 0.5F);
			int i = frienderman.getBrightnessForRender();
			int j = i % 65536;
			int k = i / 65536;
			OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
			GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
			endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
			blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
			GlStateManager.popMatrix();
			GlStateManager.disableRescaleNormal();
		}
	}
	else if (!stack.isEmpty()) {
		if (frienderman.deathTime > 0) {
			return;
		}
		GlStateManager.pushMatrix();
		GlStateManager.translate(-0.25F, 0.6875F, -0.75F);
		GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.translate(0.6F, 0.1F, -0.25F);
		GlStateManager.scale(-0.7F, -0.7F, 0.7F);
		if (Mods.ENDERSTORAGE.isLoaded() && frienderman.isHoldingEnderStorageChest()) {
			EnderStorage.renderItemChest(stack, -frienderman.getLidAngle());
		}
		else if (frienderman.isHoldingVanillaChest()) {
			ChestType type = null;
			switch (frienderman.getVanillaChestType()) {
			case ENDER:
				type = ChestType.ENDER;
				break;
			case NORMAL:
				type = ChestType.NORMAL;
				break;
			case TRAPPED:
			default:
				type = ChestType.TRAPPED;
				break;
			}
			CustomChestRenderer.renderChest(type, -frienderman.getLidAngle());
		}
		else if (frienderman.isHoldingVanillaShulkerBox()) {
			CustomChestRenderer.renderShulkerBox(BlockShulkerBox.getColorFromItem(stack.getItem()).getMetadata(), frienderman.getLidAngle());
		}
		else if (frienderman.isHoldingIronChest()) {
			IronChests.renderChest(stack, -frienderman.getLidAngle());
		}
		else if (frienderman.isHoldingIronShulkerBox()) {
			IronChests.renderShulkerBox(stack, frienderman.getLidAngle());
		}
		else {
			RenderUtils.getRenderItem().renderItem(stack, RenderUtils.getMesher().getItemModel(stack));
		}
		GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
		GlStateManager.popMatrix();
	}
}
 
Example 20
Project: Backmemed   File: RenderManager.java   View Source Code Vote up 4 votes
public void cacheActiveRenderInfo(World worldIn, FontRenderer textRendererIn, Entity livingPlayerIn, Entity pointedEntityIn, GameSettings optionsIn, float partialTicks)
{
    this.worldObj = worldIn;
    this.options = optionsIn;
    this.renderViewEntity = livingPlayerIn;
    this.pointedEntity = pointedEntityIn;
    this.textRenderer = textRendererIn;

    if (livingPlayerIn instanceof EntityLivingBase && ((EntityLivingBase)livingPlayerIn).isPlayerSleeping())
    {
        IBlockState iblockstate = worldIn.getBlockState(new BlockPos(livingPlayerIn));
        Block block = iblockstate.getBlock();

        if (Reflector.callBoolean(block, Reflector.ForgeBlock_isBed, new Object[] {iblockstate, worldIn, new BlockPos(livingPlayerIn), (EntityLivingBase)livingPlayerIn}))
        {
            EnumFacing enumfacing = (EnumFacing)Reflector.call(block, Reflector.ForgeBlock_getBedDirection, new Object[] {iblockstate, worldIn, new BlockPos(livingPlayerIn)});
            int i = enumfacing.getHorizontalIndex();
            this.playerViewY = (float)(i * 90 + 180);
            this.playerViewX = 0.0F;
        }
        else if (block == Blocks.BED)
        {
            int j = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex();
            this.playerViewY = (float)(j * 90 + 180);
            this.playerViewX = 0.0F;
        }
    }
    else
    {
        this.playerViewY = livingPlayerIn.prevRotationYaw + (livingPlayerIn.rotationYaw - livingPlayerIn.prevRotationYaw) * partialTicks;
        this.playerViewX = livingPlayerIn.prevRotationPitch + (livingPlayerIn.rotationPitch - livingPlayerIn.prevRotationPitch) * partialTicks;
    }

    if (optionsIn.thirdPersonView == 2)
    {
        this.playerViewY += 180.0F;
    }

    this.viewerPosX = livingPlayerIn.lastTickPosX + (livingPlayerIn.posX - livingPlayerIn.lastTickPosX) * (double)partialTicks;
    this.viewerPosY = livingPlayerIn.lastTickPosY + (livingPlayerIn.posY - livingPlayerIn.lastTickPosY) * (double)partialTicks;
    this.viewerPosZ = livingPlayerIn.lastTickPosZ + (livingPlayerIn.posZ - livingPlayerIn.lastTickPosZ) * (double)partialTicks;
}