本文整理汇总了Java中net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.staticPlayerY方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityRendererDispatcher.staticPlayerY方法的具体用法?Java TileEntityRendererDispatcher.staticPlayerY怎么用?Java TileEntityRendererDispatcher.staticPlayerY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
的用法示例。
在下文中一共展示了TileEntityRendererDispatcher.staticPlayerY方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
@Override
public void render(TileEntityCauldron cauldron, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (cauldron != null) {
final TileFluidTank tank = cauldron.tank;
if (tank != null && tank.getFluid() != null && tank.getFluidAmount() > 0) {
FluidStack fluid = tank.getFluid();
BlockPos pos = cauldron.getPos();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
final float staticX = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
final float staticY = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
final float staticZ = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);
GlStateManager.translate(staticX, staticY, staticZ);
RenderUtils.renderFluid(fluid, cauldron.getPos(), 0.06D, 0.14D, 0.00D, 0.06D, 0.06D, 0.1D, 0.82D, (double) tank.getFluidAmount() / (double) tank.getCapacity() * 0.8d, 0.88d, fluid.getFluid().getColor(fluid));
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
}
}
示例2: translateAgainstPlayer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void translateAgainstPlayer (BlockPos pos) {
final float x = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
final float y = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
final float z = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);
GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5);
}
示例3: onPlayerRender
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Post event) {
EntityPlayer player = event.getEntityPlayer();
float delta = event.getPartialRenderTick();
boolean iWalked = new Vec3d(player.posX, player.posY, player.posZ).distanceTo(new Vec3d(player.prevPosX, player.prevPosY, player.prevPosZ)) > 0.15;
if (!player.isInvisible() && ((player.getActivePotionEffect(ModPotions.VANISH) != null && iWalked) || player.getActivePotionEffect(ModPotions.VANISH) == null))
if (delta < 1) { // not rendering in inventory
double x = -TileEntityRendererDispatcher.staticPlayerX;
double y = -TileEntityRendererDispatcher.staticPlayerY;
double z = -TileEntityRendererDispatcher.staticPlayerZ;
instance().getCape(player).render(player, x, y, z, delta);
}
}
示例4: getRealPositionX
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
public static Vector3d getRealPositionX(BlockPos pos)
{
Vector3d vector3d = new Vector3d();
vector3d.x = pos.getX() - TileEntityRendererDispatcher.staticPlayerX;
vector3d.y = pos.getY() - TileEntityRendererDispatcher.staticPlayerY;
vector3d.z = pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ;
return vector3d;
}
示例5: drawSquishingBlocks
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
private AxisAlignedBB drawSquishingBlocks(Coord upperCorner, Coord lowerCorner, float partial) {
double spx, spy, spz;
spx = TileEntityRendererDispatcher.staticPlayerX;
spy = TileEntityRendererDispatcher.staticPlayerY;
spz = TileEntityRendererDispatcher.staticPlayerZ;
TileEntityRendererDispatcher.staticPlayerX = TileEntityRendererDispatcher.staticPlayerY = TileEntityRendererDispatcher.staticPlayerZ = 0;
try {
return _drawSquishingBlocks(upperCorner, lowerCorner, partial);
} finally {
TileEntityRendererDispatcher.staticPlayerX = spx;
TileEntityRendererDispatcher.staticPlayerY = spy;
TileEntityRendererDispatcher.staticPlayerZ = spz;
}
}
示例6: translateAgainstPlayer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
/**
* Translates the render state to be relative to the player's position. Allows for
* rendering at a static world position that is not tied to the player's position.
*
* @param pos The BlockPos The position to translate to within the world.
*/
public static void translateAgainstPlayer (BlockPos pos, boolean offset) {
final float x = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
final float y = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
final float z = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);
if (offset)
GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5);
else
GlStateManager.translate(x, y, z);
}
示例7: translateAgainstPlayer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
/**
* Translates the render state to be relative to the player's position. Allows for
* rendering at a static world position that is not tied to the player's position.
*
* @param pos The BlockPos The position to translate to within the world.
*/
public static void translateAgainstPlayer (BlockPos pos, boolean offset) {
final float x = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
final float y = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
final float z = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);
if (offset) {
GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5);
}
else {
GlStateManager.translate(x, y, z);
}
}
示例8: renderEntities
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
void renderEntities(float partialTicks) {
RenderHelper.enableStandardItemLighting();
//Maybe we should use RenderGlobal.renderEntities ???
double sx = TileEntityRendererDispatcher.staticPlayerX;
double sy = TileEntityRendererDispatcher.staticPlayerY;
double sz = TileEntityRendererDispatcher.staticPlayerZ;
double px = TileEntityRendererDispatcher.instance.entityX;
double py = TileEntityRendererDispatcher.instance.entityY;
double pz = TileEntityRendererDispatcher.instance.entityZ;
// The player's position converted to shadow coordinates; these fields used in renderTileEntity()
TileEntityRendererDispatcher.instance.entityX = shadowEye.posX;
TileEntityRendererDispatcher.instance.entityY = shadowEye.posY;
TileEntityRendererDispatcher.instance.entityZ = shadowEye.posZ;
Minecraft mc = Minecraft.getMinecraft();
RenderManager renderManager = mc.getRenderManager();
try {
int xwidth = far.x - corner.x;
int height = far.y - corner.y;
int zwidth = far.z - corner.z;
for (int cdx = 0; cdx < xwidth; cdx++) {
for (int cdz = 0; cdz < zwidth; cdz++) {
Chunk here = corner.w.getChunkFromBlockCoords(new BlockPos(corner.x + cdx*16, corner.y, corner.z + cdz*16));
Core.profileStart("entity");
ClassInheritanceMultiMap<Entity>[] entityLists = here.getEntityLists();
for (ClassInheritanceMultiMap<Entity> entityList : entityLists) {
for (Entity ent : entityList) {
if (ent.posY < corner.y - entity_buffer) {
continue;
}
if (ent.posY > far.y + entity_buffer) {
continue;
}
if (nest == 3 && ent instanceof DimensionSliceEntity) {
continue;
}
//if ent is a proxying player, don't render it?
renderManager.renderEntitySimple(ent, partialTicks);
}
}
Core.profileEnd();
Core.profileStart("tesr");
for (TileEntity te : here.getTileEntityMap().values()) {
//I warned you about comods, bro! I told you, dawg! (Shouldn't actually be a problem if we're rendering properly)
//Since we don't know the actual distance from the player to the TE, we need to cheat.
//(We *could* calculate it, I suppose... Or maybe just not render entities when the player's far away)
/*TileEntityRendererDispatcher.staticPlayerX = te.xCoord;
TileEntityRendererDispatcher.staticPlayerY = te.yCoord;
TileEntityRendererDispatcher.staticPlayerZ = te.zCoord;*/
TileEntityRendererDispatcher.instance.renderTileEntity(te, partialTicks, -1);
// NORELEASE (probably): cull if outside camera!
// NORELEASE: That's the wrong list? It's every TE, not the TESR'd TEs.
}
Core.profileEnd();
}
}
} finally {
TileEntityRendererDispatcher.staticPlayerX = sx;
TileEntityRendererDispatcher.staticPlayerY = sy;
TileEntityRendererDispatcher.staticPlayerZ = sz;
TileEntityRendererDispatcher.instance.entityX = px;
TileEntityRendererDispatcher.instance.entityY = py;
TileEntityRendererDispatcher.instance.entityZ = pz;
}
}
示例9: getY
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
private static double getY(int y)
{
return y - TileEntityRendererDispatcher.staticPlayerY;
}
示例10: getY
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
private double getY(int y)
{
return y - TileEntityRendererDispatcher.staticPlayerY;
}
示例11: renderLines
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
@SubscribeEvent
public void renderLines(RenderPlayerEvent.Pre evt) {
final EntityPlayer player = evt.getEntityPlayer();
if (!ItemCraneBackpack.isWearingCrane(player)) return;
final EntityMagnet magnet = CraneRegistry.instance.getMagnetForPlayer(player);
if (magnet == null) return;
final float partialRenderTick = evt.getPartialRenderTick();
double playerX = interpolatePos(player.posX, player.lastTickPosX, partialRenderTick)
- TileEntityRendererDispatcher.staticPlayerX;
double playerY = interpolatePos(player.posY, player.lastTickPosY, partialRenderTick)
- TileEntityRendererDispatcher.staticPlayerY;
double playerZ = interpolatePos(player.posZ, player.lastTickPosZ, partialRenderTick)
- TileEntityRendererDispatcher.staticPlayerZ;
playerY += player.getEyeHeight();
final float offset = interpolateAngle(player.renderYawOffset, player.prevRenderYawOffset, partialRenderTick);
final float head = interpolateAngle(player.rotationYawHead, player.prevRotationYawHead, partialRenderTick);
double armX = playerX;
double armY = playerY;
double armZ = playerZ;
double armLength;
if (player.isSneaking()) {
armY += 0.70;
armLength = 2;
} else {
armX += -0.45 * MathHelper.cos(offset);
armY += 0.65;
armZ += -0.45 * MathHelper.sin(offset);
armLength = 2.4;
}
armX += armLength * MathHelper.cos(head);
armZ += armLength * MathHelper.sin(head);
final double magnetX = interpolatePos(magnet.posX, magnet.lastTickPosX, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerX;
final double magnetY = interpolatePos(magnet.posY, magnet.lastTickPosY, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerY + magnet.height - 0.1;
final double magnetZ = interpolatePos(magnet.posZ, magnet.lastTickPosZ, partialRenderTick) - TileEntityRendererDispatcher.staticPlayerZ;
GlStateManager.glLineWidth(2);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GL11.glEnable(GL11.GL_LINE_STIPPLE);
GlStateManager.color(1, 1, 0);
GL11.glLineStipple(3, (short)0x0555);
GL11.glBegin(GL11.GL_LINES);
GL11.glVertex3d(armX, armY, armZ);
GL11.glVertex3d(magnetX, magnetY, magnetZ);
GL11.glEnd();
GL11.glDisable(GL11.GL_LINE_STIPPLE);
GlStateManager.enableLighting();
GlStateManager.enableTexture2D();
GlStateManager.glLineWidth(1);
GlStateManager.color(1, 1, 1);
drawLine(magnetX, magnetY, magnetZ, armX, armY, armZ);
}