本文整理汇总了Java中net.minecraft.profiler.Profiler.startSection方法的典型用法代码示例。如果您正苦于以下问题:Java Profiler.startSection方法的具体用法?Java Profiler.startSection怎么用?Java Profiler.startSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.profiler.Profiler
的用法示例。
在下文中一共展示了Profiler.startSection方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatch
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
public static void dispatch()
{
Tessellator tessellator = Tessellator.getInstance();
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
// GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);
// GlStateManager.disableLighting();
profiler.startSection("path");
PathFX.dispatchQueuedRenders(tessellator);
profiler.endSection();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1f);
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
GL11.glPopAttrib();
}
示例2: doNetworkTick
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@Override
public void doNetworkTick(@Nonnull Profiler theProfiler) {
for (INetworkedInventory ni : inventories) {
if (requiresSort) {
theProfiler.startSection("updateInsertOrder");
ni.updateInsertOrder();
theProfiler.endSection();
}
theProfiler.startSection("NetworkedInventoryTick");
ni.onTick();
theProfiler.endSection();
}
if (requiresSort) {
requiresSort = false;
changeCount++;
}
// if(database != null) {
// theProfiler.startSection("DatabaseTick");
// database.tick();
// theProfiler.endSection();
// }
}
示例3: tickEnd
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
public void tickEnd(TickEvent.ServerTickEvent event) {
final Profiler theProfiler = FMLCommonHandler.instance().getMinecraftServerInstance().profiler;
theProfiler.startSection("root"); // this event is fired outside the profilers normal coverage...
theProfiler.startSection("EnderIO_All_Conduit_Networks_Tick");
for (TickListener h : listeners) {
theProfiler.startSection(h.getClass().getName().replaceFirst(".*\\.", ""));
h.tickEnd(event, theProfiler);
theProfiler.endSection();
}
for(AbstractConduitNetwork<?,?> cn : networks.keySet()) {
theProfiler.startSection(cn.getClass().getName().replaceFirst(".*\\.", ""));
cn.doNetworkTick(theProfiler);
theProfiler.endSection();
}
theProfiler.endSection();
theProfiler.endSection();
}
示例4: onServerTick
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@SubscribeEvent
public static void onServerTick(@Nonnull TickEvent.ServerTickEvent event) {
final Profiler profiler = FMLCommonHandler.instance().getMinecraftServerInstance().profiler;
profiler.startSection("root"); // this event is fired outside the profiler's normal coverage...
profiler.startSection("ServerTickEvent");
for (Entry<ITickListener, String> entry : listeners.entrySet()) {
profiler.startSection(NullHelper.first(entry.getValue(), "(unnamed)"));
if (event.phase == Phase.START) {
entry.getKey().tickStart(event, profiler);
} else {
entry.getKey().tickEnd(event, profiler);
}
profiler.endSection();
}
profiler.endSection(); // ServerTickEvent
profiler.endSection(); // root
}
示例5: dispatch
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
public static void dispatch() {
Tessellator tessellator = Tessellator.getInstance();
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
//GL11.glPushAttrib(GL11.GL_LIGHTING);
GLCore.glBlend(true);
GLCore.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
profiler.startSection("death particle");
DeathParticles.dispatchQueuedRenders(tessellator);
profiler.endSection();
GLCore.glBlend(false);
//GL11.glPopAttrib();
}
示例6: onRenderWorldLast
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event)
{
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
profiler.startSection("tmg_particles");
ParticleRenderDispatcher.dispatch();
profiler.endSection();
}
示例7: tickEnd
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@Override
public void tickEnd(TickEvent.ServerTickEvent evt, Profiler theProfiler) {
theProfiler.startSection("ItemCharging");
chargeItems(inventory.getStacks());
theProfiler.endStartSection("EnergyTransmitting");
transmitEnergy();
if (energyStored != prevEnergyStored) {
theProfiler.endStartSection("EnergyBalancing");
distributeEnergyToBanks();
}
theProfiler.endSection();
powerTrackerIn.tick(energyReceived);
powerTrackerOut.tick(energySend);
prevEnergyStored = energyStored;
energyReceived = 0;
energySend = 0;
if (firstUpate) {
if (!capBanks.isEmpty()) {
PacketHandler.sendToAllAround(new PacketNetworkStateResponse(this), capBanks.get(0));
PacketHandler.sendToAllAround(new PacketNetworkEnergyResponse(this), capBanks.get(0));
}
firstUpate = false;
}
}
示例8: doNetworkTick
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@Override
public void doNetworkTick(@Nonnull Profiler theProfiler) {
List<LiquidConduit> cons = getConduits();
if (cons == null || cons.isEmpty()) {
return;
}
if (isEmpty()) {
if (!fluidTypeLocked && liquidType != null) {
ticksEmpty++;
if (ticksEmpty > 40) {
setFluidType(null);
ticksEmpty = 0;
}
}
return;
}
ticksEmpty = 0;
long curTime = cons.get(0).getBundle().getEntity().getWorld().getTotalWorldTime();
// 1000 water, 6000 lava
if (liquidType != null && liquidType.getFluid() != null && !isEmpty()) {
int visc = Math.max(1000, liquidType.getFluid().getViscosity());
if (curTime % (visc / 500) == 0) {
theProfiler.startSection("flow");
doFlow();
theProfiler.endSection();
}
}
}
示例9: renderTileEntityAt
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityElevator te, double x, double y, double z, float partialTicks, int destroyStage) {
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
profiler.startSection("crystalmod-elevator");
if (te.isMoving()) {
// Correction in the y translation to avoid jitter when both player and platform are moving
AxisAlignedBB aabb = te.getAABBAboveElevator(0);
boolean on = CrystalMod.proxy.getClientPlayer().getEntityBoundingBox().intersectsWith(aabb);
double diff = on ? (te.getPos().getY() - (y+te.getMovingY()) - 1) : 0;
GlStateManager.pushMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend();
GlStateManager.disableCull();
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
if (Minecraft.isAmbientOcclusionEnabled()) {
GlStateManager.shadeModel(GL11.GL_SMOOTH);
} else {
GlStateManager.shadeModel(GL11.GL_FLAT);
}
IBlockState movingState = te.getMovingState();
GlStateManager.translate(0, te.getMovingY() - te.getPos().getY() + diff, 0);
Tessellator tessellator = Tessellator.getInstance();
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
//chunk.setWorld(te.getWorld());
for (BlockPos pos : te.getPositions()) {
int dx = te.getPos().getX() - pos.getX();
int dy = te.getPos().getY() - pos.getY();
int dz = te.getPos().getZ() - pos.getZ();
tessellator.getBuffer().setTranslation(x - pos.getX() - dx, y - pos.getY() - dy, z - pos.getZ() - dz);
//chunk.setBlockState(pos, movingState);
renderBlock(dispatcher, movingState, pos, te.getWorld(), tessellator.getBuffer());
}
tessellator.getBuffer().setTranslation(0, 0, 0);
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.enableCull();
GlStateManager.popMatrix();
RenderHelper.enableStandardItemLighting();
}
profiler.endSection();
}
示例10: onRenderGameOverlayPost
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderGameOverlayPost(Post event) {
if (event.type == ElementType.ALL) {
Minecraft mc = Minecraft.getMinecraft();
FontRenderer fr = mc.fontRenderer;
Profiler p = mc.mcProfiler;
p.startSection("gimmetime-hud");
switch (ConfigHandler.analog_digital) {
case 0: // None
break;
case 1: // Analog
p.startSection("clock");
RenderUtil.drawClock(32, 34, 24);
p.endSection();
break;
case 2: // Digital
p.startSection("clock");
drawString(TimeUtil.getTime(), 1, 1);
p.endSection();
break;
case 3: // Both
p.startSection("clock");
RenderUtil.drawClock(32, 34, 24);
drawString(TimeUtil.getTime(), 64, 1);
p.endSection();
break;
}
if (currentAlarm != null) {
p.startSection("alarm");
String title = currentAlarm.getTitle() + " - " + TimeUtil.getAlarmTimeString();
drawString(title, (event.resolution.getScaledWidth() / 2) - (fr.getStringWidth(title) / 2), (event.resolution.getScaledHeight() / 2) - (fr.FONT_HEIGHT + 4));
String closeHint = StatCollector.translateToLocalFormatted("hud.alarmAlert.close", GameSettings.getKeyDisplayString(KeyHandler.INSTANCE.clock.getKeyCode()));
drawString(closeHint, (event.resolution.getScaledWidth() / 2) - (fr.getStringWidth(closeHint) / 2), (event.resolution.getScaledHeight() / 2) + (fr.FONT_HEIGHT - 2));
p.endSection();
}
p.endSection();
}
}
示例11: doNetworkTick
import net.minecraft.profiler.Profiler; //导入方法依赖的package包/类
@Override
public void doNetworkTick(@Nonnull Profiler theProfiler) {
if (liquidType == null || outputs.isEmpty() || !tank.containsValidLiquid() || tank.isEmpty()) {
theProfiler.startSection("updateActiveState");
updateActiveState();
theProfiler.endSection();
return;
}
if (outputIterator == null || !outputIterator.hasNext()) {
outputIterator = outputs.iterator();
}
theProfiler.startSection("updateActiveState");
updateActiveState();
theProfiler.endStartSection("pushFluid");
int numVisited = 0;
while (!tank.isEmpty() && numVisited < outputs.size()) {
if (!outputIterator.hasNext()) {
outputIterator = outputs.iterator();
}
LiquidOutput output = outputIterator.next();
if (output != null) {
theProfiler.startSection("otherMod_getTankContainer");
IFluidWrapper cont = getTankContainer(output);
theProfiler.endSection();
if (cont != null) {
FluidStack offer = tank.getFluid().copy();
theProfiler.startSection("otherMod_fill");
int filled = cont.fill(offer);
theProfiler.endSection();
if (filled > 0) {
tank.addAmount(-filled);
}
}
}
numVisited++;
}
theProfiler.endSection();
}