diff --git a/src/main/java/com/jozufozu/flywheel/backend/Loader.java b/src/main/java/com/jozufozu/flywheel/backend/Loader.java
index dde50a6fe..363dcff13 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/Loader.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/Loader.java
@@ -1,8 +1,5 @@
package com.jozufozu.flywheel.backend;
-import java.util.Collection;
-import java.util.function.Predicate;
-
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
@@ -21,23 +18,27 @@ import com.mojang.serialization.JsonOps;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.minecraft.server.packs.resources.Resource;
import net.minecraft.server.packs.resources.ResourceManager;
-import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
import net.minecraftforge.fml.ModLoader;
import net.minecraftforge.resource.IResourceType;
-import net.minecraftforge.resource.ISelectiveResourceReloadListener;
import net.minecraftforge.resource.VanillaResourceType;
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+
/**
* The main entity for loading shaders.
*
*
- * This class is responsible for invoking the loading, parsing, and compilation stages.
+ * This class is responsible for invoking the loading, parsing, and compilation stages.
*
*/
-public class Loader implements ISelectiveResourceReloadListener {
+public class Loader implements ResourceManagerReloadListener {
public static final String PROGRAM_DIR = "flywheel/programs/";
private static final Gson GSON = new GsonBuilder().create();
@@ -64,44 +65,42 @@ public class Loader implements ISelectiveResourceReloadListener {
}
@Override
- public void onResourceManagerReload(ResourceManager manager, Predicate predicate) {
- if (predicate.test(VanillaResourceType.SHADERS)) {
- backend.refresh();
+ public void onResourceManagerReload(ResourceManager manager) {
+ backend.refresh();
- if (backend.gl20()) {
- shouldCrash = false;
- backend._clearContexts();
+ if (backend.gl20()) {
+ shouldCrash = false;
+ backend._clearContexts();
- Resolver.INSTANCE.invalidate();
- ModLoader.get()
- .postEvent(new GatherContextEvent(backend, firstLoad));
+ Resolver.INSTANCE.invalidate();
+ ModLoader.get()
+ .postEvent(new GatherContextEvent(backend, firstLoad));
- ShaderSources sources = new ShaderSources(manager);
+ ShaderSources sources = new ShaderSources(manager);
- loadProgramSpecs(manager);
+ loadProgramSpecs(manager);
- Resolver.INSTANCE.resolve(sources);
+ Resolver.INSTANCE.resolve(sources);
- for (IShaderContext> context : backend.allContexts()) {
- context.load();
- }
-
- if (shouldCrash) {
- throw new ShaderLoadingException("Could not load all shaders, see log for details");
- }
-
- Backend.log.info("Loaded all shader programs.");
-
- ClientLevel world = Minecraft.getInstance().level;
- if (Backend.isFlywheelWorld(world)) {
- // TODO: looks like it might be good to have another event here
- InstancedRenderDispatcher.loadAllInWorld(world);
- CrumblingRenderer.reset();
- }
+ for (IShaderContext> context : backend.allContexts()) {
+ context.load();
}
- firstLoad = false;
+ if (shouldCrash) {
+ throw new ShaderLoadingException("Could not load all shaders, see log for details");
+ }
+
+ Backend.log.info("Loaded all shader programs.");
+
+ ClientLevel world = Minecraft.getInstance().level;
+ if (Backend.isFlywheelWorld(world)) {
+ // TODO: looks like it might be good to have another event here
+ InstancedRenderDispatcher.loadAllInWorld(world);
+ CrumblingRenderer.reset();
+ }
}
+
+ firstLoad = false;
}
private void loadProgramSpecs(ResourceManager manager) {
@@ -129,4 +128,10 @@ public class Loader implements ISelectiveResourceReloadListener {
}
}
}
+
+ @Nullable
+ @Override
+ public IResourceType getResourceType() {
+ return VanillaResourceType.SHADERS;
+ }
}
diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/package-info.java
index 4d3485865..5fb341756 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/gl/attrib/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.gl.attrib;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/package-info.java
index fb593bf7c..42e951282 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.gl.buffer;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/gl/package-info.java
index 8abd8a8a9..aa181e8fe 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/gl/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/gl/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.gl;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/package-info.java
index 5c4bed0b3..865330294 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.gl.shader;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
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 7a9fe3ec8..50073b868 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java
@@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.instancing;
import net.minecraft.world.level.Level;
/**
- * Something (a TileEntity or Entity) that can be rendered using the instancing API.
+ * Something (a BlockEntity or Entity) that can be rendered using the instancing API.
*/
public interface IInstanceRendered {
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 041f62ff1..71e5e1d8d 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/ITickableInstance.java
@@ -13,7 +13,7 @@ import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
* eg. adding or removing parts, snapping to a different rotation, etc.
*
*
- * Your TileEntity does animate, but the animation doesn't have
+ * Your BlockEntity does animate, but the animation doesn't have
* to be smooth, in which case this could be an optimization.
*
*
diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java
index 1eeb5aa32..64e92c3ee 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java
@@ -11,7 +11,7 @@ import com.jozufozu.flywheel.light.IMovingListener;
import com.jozufozu.flywheel.light.LightProvider;
import net.minecraft.world.entity.Entity;
-import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.phys.AABB;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
@@ -20,7 +20,7 @@ import com.mojang.math.Vector3f;
import net.minecraft.core.Vec3i;
/**
- * The layer between a {@link TileEntity} and the Flywheel backend.
+ * The layer between a {@link BlockEntity} and the Flywheel backend.
* *
*
There are a few additional features that overriding classes can opt in to:
*
diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java
index 4ce85a9f8..feeb161a1 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.instancing.entity;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java
index 2210f8d14..6b642e1f6 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.instancing;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java
index 19866f878..b51e9fddb 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java
@@ -16,7 +16,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.core.BlockPos;
/**
- * The layer between a {@link TileEntity} and the Flywheel backend.
+ * The layer between a {@link BlockEntity} and the Flywheel backend.
*
*
{@link #updateLight()} is called after construction.
*
@@ -30,7 +30,7 @@ import net.minecraft.core.BlockPos;
*
Implementing one or more of these will give a {@link TileEntityInstance} access
* to more interesting and regular points within a tick or a frame.
*
- * @param The type of {@link TileEntity} your class is an instance of.
+ * @param The type of {@link BlockEntity} your class is an instance of.
*/
public abstract class TileEntityInstance extends AbstractInstance {
@@ -64,7 +64,7 @@ public abstract class TileEntityInstance extends Abstract
* {@link TileInstanceManager}s are allowed to arbitrarily adjust the origin, and
* shift the world matrix provided as a shader uniform accordingly.
*
- * @return The {@link BlockPos position} of the {@link TileEntity} this instance
+ * @return The {@link BlockPos position} of the {@link BlockEntity} this instance
* represents should be rendered at to appear in the correct location.
*/
public BlockPos getInstancePosition() {
diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/package-info.java
index 6e52353b7..d8532a523 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.instancing.tile;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/material/package-info.java
index da6906de5..6568fe53f 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/material/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/material/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.material;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/package-info.java
index da24500d1..6f01179a5 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/package-info.java
index 65620a403..25c300762 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.pipeline;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/error/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/source/error/package-info.java
index 536999b8f..250db26d8 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/source/error/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/source/error/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.source.error;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/source/package-info.java
index 5deff62a4..bb8d86f6d 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/source/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/source/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.source;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/parse/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/source/parse/package-info.java
index c3951a07e..61225f714 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/source/parse/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/source/parse/package-info.java
@@ -4,4 +4,4 @@ package com.jozufozu.flywheel.backend.source.parse;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/span/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/source/span/package-info.java
index 069d24f8d..4119b8241 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/source/span/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/source/span/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.source.span;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java b/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java
index eb5ed5dea..5e3063d93 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java
@@ -34,7 +34,7 @@ public class TextureRenderState implements IRenderState {
@Override
public void bind() {
unit.makeActive();
- Minecraft.getInstance().textureManager.bind(location);
+ Minecraft.getInstance().textureManager.bindForSetup(location);
}
@Override
diff --git a/src/main/java/com/jozufozu/flywheel/backend/state/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/state/package-info.java
index 0fb20311b..d769925d3 100644
--- a/src/main/java/com/jozufozu/flywheel/backend/state/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/backend/state/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.backend.state;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java
index 635cc6e8a..fc91f3b8d 100644
--- a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java
+++ b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java
@@ -6,7 +6,7 @@ import com.mojang.brigadier.builder.ArgumentBuilder;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.server.level.ServerPlayer;
-import net.minecraftforge.fml.network.PacketDistributor;
+import net.minecraftforge.fmllegacy.network.PacketDistributor;
public class BooleanConfigCommand {
diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
index 4929a4106..054683390 100644
--- a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
+++ b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java
@@ -5,7 +5,7 @@ import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
+import net.minecraftforge.fmlserverevents.FMLServerStartingEvent;
public class FlwCommands {
@SubscribeEvent
diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java b/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java
index 1cfda4c5a..45207b3aa 100644
--- a/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java
+++ b/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java
@@ -3,9 +3,9 @@ package com.jozufozu.flywheel.config;
import com.jozufozu.flywheel.Flywheel;
import net.minecraft.resources.ResourceLocation;
-import net.minecraftforge.fml.network.NetworkDirection;
-import net.minecraftforge.fml.network.NetworkRegistry;
-import net.minecraftforge.fml.network.simple.SimpleChannel;
+import net.minecraftforge.fmllegacy.network.NetworkDirection;
+import net.minecraftforge.fmllegacy.network.NetworkRegistry;
+import net.minecraftforge.fmllegacy.network.simple.SimpleChannel;
public class FlwPackets {
public static final ResourceLocation CHANNEL_NAME = new ResourceLocation(Flywheel.ID, "network");
diff --git a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java
index 14934bc91..26896166b 100644
--- a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java
+++ b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java
@@ -1,9 +1,10 @@
package com.jozufozu.flywheel.config;
-import java.util.function.Supplier;
import net.minecraft.network.FriendlyByteBuf;
-import net.minecraftforge.fml.network.NetworkEvent;
+import net.minecraftforge.fmllegacy.network.NetworkEvent;
+
+import java.util.function.Supplier;
/**
* Thanks, @zelophed
diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java
index 00190daac..df35fda0f 100644
--- a/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.core.crumbling;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedData.java b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedData.java
index 02897c1d4..7e133cbaa 100644
--- a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedData.java
+++ b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedData.java
@@ -6,7 +6,6 @@ import com.jozufozu.flywheel.util.vec.Vec3;
import net.minecraft.core.BlockPos;
import com.mojang.math.Quaternion;
-import net.minecraft.world.phys.Vec3;
import com.mojang.math.Vector3f;
public class OrientedData extends BasicData {
@@ -55,7 +54,7 @@ public class OrientedData extends BasicData {
return setPosition(pos.x(), pos.y(), pos.z());
}
- public OrientedData setPivot(Vec3 pos) {
+ public OrientedData setPivot(net.minecraft.world.phys.Vec3 pos) {
return setPosition((float) pos.x(), (float) pos.y(), (float) pos.z());
}
diff --git a/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java b/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
index 6792ff1ce..7cd27db3b 100644
--- a/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
+++ b/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java
@@ -81,8 +81,8 @@ public class BlockModel implements IModel {
// .flatMap(dir -> model.getQuads(referenceState, dir, mc.world.rand, modelData).stream())
// .collect(Collectors.toList());
- builder.begin(GL11.GL_QUADS, DefaultVertexFormat.BLOCK);
- blockRenderer.renderModel(mc.level, model, referenceState, BlockPos.ZERO.above(255), ms, builder, true, mc.level.random, 42, OverlayTexture.NO_OVERLAY, VirtualEmptyModelData.INSTANCE);
+ builder.begin(com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
+ blockRenderer.tesselateBlock(mc.level, model, referenceState, BlockPos.ZERO.above(255), ms, builder, true, mc.level.random, 42, OverlayTexture.NO_OVERLAY, VirtualEmptyModelData.INSTANCE);
builder.end();
return builder;
}
diff --git a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java b/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
index f138d80f7..bd35ed0d2 100644
--- a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
+++ b/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
@@ -1,5 +1,6 @@
package com.jozufozu.flywheel.core.model;
+import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS;
import static org.lwjgl.opengl.GL11.GL_QUADS;
import java.util.Collection;
@@ -32,7 +33,7 @@ public class ModelUtil {
PoseStack ms = new PoseStack();
Random random = new Random();
BufferBuilder builder = new BufferBuilder(DefaultVertexFormat.BLOCK.getIntegerSize());
- builder.begin(GL_QUADS, DefaultVertexFormat.BLOCK);
+ builder.begin(QUADS, DefaultVertexFormat.BLOCK);
ForgeHooksClient.setRenderLayer(layer);
ModelBlockRenderer.enableCaching();
@@ -48,7 +49,7 @@ public class ModelUtil {
ms.pushPose();
ms.translate(pos.getX(), pos.getY(), pos.getZ());
- MODEL_RENDERER.get().renderModel(renderWorld, BLOCK_MODELS.get().getBlockModel(state), state, pos, ms, builder, true,
+ MODEL_RENDERER.get().tesselateBlock(renderWorld, BLOCK_MODELS.get().getBlockModel(state), state, pos, ms, builder, true,
random, 42, OverlayTexture.NO_OVERLAY, EmptyModelData.INSTANCE);
ms.popPose();
}
diff --git a/src/main/java/com/jozufozu/flywheel/core/model/package-info.java b/src/main/java/com/jozufozu/flywheel/core/model/package-info.java
index 33950a9c0..c05e3867b 100644
--- a/src/main/java/com/jozufozu/flywheel/core/model/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/core/model/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.core.model;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/core/package-info.java b/src/main/java/com/jozufozu/flywheel/core/package-info.java
index 4cef387dc..7962f9fca 100644
--- a/src/main/java/com/jozufozu/flywheel/core/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/core/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.core;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/event/GatherContextEvent.java b/src/main/java/com/jozufozu/flywheel/event/GatherContextEvent.java
index c7891abfb..df5a6307b 100644
--- a/src/main/java/com/jozufozu/flywheel/event/GatherContextEvent.java
+++ b/src/main/java/com/jozufozu/flywheel/event/GatherContextEvent.java
@@ -3,7 +3,7 @@ package com.jozufozu.flywheel.event;
import com.jozufozu.flywheel.backend.Backend;
import net.minecraftforge.eventbus.api.Event;
-import net.minecraftforge.fml.event.lifecycle.IModBusEvent;
+import net.minecraftforge.fml.event.IModBusEvent;
public class GatherContextEvent extends Event implements IModBusEvent {
diff --git a/src/main/java/com/jozufozu/flywheel/event/package-info.java b/src/main/java/com/jozufozu/flywheel/event/package-info.java
index b2b0463bf..5c2bd7fe5 100644
--- a/src/main/java/com/jozufozu/flywheel/event/package-info.java
+++ b/src/main/java/com/jozufozu/flywheel/event/package-info.java
@@ -3,4 +3,4 @@ package com.jozufozu.flywheel.event;
import javax.annotation.ParametersAreNonnullByDefault;
-import mcp.MethodsReturnNonnullByDefault;
+import net.minecraft.MethodsReturnNonnullByDefault;
diff --git a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java
index e6d7d24b3..3456690dd 100644
--- a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java
+++ b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java
@@ -21,7 +21,7 @@ import net.minecraft.util.ClassInstanceMultiMap;
public class CancelEntityRenderMixin {
@Group(name = "entityFilter", min = 1, max = 1)
- @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;entitiesForRendering()Ljava/lang/Iterable;"))
+ @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientLevel;entitiesForRendering()Ljava/lang/Iterable;"))
private Iterable filterEntities(ClientLevel world) {
Iterable entities = world.entitiesForRendering();
if (Backend.getInstance()
@@ -38,7 +38,7 @@ public class CancelEntityRenderMixin {
}
@Group(name = "entityFilter")
- @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ClassInheritanceMultiMap;iterator()Ljava/util/Iterator;"))
+ @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ClassInstanceMultiMap;iterator()Ljava/util/Iterator;"))
private Iterator filterEntitiesOF(ClassInstanceMultiMap classInheritanceMultiMap) {
if (Backend.getInstance()
.canUseInstancing()) {
diff --git a/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java
index f73973d77..27a10a6a2 100644
--- a/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java
+++ b/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java
@@ -22,6 +22,8 @@ import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.ChunkAccess;
+import java.util.BitSet;
+
@Mixin(ClientChunkCache.class)
public abstract class FastChunkProviderMixin extends ChunkSource {
@@ -71,7 +73,7 @@ public abstract class FastChunkProviderMixin extends ChunkSource {
}
@Inject(method = "replaceWithPacketData", at = @At("HEAD"))
- public void invalidateOnPacket(int x, int z, ChunkBiomeContainer p_228313_3_, FriendlyByteBuf p_228313_4_, CompoundTag p_228313_5_, int p_228313_6_, boolean p_228313_7_, CallbackInfoReturnable cir) {
+ public void invalidateOnPacket(int x, int z, ChunkBiomeContainer p_171618_, FriendlyByteBuf p_171619_, CompoundTag p_171620_, BitSet p_171621_, CallbackInfoReturnable cir) {
if (Backend.getInstance().chunkCachingEnabled) {
synchronized (level) {
if (x == lastX && z == lastZ) lastChunk = null;
diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
index 3cbb7d3b2..a207069ad 100644
--- a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
+++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java
@@ -55,7 +55,7 @@ public class RenderHooksMixin {
* This should probably be a forge event.
*/
@Inject(at = @At("TAIL"), method = "renderChunkLayer")
- private void renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ, CallbackInfo ci) {
+ private void renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ, Matrix4f p_172999_, CallbackInfo ci) {
RenderBuffers renderBuffers = this.renderBuffers;
@@ -75,7 +75,7 @@ public class RenderHooksMixin {
}
- @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;checkPoseStack(Lcom/mojang/blaze3d/matrix/MatrixStack;)V", ordinal = 2 // after the game renders the breaking overlay normally
+ @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;checkPoseStack(Lcom/mojang/blaze3d/vertex/PoseStack;)V", ordinal = 2 // after the game renders the breaking overlay normally
), method = "renderLevel")
private void renderBlockBreaking(PoseStack stack, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, Camera info, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f p_228426_9_, CallbackInfo ci) {
if (!Backend.getInstance()
@@ -98,7 +98,7 @@ public class RenderHooksMixin {
/**
* This gets called when a block is marked for rerender by vanilla.
*/
- @Inject(at = @At("TAIL"), method = "setBlockDirty(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)V")
+ @Inject(at = @At("TAIL"), method = "setBlockDirty(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockState;)V")
private void checkUpdate(BlockPos pos, BlockState lastState, BlockState newState, CallbackInfo ci) {
InstancedRenderDispatcher.getTiles(level)
.update(level.getBlockEntity(pos));
diff --git a/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java
index 84c52b577..4480c68ee 100644
--- a/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java
+++ b/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java
@@ -22,7 +22,7 @@ public abstract class StoreProjectionMatrixMixin {
* We only want to copy the projection matrix if it is going to be used to render the world.
* We don't care about the mat for your hand.
*/
- @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;resetProjectionMatrix(Lnet/minecraft/util/math/vector/Matrix4f;)V"))
+ @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;resetProjectionMatrix(Lcom/mojang/math/Matrix4f;)V"))
private void projectionMatrixReady(float p_228378_1_, long p_228378_2_, PoseStack p_228378_4_, CallbackInfo ci) {
shouldCopy = true;
}
diff --git a/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java
index c6e081f76..228c37edc 100644
--- a/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java
+++ b/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java
@@ -2,13 +2,14 @@ package com.jozufozu.flywheel.mixin;
import java.util.Set;
+import net.minecraft.world.level.block.entity.TickingBlockEntity;
+
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.jozufozu.flywheel.backend.instancing.InstanceManager;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
@@ -30,13 +31,13 @@ public class TileWorldHookMixin {
@Shadow
@Final
- protected Set blockEntitiesToUnload;
+ protected Set f_46434_; // FIXME: is this correct?
- @Inject(at = @At("TAIL"), method = "addBlockEntity")
- private void onAddTile(BlockEntity te, CallbackInfoReturnable cir) {
+ @Inject(at = @At("TAIL"), method = "addBlockEntityTicker(Lnet/minecraft/world/level/block/entity/TickingBlockEntity;)V")
+ private void onAddTile(TickingBlockEntity te, CallbackInfo ci) {
if (isClientSide) {
InstancedRenderDispatcher.getTiles(self)
- .queueAdd(te);
+ .queueAdd((BlockEntity) te);
}
}
@@ -47,7 +48,7 @@ public class TileWorldHookMixin {
private void onChunkUnload(CallbackInfo ci) {
if (isClientSide) {
InstanceManager kineticRenderer = InstancedRenderDispatcher.getTiles(self);
- for (BlockEntity tile : blockEntitiesToUnload) {
+ for (BlockEntity tile : f_46434_) {
kineticRenderer.remove(tile);
}
}
diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java
index 39b23584a..b5b19b293 100644
--- a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java
+++ b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java
@@ -62,7 +62,7 @@ public class MinecartInstance extends EntityInstance
);
- float yaw = Mth.lerp(pt, entity.yRotO, entity.yRot);
+ float yaw = Mth.lerp(pt, entity.yRotO, entity.getYRot());
long i = (long)entity.getId() * 493286711L;
i = i * i * 4392167121L + i * 98761L;
@@ -75,7 +75,7 @@ public class MinecartInstance extends EntityInstance
double d1 = Mth.lerp(pt, entity.yOld, entity.getY());
double d2 = Mth.lerp(pt, entity.zOld, entity.getZ());
Vec3 vector3d = entity.getPos(d0, d1, d2);
- float f3 = Mth.lerp(pt, entity.xRotO, entity.xRot);
+ float f3 = Mth.lerp(pt, entity.xRotO, entity.getXRot());
if (vector3d != null) {
Vec3 vector3d1 = entity.getPosOffs(d0, d1, d2, 0.3F);
Vec3 vector3d2 = entity.getPosOffs(d0, d1, d2, -0.3F);