本文整理匯總了Java中net.minecraft.client.entity.EntityClientPlayerMP類的典型用法代碼示例。如果您正苦於以下問題:Java EntityClientPlayerMP類的具體用法?Java EntityClientPlayerMP怎麽用?Java EntityClientPlayerMP使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityClientPlayerMP類屬於net.minecraft.client.entity包,在下文中一共展示了EntityClientPlayerMP類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPreGuiRender
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@SubscribeEvent
public void onPreGuiRender(RenderGameOverlayEvent.Pre event)
{
final Minecraft minecraft = FMLClientHandler.instance().getClient();
final EntityClientPlayerMP player = minecraft.thePlayer;
if (event.type == RenderGameOverlayEvent.ElementType.ALL)
{
if (player != null && player.ridingEntity != null && player.ridingEntity instanceof IIgnoreShift && ((IIgnoreShift) player.ridingEntity).shouldIgnoreShiftExit())
{
// Remove "Press shift to dismount" message when shift-exiting is disabled (not ideal, but the only option)
String str = I18n.format("mount.onboard", new Object[] { GameSettings.getKeyDisplayString(minecraft.gameSettings.keyBindSneak.getKeyCode()) });
if (minecraft.ingameGUI.recordPlaying.equals(str))
{
minecraft.ingameGUI.recordPlaying = "";
}
}
}
}
示例2: GuiJoinSpaceRace
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
public GuiJoinSpaceRace(EntityClientPlayerMP player)
{
this.thePlayer = player;
GCPlayerStatsClient stats = GCPlayerStatsClient.get(player);
SpaceRace race = SpaceRaceManager.getSpaceRaceFromID(stats.spaceRaceInviteTeamID);
if (race != null)
{
this.spaceRaceData = race;
}
else
{
List<String> playerList = new ArrayList<String>();
playerList.add(player.getGameProfile().getName());
this.spaceRaceData = new SpaceRace(playerList, SpaceRace.DEFAULT_NAME, new FlagData(48, 32), new Vector3(1, 1, 1));
}
}
示例3: getFogColorHook
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
public static Vec3 getFogColorHook(World world)
{
EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
if (world.provider.getSkyRenderer() instanceof SkyProviderOverworld)
{
float var20 = ((float) (player.posY) - Constants.OVERWORLD_SKYPROVIDER_STARTHEIGHT) / 1000.0F;
var20 = MathHelper.sqrt_float(var20);
final float var21 = Math.max(1.0F - var20 * 40.0F, 0.0F);
Vec3 vec = world.getFogColor(1.0F);
return Vec3.createVectorHelper(vec.xCoord * Math.max(1.0F - var20 * 1.29F, 0.0F), vec.yCoord * Math.max(1.0F - var20 * 1.29F, 0.0F), vec.zCoord * Math.max(1.0F - var20 * 1.29F, 0.0F));
}
return world.getFogColor(1.0F);
}
示例4: onMessage
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@Override
public IMessage onMessage(DragonPlayerUpdateIsDragon message, MessageContext ctx) {
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
if (player != null) {
if (player != null) {
DragonPlayer dragonPlayer = DragonPlayer.get(player);
dragonPlayer.setDragon(message.value, false);
if (!message.value) {
// Some other human defaults
// player.noClip = false;
player.stepHeight = 0.5F; // Normally 0.5F for player
}
}
}
return null;
}
示例5: onKeyInput
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
PlayerInfo pi = PlayerManagerTFC.getInstance().getClientPlayer();
EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
if (FMLClientHandler.instance().getClient().inGameHasFocus &&
FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem() != null &&
FMLClientHandler.instance().getClient().currentScreen == null) {
if (Key_PrevChiselMode.isPressed()) {
if (player.getCurrentEquippedItem().getItem() instanceof ItemChisel) {
pi.setChiselMode(prevChiselMode(pi));
//Let's send the actual ChiselMode so the server/client does not
//come out of sync.
AbstractPacket pkt = new KeyPressPacket(pi.chiselMode);
TerraFirmaCraft.PACKET_PIPELINE.sendToServer(pkt);
}
}
}
}
示例6: jump
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
/**
* Causes this entity to do an upwards motion (jumping).
*/
protected void jump()
{
this.motionY = 0.41999998688697815D * (Resilience.getInstance().getValues().highJumpEnabled && (this instanceof EntityClientPlayerMP) ? Resilience.getInstance().getValues().highJumpMultiplier.getValue() : 1);
if (this.isPotionActive(Potion.jump))
{
this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
}
if (this.isSprinting())
{
float var1 = this.rotationYaw * 0.017453292F;
this.motionX -= (double)(MathHelper.sin(var1) * 0.2F);
this.motionZ += (double)(MathHelper.cos(var1) * 0.2F);
}
this.isAirBorne = true;
}
示例7: handlePlayerPosLook
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
/**
* Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
* mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
* player positioning
*/
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
EntityClientPlayerMP var2 = this.gameController.thePlayer;
double var3 = p_147258_1_.func_148932_c();
double var5 = p_147258_1_.func_148928_d();
double var7 = p_147258_1_.func_148933_e();
float var9 = p_147258_1_.func_148931_f();
float var10 = p_147258_1_.func_148930_g();
var2.ySize = 0.0F;
var2.motionX = var2.motionY = var2.motionZ = 0.0D;
var2.setPositionAndRotation(var3, var5, var7, var9, var10);
this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(var2.posX, var2.boundingBox.minY, var2.posY, var2.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);
if (!this.doneLoadingTerrain)
{
this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
this.doneLoadingTerrain = true;
this.gameController.displayGuiScreen((GuiScreen)null);
}
}
示例8: handleConfirmTransaction
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
/**
* Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
* and confirms if it is the case.
*/
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
Container var2 = null;
EntityClientPlayerMP var3 = this.gameController.thePlayer;
if (p_147239_1_.func_148889_c() == 0)
{
var2 = var3.inventoryContainer;
}
else if (p_147239_1_.func_148889_c() == var3.openContainer.windowId)
{
var2 = var3.openContainer;
}
if (var2 != null && !p_147239_1_.func_148888_e())
{
this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
}
}
示例9: renderOverlay
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(RenderWorldLastEvent evt, EntityClientPlayerMP player, ItemStack wand) {
MovingObjectPosition mouseOver = Minecraft.getMinecraft().objectMouseOver;
if (mouseOver != null) {
World world = player.worldObj;
int x = mouseOver.blockX;
int y = mouseOver.blockY;
int z = mouseOver.blockZ;
Block block = world.getBlock(x, y, z);
if (block != null && block.getMaterial() != Material.air) {
Set<Coordinate> coordinates = findSuitableBlocks(wand, world, mouseOver.sideHit, x, y, z);
renderOutlines(evt, player, coordinates, 200, 230, 180);
}
}
}
示例10: renderOverlay
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(RenderWorldLastEvent evt, EntityClientPlayerMP player, ItemStack wand) {
MovingObjectPosition mouseOver = Minecraft.getMinecraft().objectMouseOver;
if (mouseOver != null) {
Block block = player.worldObj.getBlock(mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ);
if (block != null && block.getMaterial() != Material.air) {
int meta = player.worldObj.getBlockMetadata(mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ);
int wandId = Tools.getTagCompound(wand).getInteger("block");
Block wandBlock = (Block) Block.blockRegistry.getObjectById(wandId);
int wandMeta = Tools.getTagCompound(wand).getInteger("meta");
if (wandBlock == block && wandMeta == meta) {
return;
}
Set<Coordinate> coordinates = findSuitableBlocks(wand, player.worldObj, mouseOver.sideHit, mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ, block, meta);
renderOutlines(evt, player, coordinates, 200, 230, 180);
}
}
}
示例11: renderOutlines
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
protected static void renderOutlines(RenderWorldLastEvent evt, EntityClientPlayerMP p, Set<Coordinate> coordinates, int r, int g, int b) {
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * evt.partialTicks;
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * evt.partialTicks;
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * evt.partialTicks;
GL11.glPushAttrib(GL11.GL_CURRENT_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT | GL11.GL_TEXTURE_BIT);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix();
GL11.glTranslated(-doubleX, -doubleY, -doubleZ);
renderOutlines(coordinates, r, g, b, 4);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例12: getKit
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
public static KitCTF getKit(EntityClientPlayerMP player) {
for (KitCTF kit : kits.values()) {
Item helm = player.inventory.armorInventory[3] == null ? KitsCTF.empty : player.inventory.armorInventory[3].getItem();
Item chest = player.inventory.armorInventory[2] == null ? KitsCTF.empty : player.inventory.armorInventory[2].getItem();
Item legs = player.inventory.armorInventory[1] == null ? KitsCTF.empty : player.inventory.armorInventory[1].getItem();
Item boots = player.inventory.armorInventory[0] == null ? KitsCTF.empty : player.inventory.armorInventory[0].getItem();
if (helm != kit.helm.getItem()) continue;
if (chest != kit.chest.getItem()) continue;
if (legs != kit.legs.getItem()) continue;
if (boots != kit.boots.getItem()) continue;
return kit;
}
return new KitCTF("None", Blocks.web, null, null, null, null);
}
示例13: getArmor
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
public static void getArmor() {
if (Main.mc.thePlayer == null || Main.mc.thePlayer.inventory == null) return;
EntityClientPlayerMP player = Main.mc.thePlayer;
items.clear();
if (player.inventory.armorInventory[3] != null) items.add(player.inventory.armorInventory[3]);
if (player.inventory.armorInventory[2] != null) items.add(player.inventory.armorInventory[2]);
if (player.inventory.armorInventory[1] != null) items.add(player.inventory.armorInventory[1]);
if (player.inventory.armorInventory[0] != null) items.add(player.inventory.armorInventory[0]);
if (player.getCurrentEquippedItem() != null
&& !player.getCurrentEquippedItem().isStackable()
&& player.getCurrentEquippedItem().isItemStackDamageable())
items.add(player.getCurrentEquippedItem());
w = itemSize + getStringWidth() + 2;
h = itemSize * items.size();
}
示例14: renderItem
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
EntityClientPlayerMP player = ((EntityClientPlayerMP) data[1]);
float scopeMult = Math.min((FarragoMod.scopeTicks+ClientProxy.timer.renderPartialTicks)/5f, 1.0f);
GL11.glTranslatef(1.0f, 0f, 0f);
GL11.glRotatef(180F, 1.0f, 0.0f, 0.0f);
GL11.glRotatef(180F, 0.0f, 0.0f, 1.0f);
if (FarragoMod.scoped) {
if (player.isUsingItem()) {
GL11.glTranslatef(0f, scopeMult*-0.5f, scopeMult*0.4f);
GL11.glRotatef(5F, 0.0f, scopeMult, 0.0f);
GL11.glRotatef(10F, scopeMult, 0.0f, 0.0f);
} else {
GL11.glTranslatef(0f, 0f, scopeMult);
GL11.glRotatef(-2F, scopeMult, scopeMult, 0.0f);
}
}
IIcon icon = item.getItem().getIcon(item, 0, player, player.getItemInUse(), player.getItemInUseCount());
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMinU(), icon.getMinV(), icon.getMaxU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625f);
}
示例15: onDisplay
import net.minecraft.client.entity.EntityClientPlayerMP; //導入依賴的package包/類
@PaneEventHandler
public void onDisplay(PaneDisplayEvent e) {
oldRenderDistance = mc.gameSettings.renderDistanceChunks;
mc.gameSettings.renderDistanceChunks = 3;
fakeWorld = new WorldClient(new NetHandlerPlayClient(Minecraft.getMinecraft(), null, new NetworkManager(true)), new WorldSettings(new WorldInfo(new NBTTagCompound())), 0, EnumDifficulty.EASY, Minecraft.getMinecraft().mcProfiler);
for (int x = -1; x <= 1; x++) {
for (int z = -1; z <= 1; z++) {
fakeWorld.getChunkProvider().loadChunk(x, z);
}
}
fakeWorld.setBlock(0, 64, 0, Blocks.lit_furnace);
fakeWorld.getGameRules().setOrCreateGameRule("doDaylightCycle", "false");
fakeWorld.setWorldTime(6000);
mc.thePlayer = new EntityClientPlayerMP(mc, fakeWorld,
new FakeSession(), new FakeNetHandler(mc, null, new FakeNetManager(true)),
new FakeStatFileWriter());
mc.thePlayer.sendQueue.getNetworkManager().setNetHandler(mc.thePlayer.sendQueue);
mc.thePlayer.movementInput = new MovementInput();
mc.playerController = new PlayerControllerMP(mc, mc.thePlayer.sendQueue);
mc.renderViewEntity = mc.thePlayer;
mc.theWorld = fakeWorld;
mc.renderGlobal.setWorldAndLoadRenderers(fakeWorld);
MinecraftForge.EVENT_BUS.register(this);
}