use of net.minecraft.util.profiling.ProfilerFiller in project blueprint by team-abnormals.
the class ChunkGeneratorModificationManager method apply.
@Override
protected void apply(Map<ResourceLocation, JsonElement> map, ResourceManager resourceManager, ProfilerFiller profilerFiller) {
RegistryOps<JsonElement> registryOps = this.registryOps;
int loadedModifiers = 0;
for (Map.Entry<ResourceLocation, JsonElement> entry : map.entrySet()) {
try {
TargetedModifier<ChunkGenerator, RegistryOps<JsonElement>, RegistryOps<JsonElement>> targetedModifier = TargetedModifier.deserialize(entry.getValue().getAsJsonObject(), registryOps, ChunkGeneratorModifiers.REGISTRY);
this.modifiers.computeIfAbsent(targetedModifier.getPriority(), __ -> new LinkedList<>()).add(targetedModifier);
loadedModifiers++;
} catch (IllegalArgumentException | JsonParseException exception) {
Blueprint.LOGGER.error("Parsing error loading Chunk Generator Modifier: {}", entry.getKey(), exception);
}
}
Blueprint.LOGGER.info("Chunk Generator Modification Manager has loaded {} modifiers", loadedModifiers);
}
use of net.minecraft.util.profiling.ProfilerFiller in project pollen by MoonflowerTeam.
the class AnimatedGeometryEntityModel method setupAnim.
@Override
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float animationTicks, float netHeadYaw, float headPitch) {
GeometryModel model = this.getModel();
model.resetTransformation();
if (model instanceof AnimatedModel && this.animations.length > 0) {
ProfilerFiller profiler = Minecraft.getInstance().getProfiler();
profiler.push("createMolangRuntime");
MolangRuntime.Builder builder = this.createRuntime(entity, limbSwing, limbSwingAmount, netHeadYaw, headPitch);
if (entity instanceof MolangVariableProvider)
builder.setVariables((MolangVariableProvider) entity);
if (this.variableProvider != null)
builder.setVariables(this.variableProvider);
profiler.popPush("applyMolangAnimation");
((AnimatedModel) model).applyAnimations(animationTicks / 20F, builder, this.getAnimations());
profiler.pop();
}
}
use of net.minecraft.util.profiling.ProfilerFiller in project pollen by MoonflowerTeam.
the class GeometryTextureSpriteUploader method prepare.
@Override
protected TextureAtlas.Preparations prepare(ResourceManager resourceManager, ProfilerFiller profiler) {
try (OnlineRepository onlineRepository = new OnlineRepository(this.hashTables)) {
profiler.startTick();
profiler.push("stitching");
Stopwatch stopwatch = Stopwatch.createUnstarted();
this.beginStitch(System.currentTimeMillis(), stopwatch);
TextureAtlas.Preparations sheetData = this.textureAtlas.prepareToStitch(new OnlineResourceManager(resourceManager, onlineRepository, this.textures.stream().filter(texture -> texture.getType() == GeometryModelTexture.Type.ONLINE).collect(Collectors.toSet())), this.textures.stream().filter(texture -> texture.getType() == GeometryModelTexture.Type.LOCATION || texture.getType() == GeometryModelTexture.Type.ONLINE).map(GeometryModelTexture::getLocation).distinct(), profiler, Minecraft.getInstance().options.mipmapLevels);
this.endStitch(stopwatch);
profiler.pop();
profiler.endTick();
return sheetData;
}
}
use of net.minecraft.util.profiling.ProfilerFiller in project Iris by IrisShaders.
the class FullyBufferedMultiBufferSource method endBatch.
@Override
public void endBatch() {
ProfilerFiller profiler = Minecraft.getInstance().getProfiler();
profiler.push("collect");
Map<RenderType, List<BufferSegment>> typeToSegment = new HashMap<>();
for (SegmentedBufferBuilder builder : builders) {
List<BufferSegment> segments = builder.getSegments();
for (BufferSegment segment : segments) {
typeToSegment.computeIfAbsent(segment.getRenderType(), (type) -> new ArrayList<>()).add(segment);
}
}
profiler.popPush("resolve ordering");
Iterable<RenderType> renderOrder = renderOrderManager.getRenderOrder();
profiler.popPush("draw buffers");
for (RenderType type : renderOrder) {
type.setupRenderState();
renderTypes += 1;
for (BufferSegment segment : typeToSegment.getOrDefault(type, Collections.emptyList())) {
segmentRenderer.drawInner(segment);
drawCalls += 1;
}
type.clearRenderState();
}
profiler.popPush("reset");
renderOrderManager.reset();
affinities.clear();
profiler.pop();
}
use of net.minecraft.util.profiling.ProfilerFiller in project architectury-api by architectury.
the class MixinClientLevel method tickEntities.
@Inject(method = "tickEntities", at = @At("HEAD"))
private void tickEntities(CallbackInfo ci) {
ProfilerFiller profiler = getProfiler();
profiler.push("architecturyClientLevelPreTick");
ClientTickEvent.CLIENT_LEVEL_PRE.invoker().tick((ClientLevel) (Object) this);
profiler.pop();
}
Aggregations