mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-08 13:26:39 +01:00
Small tidying
- Move RenderTypeExtension to util - Avoid creating unnecessary material objects in Shuklers - Remove vestigial classes
This commit is contained in:
parent
4405f92639
commit
92c017d680
6 changed files with 8 additions and 42 deletions
|
@ -1,32 +0,0 @@
|
||||||
package com.jozufozu.flywheel.backend;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL43;
|
|
||||||
import org.lwjgl.opengl.GLDebugMessageCallback;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlDebug;
|
|
||||||
|
|
||||||
public class FlywheelDebug {
|
|
||||||
//
|
|
||||||
// public static void setup() {
|
|
||||||
// GLDebugMessageCallback.create()
|
|
||||||
// GL43.glDebugMessageCallback();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void printDebugLog(int p_84039_, int p_84040_, int p_84041_, int p_84042_, int p_84043_, long p_84044_, long p_84045_) {
|
|
||||||
// String s = GLDebugMessageCallback.getMessage(p_84043_, p_84044_);
|
|
||||||
// GlDebug.LogEntry gldebug$logentry;
|
|
||||||
// synchronized(MESSAGE_BUFFER) {
|
|
||||||
// gldebug$logentry = lastEntry;
|
|
||||||
// if (gldebug$logentry != null && gldebug$logentry.isSame(p_84039_, p_84040_, p_84041_, p_84042_, s)) {
|
|
||||||
// ++gldebug$logentry.count;
|
|
||||||
// } else {
|
|
||||||
// gldebug$logentry = new GlDebug.LogEntry(p_84039_, p_84040_, p_84041_, p_84042_, s);
|
|
||||||
// MESSAGE_BUFFER.add(gldebug$logentry);
|
|
||||||
// lastEntry = gldebug$logentry;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// LOGGER.info("OpenGL debug message: {}", (Object)gldebug$logentry);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
|
@ -5,6 +5,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.model.BufferBuilderExtension;
|
import com.jozufozu.flywheel.backend.model.BufferBuilderExtension;
|
||||||
import com.jozufozu.flywheel.backend.model.DirectVertexConsumer;
|
import com.jozufozu.flywheel.backend.model.DirectVertexConsumer;
|
||||||
|
import com.jozufozu.flywheel.util.RenderTypeExtension;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
package com.jozufozu.flywheel.backend.instancing;
|
|
||||||
|
|
||||||
@FunctionalInterface
|
|
||||||
public interface Renderable {
|
|
||||||
void draw();
|
|
||||||
}
|
|
|
@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.instancing.DrawBuffer;
|
import com.jozufozu.flywheel.backend.instancing.DrawBuffer;
|
||||||
import com.jozufozu.flywheel.backend.instancing.RenderTypeExtension;
|
import com.jozufozu.flywheel.util.RenderTypeExtension;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
package com.jozufozu.flywheel.backend.instancing;
|
package com.jozufozu.flywheel.util;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.backend.instancing.DrawBuffer;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
|
|
|
@ -31,8 +31,9 @@ import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
|
||||||
|
|
||||||
public class ShulkerBoxInstance extends BlockEntityInstance<ShulkerBoxBlockEntity> implements DynamicInstance {
|
public class ShulkerBoxInstance extends BlockEntityInstance<ShulkerBoxBlockEntity> implements DynamicInstance {
|
||||||
|
|
||||||
private static final Function<TextureAtlasSprite, BasicModelSupplier> BASE = Util.memoize(it -> new BasicModelSupplier(() -> makeBaseModel(it), new Material(RenderType.entityCutoutNoCull(Sheets.SHULKER_SHEET), MaterialShaders.SHADED_VERTEX, MaterialShaders.DEFAULT_FRAGMENT)));
|
private static final Material SHULKER_BOX_MATERIAL = new Material(RenderType.entityCutoutNoCull(Sheets.SHULKER_SHEET), MaterialShaders.SHADED_VERTEX, MaterialShaders.DEFAULT_FRAGMENT);
|
||||||
private static final Function<TextureAtlasSprite, BasicModelSupplier> LID = Util.memoize(it -> new BasicModelSupplier(() -> makeLidModel(it), new Material(RenderType.entityCutoutNoCull(Sheets.SHULKER_SHEET), MaterialShaders.SHADED_VERTEX, MaterialShaders.DEFAULT_FRAGMENT)));
|
private static final Function<TextureAtlasSprite, BasicModelSupplier> BASE = Util.memoize(it -> new BasicModelSupplier(() -> makeBaseModel(it), SHULKER_BOX_MATERIAL));
|
||||||
|
private static final Function<TextureAtlasSprite, BasicModelSupplier> LID = Util.memoize(it -> new BasicModelSupplier(() -> makeLidModel(it), SHULKER_BOX_MATERIAL));
|
||||||
|
|
||||||
private final TextureAtlasSprite texture;
|
private final TextureAtlasSprite texture;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue