diff --git a/src/main/java/com/jozufozu/flywheel/backend/Backend.java b/src/main/java/com/jozufozu/flywheel/backend/Backend.java index 73fb81cad..5e577a590 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Backend.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Backend.java @@ -20,16 +20,15 @@ import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLCapabilities; -import com.jozufozu.flywheel.backend.core.CrumblingRenderer; -import com.jozufozu.flywheel.backend.core.WorldTileRenderer; -import com.jozufozu.flywheel.backend.core.context.WorldContext; -import com.jozufozu.flywheel.backend.core.shader.WorldProgram; -import com.jozufozu.flywheel.backend.core.shader.spec.ProgramSpec; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; import com.jozufozu.flywheel.backend.gl.versioned.GlCompat; -import com.jozufozu.flywheel.backend.instancing.IFlywheelWorld; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.MaterialSpec; +import com.jozufozu.flywheel.core.CrumblingRenderer; +import com.jozufozu.flywheel.core.WorldContext; +import com.jozufozu.flywheel.core.WorldTileRenderer; +import com.jozufozu.flywheel.core.shader.WorldProgram; +import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import com.jozufozu.flywheel.util.WorldAttached; import com.simibubi.create.foundation.config.AllConfigs; @@ -141,8 +140,11 @@ public class Backend { return programSpecRegistry.get(name); } + /** + * Used to avoid calling Flywheel functions on (fake) worlds that don't specifically support it. + */ public static boolean isFlywheelWorld(World world) { - return world == Minecraft.getInstance().world || (world instanceof IFlywheelWorld && ((IFlywheelWorld) world).supportsFlywheel()); + return (world instanceof IFlywheelWorld && ((IFlywheelWorld) world).supportsFlywheel()) || world == Minecraft.getInstance().world; } public static boolean available() { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/IFlywheelWorld.java b/src/main/java/com/jozufozu/flywheel/backend/IFlywheelWorld.java similarity index 61% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/IFlywheelWorld.java rename to src/main/java/com/jozufozu/flywheel/backend/IFlywheelWorld.java index 5a138fefc..52f1712ed 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IFlywheelWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/IFlywheelWorld.java @@ -1,10 +1,10 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend; /** * A marker interface custom worlds can override to indicate * that tiles inside the world should render with Flywheel. * - * Minecraft.getInstance().world will always support Flywheel. + * Minecraft.getInstance().world is special cased and will support Flywheel by default. */ public interface IFlywheelWorld { default boolean supportsFlywheel() { diff --git a/src/main/java/com/jozufozu/flywheel/backend/ShaderContext.java b/src/main/java/com/jozufozu/flywheel/backend/ShaderContext.java index 0a86e017a..e93aeae41 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/ShaderContext.java +++ b/src/main/java/com/jozufozu/flywheel/backend/ShaderContext.java @@ -4,13 +4,13 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import com.jozufozu.flywheel.backend.core.shader.IMultiProgram; -import com.jozufozu.flywheel.backend.core.shader.spec.ProgramSpec; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; import com.jozufozu.flywheel.backend.gl.shader.ShaderType; import com.jozufozu.flywheel.backend.loading.Program; import com.jozufozu.flywheel.backend.loading.Shader; import com.jozufozu.flywheel.backend.loading.ShaderTransformer; +import com.jozufozu.flywheel.core.shader.IMultiProgram; +import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/backend/ShaderLoader.java b/src/main/java/com/jozufozu/flywheel/backend/ShaderLoader.java index 848b5943c..068c8ecb1 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/ShaderLoader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/ShaderLoader.java @@ -30,14 +30,14 @@ import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; -import com.jozufozu.flywheel.backend.core.shader.spec.ProgramSpec; -import com.jozufozu.flywheel.backend.core.shader.spec.SpecMetaRegistry; import com.jozufozu.flywheel.backend.gl.GlObject; import com.jozufozu.flywheel.backend.gl.shader.GlShader; import com.jozufozu.flywheel.backend.gl.shader.ShaderType; import com.jozufozu.flywheel.backend.loading.Program; import com.jozufozu.flywheel.backend.loading.Shader; import com.jozufozu.flywheel.backend.loading.ShaderLoadingException; +import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; +import com.jozufozu.flywheel.core.shader.spec.SpecMetaRegistry; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.DataResult; diff --git a/src/main/java/com/jozufozu/flywheel/backend/core/FirstNonnullMultiProgram.java b/src/main/java/com/jozufozu/flywheel/backend/core/FirstNonnullMultiProgram.java deleted file mode 100644 index 1e7b441dd..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/core/FirstNonnullMultiProgram.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.jozufozu.flywheel.backend.core; - -import com.jozufozu.flywheel.backend.gl.shader.GlProgram; - -public class FirstNonnullMultiProgram

{ -} diff --git a/src/main/java/com/jozufozu/flywheel/backend/core/IndexedModel.java b/src/main/java/com/jozufozu/flywheel/backend/core/IndexedModel.java deleted file mode 100644 index cb76197d7..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/core/IndexedModel.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.jozufozu.flywheel.backend.core; - -import java.nio.ByteBuffer; - -import org.lwjgl.opengl.GL20; - -import com.jozufozu.flywheel.backend.gl.GlPrimitiveType; -import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; -import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer; -import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType; -import com.jozufozu.flywheel.util.AttribUtil; - -public class IndexedModel extends BufferedModel { - - protected GlPrimitiveType eboIndexType; - protected GlBuffer ebo; - - public IndexedModel(VertexFormat modelFormat, ByteBuffer buf, int vertices, ByteBuffer indices, GlPrimitiveType indexType) { - super(modelFormat, buf, vertices); - - ebo = new GlBuffer(GlBufferType.ELEMENT_ARRAY_BUFFER); - this.eboIndexType = indexType; - - int indicesSize = vertexCount * indexType.getSize(); - - ebo.bind(); - - ebo.alloc(indicesSize); - ebo.getBuffer(0, indicesSize) - .put(indices) - .flush(); - - ebo.unbind(); - } - - public void render() { - vbo.bind(); - ebo.bind(); - - AttribUtil.enableArrays(getAttributeCount()); - format.vertexAttribPointers(0); - - GL20.glDrawElements(GL20.GL_QUADS, vertexCount, eboIndexType.getGlConstant(), 0); - - AttribUtil.disableArrays(getAttributeCount()); - - ebo.unbind(); - vbo.unbind(); - } - - @Override - public void delete() { - super.delete(); - ebo.delete(); - } -} diff --git a/src/main/java/com/jozufozu/flywheel/backend/core/shader/ShaderCallback.java b/src/main/java/com/jozufozu/flywheel/backend/core/shader/ShaderCallback.java deleted file mode 100644 index 2bf2f5440..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/core/shader/ShaderCallback.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.jozufozu.flywheel.backend.core.shader; - -import com.jozufozu.flywheel.backend.gl.shader.GlProgram; - -/** - * A Callback for when a shader is called. Used to define shader uniforms. - */ -@FunctionalInterface -public interface ShaderCallback

{ - - void call(P program); - - default ShaderCallback

andThen(ShaderCallback

other) { - return program -> { - call(program); - other.call(program); - }; - } -} diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitiveType.java b/src/main/java/com/jozufozu/flywheel/backend/gl/GlNumericType.java similarity index 63% rename from src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitiveType.java rename to src/main/java/com/jozufozu/flywheel/backend/gl/GlNumericType.java index 1737c6bd4..7a39b34b6 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitiveType.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/GlNumericType.java @@ -13,27 +13,28 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -public enum GlPrimitiveType { +public enum GlNumericType { FLOAT(4, "float", GL11.GL_FLOAT), UBYTE(1, "ubyte", GL11.GL_UNSIGNED_BYTE), BYTE(1, "byte", GL11.GL_BYTE), USHORT(2, "ushort", GL11.GL_UNSIGNED_SHORT), SHORT(2, "short", GL11.GL_SHORT), UINT(4, "uint", GL11.GL_UNSIGNED_INT), - INT(4, "int", GL11.GL_INT); + INT(4, "int", GL11.GL_INT), + ; - private static final GlPrimitiveType[] VALUES = values(); - private static final Map NAME_LOOKUP = Arrays.stream(VALUES) - .collect(Collectors.toMap(GlPrimitiveType::getDisplayName, type -> type)); + private static final GlNumericType[] VALUES = values(); + private static final Map NAME_LOOKUP = Arrays.stream(VALUES) + .collect(Collectors.toMap(GlNumericType::getDisplayName, type -> type)); private final int size; private final String displayName; - private final int glConstant; + private final int glEnum; - GlPrimitiveType(int bytes, String name, int glEnum) { + GlNumericType(int bytes, String name, int glEnum) { this.size = bytes; this.displayName = name; - this.glConstant = glEnum; + this.glEnum = glEnum; } public int getSize() { @@ -44,12 +45,12 @@ public enum GlPrimitiveType { return this.displayName; } - public int getGlConstant() { - return this.glConstant; + public int getGlEnum() { + return this.glEnum; } @Nullable - public static GlPrimitiveType byName(String name) { + public static GlNumericType byName(String name) { return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT)); } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitive.java b/src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitive.java new file mode 100644 index 000000000..71a8d5353 --- /dev/null +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/GlPrimitive.java @@ -0,0 +1,23 @@ +package com.jozufozu.flywheel.backend.gl; + +import org.lwjgl.opengl.GL11; + +public enum GlPrimitive { + POINTS(GL11.GL_POINTS), + LINES(GL11.GL_LINES), + LINE_LOOP(GL11.GL_LINE_LOOP), + LINE_STRIP(GL11.GL_LINE_STRIP), + TRIANGLES(GL11.GL_TRIANGLES), + TRIANGLE_STRIP(GL11.GL_TRIANGLE_STRIP), + TRIANGLE_FAN(GL11.GL_TRIANGLE_FAN), + QUADS(GL11.GL_QUADS), + QUAD_STRIP(GL11.GL_QUAD_STRIP), + POLYGON(GL11.GL_POLYGON), + ; + + public final int glEnum; + + GlPrimitive(int glEnum) { + this.glEnum = glEnum; + } +} diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/CommonAttributes.java b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/CommonAttributes.java index 99f754efe..a1726fae0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/CommonAttributes.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/CommonAttributes.java @@ -1,21 +1,21 @@ package com.jozufozu.flywheel.backend.gl.attrib; -import com.jozufozu.flywheel.backend.gl.GlPrimitiveType; +import com.jozufozu.flywheel.backend.gl.GlNumericType; public class CommonAttributes { - public static final VertexAttribSpec VEC4 = new VertexAttribSpec(GlPrimitiveType.FLOAT, 4); - public static final VertexAttribSpec VEC3 = new VertexAttribSpec(GlPrimitiveType.FLOAT, 3); - public static final VertexAttribSpec VEC2 = new VertexAttribSpec(GlPrimitiveType.FLOAT, 2); - public static final VertexAttribSpec FLOAT = new VertexAttribSpec(GlPrimitiveType.FLOAT, 1); + public static final VertexAttribSpec VEC4 = new VertexAttribSpec(GlNumericType.FLOAT, 4); + public static final VertexAttribSpec VEC3 = new VertexAttribSpec(GlNumericType.FLOAT, 3); + public static final VertexAttribSpec VEC2 = new VertexAttribSpec(GlNumericType.FLOAT, 2); + public static final VertexAttribSpec FLOAT = new VertexAttribSpec(GlNumericType.FLOAT, 1); - public static final VertexAttribSpec QUATERNION = new VertexAttribSpec(GlPrimitiveType.FLOAT, 4); - public static final VertexAttribSpec NORMAL = new VertexAttribSpec(GlPrimitiveType.BYTE, 3, true); - public static final VertexAttribSpec UV = new VertexAttribSpec(GlPrimitiveType.FLOAT, 2); + public static final VertexAttribSpec QUATERNION = new VertexAttribSpec(GlNumericType.FLOAT, 4); + public static final VertexAttribSpec NORMAL = new VertexAttribSpec(GlNumericType.BYTE, 3, true); + public static final VertexAttribSpec UV = new VertexAttribSpec(GlNumericType.FLOAT, 2); - public static final VertexAttribSpec RGBA = new VertexAttribSpec(GlPrimitiveType.UBYTE, 4, true); - public static final VertexAttribSpec RGB = new VertexAttribSpec(GlPrimitiveType.UBYTE, 3, true); - public static final VertexAttribSpec LIGHT = new VertexAttribSpec(GlPrimitiveType.UBYTE, 2, true); + public static final VertexAttribSpec RGBA = new VertexAttribSpec(GlNumericType.UBYTE, 4, true); + public static final VertexAttribSpec RGB = new VertexAttribSpec(GlNumericType.UBYTE, 3, true); + public static final VertexAttribSpec LIGHT = new VertexAttribSpec(GlNumericType.UBYTE, 2, true); - public static final VertexAttribSpec NORMALIZED_BYTE = new VertexAttribSpec(GlPrimitiveType.BYTE, 1, true); + public static final VertexAttribSpec NORMALIZED_BYTE = new VertexAttribSpec(GlNumericType.BYTE, 1, true); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/MatrixAttributes.java b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/MatrixAttributes.java index 86cf089aa..49b6731fe 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/MatrixAttributes.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/MatrixAttributes.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.backend.gl.attrib; import org.lwjgl.opengl.GL20; -import com.jozufozu.flywheel.backend.gl.GlPrimitiveType; +import com.jozufozu.flywheel.backend.gl.GlNumericType; public enum MatrixAttributes implements IAttribSpec { MAT3(3, 3), @@ -20,14 +20,14 @@ public enum MatrixAttributes implements IAttribSpec { @Override public void vertexAttribPointer(int stride, int index, int pointer) { for (int i = 0; i < rows; i++) { - long attribPointer = pointer + (long) i * cols * GlPrimitiveType.FLOAT.getSize(); - GL20.glVertexAttribPointer(index + i, cols, GlPrimitiveType.FLOAT.getGlConstant(), false, stride, attribPointer); + long attribPointer = pointer + (long) i * cols * GlNumericType.FLOAT.getSize(); + GL20.glVertexAttribPointer(index + i, cols, GlNumericType.FLOAT.getGlEnum(), false, stride, attribPointer); } } @Override public int getSize() { - return GlPrimitiveType.FLOAT.getSize() * rows * cols; + return GlNumericType.FLOAT.getSize() * rows * cols; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/VertexAttribSpec.java b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/VertexAttribSpec.java index 7717114ab..663ad8342 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/VertexAttribSpec.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/VertexAttribSpec.java @@ -2,21 +2,21 @@ package com.jozufozu.flywheel.backend.gl.attrib; import org.lwjgl.opengl.GL20; -import com.jozufozu.flywheel.backend.gl.GlPrimitiveType; +import com.jozufozu.flywheel.backend.gl.GlNumericType; public class VertexAttribSpec implements IAttribSpec { - private final GlPrimitiveType type; + private final GlNumericType type; private final int count; private final int size; private final int attributeCount; private final boolean normalized; - public VertexAttribSpec(GlPrimitiveType type, int count) { + public VertexAttribSpec(GlNumericType type, int count) { this(type, count, false); } - public VertexAttribSpec(GlPrimitiveType type, int count, boolean normalized) { + public VertexAttribSpec(GlNumericType type, int count, boolean normalized) { this.type = type; this.count = count; this.size = type.getSize() * count; @@ -26,7 +26,7 @@ public class VertexAttribSpec implements IAttribSpec { @Override public void vertexAttribPointer(int stride, int index, int pointer) { - GL20.glVertexAttribPointer(index, count, type.getGlConstant(), normalized, stride, pointer); + GL20.glVertexAttribPointer(index, count, type.getGlEnum(), normalized, stride, pointer); } @Override diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/instancing/DrawInstanced.java b/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/instancing/DrawInstanced.java index e30ba9bfc..c2d73e0c4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/instancing/DrawInstanced.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/instancing/DrawInstanced.java @@ -5,6 +5,8 @@ import org.lwjgl.opengl.EXTDrawInstanced; import org.lwjgl.opengl.GL31; import org.lwjgl.opengl.GLCapabilities; +import com.jozufozu.flywheel.backend.gl.GlNumericType; +import com.jozufozu.flywheel.backend.gl.GlPrimitive; import com.jozufozu.flywheel.backend.gl.versioned.GlVersioned; public enum DrawInstanced implements GlVersioned { @@ -15,8 +17,13 @@ public enum DrawInstanced implements GlVersioned { } @Override - public void drawArraysInstanced(int mode, int first, int count, int primcount) { - GL31.glDrawArraysInstanced(mode, first, count, primcount); + public void drawArraysInstanced(GlPrimitive mode, int first, int count, int primcount) { + GL31.glDrawArraysInstanced(mode.glEnum, first, count, primcount); + } + + @Override + public void drawElementsInstanced(GlPrimitive mode, int elementCount, GlNumericType type, long indices, int primcount) { + GL31.glDrawElementsInstanced(mode.glEnum, elementCount, type.getGlEnum(), indices, primcount); } }, ARB_DRAW_INSTANCED { @@ -26,8 +33,13 @@ public enum DrawInstanced implements GlVersioned { } @Override - public void drawArraysInstanced(int mode, int first, int count, int primcount) { - ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); + public void drawArraysInstanced(GlPrimitive mode, int first, int count, int primcount) { + ARBDrawInstanced.glDrawArraysInstancedARB(mode.glEnum, first, count, primcount); + } + + @Override + public void drawElementsInstanced(GlPrimitive mode, int elementCount, GlNumericType type, long indices, int primcount) { + ARBDrawInstanced.glDrawElementsInstancedARB(mode.glEnum, elementCount, type.getGlEnum(), indices, primcount); } }, EXT_DRAW_INSTANCED { @@ -37,8 +49,13 @@ public enum DrawInstanced implements GlVersioned { } @Override - public void drawArraysInstanced(int mode, int first, int count, int primcount) { - EXTDrawInstanced.glDrawArraysInstancedEXT(mode, first, count, primcount); + public void drawArraysInstanced(GlPrimitive mode, int first, int count, int primcount) { + EXTDrawInstanced.glDrawArraysInstancedEXT(mode.glEnum, first, count, primcount); + } + + @Override + public void drawElementsInstanced(GlPrimitive mode, int elementCount, GlNumericType type, long indices, int primcount) { + EXTDrawInstanced.glDrawElementsInstancedEXT(mode.glEnum, elementCount, type.getGlEnum(), indices, primcount); } }, UNSUPPORTED { @@ -46,12 +63,14 @@ public enum DrawInstanced implements GlVersioned { public boolean supported(GLCapabilities caps) { return true; } - - @Override - public void drawArraysInstanced(int mode, int first, int count, int primcount) { - throw new UnsupportedOperationException(); - } }; - public abstract void drawArraysInstanced(int mode, int first, int count, int primcount); + + public void drawArraysInstanced(GlPrimitive mode, int first, int count, int primcount) { + throw new UnsupportedOperationException(); + } + + public void drawElementsInstanced(GlPrimitive mode, int elementCount, GlNumericType type, long indices, int primcount) { + throw new UnsupportedOperationException(); + } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java index 32bab42ab..8030ef77d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java @@ -3,9 +3,8 @@ package com.jozufozu.flywheel.backend.instancing; import net.minecraft.util.math.BlockPos; /** - * A general interface providing information about any type of thing that could use - * Flywheel's instanced rendering. Right now, that's only {@link InstancedTileRenderer}, - * but there could be an entity equivalent in the future. + * A general interface providing information about any type of thing that could use Flywheel's instanced rendering. + * Right now, that's only {@link InstancedTileRenderer}, but there could be an entity equivalent in the future. */ public interface IInstance { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceFactory.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceFactory.java new file mode 100644 index 000000000..f2364392c --- /dev/null +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceFactory.java @@ -0,0 +1,5 @@ +package com.jozufozu.flywheel.backend.instancing; + +public interface IInstanceFactory { + D create(Instancer owner); +} diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java index b9494058c..bf5382e34 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java @@ -1,7 +1,14 @@ package com.jozufozu.flywheel.backend.instancing; +/** + * Something (a TileEntity or Entity) that can be rendered using the instancing API. + */ public interface IInstanceRendered { - default boolean shouldRenderAsTE() { + + /** + * @return true if there are parts of the renderer that cannot be implemented with Flywheel. + */ + default boolean shouldRenderNormally() { return false; } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java index e660195c1..846ad7d8e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java @@ -8,7 +8,7 @@ package com.jozufozu.flywheel.backend.instancing; *