mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
Add 2 new RenderLevelStageEvent.Stage for After Entities and After Block Entities (#9259)
This commit is contained in:
1 parent
79dfdb0ace
commit
183d43f5f8
4 files changed
+60
-1
No files matched your search
@@ -61,7 +61,14 @@
|
||||
multibuffersource = multibuffersource$buffersource;
|
||||
}
|
||||
|
||||
@@ -1226,6 +_,7 @@
|
||||
@@ -1220,12 +_,14 @@
|
||||
multibuffersource$buffersource.m_109912_(RenderType.m_110452_(TextureAtlas.f_118259_));
|
||||
multibuffersource$buffersource.m_109912_(RenderType.m_110458_(TextureAtlas.f_118259_));
|
||||
multibuffersource$buffersource.m_109912_(RenderType.m_110476_(TextureAtlas.f_118259_));
|
||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderStage(net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_ENTITIES, this, p_109600_, p_254120_, this.f_109477_, p_109604_, frustum);
|
||||
profilerfiller.m_6182_("blockentities");
|
||||
|
||||
for(LevelRenderer.RenderChunkInfo levelrenderer$renderchunkinfo : this.f_194297_) {
|
||||
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
|
||||
if (!list.isEmpty()) {
|
||||
for(BlockEntity blockentity1 : list) {
|
||||
@@ -93,6 +100,14 @@
|
||||
this.f_172946_.m_112267_(blockentity, p_109601_, p_109600_, multibuffersource$buffersource);
|
||||
p_109600_.m_85849_();
|
||||
}
|
||||
@@ -1276,6 +_,7 @@
|
||||
this.f_109461_.m_91385_().m_83947_(false);
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderStage(net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_BLOCK_ENTITIES, this, p_109600_, p_254120_, this.f_109477_, p_109604_, frustum);
|
||||
profilerfiller.m_6182_("destroyProgress");
|
||||
|
||||
for(Long2ObjectMap.Entry<SortedSet<BlockDestructionProgress>> entry : this.f_109409_.long2ObjectEntrySet()) {
|
||||
@@ -1291,7 +_,8 @@
|
||||
p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2);
|
||||
PoseStack.Pose posestack$pose = p_109600_.m_85850_();
|
||||
|
||||
@@ -169,6 +169,14 @@ public class RenderLevelStageEvent extends Event
|
||||
* Use this to render custom block-like geometry into the world.
|
||||
*/
|
||||
public static final Stage AFTER_CUTOUT_BLOCKS = register("after_cutout_blocks", RenderType.cutout());
|
||||
/**
|
||||
* Use this to render custom block-like geometry into the world.
|
||||
*/
|
||||
public static final Stage AFTER_ENTITIES = register("after_entities", null);
|
||||
/**
|
||||
* Use this to render custom block-like geometry into the world.
|
||||
*/
|
||||
public static final Stage AFTER_BLOCK_ENTITIES = register("after_block_entities", null);
|
||||
/**
|
||||
* Use this to render custom block-like geometry into the world.
|
||||
* Due to how transparency sorting works, this stage may not work properly with translucency. If you intend to render translucency,
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.minecraftforge.debug.client.rendering;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import net.minecraftforge.client.event.RenderLevelStageEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod("render_level_stages_test")
|
||||
public class RenderLevelStagesTest
|
||||
{
|
||||
public static final org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public RenderLevelStagesTest()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.addListener(this::onRenderLevelStages);
|
||||
}
|
||||
|
||||
private int count = 0;
|
||||
public void onRenderLevelStages(RenderLevelStageEvent event)
|
||||
{
|
||||
if(count < 10)
|
||||
{
|
||||
LOGGER.info("Render Stage: " + event.getStage());
|
||||
if(event.getStage() == RenderLevelStageEvent.Stage.AFTER_WEATHER)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,6 +275,8 @@ modId="data_pack_registries_test"
|
||||
[[mods]]
|
||||
modId="creative_mode_tab_test"
|
||||
[[mods]]
|
||||
modId="render_level_stages_test"
|
||||
[[mods]]
|
||||
modId="trade_with_villager_event_test"
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user