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