|
27 | 27 | import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback; |
28 | 28 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents; |
29 | 29 | import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; |
30 | | -import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; |
| 30 | +import net.fabricmc.fabric.api.client.rendering.v1.world.WorldRenderEvents; |
31 | 31 | import net.kyori.adventure.platform.modcommon.MinecraftAudiences; |
32 | 32 | import net.kyori.adventure.platform.modcommon.MinecraftClientAudiences; |
33 | 33 | import net.minecraft.client.MinecraftClient; |
@@ -55,8 +55,8 @@ public static User getUser() { |
55 | 55 | public void onInitializeClient() { |
56 | 56 | LOGGER.info("Sparking it up"); |
57 | 57 |
|
58 | | - // FlintAPI.setDebugging(true); |
59 | | - // FlintAPI.confirmLocationWithLocate(); |
| 58 | +// FlintAPI.setDebugging(true); |
| 59 | +// FlintAPI.confirmLocationWithLocate(); |
60 | 60 |
|
61 | 61 | FlintUpdate.fetchLatestRelease(); |
62 | 62 |
|
@@ -103,76 +103,65 @@ private void registerEventCallbacks() { |
103 | 103 | ) |
104 | 104 | ); |
105 | 105 |
|
106 | | - WorldRenderEvents.LAST.register(worldRenderContext -> |
| 106 | + WorldRenderEvents.AFTER_BLOCK_OUTLINE_EXTRACTION.register((context, hit) -> |
107 | 107 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
108 | | - ((WorldRenderFeature) feature).worldRenderLast(worldRenderContext) |
| 108 | + ((WorldRenderFeature) feature).worldRenderAfterBlockOutlineExtraction(context, hit) |
109 | 109 | ) |
110 | 110 | ); |
111 | 111 |
|
112 | | - WorldRenderEvents.END.register(worldRenderContext -> |
| 112 | + WorldRenderEvents.END_EXTRACTION.register(context -> |
113 | 113 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
114 | | - ((WorldRenderFeature) feature).worldRenderEnd(worldRenderContext) |
| 114 | + ((WorldRenderFeature) feature).worldRenderEndExtraction(context) |
115 | 115 | ) |
116 | 116 | ); |
117 | 117 |
|
118 | | - WorldRenderEvents.BEFORE_BLOCK_OUTLINE.register((worldRenderContext, hitResult) -> { |
119 | | - boolean shouldRender = true; |
120 | | - for (FeatureTrait feature : FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER)) { |
121 | | - if (((WorldRenderFeature) feature).worldRenderBeforeBlockOutline(worldRenderContext, hitResult) == EventResult.CANCEL) { |
122 | | - shouldRender = false; |
123 | | - } |
124 | | - } |
125 | | - |
126 | | - return shouldRender; |
127 | | - }); |
128 | | - |
129 | | - WorldRenderEvents.BEFORE_ENTITIES.register(worldRenderContext -> |
| 118 | + WorldRenderEvents.START_MAIN.register(context -> |
130 | 119 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
131 | | - ((WorldRenderFeature) feature).worldRenderBeforeEntities(worldRenderContext) |
| 120 | + ((WorldRenderFeature) feature).worldRenderStartMain(context) |
132 | 121 | ) |
133 | 122 | ); |
134 | | - |
135 | | - WorldRenderEvents.AFTER_ENTITIES.register(worldRenderContext -> |
| 123 | + |
| 124 | + WorldRenderEvents.BEFORE_ENTITIES.register(context -> |
136 | 125 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
137 | | - ((WorldRenderFeature) feature).worldRenderAfterEntities(worldRenderContext) |
| 126 | + ((WorldRenderFeature) feature).worldRenderBeforeEntities(context) |
138 | 127 | ) |
139 | 128 | ); |
140 | | - |
141 | | - WorldRenderEvents.AFTER_SETUP.register(worldRenderContext -> |
| 129 | + |
| 130 | + WorldRenderEvents.AFTER_ENTITIES.register(context -> |
142 | 131 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
143 | | - ((WorldRenderFeature) feature).worldRenderAfterSetup(worldRenderContext) |
| 132 | + ((WorldRenderFeature) feature).worldRenderAfterEntities(context) |
144 | 133 | ) |
145 | 134 | ); |
146 | | - |
147 | | - WorldRenderEvents.AFTER_TRANSLUCENT.register(worldRenderContext -> |
| 135 | + |
| 136 | + WorldRenderEvents.BEFORE_DEBUG_RENDER.register(context -> |
148 | 137 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
149 | | - ((WorldRenderFeature) feature).worldRenderAfterTranslucent(worldRenderContext) |
| 138 | + ((WorldRenderFeature) feature).worldRenderBeforeDebugRender(context) |
150 | 139 | ) |
151 | | - ); |
152 | | - |
153 | | - WorldRenderEvents.BEFORE_DEBUG_RENDER.register(worldRenderContext -> |
| 140 | + ); |
| 141 | + |
| 142 | + WorldRenderEvents.BEFORE_TRANSLUCENT.register(context -> |
154 | 143 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
155 | | - ((WorldRenderFeature) feature).worldRenderBeforeDebugRender(worldRenderContext) |
| 144 | + ((WorldRenderFeature) feature).worldRenderBeforeTranslucent(context) |
156 | 145 | ) |
157 | 146 | ); |
158 | 147 |
|
159 | | - WorldRenderEvents.BLOCK_OUTLINE.register((worldRenderContext, blockOutlineContext) -> { |
| 148 | + WorldRenderEvents.BEFORE_BLOCK_OUTLINE.register((context, outlineRenderState) -> { |
160 | 149 | boolean shouldRender = true; |
161 | 150 | for (FeatureTrait feature : FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER)) { |
162 | | - if (((WorldRenderFeature) feature).worldRenderBlockOutline(worldRenderContext, blockOutlineContext) == EventResult.CANCEL) { |
| 151 | + if (((WorldRenderFeature) feature).worldRenderBeforeBlockOutline(context, outlineRenderState) == EventResult.CANCEL) { |
163 | 152 | shouldRender = false; |
164 | 153 | } |
165 | 154 | } |
166 | 155 |
|
167 | 156 | return shouldRender; |
168 | 157 | }); |
169 | 158 |
|
170 | | - WorldRenderEvents.START.register(worldRenderContext -> |
| 159 | + WorldRenderEvents.END_MAIN.register(context -> |
171 | 160 | FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature -> |
172 | | - ((WorldRenderFeature) feature).worldRenderStart(worldRenderContext) |
| 161 | + ((WorldRenderFeature) feature).worldRenderEndMain(context) |
173 | 162 | ) |
174 | 163 | ); |
175 | | - |
| 164 | + |
176 | 165 | ClientLifecycleEvents.CLIENT_STOPPING.register(client -> |
177 | 166 | FEATURE_MANAGER.getByTrait(FeatureTraitType.SHUTDOWN).forEach(feature -> |
178 | 167 | ((ShutdownFeature) feature).onShutdown() |
|
0 commit comments