本文整理匯總了Java中net.minecraft.client.renderer.RenderGlobal.isMoving方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderGlobal.isMoving方法的具體用法?Java RenderGlobal.isMoving怎麽用?Java RenderGlobal.isMoving使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.RenderGlobal
的用法示例。
在下文中一共展示了RenderGlobal.isMoving方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: preRender
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public void preRender(RenderGlobal rg, EntityLivingBase player)
{
this.updateTargetNum = 0;
if (this.updateThread != null)
{
if (this.updateStartTimeNs == 0L)
{
this.updateStartTimeNs = System.nanoTime();
}
if (this.updateThread.hasWorkToDo())
{
this.updateTargetNum = Config.getUpdatesPerFrame();
if (Config.isDynamicUpdates() && !rg.isMoving(player))
{
this.updateTargetNum *= 3;
}
this.updateTargetNum = Math.min(this.updateTargetNum, this.updateThread.getPendingUpdatesCount());
if (this.updateTargetNum > 0)
{
this.updateThread.unpause();
}
}
}
}
示例2: updateRenderers
import net.minecraft.client.renderer.RenderGlobal; //導入方法依賴的package包/類
public boolean updateRenderers(RenderGlobal rg, EntityLivingBase entityliving, boolean flag)
{
this.lastUpdateStartTimeNs = this.updateStartTimeNs;
this.updateStartTimeNs = System.nanoTime();
long finishTimeNs = this.updateStartTimeNs + this.updateTimeNs;
int maxNum = Config.getUpdatesPerFrame();
if (Config.isDynamicUpdates() && !rg.isMoving(entityliving))
{
maxNum *= 3;
}
this.renderersUpdated = 0;
do
{
this.renderersFound = 0;
this.updateRenderersImpl(rg, entityliving, flag);
}
while (this.renderersFound > 0 && System.nanoTime() - finishTimeNs < 0L);
if (this.renderersFound > 0)
{
maxNum = Math.min(maxNum, this.renderersFound);
long diff = 400000L;
if (this.renderersUpdated > maxNum)
{
this.updateTimeNs -= 2L * diff;
}
if (this.renderersUpdated < maxNum)
{
this.updateTimeNs += diff;
}
}
else
{
this.updateTimeNs = 0L;
this.updateTimeNs -= 200000L;
}
if (this.updateTimeNs < 0L)
{
this.updateTimeNs = 0L;
}
return this.renderersUpdated > 0;
}