Search in sources :

Example 46 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project DynamicSurroundings by OreCruncher.

the class KeyHandler method sendPlayerMessage.

private static void sendPlayerMessage(final String fmt, final Object... parms) {
    if (ModOptions.general.hideChatNotices)
        return;
    final EntityPlayerSP player = Minecraft.getMinecraft().player;
    if (player != null) {
        final String txt = chatPrefix + Localization.format(fmt, parms);
        player.sendMessage(new TextComponentString(txt));
    }
}
Also used : TextComponentString(net.minecraft.util.text.TextComponentString) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) TextComponentString(net.minecraft.util.text.TextComponentString)

Example 47 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project BuildCraft by BuildCraft.

the class FluidShaderRenderer method renderAll.

public void renderAll(float partialTicks) {
    long tick = Minecraft.getMinecraft().theWorld.getTotalWorldTime();
    EntityPlayerSP clientPlayer = Minecraft.getMinecraft().thePlayer;
    Vec3d pos = Utils.getInterpolatedVec(clientPlayer, partialTicks);
    GL11.glPushMatrix();
    RenderUtils.translate(Utils.multiply(pos, -1));
    // FluidShaderManager.INSTANCE.getShader().useShader();
    // temp
    GL11.glPointSize(8);
    GL11.glLineWidth(4);
    for (FluidShaderData fluidShaderData : shaderList) {
        renderShader(tick, partialTicks, fluidShaderData);
    }
    // FluidShaderManager.INSTANCE.getShader().endShader();
    GL11.glPopMatrix();
}
Also used : EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) Vec3d(net.minecraft.util.math.Vec3d)

Example 48 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class PlayerMovementDataGenerator method generatePlayerMovementDataForClient.

/**
 * Only works on the client.
 */
public static PlayerMovementData generatePlayerMovementDataForClient() {
    final EntityPlayerSP entityPlayer = Minecraft.getMinecraft().player;
    final EntityShipMovementData entityShipMovementData = ValkyrienUtils.getEntityShipMovementDataFor(entityPlayer);
    final ShipData lastTouchedShip = entityShipMovementData.getLastTouchedShip();
    final UUID lastTouchedShipId = lastTouchedShip != null ? lastTouchedShip.getUuid() : null;
    final Vector3d playerPosInLocal = new Vector3d(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ);
    final Vector3d playerLookInLocal = JOML.convert(entityPlayer.getLook(1));
    final boolean onGround = entityPlayer.onGround;
    if (lastTouchedShip != null) {
        final ShipTransform shipTransform = lastTouchedShip.getShipTransform();
        shipTransform.transformPosition(playerPosInLocal, TransformType.GLOBAL_TO_SUBSPACE);
        shipTransform.transformDirection(playerLookInLocal, TransformType.GLOBAL_TO_SUBSPACE);
    }
    return new PlayerMovementData(lastTouchedShipId, entityShipMovementData.getTicksSinceTouchedShip(), entityShipMovementData.getTicksPartOfGround(), playerPosInLocal, playerLookInLocal, onGround);
}
Also used : EntityShipMovementData(org.valkyrienskies.mod.common.entity.EntityShipMovementData) Vector3d(org.joml.Vector3d) ShipTransform(org.valkyrienskies.mod.common.ships.ship_transform.ShipTransform) ShipData(org.valkyrienskies.mod.common.ships.ShipData) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) UUID(java.util.UUID)

Example 49 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project Railcraft by Railcraft.

the class PacketGuiWidget method readData.

@Override
public void readData(RailcraftInputStream data) throws IOException {
    windowId = data.readByte();
    byte widgetId = data.readByte();
    EntityPlayerSP player = FMLClientHandler.instance().getClient().player;
    if (player.openContainer instanceof RailcraftContainer && player.openContainer.windowId == windowId) {
        RailcraftContainer railcraftContainer = ((RailcraftContainer) player.openContainer);
        railcraftContainer.getWidgets().get(widgetId).readServerSyncData(data);
    }
}
Also used : RailcraftContainer(mods.railcraft.common.gui.containers.RailcraftContainer) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Example 50 with EntityPlayerSP

use of net.minecraft.client.entity.EntityPlayerSP in project ArsMagica2 by Mithion.

the class SpellScrollRenderer method renderFirstPersonArm.

private void renderFirstPersonArm(EntityClientPlayerMP player) {
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    float par1 = 0.5f;
    float f1 = 1.0F;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    float f2 = entityclientplayermp.prevRotationPitch + (entityclientplayermp.rotationPitch - entityclientplayermp.prevRotationPitch) * par1;
    GL11.glPushMatrix();
    GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(entityclientplayermp.prevRotationYaw + (entityclientplayermp.rotationYaw - entityclientplayermp.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();
    EntityPlayerSP entityplayersp = entityclientplayermp;
    float f3 = entityplayersp.prevRenderArmPitch + (entityplayersp.renderArmPitch - entityplayersp.prevRenderArmPitch) * par1;
    float f4 = entityplayersp.prevRenderArmYaw + (entityplayersp.renderArmYaw - entityplayersp.prevRenderArmYaw) * par1;
    GL11.glRotatef((entityclientplayermp.rotationPitch - f3) * 0.1F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef((entityclientplayermp.rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F);
    float f5 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ));
    f5 = 1.0F;
    int i = this.mc.theWorld.getLightBrightnessForSkyBlocks(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ), 0);
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f6;
    float f7;
    float f8;
    GL11.glPushMatrix();
    float f12 = 0.8F;
    f7 = entityclientplayermp.getSwingProgress(par1);
    f8 = MathHelper.sin(f7 * (float) Math.PI);
    f6 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
    GL11.glTranslatef(-f6 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.4F, -f8 * 0.4F);
    GL11.glTranslatef(0.8F * f12, -0.75F * f12 - (1.0F - f1) * 0.6F, -0.9F * f12);
    GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    f7 = entityclientplayermp.getSwingProgress(par1);
    f8 = MathHelper.sin(f7 * f7 * (float) Math.PI);
    f6 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
    GL11.glRotatef(f6 * 70.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-f8 * 20.0F, 0.0F, 0.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin());
    GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
    GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
    GL11.glScalef(1.0F, 1.0F, 1.0F);
    GL11.glTranslatef(5.6F, 0.0F, 0.0F);
    float f = 1.0F;
    GL11.glColor3f(f, f, f);
    this.modelBipedMain.onGround = 0.0F;
    this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, player);
    this.modelBipedMain.bipedRightArm.render(0.0625F);
    GL11.glPopMatrix();
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP)

Aggregations

EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)158 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)31 Minecraft (net.minecraft.client.Minecraft)29 ItemStack (net.minecraft.item.ItemStack)29 BlockPos (net.minecraft.util.math.BlockPos)27 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)23 Entity (net.minecraft.entity.Entity)21 EntityPlayer (net.minecraft.entity.player.EntityPlayer)13 TileEntity (net.minecraft.tileentity.TileEntity)13 WorldClient (net.minecraft.client.multiplayer.WorldClient)11 IBlockState (net.minecraft.block.state.IBlockState)10 Tessellator (net.minecraft.client.renderer.Tessellator)10 GCPlayerStatsClient (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStatsClient)8 ArrayList (java.util.ArrayList)6 Block (net.minecraft.block.Block)6 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)6 Vec3d (net.minecraft.util.math.Vec3d)6 World (net.minecraft.world.World)6 UUID (java.util.UUID)5 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)5