use of net.minecraft.client.entity.EntityPlayerSP in project malmo by Microsoft.
the class CommandForWheeledRobotNavigationImplementation method onRenderTick.
/** Called for each screen redraw - approximately three times as often as the other tick events,
* under normal conditions.<br>
* This is where we want to update our yaw/pitch, in order to get smooth panning etc
* (which is how Minecraft itself does it).
* The speed of the render ticks is not guaranteed, and can vary from machine to machine, so
* we try to account for this in the calculations.
* @param ev the RenderTickEvent object for this tick
*/
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent ev) {
if (ev.phase == Phase.START) {
if (this.isOverriding()) {
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
if (player != null) {
updateYawAndPitch();
player.rotationPitch = this.mCameraPitch;
player.rotationYaw = this.mYaw;
}
}
}
}
use of net.minecraft.client.entity.EntityPlayerSP in project GregTech by GregTechCE.
the class UIFactory method initClientUI.
@SideOnly(Side.CLIENT)
public final void initClientUI(PacketBuffer serializedHolder, int windowId) {
E holder = readHolderFromSyncData(serializedHolder);
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayerSP entityPlayer = minecraft.player;
ModularUI<E> uiTemplate = createUITemplate(holder, entityPlayer);
uiTemplate.initWidgets();
minecraft.addScheduledTask(() -> {
minecraft.displayGuiScreen(new ModularUIGui(uiTemplate));
entityPlayer.openContainer.windowId = windowId;
});
}
use of net.minecraft.client.entity.EntityPlayerSP in project Almura by AlmuraDev.
the class ClientboundExchangeOpenResponsePacketHandler method handleMessage.
@Override
public void handleMessage(ClientboundExchangeOpenResponsePacket message, RemoteConnection connection, Platform.Type side) {
if (side.isClient()) {
final Minecraft client = Minecraft.getMinecraft();
if (PacketUtil.checkThreadAndEnqueue(client, message, this, connection, side)) {
final EntityPlayerSP player = client.player;
final WorldClient world = client.world;
if (world != null) {
new ExchangeGUI(player, world, player.getPosition()).display();
}
}
}
}
use of net.minecraft.client.entity.EntityPlayerSP in project ForestryMC by ForestryMC.
the class ItemHabitatLocator method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, @Nullable World world, List<String> list, ITooltipFlag flag) {
super.addInformation(itemstack, world, list, flag);
Minecraft minecraft = Minecraft.getMinecraft();
if (world != null && minecraft.player != null) {
EntityPlayerSP player = minecraft.player;
Biome currentBiome = player.world.getBiome(player.getPosition());
float temperatureValue = ClimateUtil.getTemperature(world, player.getPosition());
EnumTemperature temperature = EnumTemperature.getFromValue(temperatureValue);
EnumHumidity humidity = EnumHumidity.getFromValue(ClimateUtil.getHumidity(world, player.getPosition()));
list.add(Translator.translateToLocal("for.gui.currentBiome") + ": " + currentBiome.getBiomeName());
list.add(Translator.translateToLocal("for.gui.temperature") + ": " + AlleleManager.climateHelper.toDisplay(temperature));
list.add(Translator.translateToLocal("for.gui.humidity") + ": " + AlleleManager.climateHelper.toDisplay(humidity));
}
}
use of net.minecraft.client.entity.EntityPlayerSP in project Hyperium by HyperiumClient.
the class UniversalUtil method addChatMessage.
private static void addChatMessage(Object component) {
EntityPlayerSP thePlayer = autotip.getMinecraft().thePlayer;
thePlayer.addChatMessage((IChatComponent) component);
}
Aggregations