mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-25 20:37:54 +01:00
A bit of backporting
- Backport general changes from 1.19 - Fix Javadoc of PartialModel - Remove default Model#getType implementation - Increment version to 0.6.8 - Update Parchment
This commit is contained in:
parent
edd6c736cf
commit
b76e8b1a89
23 changed files with 111 additions and 111 deletions
|
@ -13,6 +13,17 @@ insert_final_newline = true
|
||||||
[*.json]
|
[*.json]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
max_line_length = 500
|
||||||
|
ij_json_keep_blank_lines_in_code = 0
|
||||||
|
ij_json_keep_indents_on_empty_lines = false
|
||||||
|
ij_json_keep_line_breaks = true
|
||||||
|
ij_json_space_after_colon = true
|
||||||
|
ij_json_space_after_comma = true
|
||||||
|
ij_json_space_before_colon = true
|
||||||
|
ij_json_space_before_comma = false
|
||||||
|
ij_json_spaces_within_braces = true
|
||||||
|
ij_json_spaces_within_brackets = false
|
||||||
|
ij_json_wrap_long_lines = false
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
@ -59,6 +59,7 @@ body:
|
||||||
label: Mod Version
|
label: Mod Version
|
||||||
description: The version of the mod you were using when the bug occured
|
description: The version of the mod you were using when the bug occured
|
||||||
options:
|
options:
|
||||||
|
- "0.6.8"
|
||||||
- "0.6.7"
|
- "0.6.7"
|
||||||
- "0.6.6"
|
- "0.6.6"
|
||||||
- "0.6.5"
|
- "0.6.5"
|
||||||
|
|
|
@ -44,6 +44,7 @@ minecraft {
|
||||||
property 'mixin.debug.export', 'true'
|
property 'mixin.debug.export', 'true'
|
||||||
property 'mixin.env.remapRefMap', 'true'
|
property 'mixin.env.remapRefMap', 'true'
|
||||||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
||||||
|
property 'flw.loadRenderDoc', 'true'
|
||||||
|
|
||||||
arg '-mixin.config=flywheel.mixins.json'
|
arg '-mixin.config=flywheel.mixins.json'
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx3G
|
||||||
org.gradle.daemon = false
|
org.gradle.daemon = false
|
||||||
|
|
||||||
# mod version info
|
# mod version info
|
||||||
mod_version = 0.6.6
|
mod_version = 0.6.8
|
||||||
artifact_minecraft_version = 1.18.2
|
artifact_minecraft_version = 1.18.2
|
||||||
|
|
||||||
minecraft_version = 1.18.2
|
minecraft_version = 1.18.2
|
||||||
|
@ -14,7 +14,7 @@ mixingradle_version = 0.7-SNAPSHOT
|
||||||
mixin_version = 0.8.5
|
mixin_version = 0.8.5
|
||||||
librarian_version = 1.+
|
librarian_version = 1.+
|
||||||
cursegradle_version = 1.4.0
|
cursegradle_version = 1.4.0
|
||||||
parchment_version = 2022.07.10
|
parchment_version = 2022.11.06
|
||||||
|
|
||||||
# curseforge info
|
# curseforge info
|
||||||
projectId = 486392
|
projectId = 486392
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class MappedBuffer extends VecBuffer implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws Exception {
|
public void close() {
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.jozufozu.flywheel.backend.instancing;
|
package com.jozufozu.flywheel.backend.instancing;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -359,4 +360,14 @@ public abstract class InstanceManager<T> implements InstancingEngine.OriginShift
|
||||||
LightUpdater.get(value.world).removeListener(value);
|
LightUpdater.get(value.world).removeListener(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void queueAddAll(Collection<? extends T> objects) {
|
||||||
|
if (!Backend.isOn() || objects.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (queuedAdditions) {
|
||||||
|
queuedAdditions.addAll(objects);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.jozufozu.flywheel.backend.model;
|
package com.jozufozu.flywheel.backend.model;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.core.Formats;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
|
|
||||||
public enum FallbackAllocator implements ModelAllocator {
|
public enum FallbackAllocator implements ModelAllocator {
|
||||||
|
@ -7,7 +8,7 @@ public enum FallbackAllocator implements ModelAllocator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BufferedModel alloc(Model model, Callback allocationCallback) {
|
public BufferedModel alloc(Model model, Callback allocationCallback) {
|
||||||
IndexedModel out = new IndexedModel(model);
|
IndexedModel out = new IndexedModel(model, Formats.POS_TEX_NORMAL);
|
||||||
allocationCallback.onAlloc(out);
|
allocationCallback.onAlloc(out);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.jozufozu.flywheel.core.model.Model;
|
||||||
*/
|
*/
|
||||||
public class IndexedModel implements BufferedModel {
|
public class IndexedModel implements BufferedModel {
|
||||||
|
|
||||||
|
protected final VertexType type;
|
||||||
protected final Model model;
|
protected final Model model;
|
||||||
protected final GlPrimitive primitiveMode;
|
protected final GlPrimitive primitiveMode;
|
||||||
protected ElementBuffer ebo;
|
protected ElementBuffer ebo;
|
||||||
|
@ -27,6 +28,11 @@ public class IndexedModel implements BufferedModel {
|
||||||
protected boolean deleted;
|
protected boolean deleted;
|
||||||
|
|
||||||
public IndexedModel(Model model) {
|
public IndexedModel(Model model) {
|
||||||
|
this(model, model.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public IndexedModel(Model model, VertexType type) {
|
||||||
|
this.type = type;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.primitiveMode = GlPrimitive.TRIANGLES;
|
this.primitiveMode = GlPrimitive.TRIANGLES;
|
||||||
|
|
||||||
|
@ -38,7 +44,8 @@ public class IndexedModel implements BufferedModel {
|
||||||
|
|
||||||
// mirror it in system memory, so we can write to it, and upload our model.
|
// mirror it in system memory, so we can write to it, and upload our model.
|
||||||
try (MappedBuffer buffer = vbo.getBuffer()) {
|
try (MappedBuffer buffer = vbo.getBuffer()) {
|
||||||
model.writeInto(buffer.unwrap());
|
type.createWriter(buffer.unwrap())
|
||||||
|
.writeVertexList(model.getReader());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Flywheel.LOGGER.error(String.format("Error uploading model '%s':", model.name()), e);
|
Flywheel.LOGGER.error(String.format("Error uploading model '%s':", model.name()), e);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +87,7 @@ public class IndexedModel implements BufferedModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VertexType getType() {
|
public VertexType getType() {
|
||||||
return model.getType();
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVertexCount() {
|
public int getVertexCount() {
|
||||||
|
|
|
@ -14,12 +14,12 @@ import net.minecraftforge.client.model.ForgeModelBakery;
|
||||||
* A helper class for loading and accessing json models.
|
* A helper class for loading and accessing json models.
|
||||||
* <br>
|
* <br>
|
||||||
* Creating a PartialModel will make the associated modelLocation automatically load.
|
* Creating a PartialModel will make the associated modelLocation automatically load.
|
||||||
* PartialModels must be initialized during {@link net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent FMLClientSetupEvent}.
|
* PartialModels must be initialized the mod class constructor.
|
||||||
* <br>
|
* <br>
|
||||||
* Once {@link ModelBakeEvent} finishes, all PartialModels (with valid modelLocations)
|
* Once {@link ModelBakeEvent} finishes, all PartialModels (with valid modelLocations)
|
||||||
* will have their bakedModel fields populated.
|
* will have their bakedModel fields populated.
|
||||||
* <br>
|
* <br>
|
||||||
* Attempting to create a PartialModel after ModelRegistryEvent will cause an error.
|
* Attempting to create a PartialModel after {@link ModelRegistryEvent} will cause an error.
|
||||||
*/
|
*/
|
||||||
public class PartialModel {
|
public class PartialModel {
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.jozufozu.flywheel.core.hardcoded;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||||
|
import com.jozufozu.flywheel.api.vertex.VertexType;
|
||||||
import com.jozufozu.flywheel.core.Formats;
|
import com.jozufozu.flywheel.core.Formats;
|
||||||
import com.jozufozu.flywheel.core.model.Model;
|
import com.jozufozu.flywheel.core.model.Model;
|
||||||
import com.jozufozu.flywheel.core.vertex.PosTexNormalWriterUnsafe;
|
import com.jozufozu.flywheel.core.vertex.PosTexNormalWriterUnsafe;
|
||||||
|
@ -52,6 +53,11 @@ public class ModelPart implements Model {
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VertexType getType() {
|
||||||
|
return Formats.POS_TEX_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete() {
|
public void delete() {
|
||||||
if (reader instanceof AutoCloseable closeable) {
|
if (reader instanceof AutoCloseable closeable) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.jozufozu.flywheel.core.model;
|
package com.jozufozu.flywheel.core.model;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||||
|
import com.jozufozu.flywheel.api.vertex.VertexType;
|
||||||
import com.jozufozu.flywheel.core.Formats;
|
import com.jozufozu.flywheel.core.Formats;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
|
@ -12,10 +13,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
* A model of a single block.
|
* A model of a single block.
|
||||||
*/
|
*/
|
||||||
public class BlockModel implements Model {
|
public class BlockModel implements Model {
|
||||||
private static final PoseStack IDENTITY = new PoseStack();
|
|
||||||
|
|
||||||
private final VertexList reader;
|
private final VertexList reader;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public BlockModel(BlockState state) {
|
public BlockModel(BlockState state) {
|
||||||
|
@ -25,12 +24,21 @@ public class BlockModel implements Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockModel(BakedModel model, BlockState referenceState) {
|
public BlockModel(BakedModel model, BlockState referenceState) {
|
||||||
this(model, referenceState, IDENTITY);
|
this(new BakedModelBuilder(model).withReferenceState(referenceState), referenceState.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockModel(BakedModel model, BlockState referenceState, PoseStack ms) {
|
public BlockModel(BakedModel model, BlockState referenceState, PoseStack ms) {
|
||||||
reader = Formats.BLOCK.createReader(ModelUtil.getBufferBuilder(model, referenceState, ms));
|
this(new BakedModelBuilder(model).withReferenceState(referenceState)
|
||||||
name = referenceState.toString();
|
.withPoseStack(ms), referenceState.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockModel(Bufferable bufferable, String name) {
|
||||||
|
this(bufferable.build(), name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockModel(ShadeSeparatedBufferBuilder bufferBuilder, String name) {
|
||||||
|
this.name = name;
|
||||||
|
reader = Formats.BLOCK.createReader(bufferBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,6 +56,11 @@ public class BlockModel implements Model {
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VertexType getType() {
|
||||||
|
return Formats.BLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete() {
|
public void delete() {
|
||||||
if (reader instanceof AutoCloseable closeable) {
|
if (reader instanceof AutoCloseable closeable) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import java.nio.ByteBuffer;
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexType;
|
import com.jozufozu.flywheel.api.vertex.VertexType;
|
||||||
import com.jozufozu.flywheel.backend.model.ElementBuffer;
|
import com.jozufozu.flywheel.backend.model.ElementBuffer;
|
||||||
import com.jozufozu.flywheel.core.Formats;
|
|
||||||
import com.jozufozu.flywheel.core.QuadConverter;
|
import com.jozufozu.flywheel.core.QuadConverter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,9 +41,7 @@ public interface Model {
|
||||||
*/
|
*/
|
||||||
int vertexCount();
|
int vertexCount();
|
||||||
|
|
||||||
default VertexType getType() {
|
VertexType getType();
|
||||||
return Formats.POS_TEX_NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX Since this is public API (technically) we cannot make assumptions about what GL state this method can use or modify unless a contract is established.
|
// XXX Since this is public API (technically) we cannot make assumptions about what GL state this method can use or modify unless a contract is established.
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
package com.jozufozu.flywheel.core.model;
|
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexType;
|
|
||||||
import com.jozufozu.flywheel.core.Formats;
|
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
|
||||||
|
|
||||||
public class WorldModel implements Model {
|
|
||||||
|
|
||||||
private final VertexList reader;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
public WorldModel(BufferBuilder bufferBuilder, String name) {
|
|
||||||
this.reader = Formats.BLOCK.createReader(bufferBuilder);
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String name() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VertexType getType() {
|
|
||||||
return Formats.BLOCK;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int vertexCount() {
|
|
||||||
return reader.getVertexCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VertexList getReader() {
|
|
||||||
return reader;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -80,7 +80,7 @@ public final class WorldModelBuilder implements Bufferable {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldModel intoMesh(String name) {
|
public BlockModel intoMesh(String name) {
|
||||||
return new WorldModel(ModelUtil.getBufferBuilder(this), name);
|
return new BlockModel(ModelUtil.getBufferBuilder(this), name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import org.lwjgl.system.MemoryUtil;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||||
import com.mojang.blaze3d.platform.MemoryTracker;
|
import com.mojang.blaze3d.platform.MemoryTracker;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
|
||||||
|
|
||||||
public abstract class AbstractVertexList implements VertexList, AutoCloseable {
|
public abstract class AbstractVertexList implements VertexList, AutoCloseable {
|
||||||
|
|
||||||
|
@ -22,15 +21,6 @@ public abstract class AbstractVertexList implements VertexList, AutoCloseable {
|
||||||
init(copyFrom);
|
init(copyFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractVertexList(BufferBuilder builder) {
|
|
||||||
var pair = builder.popNextBuffer();
|
|
||||||
ByteBuffer copyFrom = pair.getSecond();
|
|
||||||
this.contents = MemoryTracker.create(copyFrom.capacity());
|
|
||||||
this.vertexCount = pair.getFirst().vertexCount();
|
|
||||||
this.base = MemoryUtil.memAddress(this.contents);
|
|
||||||
init(copyFrom);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init(ByteBuffer copyFrom) {
|
private void init(ByteBuffer copyFrom) {
|
||||||
this.contents.order(copyFrom.order());
|
this.contents.order(copyFrom.order());
|
||||||
this.contents.put(copyFrom);
|
this.contents.put(copyFrom);
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
package com.jozufozu.flywheel.core.vertex;
|
package com.jozufozu.flywheel.core.vertex;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
||||||
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferBuilder;
|
|
||||||
import com.jozufozu.flywheel.util.RenderMath;
|
import com.jozufozu.flywheel.util.RenderMath;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
|
||||||
|
|
||||||
public class BlockVertexList extends AbstractVertexList {
|
public class BlockVertexList extends AbstractVertexList {
|
||||||
|
|
||||||
private final int stride;
|
private final int stride;
|
||||||
|
|
||||||
public BlockVertexList(BufferBuilder builder) {
|
public BlockVertexList(ByteBuffer copyFrom, int vertexCount, int stride) {
|
||||||
super(builder);
|
super(copyFrom, vertexCount);
|
||||||
this.stride = builder.getVertexFormat()
|
this.stride = stride;
|
||||||
.getVertexSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,9 +92,9 @@ public class BlockVertexList extends AbstractVertexList {
|
||||||
|
|
||||||
private final int unshadedStartVertex;
|
private final int unshadedStartVertex;
|
||||||
|
|
||||||
public Shaded(ShadeSeparatedBufferBuilder builder) {
|
public Shaded(ByteBuffer copyFrom, int vertexCount, int stride, int unshadedStartVertex) {
|
||||||
super(builder);
|
super(copyFrom, vertexCount, stride);
|
||||||
unshadedStartVertex = builder.getUnshadedStartVertex();
|
this.unshadedStartVertex = unshadedStartVertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,9 +18,7 @@ public class ForgeEvents {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void addToDebugScreen(RenderGameOverlayEvent.Text event) {
|
public static void addToDebugScreen(RenderGameOverlayEvent.Text event) {
|
||||||
|
|
||||||
if (Minecraft.getInstance().options.renderDebug) {
|
if (Minecraft.getInstance().options.renderDebug) {
|
||||||
|
|
||||||
InstancedRenderDispatcher.getDebugString(event.getRight());
|
InstancedRenderDispatcher.getDebugString(event.getRight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.jozufozu.flywheel.mixin;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import net.minecraft.client.main.Main;
|
||||||
|
|
||||||
|
@Mixin(Main.class)
|
||||||
|
public class ClientMainMixin {
|
||||||
|
|
||||||
|
@Inject(method = "main", at = @At("HEAD"))
|
||||||
|
private static void injectRenderDoc(CallbackInfo ci) {
|
||||||
|
// Only try to load RenderDoc if a system property is set.
|
||||||
|
if (System.getProperty("flw.loadRenderDoc") == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
System.loadLibrary("renderdoc");
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
// Oh well, we tried.
|
||||||
|
// On Windows, RenderDoc installs to "C:\Program Files\RenderDoc\"
|
||||||
|
System.err.println("Is RenderDoc in your PATH?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,9 +3,7 @@ package com.jozufozu.flywheel.mixin;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Group;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@ -48,33 +46,8 @@ public class LevelRendererMixin {
|
||||||
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, camera, frustum));
|
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, camera, frustum));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
|
||||||
private boolean flywheel$LayerRendered;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This only gets injected if renderChunkLayer is not Overwritten
|
|
||||||
*/
|
|
||||||
@Group(name = "flywheel$renderLayer", min = 1, max = 2)
|
|
||||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiling/ProfilerFiller;pop()V", ordinal = 1), method = "renderChunkLayer")
|
|
||||||
private void renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ, Matrix4f p_172999_, CallbackInfo ci) {
|
|
||||||
flywheel$renderLayer(type, stack, camX, camY, camZ);
|
|
||||||
flywheel$LayerRendered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This always gets injected.
|
|
||||||
*/
|
|
||||||
@Group(name = "flywheel$renderLayer")
|
|
||||||
@Inject(at = @At("TAIL"), method = "renderChunkLayer")
|
@Inject(at = @At("TAIL"), method = "renderChunkLayer")
|
||||||
private void renderLayerSodium(RenderType type, PoseStack stack, double camX, double camY, double camZ, Matrix4f p_172999_, CallbackInfo ci) {
|
private void renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ, Matrix4f projection, CallbackInfo ci) {
|
||||||
if (!flywheel$LayerRendered) {
|
|
||||||
flywheel$renderLayer(type, stack, camX, camY, camZ);
|
|
||||||
}
|
|
||||||
flywheel$LayerRendered = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Unique
|
|
||||||
private void flywheel$renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ) {
|
|
||||||
MinecraftForge.EVENT_BUS.post(new RenderLayerEvent(level, type, stack, renderBuffers, camX, camY, camZ));
|
MinecraftForge.EVENT_BUS.post(new RenderLayerEvent(level, type, stack, renderBuffers, camX, camY, camZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.jozufozu.flywheel.mixin;
|
package com.jozufozu.flywheel.mixin.instancemanage;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.jozufozu.flywheel.mixin;
|
package com.jozufozu.flywheel.mixin.instancemanage;
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.jozufozu.flywheel.mixin;
|
package com.jozufozu.flywheel.mixin.instancemanage;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
|
@ -10,13 +10,11 @@
|
||||||
"BufferBuilderMixin",
|
"BufferBuilderMixin",
|
||||||
"CameraMixin",
|
"CameraMixin",
|
||||||
"ClientLevelMixin",
|
"ClientLevelMixin",
|
||||||
"ChunkRebuildHooksMixin",
|
"ClientMainMixin",
|
||||||
"EntityTypeMixin",
|
"EntityTypeMixin",
|
||||||
"FixFabulousDepthMixin",
|
"FixFabulousDepthMixin",
|
||||||
"FrustumMixin",
|
"FrustumMixin",
|
||||||
"GlStateManagerMixin",
|
"GlStateManagerMixin",
|
||||||
"InstanceAddMixin",
|
|
||||||
"InstanceRemoveMixin",
|
|
||||||
"LevelRendererAccessor",
|
"LevelRendererAccessor",
|
||||||
"LevelRendererMixin",
|
"LevelRendererMixin",
|
||||||
"PausedPartialTickAccessor",
|
"PausedPartialTickAccessor",
|
||||||
|
@ -24,6 +22,9 @@
|
||||||
"RenderTypeMixin",
|
"RenderTypeMixin",
|
||||||
"atlas.AtlasDataMixin",
|
"atlas.AtlasDataMixin",
|
||||||
"atlas.SheetDataAccessor",
|
"atlas.SheetDataAccessor",
|
||||||
|
"instancemanage.ChunkRebuildHooksMixin",
|
||||||
|
"instancemanage.InstanceAddMixin",
|
||||||
|
"instancemanage.InstanceRemoveMixin",
|
||||||
"light.LightUpdateMixin",
|
"light.LightUpdateMixin",
|
||||||
"light.NetworkLightUpdateMixin",
|
"light.NetworkLightUpdateMixin",
|
||||||
"matrix.Matrix3fMixin",
|
"matrix.Matrix3fMixin",
|
||||||
|
|
Loading…
Reference in a new issue