forked from hlysine/create_power_loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix chunk loader renderers being loaded on dedicated server
- Loading branch information
Showing
3 changed files
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ build | |
# other | ||
eclipse | ||
run | ||
run-server | ||
run-data | ||
.cache | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/hlysine/create_power_loader/content/ContraptionRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.hlysine.create_power_loader.content; | ||
|
||
import com.hlysine.create_power_loader.content.andesitechunkloader.AndesiteChunkLoaderRenderer; | ||
import com.hlysine.create_power_loader.content.brasschunkloader.BrassChunkLoaderRenderer; | ||
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; | ||
import com.simibubi.create.content.contraptions.behaviour.MovementContext; | ||
import com.simibubi.create.content.contraptions.render.ContraptionMatrices; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
|
||
public class ContraptionRenderer { | ||
|
||
private static final AndesiteChunkLoaderRenderer ANDESITE_RENDERER = new AndesiteChunkLoaderRenderer(null); | ||
private static final BrassChunkLoaderRenderer BRASS_RENDERER = new BrassChunkLoaderRenderer(null); | ||
|
||
public static void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer, LoaderType type) { | ||
if (type == LoaderType.ANDESITE) { | ||
ANDESITE_RENDERER.renderInContraption(context, renderWorld, matrices, buffer); | ||
} else if (type == LoaderType.BRASS) { | ||
BRASS_RENDERER.renderInContraption(context, renderWorld, matrices, buffer); | ||
} else { | ||
throw new RuntimeException("Unknown block."); | ||
} | ||
} | ||
} |