本文整理汇总了Java中net.minecraftforge.client.event.RenderWorldLastEvent.getPartialTicks方法的典型用法代码示例。如果您正苦于以下问题:Java RenderWorldLastEvent.getPartialTicks方法的具体用法?Java RenderWorldLastEvent.getPartialTicks怎么用?Java RenderWorldLastEvent.getPartialTicks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.client.event.RenderWorldLastEvent
的用法示例。
在下文中一共展示了RenderWorldLastEvent.getPartialTicks方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderBlocks
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
private static void renderBlocks(RenderWorldLastEvent evt, Set<BlockPos> blocks) {
EntityPlayerSP player = MinecraftTools.getPlayer(Minecraft.getMinecraft());
double doubleX = player.lastTickPosX + (player.posX - player.lastTickPosX) * evt.getPartialTicks();
double doubleY = player.lastTickPosY + (player.posY - player.lastTickPosY) * evt.getPartialTicks();
double doubleZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * evt.getPartialTicks();
GlStateManager.pushMatrix();
GlStateManager.translate(-doubleX, -doubleY, -doubleZ);
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
for (BlockPos pos : blocks) {
renderBoxOutline(pos);
}
GlStateManager.enableDepth();
GlStateManager.popMatrix();
}
示例2: renderWorldLast
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderWorldLast(RenderWorldLastEvent event) {
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
EntityPlayer rootPlayer = Minecraft.getMinecraft().player;
double x = rootPlayer.lastTickPosX + (rootPlayer.posX - rootPlayer.lastTickPosX) * event.getPartialTicks();
double y = rootPlayer.lastTickPosY + (rootPlayer.posY - rootPlayer.lastTickPosY) * event.getPartialTicks();
double z = rootPlayer.lastTickPosZ + (rootPlayer.posZ - rootPlayer.lastTickPosZ) * event.getPartialTicks();
GlStateManager.translate(-x, -y, -z);
// vvv actual rendering stuff vvv
GlStateManager.enableBlend();
GlStateManager.alphaFunc(GL11.GL_GEQUAL, 1f / 255f);
RenderLaserUtil.startRenderingLasers();
for (LaserRenderInfo info : lasers.keySet())
RenderLaserUtil.renderLaser(info.color, info.start, info.end);
RenderLaserUtil.finishRenderingLasers();
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
示例3: onWorldRender
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldRender(final RenderWorldLastEvent event) {
final List<Trace> traces = TraceHandler.INSTANCE.getTraces();
if (traces.size() <= 0) {
return;
}
final EntityPlayerSP player = this.minecraft.player;
if (player == null) {
return;
}
this.playerPosition.x = (float) (player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks());
this.playerPosition.y = (float) (player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks());
this.playerPosition.z = (float) (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks());
this.minecraft.mcProfiler.startSection("tracer");
render(traces);
this.minecraft.mcProfiler.endSection();
}
示例4: onEvent2
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
/**
* Draws the highlighting for the block for which xray is enabled
*/
public void onEvent2(RenderWorldLastEvent event) {
if (this.mc.world != null && this.xrayEnabled) {
float f = event.getPartialTicks();
float px = (float) this.mc.player.posX;
float py = (float) this.mc.player.posY;
float pz = (float) this.mc.player.posZ;
float mx = (float) this.mc.player.prevPosX;
float my = (float) this.mc.player.prevPosY;
float mz = (float) this.mc.player.prevPosZ;
float dx = mx + (px - mx) * f;
float dy = my + (py - my) * f;
float dz = mz + (pz - mz) * f;
drawOres(dx, dy, dz);
}
}
示例5: worldRenderTick
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void worldRenderTick(RenderWorldLastEvent event) {
if ( mc.world == null || !XRay.drawCaves )
return;
float f = event.getPartialTicks();
// this is a world pos of the player
pulseRender(
(float)mc.player.prevPosX + ( (float)mc.player.posX - (float)mc.player.prevPosX ) * f,
(float)mc.player.prevPosY + ( (float)mc.player.posY - (float)mc.player.prevPosY ) * f,
(float)mc.player.prevPosZ + ( (float)mc.player.posZ - (float)mc.player.prevPosZ ) * f
);
// XRay.drawCaves = !XRay.drawCaves;
}
示例6: renderAllTip
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderAllTip(RenderWorldLastEvent event) {
mc.renderEngine.bindTexture(TipTexture);
EntityPlayerSP player = mc.player;
playerX = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks();
playerY = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks();
playerZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks();
eyeHeight = player.eyeHeight;
GL11.glPushMatrix();
GL11.glTranslated(-playerX, -playerY, -playerZ);
renderTipBlock(player, event);
renderTipEntity(player, event);
GL11.glPopMatrix();
}
示例7: onRenderWorldLast
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorldLast(final RenderWorldLastEvent event) {
final EntityPlayerSP player = this.minecraft.player;
if (player != null) {
this.playerPosition.x = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks();
this.playerPosition.y = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks();
this.playerPosition.z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks();
this.profiler.startSection("laserlevel");
GlStateManager.pushMatrix();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
render(player);
GlStateManager.disableBlend();
GlStateManager.enableTexture2D();
GlStateManager.popMatrix();
this.profiler.endSection();
}
}
示例8: renderWorldLastEvent
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderWorldLastEvent(RenderWorldLastEvent event) {
if (!GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade.coreComponents").checked) return;
Minecraft mc = FMLClientHandler.instance().getClient();
EntityPlayer player = mc.player;
double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.getPartialTicks();
double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.getPartialTicks();
double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.getPartialTicks();
GL11.glPushMatrix();
GL11.glTranslated(-playerX, -playerY, -playerZ);
ItemStack helmetStack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (helmetStack.getItem() == Itemss.PNEUMATIC_HELMET) {
if (((IPressurizable) helmetStack.getItem()).getPressure(helmetStack) > 0F) {
CommonHUDHandler comHudHandler = CommonHUDHandler.getHandlerForPlayer(player);
if (comHudHandler.ticksExisted > comHudHandler.getStartupTime()) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
for (int i = 0; i < UpgradeRenderHandlerList.instance().upgradeRenderers.size(); i++) {
if (comHudHandler.upgradeRenderersInserted[i] && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade." + UpgradeRenderHandlerList.instance().upgradeRenderers.get(i).getUpgradeName()).checked)
UpgradeRenderHandlerList.instance().upgradeRenderers.get(i).render3D(event.getPartialTicks());
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
}
}
GL11.glPopMatrix();
}
示例9: renderWorldLastEvent
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
@SubscribeEvent
public void renderWorldLastEvent(RenderWorldLastEvent event) {
Minecraft mc = FMLClientHandler.instance().getClient();
EntityPlayer player = mc.player;
double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.getPartialTicks();
double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.getPartialTicks();
double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.getPartialTicks();
GL11.glPushMatrix();
GL11.glTranslated(-playerX, -playerY, -playerZ);
RenderHelper.enableStandardItemLighting();
for (Map<BlockPos, List<ISemiBlock>> map : SemiBlockManager.getInstance(player.world).getSemiBlocks().values()) {
for (List<ISemiBlock> semiBlocks : map.values()) {
for(ISemiBlock semiBlock : semiBlocks){
ISemiBlockRenderer renderer = getRenderer(semiBlock);
if (renderer != null) {
GL11.glPushMatrix();
GL11.glTranslated(semiBlock.getPos().getX(), semiBlock.getPos().getY(), semiBlock.getPos().getZ());
renderer.render(semiBlock, event.getPartialTicks());
GL11.glPopMatrix();
}
}
}
}
RenderHelper.disableStandardItemLighting();
GL11.glPopMatrix();
}
示例10: onDraw
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onDraw(RenderWorldLastEvent event){
float partialTicks = event.getPartialTicks();
double pX = MINECRAFT.player.prevPosX + (MINECRAFT.player.posX - MINECRAFT.player.prevPosX) * partialTicks;
double pY = MINECRAFT.player.prevPosY + (MINECRAFT.player.posY - MINECRAFT.player.prevPosY) * partialTicks;
double pZ = MINECRAFT.player.prevPosZ + (MINECRAFT.player.posZ - MINECRAFT.player.prevPosZ) * partialTicks;
/* Prepare */
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
GL11.glTranslated(-pX,-pY,-pZ);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST );
calculateFlash();
drawBlocksAndChunks(pY);
drawEntities(partialTicks);
drawTileEntityTags();
drawEntityTags(partialTicks);
/* Restore settings */
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例11: onPostRender
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPostRender(RenderWorldLastEvent evt) {
if (!Loader.isModLoaded("baubles")) return;
EntityPlayer thePlayer = Minecraft.getMinecraft().player;
for(EntityPlayer entity : Minecraft.getMinecraft().world.playerEntities) {
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(entity);
ItemStack scarfStack = baubles.getStackInSlot(BAUBLE_AMULET);
if (scarfStack==null || scarfStack.isEmpty() || scarfStack.getItem()!=ThermionicsItems.SCARF) return;
Scarf scarf = scarfCache.getIfPresent(entity);
if (scarf==null) {
scarf = new Scarf();
scarfCache.put(entity, scarf);
scarf.readFromNBT(scarfStack.getTagCompound());
//System.out.println("Created scarf:"+(scarf.leftScarf.size()+scarf.rightScarf.size())+" nodes.");
} else {
scarf.updateFromNBT(scarfStack.getTagCompound());
//System.out.println("Updated scarf:"+(scarf.leftScarf.size()+scarf.rightScarf.size())+" nodes.");
}
double dx = thePlayer.prevPosX + (thePlayer.posX - thePlayer.prevPosX) * evt.getPartialTicks();
double dy = thePlayer.prevPosY + (thePlayer.posY - thePlayer.prevPosY) * evt.getPartialTicks();
double dz = thePlayer.prevPosZ + (thePlayer.posZ - thePlayer.prevPosZ) * evt.getPartialTicks();
LayerScarf.renderScarf(
dx, dy, dz,
entity, null, scarf, evt.getPartialTicks(),
Minecraft.getMinecraft().world);
}
}
示例12: addBlockUnderCrosshairs
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
private void addBlockUnderCrosshairs(RenderWorldLastEvent event) {
EntityPlayerSP player = Minecraft.getMinecraft().player;
if (player == null) {
return;
}
ItemStack wand = player.getHeldItemMainhand();
if (wand == null || !(wand.getItem() instanceof ItemChessControlWand) || !wand.hasTagCompound()) {
return;
}
BlockPos a8 = ItemChessControlWand.getA8(wand);
Side side = ((ItemChessControlWand)wand.getItem()).getSide();
if (a8 == null) {
return;
}
RayTraceResult r = player.rayTrace(ItemChessControlWand.REACH_DISTANCE, 1);
if (r.typeOfHit.equals(RayTraceResult.Type.BLOCK)) {
addCursorOverlay(a8, r);
}
if (overlays.size() < 1) {
return;
}
double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks();
double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks();
double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks();
render(x, y, z, side);
}
示例13: render
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void render(RenderWorldLastEvent event) {
TextureManager tex = Minecraft.getMinecraft().getTextureManager();
float partialTicks = event.getPartialTicks();
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthFunc(GL11.GL_LESS);
/* CUBE */
renderCube(tex, partialTicks);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
GL11.glDisable(GL11.GL_LIGHTING);
/* TWINKLE */
renderTwinkle(tex, partialTicks);
/* RADIAL */
renderRadial(tex, partialTicks);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
示例14: onRenderWorldLast
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent e)
{
if (player == null)
player = Minecraft.getMinecraft().player;
playerX = player.prevPosX + (player.posX - player.prevPosX) * e.getPartialTicks();
playerY = player.prevPosY + (player.posY - player.prevPosY) * e.getPartialTicks();
playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * e.getPartialTicks();
MarkerDataHandler.getMarkersList().forEach((marker ->
{
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
RenderGlobal.drawSelectionBoundingBox(new AxisAlignedBB(marker.getPos()).grow(0.005, 0.005, 0.005)
.offset(-playerX, -playerY, -playerZ),
0.8f, 0, 0, getAlpha(marker) + 0.2f);
RenderGlobal.renderFilledBox(new AxisAlignedBB(marker.getPos()).grow(0.005, 0.005, 0.005)
.offset(-playerX, -playerY, -playerZ),
0.5f, 0, 0, getAlpha(marker));
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
}));
MarkerDataHandler.getMarkersList().removeIf(marker ->
marker.getStartTime() + marker.getDuration() <= System.currentTimeMillis());
}
示例15: onRenderWorldLast
import net.minecraftforge.client.event.RenderWorldLastEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event) {
if (this.streetViewOpacity > 0.0F) {
if (this.streetView == null) {
this.streetView = new AdvancedDynamicTexture[6];
for (int i = 0; i < 6; i++) {
BufferedImage image = this.streetViewImages[i];
this.streetView[i] = new AdvancedDynamicTexture("street_view_" + i, image);
}
}
float partialTicks = event.getPartialTicks();
float opacity = this.lastStreetViewOpacity + (this.streetViewOpacity - this.lastStreetViewOpacity) * partialTicks;
GlStateManager.pushMatrix();
GlStateManager.disableDepth();
GlStateManager.disableCull();
GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, opacity);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer buffer = tessellator.getBuffer();
for (int i = 0; i < 6; i++) {
this.renderFace(tessellator, buffer, i);
}
GlStateManager.disableBlend();
GlStateManager.enableDepth();
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
}