From 2fc54ffbeee50b9d556bc957f160ede3e79eead9 Mon Sep 17 00:00:00 2001 From: grimmauld Date: Wed, 15 Sep 2021 08:45:29 +0200 Subject: [PATCH] Remap, update forge, minecraft and java --- build.gradle | 4 +- gradle.properties | 6 +- .../java/com/jozufozu/flywheel/Flywheel.java | 2 +- .../jozufozu/flywheel/backend/Backend.java | 12 ++-- .../flywheel/backend/IShaderContext.java | 2 +- .../com/jozufozu/flywheel/backend/Loader.java | 24 ++++---- .../flywheel/backend/SpecMetaRegistry.java | 2 +- .../flywheel/backend/gl/shader/GlProgram.java | 4 +- .../flywheel/backend/gl/shader/GlShader.java | 2 +- .../backend/instancing/AbstractInstance.java | 16 ++--- .../backend/instancing/IInstance.java | 2 +- .../backend/instancing/IInstanceRendered.java | 4 +- .../backend/instancing/InstanceManager.java | 12 ++-- .../backend/instancing/InstanceWorld.java | 12 ++-- .../instancing/InstancedRenderDispatcher.java | 22 +++---- .../instancing/InstancedRenderRegistry.java | 28 ++++----- .../instancing/entity/EntityInstance.java | 30 +++++----- .../entity/EntityInstanceManager.java | 12 ++-- .../entity/IEntityInstanceFactory.java | 2 +- .../instancing/tile/ITileInstanceFactory.java | 4 +- .../instancing/tile/TileEntityInstance.java | 8 +-- .../instancing/tile/TileInstanceManager.java | 20 +++---- .../flywheel/backend/material/Material.java | 8 +-- .../backend/material/MaterialGroupImpl.java | 2 +- .../backend/material/MaterialManager.java | 12 ++-- .../backend/material/MaterialManagerImpl.java | 22 +++---- .../backend/material/MaterialRenderer.java | 2 +- .../backend/material/MaterialSpec.java | 2 +- .../backend/pipeline/WorldShader.java | 2 +- .../backend/pipeline/WorldShaderPipeline.java | 2 +- .../backend/source/FileResolution.java | 2 +- .../backend/source/ISourceHolder.java | 2 +- .../flywheel/backend/source/Index.java | 2 +- .../flywheel/backend/source/Resolver.java | 2 +- .../backend/source/ShaderSources.java | 10 ++-- .../flywheel/backend/source/SourceFile.java | 2 +- .../flywheel/backend/source/parse/Import.java | 2 +- .../flywheel/backend/state/IRenderState.java | 2 +- .../flywheel/backend/state/RenderState.java | 2 +- .../backend/state/TextureRenderState.java | 2 +- .../flywheel/config/BooleanConfig.java | 34 +++++------ .../flywheel/config/BooleanConfigCommand.java | 14 ++--- .../jozufozu/flywheel/config/FlwCommands.java | 6 +- .../jozufozu/flywheel/config/FlwPackets.java | 2 +- .../config/SConfigureBooleanPacket.java | 6 +- .../jozufozu/flywheel/core/AtlasStitcher.java | 6 +- .../com/jozufozu/flywheel/core/Contexts.java | 2 +- .../com/jozufozu/flywheel/core/Materials.java | 2 +- .../jozufozu/flywheel/core/PartialModel.java | 10 ++-- .../com/jozufozu/flywheel/core/Programs.java | 2 +- .../flywheel/core/StitchedSprite.java | 6 +- .../jozufozu/flywheel/core/WorldContext.java | 2 +- .../flywheel/core/atlas/AtlasInfo.java | 16 ++--- .../core/crumbling/CrumblingGroup.java | 2 +- .../crumbling/CrumblingInstanceManager.java | 2 +- .../core/crumbling/CrumblingProgram.java | 10 ++-- .../core/crumbling/CrumblingRenderer.java | 48 +++++++-------- .../core/materials/model/ModelData.java | 4 +- .../core/materials/oriented/OrientedData.java | 10 ++-- .../flywheel/core/model/BakedModelModel.java | 24 ++++---- .../flywheel/core/model/BlockModel.java | 32 +++++----- .../flywheel/core/model/ModelUtil.java | 44 +++++++------- .../flywheel/core/model/PartBuilder.java | 8 +-- .../flywheel/core/model/Readable.java | 4 +- .../flywheel/core/model/WorldModel.java | 6 +- .../core/shader/ExtensibleGlProgram.java | 2 +- .../flywheel/core/shader/FogMode.java | 2 +- .../flywheel/core/shader/WorldFog.java | 2 +- .../flywheel/core/shader/WorldProgram.java | 8 +-- .../shader/extension/IExtensionInstance.java | 2 +- .../shader/extension/IProgramExtension.java | 2 +- .../extension/UnitExtensionInstance.java | 2 +- .../shader/gamestate/FogStateProvider.java | 2 +- .../shader/gamestate/IGameStateProvider.java | 2 +- .../gamestate/NormalDebugStateProvider.java | 2 +- .../spec/BooleanGameStateCondition.java | 2 +- .../core/shader/spec/IGameStateCondition.java | 2 +- .../core/shader/spec/ProgramSpec.java | 2 +- .../shader/spec/SpecificValueCondition.java | 2 +- .../flywheel/event/BeginFrameEvent.java | 24 ++++---- .../jozufozu/flywheel/event/ForgeEvents.java | 8 +-- .../flywheel/event/ReloadRenderersEvent.java | 8 +-- .../flywheel/event/RenderLayerEvent.java | 18 +++--- .../flywheel/light/BasicProvider.java | 18 +++--- .../flywheel/light/GPULightVolume.java | 4 +- .../flywheel/light/GridAlignedBB.java | 30 +++++----- .../flywheel/light/ILightUpdateListener.java | 8 +-- .../jozufozu/flywheel/light/ImmutableBox.java | 8 +-- .../flywheel/light/LightProvider.java | 6 +- .../jozufozu/flywheel/light/LightUpdater.java | 16 ++--- .../jozufozu/flywheel/light/LightVolume.java | 24 ++++---- .../mixin/CancelEntityRenderMixin.java | 14 ++--- .../mixin/CancelTileEntityRenderMixin.java | 6 +- .../mixin/FastChunkProviderMixin.java | 34 +++++------ .../flywheel/mixin/FixFabulousDepthMixin.java | 12 ++-- .../flywheel/mixin/RenderHooksMixin.java | 36 ++++++------ .../flywheel/mixin/ShaderCloseMixin.java | 4 +- .../mixin/StoreProjectionMatrixMixin.java | 6 +- .../flywheel/mixin/TileRemoveMixin.java | 14 ++--- .../flywheel/mixin/TileWorldHookMixin.java | 16 ++--- .../flywheel/mixin/atlas/AtlasDataMixin.java | 14 ++--- .../mixin/atlas/SheetDataAccessor.java | 4 +- .../mixin/light/LightUpdateMixin.java | 20 +++---- .../mixin/light/NetworkLightUpdateMixin.java | 12 ++-- .../jozufozu/flywheel/util/AngleHelper.java | 4 +- .../flywheel/util/BakedQuadWrapper.java | 20 +++---- .../flywheel/util/BufferBuilderReader.java | 4 +- .../com/jozufozu/flywheel/util/ChunkUtil.java | 8 +-- .../jozufozu/flywheel/util/RenderUtil.java | 16 ++--- .../jozufozu/flywheel/util/ResourceUtil.java | 2 +- .../jozufozu/flywheel/util/WorldAttached.java | 18 +++--- .../util/transform/MatrixTransformStack.java | 16 ++--- .../util/transform/TransformStack.java | 18 +++--- .../com/jozufozu/flywheel/util/vec/Vec3.java | 4 +- .../com/jozufozu/flywheel/util/vec/Vec4.java | 2 +- .../flywheel/vanilla/BellInstance.java | 18 +++--- .../flywheel/vanilla/ChestInstance.java | 32 +++++----- .../flywheel/vanilla/MinecartInstance.java | 44 +++++++------- .../flywheel/vanilla/RenderStates.java | 4 +- .../flywheel/vanilla/ShulkerBoxInstance.java | 22 +++---- .../flywheel/vanilla/VanillaInstances.java | 14 ++--- .../resources/META-INF/accesstransformer.cfg | 58 +++++++++---------- 122 files changed, 658 insertions(+), 656 deletions(-) diff --git a/build.gradle b/build.gradle index 2da47d936..7b13d2fda 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildnumber}" : '') group = 'com.jozufozu.flywheel' archivesBaseName = 'flywheel' -java.toolchain.languageVersion = JavaLanguageVersion.of(8) +java.toolchain.languageVersion = JavaLanguageVersion.of(16) minecraft { mappings channel: 'official', version: "${minecraft_version}" @@ -143,6 +143,7 @@ artifacts { archives jar, sourcesJar, javadocJar } +/* publishing { tasks.publish.dependsOn 'build' publications { @@ -174,3 +175,4 @@ curseforge { mainArtifact jar } } + */ diff --git a/gradle.properties b/gradle.properties index 86775ac82..7f44b2836 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # mod version info mod_version=0.2.3 -mc_update_version=1.16 -minecraft_version=1.16.5 -forge_version=36.1.66 +mc_update_version=1.17 +minecraft_version=1.17.1 +forge_version=37.0.59 # curseforge info projectId=486392 diff --git a/src/main/java/com/jozufozu/flywheel/Flywheel.java b/src/main/java/com/jozufozu/flywheel/Flywheel.java index e44464612..3a34d5989 100644 --- a/src/main/java/com/jozufozu/flywheel/Flywheel.java +++ b/src/main/java/com/jozufozu/flywheel/Flywheel.java @@ -4,7 +4,7 @@ import com.jozufozu.flywheel.config.FlwCommands; import com.jozufozu.flywheel.config.FlwConfig; import com.jozufozu.flywheel.config.FlwPackets; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.DistExecutor; diff --git a/src/main/java/com/jozufozu/flywheel/backend/Backend.java b/src/main/java/com/jozufozu/flywheel/backend/Backend.java index 27852a64a..c352f951f 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Backend.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Backend.java @@ -20,10 +20,10 @@ import com.jozufozu.flywheel.config.FlwConfig; import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.vector.Matrix4f; -import net.minecraft.world.IWorld; -import net.minecraft.world.World; +import net.minecraft.resources.ResourceLocation; +import com.mojang.math.Matrix4f; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.Level; public class Backend { public static final Logger log = LogManager.getLogger(Backend.class); @@ -144,7 +144,7 @@ public class Backend { .chunkCaching(); } - public boolean canUseInstancing(@Nullable World world) { + public boolean canUseInstancing(@Nullable Level world) { return canUseInstancing() && isFlywheelWorld(world); } @@ -171,7 +171,7 @@ public class Backend { /** * Used to avoid calling Flywheel functions on (fake) worlds that don't specifically support it. */ - public static boolean isFlywheelWorld(@Nullable IWorld world) { + public static boolean isFlywheelWorld(@Nullable LevelAccessor world) { if (world == null) return false; if (world instanceof IFlywheelWorld && ((IFlywheelWorld) world).supportsFlywheel()) return true; diff --git a/src/main/java/com/jozufozu/flywheel/backend/IShaderContext.java b/src/main/java/com/jozufozu/flywheel/backend/IShaderContext.java index 181e40e84..0d24963f2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/IShaderContext.java +++ b/src/main/java/com/jozufozu/flywheel/backend/IShaderContext.java @@ -4,7 +4,7 @@ import java.util.function.Supplier; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public interface IShaderContext

{ diff --git a/src/main/java/com/jozufozu/flywheel/backend/Loader.java b/src/main/java/com/jozufozu/flywheel/backend/Loader.java index de617646e..dde50a6fe 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Loader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Loader.java @@ -20,11 +20,11 @@ import com.mojang.serialization.DataResult; import com.mojang.serialization.JsonOps; import net.minecraft.client.Minecraft; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.resources.IReloadableResourceManager; -import net.minecraft.resources.IResource; -import net.minecraft.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; +import net.minecraft.client.multiplayer.ClientLevel; +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.minecraftforge.fml.ModLoader; import net.minecraftforge.resource.IResourceType; import net.minecraftforge.resource.ISelectiveResourceReloadListener; @@ -52,9 +52,9 @@ public class Loader implements ISelectiveResourceReloadListener { // Can be null when running datagenerators due to the unfortunate time we call this Minecraft minecraft = Minecraft.getInstance(); if (minecraft != null) { - IResourceManager manager = minecraft.getResourceManager(); - if (manager instanceof IReloadableResourceManager) { - ((IReloadableResourceManager) manager).registerReloadListener(this); + ResourceManager manager = minecraft.getResourceManager(); + if (manager instanceof ReloadableResourceManager) { + ((ReloadableResourceManager) manager).registerReloadListener(this); } } } @@ -64,7 +64,7 @@ public class Loader implements ISelectiveResourceReloadListener { } @Override - public void onResourceManagerReload(IResourceManager manager, Predicate predicate) { + public void onResourceManagerReload(ResourceManager manager, Predicate predicate) { if (predicate.test(VanillaResourceType.SHADERS)) { backend.refresh(); @@ -92,7 +92,7 @@ public class Loader implements ISelectiveResourceReloadListener { Backend.log.info("Loaded all shader programs."); - ClientWorld world = Minecraft.getInstance().level; + ClientLevel world = Minecraft.getInstance().level; if (Backend.isFlywheelWorld(world)) { // TODO: looks like it might be good to have another event here InstancedRenderDispatcher.loadAllInWorld(world); @@ -104,12 +104,12 @@ public class Loader implements ISelectiveResourceReloadListener { } } - private void loadProgramSpecs(IResourceManager manager) { + private void loadProgramSpecs(ResourceManager manager) { Collection programSpecs = manager.listResources(PROGRAM_DIR, s -> s.endsWith(".json")); for (ResourceLocation location : programSpecs) { try { - IResource file = manager.getResource(location); + Resource file = manager.getResource(location); String s = StreamUtil.readToString(file.getInputStream()); diff --git a/src/main/java/com/jozufozu/flywheel/backend/SpecMetaRegistry.java b/src/main/java/com/jozufozu/flywheel/backend/SpecMetaRegistry.java index a19ed77f7..14717f9f7 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/SpecMetaRegistry.java +++ b/src/main/java/com/jozufozu/flywheel/backend/SpecMetaRegistry.java @@ -6,7 +6,7 @@ import java.util.Map; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class SpecMetaRegistry { diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlProgram.java b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlProgram.java index 39981fcb0..692002529 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlProgram.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlProgram.java @@ -10,8 +10,8 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlObject; import com.jozufozu.flywheel.util.RenderUtil; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.resources.ResourceLocation; +import com.mojang.math.Matrix4f; public abstract class GlProgram extends GlObject { diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java index 2fa733821..c386294ba 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java @@ -6,7 +6,7 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlObject; import com.jozufozu.flywheel.backend.gl.versioned.GlCompat; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class GlShader extends GlObject { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java index dc9c77c25..b17051c50 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java @@ -11,9 +11,9 @@ import com.jozufozu.flywheel.light.ImmutableBox; import com.jozufozu.flywheel.light.LightProvider; import com.jozufozu.flywheel.light.ListenerStatus; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.LightType; -import net.minecraft.world.World; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.Level; /** * A general interface providing information about any type of thing that could use Flywheel's instanced rendering. @@ -22,9 +22,9 @@ import net.minecraft.world.World; public abstract class AbstractInstance implements IInstance, ILightUpdateListener { protected final MaterialManager materialManager; - public final World world; + public final Level world; - public AbstractInstance(MaterialManager materialManager, World world) { + public AbstractInstance(MaterialManager materialManager, Level world) { this.materialManager = materialManager; this.world = world; } @@ -73,16 +73,16 @@ public abstract class AbstractInstance implements IInstance, ILightUpdateListene } @Override - public void onLightUpdate(LightProvider world, LightType type, ImmutableBox changed) { + public void onLightUpdate(LightProvider world, LightLayer type, ImmutableBox changed) { updateLight(); } protected void relight(BlockPos pos, IFlatLight... models) { - relight(world.getBrightness(LightType.BLOCK, pos), world.getBrightness(LightType.SKY, pos), models); + relight(world.getBrightness(LightLayer.BLOCK, pos), world.getBrightness(LightLayer.SKY, pos), models); } protected > void relight(BlockPos pos, Stream models) { - relight(world.getBrightness(LightType.BLOCK, pos), world.getBrightness(LightType.SKY, pos), models); + relight(world.getBrightness(LightLayer.BLOCK, pos), world.getBrightness(LightLayer.SKY, pos), models); } protected void relight(int block, int sky, IFlatLight... models) { 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 ceeb2d6dc..9514740d8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstance.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.backend.instancing; -import net.minecraft.util.math.BlockPos; +import net.minecraft.core.BlockPos; public interface IInstance { BlockPos getWorldPosition(); 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 71d9a13af..7a9fe3ec8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/IInstanceRendered.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.backend.instancing; -import net.minecraft.world.World; +import net.minecraft.world.level.Level; /** * Something (a TileEntity or Entity) that can be rendered using the instancing API. @@ -14,5 +14,5 @@ public interface IInstanceRendered { return false; } - World getWorld(); + Level getWorld(); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java index bb600858c..864706ca9 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java @@ -14,10 +14,10 @@ import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; import com.jozufozu.flywheel.light.LightUpdater; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.client.Camera; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Mth; +import com.mojang.math.Vector3f; public abstract class InstanceManager implements MaterialManagerImpl.OriginShiftListener { @@ -103,7 +103,7 @@ public abstract class InstanceManager implements MaterialManagerImpl.OriginSh } } - public void beginFrame(ActiveRenderInfo info) { + public void beginFrame(Camera info) { frame++; processQueuedAdditions(); @@ -266,7 +266,7 @@ public abstract class InstanceManager implements MaterialManagerImpl.OriginSh int i = (dSq / 2048); - return divisorSequence[MathHelper.clamp(i, 0, divisorSequence.length - 1)]; + return divisorSequence[Mth.clamp(i, 0, divisorSequence.length - 1)]; } protected void addInternal(T tile) { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java index 880173feb..2cbd2d0a3 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java @@ -10,9 +10,9 @@ import com.jozufozu.flywheel.event.BeginFrameEvent; import com.jozufozu.flywheel.event.RenderLayerEvent; import net.minecraft.client.Minecraft; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.entity.BlockEntity; /** * A manager class for a single world where instancing is supported. @@ -23,7 +23,7 @@ import net.minecraft.tileentity.TileEntity; public class InstanceWorld { protected final MaterialManagerImpl materialManager; protected final InstanceManager entityInstanceManager; - protected final InstanceManager tileEntityInstanceManager; + protected final InstanceManager tileEntityInstanceManager; public InstanceWorld() { @@ -41,7 +41,7 @@ public class InstanceWorld { return entityInstanceManager; } - public InstanceManager getTileEntityInstanceManager() { + public InstanceManager getTileEntityInstanceManager() { return tileEntityInstanceManager; } @@ -55,7 +55,7 @@ public class InstanceWorld { /** * Instantiate all the necessary instances to render the given world. */ - public void loadAll(ClientWorld world) { + public void loadAll(ClientLevel world) { world.blockEntityList.forEach(tileEntityInstanceManager::add); world.entitiesForRendering() .forEach(entityInstanceManager::add); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java index 32810d03d..d0c0fa6e9 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java @@ -10,10 +10,10 @@ import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.WorldAttached; import net.minecraft.client.Minecraft; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IWorld; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.LevelAccessor; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.TickEvent; @@ -30,7 +30,7 @@ public class InstancedRenderDispatcher { * Call this when you want to manually run {@link AbstractInstance#update()}. * @param te The tile whose instance you want to update. */ - public static void enqueueUpdate(TileEntity te) { + public static void enqueueUpdate(BlockEntity te) { getTiles(te.getLevel()).queueUpdate(te); } @@ -43,13 +43,13 @@ public class InstancedRenderDispatcher { } @Nonnull - public static InstanceManager getTiles(IWorld world) { + public static InstanceManager getTiles(LevelAccessor world) { return instanceWorlds.get(world) .getTileEntityInstanceManager(); } @Nonnull - public static InstanceManager getEntities(IWorld world) { + public static InstanceManager getEntities(LevelAccessor world) { return instanceWorlds.get(world) .getEntityInstanceManager(); } @@ -61,7 +61,7 @@ public class InstancedRenderDispatcher { return; } Minecraft mc = Minecraft.getInstance(); - ClientWorld world = mc.level; + ClientLevel world = mc.level; AnimationTickHolder.tick(); instanceWorlds.get(world).tick(); @@ -79,7 +79,7 @@ public class InstancedRenderDispatcher { public static void renderLayer(RenderLayerEvent event) { if (event.layer == null) return; - ClientWorld world = event.getWorld(); + ClientLevel world = event.getWorld(); if (!Backend.getInstance() .canUseInstancing(world)) return; @@ -88,14 +88,14 @@ public class InstancedRenderDispatcher { @SubscribeEvent public static void onReloadRenderers(ReloadRenderersEvent event) { - ClientWorld world = event.getWorld(); + ClientLevel world = event.getWorld(); if (Backend.getInstance() .canUseInstancing() && world != null) { loadAllInWorld(world); } } - public static void loadAllInWorld(ClientWorld world) { + public static void loadAllInWorld(ClientLevel world) { instanceWorlds.replace(world, InstanceWorld::delete) .loadAll(world); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java index a44b2b6da..cbafe6398 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java @@ -13,10 +13,10 @@ import com.jozufozu.flywheel.backend.material.MaterialManager; import it.unimi.dsi.fastutil.objects.Object2BooleanLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2BooleanMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityType; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; public class InstancedRenderRegistry { private static final InstancedRenderRegistry INSTANCE = new InstancedRenderRegistry(); @@ -26,14 +26,14 @@ public class InstancedRenderRegistry { } private final Object2BooleanMap skipRender = new Object2BooleanLinkedOpenHashMap<>(); - private final Map, ITileInstanceFactory> tiles = Maps.newHashMap(); + private final Map, ITileInstanceFactory> tiles = Maps.newHashMap(); private final Map, IEntityInstanceFactory> entities = Maps.newHashMap(); protected InstancedRenderRegistry() { skipRender.defaultReturnValue(false); } - public boolean shouldSkipRender(T type) { + public boolean shouldSkipRender(T type) { return _skipRender(type.getType()) || ((type instanceof IInstanceRendered) && !((IInstanceRendered) type).shouldRenderNormally()); } @@ -41,7 +41,7 @@ public class InstancedRenderRegistry { return _skipRender(type.getType()) || ((type instanceof IInstanceRendered) && !((IInstanceRendered) type).shouldRenderNormally()); } - public boolean canInstance(TileEntityType type) { + public boolean canInstance(BlockEntityType type) { return tiles.containsKey(type); } @@ -49,7 +49,7 @@ public class InstancedRenderRegistry { return entities.containsKey(type); } - public TileConfig tile(TileEntityType type) { + public TileConfig tile(BlockEntityType type) { return new TileConfig<>(type); } @@ -61,7 +61,7 @@ public class InstancedRenderRegistry { * @deprecated will be removed in 0.3.0, use {@link #tile} */ @Deprecated - public void register(TileEntityType type, ITileInstanceFactory rendererFactory) { + public void register(BlockEntityType type, ITileInstanceFactory rendererFactory) { this.tile(type) .factory(rendererFactory); } @@ -77,8 +77,8 @@ public class InstancedRenderRegistry { @SuppressWarnings("unchecked") @Nullable - public TileEntityInstance create(MaterialManager manager, T tile) { - TileEntityType type = tile.getType(); + public TileEntityInstance create(MaterialManager manager, T tile) { + BlockEntityType type = tile.getType(); ITileInstanceFactory factory = (ITileInstanceFactory) this.tiles.get(type); if (factory == null) return null; @@ -107,12 +107,12 @@ public class InstancedRenderRegistry { CONFIG setSkipRender(boolean skipRender); } - public class TileConfig implements Config, ITileInstanceFactory> { + public class TileConfig implements Config, ITileInstanceFactory> { - private final TileEntityType type; + private final BlockEntityType type; - public TileConfig(TileEntityType type) { + public TileConfig(BlockEntityType type) { this.type = type; } 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 81ec407e3..1eeb5aa32 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 @@ -10,14 +10,14 @@ import com.jozufozu.flywheel.light.ILightUpdateListener; import com.jozufozu.flywheel.light.IMovingListener; import com.jozufozu.flywheel.light.LightProvider; -import net.minecraft.entity.Entity; +import net.minecraft.world.entity.Entity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3f; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.world.phys.AABB; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Mth; +import net.minecraft.world.phys.Vec3; +import com.mojang.math.Vector3f; +import net.minecraft.core.Vec3i; /** * The layer between a {@link TileEntity} and the Flywheel backend. @@ -52,7 +52,7 @@ public abstract class EntityInstance extends AbstractInstance @Override public boolean update(LightProvider provider) { - AxisAlignedBB boundsNow = entity.getBoundingBox(); + AABB boundsNow = entity.getBoundingBox(); if (bounds.sameAs(boundsNow)) return false; @@ -71,8 +71,8 @@ public abstract class EntityInstance extends AbstractInstance * @return The position this instance should be rendered at to appear in the correct location. */ public Vector3f getInstancePosition() { - Vector3d pos = entity.position(); - Vector3i origin = materialManager.getOriginCoordinate(); + Vec3 pos = entity.position(); + Vec3i origin = materialManager.getOriginCoordinate(); return new Vector3f((float) (pos.x - origin.getX()), (float) (pos.y - origin.getY()), (float) (pos.z - origin.getZ())); } @@ -84,12 +84,12 @@ public abstract class EntityInstance extends AbstractInstance * @return The position this instance should be rendered at to appear in the correct location. */ public Vector3f getInstancePosition(float partialTicks) { - Vector3d pos = entity.position(); - Vector3i origin = materialManager.getOriginCoordinate(); + Vec3 pos = entity.position(); + Vec3i origin = materialManager.getOriginCoordinate(); return new Vector3f( - (float) (MathHelper.lerp(partialTicks, entity.xOld, pos.x) - origin.getX()), - (float) (MathHelper.lerp(partialTicks, entity.yOld, pos.y) - origin.getY()), - (float) (MathHelper.lerp(partialTicks, entity.zOld, pos.z) - origin.getZ()) + (float) (Mth.lerp(partialTicks, entity.xOld, pos.x) - origin.getX()), + (float) (Mth.lerp(partialTicks, entity.yOld, pos.y) - origin.getY()), + (float) (Mth.lerp(partialTicks, entity.zOld, pos.z) - origin.getZ()) ); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java index a34c7f0a7..b98ea2d88 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java @@ -6,10 +6,10 @@ import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; -import net.minecraft.entity.Entity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockReader; -import net.minecraft.world.World; +import net.minecraft.world.entity.Entity; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; public class EntityInstanceManager extends InstanceManager { @@ -32,14 +32,14 @@ public class EntityInstanceManager extends InstanceManager { protected boolean canCreateInstance(Entity entity) { if (!entity.isAlive()) return false; - World world = entity.level; + Level world = entity.level; if (world == null) return false; if (Backend.isFlywheelWorld(world)) { BlockPos pos = entity.blockPosition(); - IBlockReader existingChunk = world.getChunkForCollisions(pos.getX() >> 4, pos.getZ() >> 4); + BlockGetter existingChunk = world.getChunkForCollisions(pos.getX() >> 4, pos.getZ() >> 4); return existingChunk != null; } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/IEntityInstanceFactory.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/IEntityInstanceFactory.java index 22ac1cea6..67d5a0257 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/IEntityInstanceFactory.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/IEntityInstanceFactory.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.backend.instancing.entity; import com.jozufozu.flywheel.backend.material.MaterialManager; -import net.minecraft.entity.Entity; +import net.minecraft.world.entity.Entity; @FunctionalInterface public interface IEntityInstanceFactory { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/ITileInstanceFactory.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/ITileInstanceFactory.java index 2484b790b..3f8cdd1b8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/ITileInstanceFactory.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/ITileInstanceFactory.java @@ -2,9 +2,9 @@ package com.jozufozu.flywheel.backend.instancing.tile; import com.jozufozu.flywheel.backend.material.MaterialManager; -import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.level.block.entity.BlockEntity; @FunctionalInterface -public interface ITileInstanceFactory { +public interface ITileInstanceFactory { TileEntityInstance create(MaterialManager manager, T te); } 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 957a4565f..19866f878 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 @@ -11,9 +11,9 @@ import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.light.GridAlignedBB; import com.jozufozu.flywheel.light.ImmutableBox; -import net.minecraft.block.BlockState; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.core.BlockPos; /** * The layer between a {@link TileEntity} and the Flywheel backend. @@ -32,7 +32,7 @@ import net.minecraft.util.math.BlockPos; * * @param The type of {@link TileEntity} your class is an instance of. */ -public abstract class TileEntityInstance extends AbstractInstance { +public abstract class TileEntityInstance extends AbstractInstance { protected final T tile; protected final BlockPos pos; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java index 4b2b05275..7d1c793d2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java @@ -6,33 +6,33 @@ import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockReader; -import net.minecraft.world.World; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; -public class TileInstanceManager extends InstanceManager { +public class TileInstanceManager extends InstanceManager { public TileInstanceManager(MaterialManagerImpl materialManager) { super(materialManager); } @Override - protected boolean canInstance(TileEntity obj) { + protected boolean canInstance(BlockEntity obj) { return obj != null && InstancedRenderRegistry.getInstance().canInstance(obj.getType()); } @Override - protected AbstractInstance createRaw(TileEntity obj) { + protected AbstractInstance createRaw(BlockEntity obj) { return InstancedRenderRegistry.getInstance() .create(materialManager, obj); } @Override - protected boolean canCreateInstance(TileEntity tile) { + protected boolean canCreateInstance(BlockEntity tile) { if (tile.isRemoved()) return false; - World world = tile.getLevel(); + Level world = tile.getLevel(); if (world == null) return false; @@ -41,7 +41,7 @@ public class TileInstanceManager extends InstanceManager { if (Backend.isFlywheelWorld(world)) { BlockPos pos = tile.getBlockPos(); - IBlockReader existingChunk = world.getChunkForCollisions(pos.getX() >> 4, pos.getZ() >> 4); + BlockGetter existingChunk = world.getChunkForCollisions(pos.getX() >> 4, pos.getZ() >> 4); return existingChunk != null; } diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/Material.java b/src/main/java/com/jozufozu/flywheel/backend/material/Material.java index db56d012a..a7a68133d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/Material.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/Material.java @@ -9,10 +9,10 @@ import com.jozufozu.flywheel.core.model.BlockModel; import com.jozufozu.flywheel.core.model.IModel; import com.jozufozu.flywheel.util.Pair; import com.jozufozu.flywheel.util.RenderUtil; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.block.BlockState; -import net.minecraft.util.Direction; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.core.Direction; public interface Material { /** @@ -32,7 +32,7 @@ public interface Material { return getModel(partial, referenceState, dir, RenderUtil.rotateToFace(dir)); } - default Instancer getModel(PartialModel partial, BlockState referenceState, Direction dir, Supplier modelTransform) { + default Instancer getModel(PartialModel partial, BlockState referenceState, Direction dir, Supplier modelTransform) { return model(Pair.of(dir, partial), () -> new BlockModel(partial.get(), referenceState, modelTransform.get())); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java index 0f3661929..8cea7ca24 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java @@ -8,7 +8,7 @@ import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.core.shader.WorldProgram; -import net.minecraft.util.math.vector.Matrix4f; +import com.mojang.math.Matrix4f; /** * A group of materials all rendered with the same GL state. diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManager.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManager.java index cf15fc608..74f17e702 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManager.java @@ -4,8 +4,8 @@ import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.backend.state.RenderLayer; import com.jozufozu.flywheel.backend.state.TextureRenderState; -import net.minecraft.inventory.container.PlayerContainer; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.core.Vec3i; public interface MaterialManager { @@ -18,7 +18,7 @@ public interface MaterialManager { */ MaterialGroup state(RenderLayer layer, IRenderState state); - Vector3i getOriginCoordinate(); + Vec3i getOriginCoordinate(); default MaterialGroup solid(IRenderState state) { return state(RenderLayer.SOLID, state); @@ -33,14 +33,14 @@ public interface MaterialManager { } default MaterialGroup defaultSolid() { - return solid(TextureRenderState.get(PlayerContainer.BLOCK_ATLAS)); + return solid(TextureRenderState.get(InventoryMenu.BLOCK_ATLAS)); } default MaterialGroup defaultCutout() { - return cutout(TextureRenderState.get(PlayerContainer.BLOCK_ATLAS)); + return cutout(TextureRenderState.get(InventoryMenu.BLOCK_ATLAS)); } default MaterialGroup defaultTransparent() { - return transparent(TextureRenderState.get(PlayerContainer.BLOCK_ATLAS)); + return transparent(TextureRenderState.get(InventoryMenu.BLOCK_ATLAS)); } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java index f6771ddf7..5f0281d54 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java @@ -11,12 +11,12 @@ import com.jozufozu.flywheel.core.WorldContext; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.util.WeakHashSet; -import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.vector.Matrix4f; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.client.Camera; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Mth; +import com.mojang.math.Matrix4f; +import net.minecraft.core.Vec3i; public class MaterialManagerImpl

implements MaterialManager { @@ -105,7 +105,7 @@ public class MaterialManagerImpl

implements MaterialMana } @Override - public Vector3i getOriginCoordinate() { + public Vec3i getOriginCoordinate() { return originCoordinate; } @@ -118,10 +118,10 @@ public class MaterialManagerImpl

implements MaterialMana * * This prevents floating point precision issues at high coordinates. */ - public void beginFrame(ActiveRenderInfo info) { - int cX = MathHelper.floor(info.getPosition().x); - int cY = MathHelper.floor(info.getPosition().y); - int cZ = MathHelper.floor(info.getPosition().z); + public void beginFrame(Camera info) { + int cX = Mth.floor(info.getPosition().x); + int cY = Mth.floor(info.getPosition().y); + int cZ = Mth.floor(info.getPosition().z); int dX = cX - originCoordinate.getX(); int dY = cY - originCoordinate.getY(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java index bf3cfb843..8bd0ae82b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java @@ -7,7 +7,7 @@ import java.util.function.Supplier; import com.jozufozu.flywheel.backend.instancing.GPUInstancer; import com.jozufozu.flywheel.core.shader.WorldProgram; -import net.minecraft.util.math.vector.Matrix4f; +import com.mojang.math.Matrix4f; public class MaterialRenderer

{ diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialSpec.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialSpec.java index 7cc5120ea..733d98947 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialSpec.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialSpec.java @@ -4,7 +4,7 @@ import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.struct.StructType; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class MaterialSpec { diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java index ec0505cb4..c71117e34 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java @@ -8,7 +8,7 @@ import com.jozufozu.flywheel.backend.gl.shader.ShaderType; import com.jozufozu.flywheel.backend.source.FileResolution; import com.jozufozu.flywheel.backend.source.SourceFile; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class WorldShader { diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java index e2face450..f26126c23 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java +++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java @@ -14,7 +14,7 @@ import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import com.jozufozu.flywheel.core.shader.spec.ProgramState; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class WorldShaderPipeline

implements IShaderPipeline

{ diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/FileResolution.java b/src/main/java/com/jozufozu/flywheel/backend/source/FileResolution.java index 2e4ae7163..b04bb87c5 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/FileResolution.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/FileResolution.java @@ -9,7 +9,7 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.source.error.ErrorBuilder; import com.jozufozu.flywheel.backend.source.span.Span; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * A reference to a source file that might not be loaded when the owning object is created. diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/ISourceHolder.java b/src/main/java/com/jozufozu/flywheel/backend/source/ISourceHolder.java index 07363f380..df209dcf7 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/ISourceHolder.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/ISourceHolder.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.backend.source; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * A minimal source file lookup function. diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/Index.java b/src/main/java/com/jozufozu/flywheel/backend/source/Index.java index 75325a7be..be47757c2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/Index.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/Index.java @@ -8,7 +8,7 @@ import com.google.common.collect.MultimapBuilder; import com.jozufozu.flywheel.backend.source.parse.ShaderFunction; import com.jozufozu.flywheel.backend.source.parse.ShaderStruct; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * Indexes many shader source definitions to allow for error fix suggestions. diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/Resolver.java b/src/main/java/com/jozufozu/flywheel/backend/source/Resolver.java index 4a7cefe65..185fcd4af 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/Resolver.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/Resolver.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.source; import java.util.HashMap; import java.util.Map; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * Manages deferred file resolution. diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/ShaderSources.java b/src/main/java/com/jozufozu/flywheel/backend/source/ShaderSources.java index 3039a77eb..b53893a76 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/ShaderSources.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/ShaderSources.java @@ -10,9 +10,9 @@ import com.google.common.collect.Lists; import com.jozufozu.flywheel.util.ResourceUtil; import com.jozufozu.flywheel.util.StreamUtil; -import net.minecraft.resources.IResource; -import net.minecraft.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; +import net.minecraft.server.packs.resources.Resource; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.resources.ResourceLocation; /** * The main object for loading and parsing source files. @@ -25,7 +25,7 @@ public class ShaderSources implements ISourceHolder { public final Index index; - public ShaderSources(IResourceManager manager) { + public ShaderSources(ResourceManager manager) { Collection allShaders = manager.listResources(SHADER_DIR, s -> { for (String ext : EXTENSIONS) { if (s.endsWith(ext)) return true; @@ -35,7 +35,7 @@ public class ShaderSources implements ISourceHolder { for (ResourceLocation location : allShaders) { try { - IResource resource = manager.getResource(location); + Resource resource = manager.getResource(location); String source = StreamUtil.readToString(resource.getInputStream()); diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/SourceFile.java b/src/main/java/com/jozufozu/flywheel/backend/source/SourceFile.java index 88f23d30f..dc2d7f818 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/SourceFile.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/SourceFile.java @@ -21,7 +21,7 @@ import com.jozufozu.flywheel.util.StringUtil; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class SourceFile { private static final Pattern includePattern = Pattern.compile("#use \"(.*)\""); diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/parse/Import.java b/src/main/java/com/jozufozu/flywheel/backend/source/parse/Import.java index 55bebb898..23a7f279a 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/parse/Import.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/parse/Import.java @@ -12,7 +12,7 @@ import com.jozufozu.flywheel.backend.source.SourceFile; import com.jozufozu.flywheel.backend.source.error.ErrorReporter; import com.jozufozu.flywheel.backend.source.span.Span; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class Import extends AbstractShaderElement { diff --git a/src/main/java/com/jozufozu/flywheel/backend/state/IRenderState.java b/src/main/java/com/jozufozu/flywheel/backend/state/IRenderState.java index f312ab881..b24a755f8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/state/IRenderState.java +++ b/src/main/java/com/jozufozu/flywheel/backend/state/IRenderState.java @@ -4,7 +4,7 @@ import javax.annotation.Nullable; import com.jozufozu.flywheel.backend.gl.GlTextureUnit; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public interface IRenderState { diff --git a/src/main/java/com/jozufozu/flywheel/backend/state/RenderState.java b/src/main/java/com/jozufozu/flywheel/backend/state/RenderState.java index c72f61643..3bbb5bd37 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/state/RenderState.java +++ b/src/main/java/com/jozufozu/flywheel/backend/state/RenderState.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; import com.google.common.collect.ImmutableList; import com.jozufozu.flywheel.backend.gl.GlTextureUnit; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class RenderState implements IRenderState { 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 7c34ea096..eb5ed5dea 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java +++ b/src/main/java/com/jozufozu/flywheel/backend/state/TextureRenderState.java @@ -10,7 +10,7 @@ import com.jozufozu.flywheel.backend.gl.GlTextureUnit; import com.jozufozu.flywheel.util.Pair; import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class TextureRenderState implements IRenderState { private static final Map, TextureRenderState> states = new HashMap<>(); diff --git a/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java b/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java index 98f8701f2..ff85c8cfc 100644 --- a/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java +++ b/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java @@ -7,11 +7,11 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.OptifineHandler; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.player.ClientPlayerEntity; -import net.minecraft.util.text.IFormattableTextComponent; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.StringTextComponent; -import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.player.LocalPlayer; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.ChatFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -33,11 +33,11 @@ public enum BooleanConfig { @OnlyIn(Dist.CLIENT) private static void enabled(BooleanDirective state) { - ClientPlayerEntity player = Minecraft.getInstance().player; + LocalPlayer player = Minecraft.getInstance().player; if (player == null || state == null) return; if (state == BooleanDirective.DISPLAY) { - ITextComponent text = new StringTextComponent("Flywheel renderer is currently: ").append(boolToText(FlwConfig.get().client.enabled.get())); + Component text = new TextComponent("Flywheel renderer is currently: ").append(boolToText(FlwConfig.get().client.enabled.get())); player.displayClientMessage(text, false); return; } @@ -47,8 +47,8 @@ public enum BooleanConfig { FlwConfig.get().client.enabled.set(enabled); - ITextComponent text = boolToText(FlwConfig.get().client.enabled.get()).append(new StringTextComponent(" Flywheel renderer").withStyle(TextFormatting.WHITE)); - ITextComponent error = new StringTextComponent("Flywheel renderer does not support Optifine Shaders").withStyle(TextFormatting.RED); + Component text = boolToText(FlwConfig.get().client.enabled.get()).append(new TextComponent(" Flywheel renderer").withStyle(ChatFormatting.WHITE)); + Component error = new TextComponent("Flywheel renderer does not support Optifine Shaders").withStyle(ChatFormatting.RED); player.displayClientMessage(cannotUse ? error : text, false); Backend.reloadWorldRenderers(); @@ -56,42 +56,42 @@ public enum BooleanConfig { @OnlyIn(Dist.CLIENT) private static void normalOverlay(BooleanDirective state) { - ClientPlayerEntity player = Minecraft.getInstance().player; + LocalPlayer player = Minecraft.getInstance().player; if (player == null || state == null) return; if (state == BooleanDirective.DISPLAY) { - ITextComponent text = new StringTextComponent("Normal debug mode is currently: ").append(boolToText(FlwConfig.get().client.debugNormals.get())); + Component text = new TextComponent("Normal debug mode is currently: ").append(boolToText(FlwConfig.get().client.debugNormals.get())); player.displayClientMessage(text, false); return; } FlwConfig.get().client.debugNormals.set(state.get()); - ITextComponent text = boolToText(FlwConfig.get().client.debugNormals.get()).append(new StringTextComponent(" normal debug mode").withStyle(TextFormatting.WHITE)); + Component text = boolToText(FlwConfig.get().client.debugNormals.get()).append(new TextComponent(" normal debug mode").withStyle(ChatFormatting.WHITE)); player.displayClientMessage(text, false); } @OnlyIn(Dist.CLIENT) private static void chunkCaching(BooleanDirective state) { - ClientPlayerEntity player = Minecraft.getInstance().player; + LocalPlayer player = Minecraft.getInstance().player; if (player == null || state == null) return; if (state == BooleanDirective.DISPLAY) { - ITextComponent text = new StringTextComponent("Chunk caching is currently: ").append(boolToText(FlwConfig.get().client.chunkCaching.get())); + Component text = new TextComponent("Chunk caching is currently: ").append(boolToText(FlwConfig.get().client.chunkCaching.get())); player.displayClientMessage(text, false); return; } FlwConfig.get().client.chunkCaching.set(state.get()); - ITextComponent text = boolToText(FlwConfig.get().client.chunkCaching.get()).append(new StringTextComponent(" chunk caching").withStyle(TextFormatting.WHITE)); + Component text = boolToText(FlwConfig.get().client.chunkCaching.get()).append(new TextComponent(" chunk caching").withStyle(ChatFormatting.WHITE)); player.displayClientMessage(text, false); Backend.reloadWorldRenderers(); } - private static IFormattableTextComponent boolToText(boolean b) { - return b ? new StringTextComponent("enabled").withStyle(TextFormatting.DARK_GREEN) : new StringTextComponent("disabled").withStyle(TextFormatting.RED); + private static MutableComponent boolToText(boolean b) { + return b ? new TextComponent("enabled").withStyle(ChatFormatting.DARK_GREEN) : new TextComponent("disabled").withStyle(ChatFormatting.RED); } } diff --git a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java index 61b2cd351..635cc6e8a 100644 --- a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java +++ b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java @@ -3,9 +3,9 @@ package com.jozufozu.flywheel.config; import com.mojang.brigadier.Command; import com.mojang.brigadier.builder.ArgumentBuilder; -import net.minecraft.command.CommandSource; -import net.minecraft.command.Commands; -import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.Commands; +import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.fml.network.PacketDistributor; public class BooleanConfigCommand { @@ -19,24 +19,24 @@ public class BooleanConfigCommand { this.value = value; } - public ArgumentBuilder register() { + public ArgumentBuilder register() { return Commands.literal(name) .executes(context -> { - ServerPlayerEntity player = context.getSource() + ServerPlayer player = context.getSource() .getPlayerOrException(); FlwPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new SConfigureBooleanPacket(value, BooleanDirective.DISPLAY)); return Command.SINGLE_SUCCESS; }) .then(Commands.literal("on") .executes(context -> { - ServerPlayerEntity player = context.getSource() + ServerPlayer player = context.getSource() .getPlayerOrException(); FlwPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new SConfigureBooleanPacket(value, BooleanDirective.TRUE)); return Command.SINGLE_SUCCESS; })) .then(Commands.literal("off") .executes(context -> { - ServerPlayerEntity player = context.getSource() + ServerPlayer player = context.getSource() .getPlayerOrException(); FlwPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new SConfigureBooleanPacket(value, BooleanDirective.FALSE)); return Command.SINGLE_SUCCESS; diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java index a601971cb..4929a4106 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java @@ -2,15 +2,15 @@ package com.jozufozu.flywheel.config; import com.mojang.brigadier.CommandDispatcher; -import net.minecraft.command.CommandSource; -import net.minecraft.command.Commands; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.Commands; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; public class FlwCommands { @SubscribeEvent public static void onServerStarting(FMLServerStartingEvent event) { - CommandDispatcher dispatcher = event.getServer() + CommandDispatcher dispatcher = event.getServer() .getCommands() .getDispatcher(); diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java b/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java index 2d7fe261a..1cfda4c5a 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.config; import com.jozufozu.flywheel.Flywheel; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.fml.network.NetworkDirection; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; diff --git a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java index 6d2c97394..14934bc91 100644 --- a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java +++ b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.config; import java.util.function.Supplier; -import net.minecraft.network.PacketBuffer; +import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.fml.network.NetworkEvent; /** @@ -18,12 +18,12 @@ public class SConfigureBooleanPacket { this.directive = directive; } - public SConfigureBooleanPacket(PacketBuffer buffer) { + public SConfigureBooleanPacket(FriendlyByteBuf buffer) { target = BooleanConfig.values()[buffer.readByte()]; directive = BooleanDirective.values()[buffer.readByte()]; } - public void encode(PacketBuffer buffer) { + public void encode(FriendlyByteBuf buffer) { buffer.writeByte(target.ordinal()); buffer.writeByte(directive.ordinal()); } diff --git a/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java b/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java index 49f658d3a..507800a23 100644 --- a/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java +++ b/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.core; import java.util.ArrayList; import java.util.List; -import net.minecraft.inventory.container.PlayerContainer; -import net.minecraft.util.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.event.TextureStitchEvent; /** @@ -30,7 +30,7 @@ public class AtlasStitcher { public void onTextureStitch(TextureStitchEvent.Pre event) { if (!event.getMap() .location() - .equals(PlayerContainer.BLOCK_ATLAS)) return; + .equals(InventoryMenu.BLOCK_ATLAS)) return; sprites.forEach(StitchedSprite::reset); sprites.stream() diff --git a/src/main/java/com/jozufozu/flywheel/core/Contexts.java b/src/main/java/com/jozufozu/flywheel/core/Contexts.java index 1c70d0b51..bd5a8de66 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Contexts.java +++ b/src/main/java/com/jozufozu/flywheel/core/Contexts.java @@ -16,7 +16,7 @@ import com.jozufozu.flywheel.core.shader.gamestate.NormalDebugStateProvider; import com.jozufozu.flywheel.event.GatherContextEvent; import com.jozufozu.flywheel.util.ResourceUtil; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/com/jozufozu/flywheel/core/Materials.java b/src/main/java/com/jozufozu/flywheel/core/Materials.java index 6a41bdcb2..2103fe812 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Materials.java +++ b/src/main/java/com/jozufozu/flywheel/core/Materials.java @@ -8,7 +8,7 @@ import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedType; import com.jozufozu.flywheel.event.GatherContextEvent; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java index 198c8c8ba..d965b687d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.model.ModelLoader; @@ -27,7 +27,7 @@ public class PartialModel { private static final List all = new ArrayList<>(); protected final ResourceLocation modelLocation; - protected IBakedModel bakedModel; + protected BakedModel bakedModel; public PartialModel(ResourceLocation modelLocation) { @@ -45,12 +45,12 @@ public class PartialModel { } public static void onModelBake(ModelBakeEvent event) { - Map modelRegistry = event.getModelRegistry(); + Map modelRegistry = event.getModelRegistry(); for (PartialModel partial : all) partial.bakedModel = modelRegistry.get(partial.modelLocation); } - public IBakedModel get() { + public BakedModel get() { return bakedModel; } diff --git a/src/main/java/com/jozufozu/flywheel/core/Programs.java b/src/main/java/com/jozufozu/flywheel/core/Programs.java index a6553208f..5ed04b767 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Programs.java +++ b/src/main/java/com/jozufozu/flywheel/core/Programs.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.core; import com.jozufozu.flywheel.Flywheel; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class Programs { public static final ResourceLocation TRANSFORMED = new ResourceLocation(Flywheel.ID, "model"); diff --git a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java index 5d8498e55..f8badcd2d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java +++ b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java @@ -2,8 +2,8 @@ package com.jozufozu.flywheel.core; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.inventory.container.PlayerContainer; -import net.minecraft.util.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.resources.ResourceLocation; public class StitchedSprite { @@ -22,7 +22,7 @@ public class StitchedSprite { public TextureAtlasSprite getSprite() { if (sprite == null) { sprite = Minecraft.getInstance() - .getTextureAtlas(PlayerContainer.BLOCK_ATLAS) + .getTextureAtlas(InventoryMenu.BLOCK_ATLAS) .apply(loc); } diff --git a/src/main/java/com/jozufozu/flywheel/core/WorldContext.java b/src/main/java/com/jozufozu/flywheel/core/WorldContext.java index d13d90f08..063d8d27a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/WorldContext.java +++ b/src/main/java/com/jozufozu/flywheel/core/WorldContext.java @@ -13,7 +13,7 @@ import com.jozufozu.flywheel.core.shader.IMultiProgram; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class WorldContext

implements IShaderContext

{ public final Backend backend; diff --git a/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java b/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java index fe7dc6358..584d94a6a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java +++ b/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java @@ -6,20 +6,20 @@ import java.util.Map; import com.jozufozu.flywheel.mixin.atlas.SheetDataAccessor; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.AtlasTexture; -import net.minecraft.client.renderer.texture.Texture; +import net.minecraft.client.renderer.texture.TextureAtlas; +import net.minecraft.client.renderer.texture.AbstractTexture; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class AtlasInfo { private static final Map sheetData = new HashMap<>(); - public static AtlasTexture getAtlas(ResourceLocation name) { - Texture texture = Minecraft.getInstance().textureManager.getTexture(name); + public static TextureAtlas getAtlas(ResourceLocation name) { + AbstractTexture texture = Minecraft.getInstance().textureManager.getTexture(name); - if (texture instanceof AtlasTexture) - return (AtlasTexture) texture; + if (texture instanceof TextureAtlas) + return (TextureAtlas) texture; else return null; } @@ -28,7 +28,7 @@ public class AtlasInfo { return getAtlasData(texture.atlas()); } - public static SheetData getAtlasData(AtlasTexture atlas) { + public static SheetData getAtlasData(TextureAtlas atlas) { return getAtlasData(atlas.location()); } diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java index ef3b24588..59614b28a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java @@ -7,7 +7,7 @@ import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.core.atlas.AtlasInfo; import com.jozufozu.flywheel.core.atlas.SheetData; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class CrumblingGroup

extends MaterialGroupImpl

{ diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java index 059b366b1..814b83af6 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.crumbling; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; -import net.minecraft.util.math.BlockPos; +import net.minecraft.core.BlockPos; public class CrumblingInstanceManager extends TileInstanceManager { diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingProgram.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingProgram.java index 6cf73dfdc..61b3d9482 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingProgram.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingProgram.java @@ -8,11 +8,11 @@ import com.jozufozu.flywheel.core.atlas.AtlasInfo; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; -import net.minecraft.client.renderer.model.ModelBakery; -import net.minecraft.client.renderer.texture.AtlasTexture; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.inventory.container.PlayerContainer; -import net.minecraft.util.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.resources.ResourceLocation; public class CrumblingProgram extends WorldProgram { protected final int uTextureScale; @@ -35,7 +35,7 @@ public class CrumblingProgram extends WorldProgram { } public void setAtlasSize(int width, int height) { - AtlasTexture blockAtlas = AtlasInfo.getAtlas(PlayerContainer.BLOCK_ATLAS); + TextureAtlas blockAtlas = AtlasInfo.getAtlas(InventoryMenu.BLOCK_ATLAS); if (blockAtlas == null) return; TextureAtlasSprite sprite = blockAtlas.getSprite(ModelBakery.BREAKING_LOCATIONS.get(0)); diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java index a9cec34c1..55278e76f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java @@ -21,16 +21,16 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.client.renderer.DestroyBlockProgress; +import net.minecraft.client.Camera; +import net.minecraft.server.level.BlockDestructionProgress; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.model.ModelBakery; -import net.minecraft.client.renderer.texture.Texture; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.renderer.texture.AbstractTexture; import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.core.BlockPos; +import com.mojang.math.Matrix4f; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -53,28 +53,28 @@ public class CrumblingRenderer { INVALIDATOR = state.getSecond(); } - public static void renderBreaking(ClientWorld world, Matrix4f viewProjection, double cameraX, double cameraY, double cameraZ) { + public static void renderBreaking(ClientLevel world, Matrix4f viewProjection, double cameraX, double cameraY, double cameraZ) { if (!Backend.getInstance() .canUseInstancing(world)) return; - Int2ObjectMap> activeStages = getActiveStageTiles(world); + Int2ObjectMap> activeStages = getActiveStageTiles(world); if (activeStages.isEmpty()) return; State state = STATE.get(); RenderType layer = ModelBakery.DESTROY_TYPES.get(0); - InstanceManager renderer = state.instanceManager; + InstanceManager renderer = state.instanceManager; TextureManager textureManager = Minecraft.getInstance().textureManager; - ActiveRenderInfo info = Minecraft.getInstance().gameRenderer.getMainCamera(); + Camera info = Minecraft.getInstance().gameRenderer.getMainCamera(); MaterialManagerImpl materials = state.materialManager; layer.setupRenderState(); - for (Int2ObjectMap.Entry> stage : activeStages.int2ObjectEntrySet()) { + for (Int2ObjectMap.Entry> stage : activeStages.int2ObjectEntrySet()) { int i = stage.getIntKey(); - Texture breaking = textureManager.getTexture(ModelBakery.BREAKING_LOCATIONS.get(i)); + AbstractTexture breaking = textureManager.getTexture(ModelBakery.BREAKING_LOCATIONS.get(i)); // something about when we call this means that the textures are not ready for use on the first frame they should appear if (breaking != null) { @@ -94,30 +94,30 @@ public class CrumblingRenderer { layer.clearRenderState(); GlTextureUnit.T0.makeActive(); - Texture breaking = textureManager.getTexture(ModelBakery.BREAKING_LOCATIONS.get(0)); + AbstractTexture breaking = textureManager.getTexture(ModelBakery.BREAKING_LOCATIONS.get(0)); if (breaking != null) glBindTexture(GL_TEXTURE_2D, breaking.getId()); } /** * Associate each breaking stage with a list of all tile entities at that stage. */ - private static Int2ObjectMap> getActiveStageTiles(ClientWorld world) { - Long2ObjectMap> breakingProgressions = Minecraft.getInstance().levelRenderer.destructionProgress; + private static Int2ObjectMap> getActiveStageTiles(ClientLevel world) { + Long2ObjectMap> breakingProgressions = Minecraft.getInstance().levelRenderer.destructionProgress; - Int2ObjectMap> breakingEntities = new Int2ObjectArrayMap<>(); + Int2ObjectMap> breakingEntities = new Int2ObjectArrayMap<>(); - for (Long2ObjectMap.Entry> entry : breakingProgressions.long2ObjectEntrySet()) { + for (Long2ObjectMap.Entry> entry : breakingProgressions.long2ObjectEntrySet()) { BlockPos breakingPos = BlockPos.of(entry.getLongKey()); - SortedSet progresses = entry.getValue(); + SortedSet progresses = entry.getValue(); if (progresses != null && !progresses.isEmpty()) { int blockDamage = progresses.last() .getProgress(); - TileEntity tileEntity = world.getBlockEntity(breakingPos); + BlockEntity tileEntity = world.getBlockEntity(breakingPos); if (tileEntity != null) { - List tileEntities = breakingEntities.computeIfAbsent(blockDamage, $ -> new ArrayList<>()); + List tileEntities = breakingEntities.computeIfAbsent(blockDamage, $ -> new ArrayList<>()); tileEntities.add(tileEntity); } } @@ -128,7 +128,7 @@ public class CrumblingRenderer { @SubscribeEvent public static void onReloadRenderers(ReloadRenderersEvent event) { - ClientWorld world = event.getWorld(); + ClientLevel world = event.getWorld(); if (Backend.getInstance() .canUseInstancing() && world != null) { reset(); @@ -141,7 +141,7 @@ public class CrumblingRenderer { private static class State { private final MaterialManagerImpl materialManager; - private final InstanceManager instanceManager; + private final InstanceManager instanceManager; private State() { materialManager = MaterialManagerImpl.builder(Contexts.CRUMBLING) diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelData.java b/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelData.java index 94a481097..ff225c0ea 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelData.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelData.java @@ -3,14 +3,14 @@ package com.jozufozu.flywheel.core.materials.model; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.materials.BasicData; import com.jozufozu.flywheel.util.RenderUtil; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; public class ModelData extends BasicData { private static final float[] empty = new float[25]; public float[] matrices = empty; - public ModelData setTransform(MatrixStack stack) { + public ModelData setTransform(PoseStack stack) { matrices = RenderUtil.writeMatrixStack(stack); markDirty(); return this; 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 fa460e9a9..02897c1d4 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 @@ -4,10 +4,10 @@ import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.materials.BasicData; import com.jozufozu.flywheel.util.vec.Vec3; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3f; +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 +55,7 @@ public class OrientedData extends BasicData { return setPosition(pos.x(), pos.y(), pos.z()); } - public OrientedData setPivot(Vector3d pos) { + public OrientedData setPivot(Vec3 pos) { return setPosition((float) pos.x(), (float) pos.y(), (float) pos.z()); } diff --git a/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java b/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java index df2259792..314cf9092 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java @@ -17,13 +17,13 @@ import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.util.VirtualEmptyModelData; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.color.ItemColors; -import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Vector3f; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.client.color.item.ItemColors; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.BakedModel; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import net.minecraft.core.Direction; +import com.mojang.math.Vector3f; +import net.minecraft.core.Vec3i; public class BakedModelModel implements IModel { // DOWN, UP, NORTH, SOUTH, WEST, EAST, null @@ -36,10 +36,10 @@ public class BakedModelModel implements IModel { } - public final IBakedModel model; + public final BakedModel model; private final int numQuads; - public BakedModelModel(IBakedModel model) { + public BakedModelModel(BakedModel model) { this.model = model; Random random = new Random(); @@ -80,13 +80,13 @@ public class BakedModelModel implements IModel { // byte blue = (byte)(i & 255); int[] aint = bakedQuad.getVertices(); - Vector3i faceNormal = bakedQuad.getDirection().getNormal(); + Vec3i faceNormal = bakedQuad.getDirection().getNormal(); Vector3f normal = new Vector3f((float)faceNormal.getX(), (float)faceNormal.getY(), (float)faceNormal.getZ()); - int intSize = DefaultVertexFormats.BLOCK.getIntegerSize(); + int intSize = DefaultVertexFormat.BLOCK.getIntegerSize(); int vertexCount = aint.length / intSize; try (MemoryStack memorystack = MemoryStack.stackPush()) { - ByteBuffer bytebuffer = memorystack.malloc(DefaultVertexFormats.BLOCK.getVertexSize()); + ByteBuffer bytebuffer = memorystack.malloc(DefaultVertexFormat.BLOCK.getVertexSize()); IntBuffer intbuffer = bytebuffer.asIntBuffer(); for(int j = 0; j < vertexCount; ++j) { 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 e582ac228..6792ff1ce 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java @@ -9,24 +9,24 @@ import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.util.BufferBuilderReader; import com.jozufozu.flywheel.util.VirtualEmptyModelData; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.block.BlockState; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockModelRenderer; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.block.ModelBlockRenderer; +import net.minecraft.client.renderer.block.BlockRenderDispatcher; +import com.mojang.blaze3d.vertex.BufferBuilder; +import net.minecraft.client.resources.model.BakedModel; import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.Direction; -import net.minecraft.util.math.BlockPos; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import net.minecraft.core.Direction; +import net.minecraft.core.BlockPos; /** * A model of a single block. */ public class BlockModel implements IModel { - private static final MatrixStack IDENTITY = new MatrixStack(); + private static final PoseStack IDENTITY = new PoseStack(); private final BufferBuilderReader reader; @@ -36,11 +36,11 @@ public class BlockModel implements IModel { .getBlockModel(state), state); } - public BlockModel(IBakedModel model, BlockState referenceState) { + public BlockModel(BakedModel model, BlockState referenceState) { this(model, referenceState, IDENTITY); } - public BlockModel(IBakedModel model, BlockState referenceState, MatrixStack ms) { + public BlockModel(BakedModel model, BlockState referenceState, PoseStack ms) { reader = new BufferBuilderReader(getBufferBuilder(model, referenceState, ms)); } @@ -68,10 +68,10 @@ public class BlockModel implements IModel { } } - public static BufferBuilder getBufferBuilder(IBakedModel model, BlockState referenceState, MatrixStack ms) { + public static BufferBuilder getBufferBuilder(BakedModel model, BlockState referenceState, PoseStack ms) { Minecraft mc = Minecraft.getInstance(); - BlockRendererDispatcher dispatcher = mc.getBlockRenderer(); - BlockModelRenderer blockRenderer = dispatcher.getModelRenderer(); + BlockRenderDispatcher dispatcher = mc.getBlockRenderer(); + ModelBlockRenderer blockRenderer = dispatcher.getModelRenderer(); BufferBuilder builder = new BufferBuilder(512); // BakedQuadWrapper quadReader = new BakedQuadWrapper(); @@ -81,7 +81,7 @@ public class BlockModel implements IModel { // .flatMap(dir -> model.getQuads(referenceState, dir, mc.world.rand, modelData).stream()) // .collect(Collectors.toList()); - builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + 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.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 4f5fc6362..f138d80f7 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java @@ -5,43 +5,43 @@ import static org.lwjgl.opengl.GL11.GL_QUADS; import java.util.Collection; import java.util.Random; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.block.BlockRenderType; -import net.minecraft.block.BlockState; +import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockModelRenderer; -import net.minecraft.client.renderer.BlockModelShapes; -import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.block.ModelBlockRenderer; +import net.minecraft.client.renderer.block.BlockModelShaper; +import com.mojang.blaze3d.vertex.BufferBuilder; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockDisplayReader; -import net.minecraft.world.gen.feature.template.Template; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.common.util.Lazy; public class ModelUtil { - private static final Lazy MODEL_RENDERER = Lazy.of(() -> new BlockModelRenderer(Minecraft.getInstance().getBlockColors())); - private static final Lazy BLOCK_MODELS = Lazy.of(() -> Minecraft.getInstance().getModelManager().getBlockModelShaper()); + private static final Lazy MODEL_RENDERER = Lazy.of(() -> new ModelBlockRenderer(Minecraft.getInstance().getBlockColors())); + private static final Lazy BLOCK_MODELS = Lazy.of(() -> Minecraft.getInstance().getModelManager().getBlockModelShaper()); - public static BufferBuilder getBufferBuilderFromTemplate(IBlockDisplayReader renderWorld, RenderType layer, Collection blocks) { - MatrixStack ms = new MatrixStack(); + public static BufferBuilder getBufferBuilderFromTemplate(BlockAndTintGetter renderWorld, RenderType layer, Collection blocks) { + PoseStack ms = new PoseStack(); Random random = new Random(); - BufferBuilder builder = new BufferBuilder(DefaultVertexFormats.BLOCK.getIntegerSize()); - builder.begin(GL_QUADS, DefaultVertexFormats.BLOCK); + BufferBuilder builder = new BufferBuilder(DefaultVertexFormat.BLOCK.getIntegerSize()); + builder.begin(GL_QUADS, DefaultVertexFormat.BLOCK); ForgeHooksClient.setRenderLayer(layer); - BlockModelRenderer.enableCaching(); - for (Template.BlockInfo info : blocks) { + ModelBlockRenderer.enableCaching(); + for (StructureTemplate.StructureBlockInfo info : blocks) { BlockState state = info.state; - if (state.getRenderShape() != BlockRenderType.MODEL) + if (state.getRenderShape() != RenderShape.MODEL) continue; - if (!RenderTypeLookup.canRenderInLayer(state, layer)) + if (!ItemBlockRenderTypes.canRenderInLayer(state, layer)) continue; BlockPos pos = info.pos; @@ -52,7 +52,7 @@ public class ModelUtil { random, 42, OverlayTexture.NO_OVERLAY, EmptyModelData.INSTANCE); ms.popPose(); } - BlockModelRenderer.clearCache(); + ModelBlockRenderer.clearCache(); ForgeHooksClient.setRenderLayer(null); builder.end(); diff --git a/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java b/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java index 74759a800..96a1a033d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java @@ -10,10 +10,10 @@ import java.util.Set; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Matrix3f; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.core.Direction; +import com.mojang.math.Matrix3f; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; public class PartBuilder { diff --git a/src/main/java/com/jozufozu/flywheel/core/model/Readable.java b/src/main/java/com/jozufozu/flywheel/core/model/Readable.java index 6f2399111..80d519dcb 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/Readable.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/Readable.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.core.model; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.core.Direction; +import com.mojang.math.Vector3f; public class Readable { public static class ModelBox { diff --git a/src/main/java/com/jozufozu/flywheel/core/model/WorldModel.java b/src/main/java/com/jozufozu/flywheel/core/model/WorldModel.java index fa2001d0d..938d5cdca 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/WorldModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/WorldModel.java @@ -9,14 +9,14 @@ import com.jozufozu.flywheel.util.BufferBuilderReader; import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.RenderType; -import net.minecraft.world.IBlockDisplayReader; -import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; public class WorldModel implements IModel { private final BufferBuilderReader reader; - public WorldModel(IBlockDisplayReader renderWorld, RenderType layer, Collection blocks) { + public WorldModel(BlockAndTintGetter renderWorld, RenderType layer, Collection blocks) { reader = new BufferBuilderReader(ModelUtil.getBufferBuilderFromTemplate(renderWorld, layer, blocks)); } diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/ExtensibleGlProgram.java b/src/main/java/com/jozufozu/flywheel/core/shader/ExtensibleGlProgram.java index 9c80ae081..2331f9d92 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/ExtensibleGlProgram.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/ExtensibleGlProgram.java @@ -11,7 +11,7 @@ import com.jozufozu.flywheel.backend.gl.shader.GlProgram; import com.jozufozu.flywheel.core.shader.extension.IExtensionInstance; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * A shader program that be arbitrarily "extended". This class can take in any number of program extensions, and diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/FogMode.java b/src/main/java/com/jozufozu/flywheel/core/shader/FogMode.java index 2ff577b0a..6dc8ed881 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/FogMode.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/FogMode.java @@ -6,7 +6,7 @@ import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; import com.jozufozu.flywheel.core.shader.extension.IExtensionInstance; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public abstract class FogMode { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/WorldFog.java b/src/main/java/com/jozufozu/flywheel/core/shader/WorldFog.java index 0f8243f85..670a4a1f7 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/WorldFog.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/WorldFog.java @@ -8,7 +8,7 @@ import com.jozufozu.flywheel.core.shader.extension.IExtensionInstance; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; import com.jozufozu.flywheel.core.shader.extension.UnitExtensionInstance; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public enum WorldFog implements IProgramExtension { NONE("none", UnitExtensionInstance::new), diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java b/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java index 37268ded0..a6b6a4037 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java @@ -9,10 +9,10 @@ import java.util.List; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; import com.jozufozu.flywheel.util.AnimationTickHolder; -import net.minecraft.client.MainWindow; +import com.mojang.blaze3d.platform.Window; import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.resources.ResourceLocation; +import com.mojang.math.Matrix4f; public class WorldProgram extends ExtensibleGlProgram { protected final int uTime = getUniformLocation("uTime"); @@ -45,7 +45,7 @@ public class WorldProgram extends ExtensibleGlProgram { public void uploadWindowSize() { if (uWindowSize < 0) return; - MainWindow window = Minecraft.getInstance().getWindow(); + Window window = Minecraft.getInstance().getWindow(); int height = window.getScreenHeight(); int width = window.getScreenWidth(); diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/extension/IExtensionInstance.java b/src/main/java/com/jozufozu/flywheel/core/shader/extension/IExtensionInstance.java index 8cd43311e..7bc070158 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/extension/IExtensionInstance.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/extension/IExtensionInstance.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.core.shader.extension; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public interface IExtensionInstance { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/extension/IProgramExtension.java b/src/main/java/com/jozufozu/flywheel/core/shader/extension/IProgramExtension.java index bdc3701ec..0767c46bf 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/extension/IProgramExtension.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/extension/IProgramExtension.java @@ -4,7 +4,7 @@ import com.jozufozu.flywheel.backend.SpecMetaRegistry; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; import com.mojang.serialization.Codec; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * A factory interface for creating {@link IExtensionInstance}s. These are what end up being passed in diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/extension/UnitExtensionInstance.java b/src/main/java/com/jozufozu/flywheel/core/shader/extension/UnitExtensionInstance.java index bab1a4bea..7b5773aa2 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/extension/UnitExtensionInstance.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/extension/UnitExtensionInstance.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.shader.extension; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.backend.gl.shader.GlProgram; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class UnitExtensionInstance implements IExtensionInstance { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/FogStateProvider.java b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/FogStateProvider.java index 8423896ea..91df1d037 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/FogStateProvider.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/FogStateProvider.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.shader.gamestate; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.core.shader.GlFog; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class FogStateProvider implements IGameStateProvider { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/IGameStateProvider.java b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/IGameStateProvider.java index 17ece39ec..587dd2c9f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/IGameStateProvider.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/IGameStateProvider.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.shader.gamestate; import com.jozufozu.flywheel.backend.SpecMetaRegistry; import com.mojang.serialization.Codec; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public interface IGameStateProvider { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/NormalDebugStateProvider.java b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/NormalDebugStateProvider.java index 60084241a..a1efdbf5f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/NormalDebugStateProvider.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/gamestate/NormalDebugStateProvider.java @@ -4,7 +4,7 @@ import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.config.FlwConfig; import com.jozufozu.flywheel.core.shader.spec.IBooleanStateProvider; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class NormalDebugStateProvider implements IBooleanStateProvider { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/spec/BooleanGameStateCondition.java b/src/main/java/com/jozufozu/flywheel/core/shader/spec/BooleanGameStateCondition.java index 91534d176..6293ade94 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/spec/BooleanGameStateCondition.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/spec/BooleanGameStateCondition.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.shader.spec; import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider; import com.mojang.serialization.Codec; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class BooleanGameStateCondition implements IGameStateCondition { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/spec/IGameStateCondition.java b/src/main/java/com/jozufozu/flywheel/core/shader/spec/IGameStateCondition.java index da51a2405..08fd87dc3 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/spec/IGameStateCondition.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/spec/IGameStateCondition.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.core.shader.spec; import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public interface IGameStateCondition { diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/spec/ProgramSpec.java b/src/main/java/com/jozufozu/flywheel/core/shader/spec/ProgramSpec.java index 97553cd9d..3716caef2 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/spec/ProgramSpec.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/spec/ProgramSpec.java @@ -9,7 +9,7 @@ import com.jozufozu.flywheel.backend.source.SourceFile; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; /** * An object describing a shader program that can be loaded by flywheel. diff --git a/src/main/java/com/jozufozu/flywheel/core/shader/spec/SpecificValueCondition.java b/src/main/java/com/jozufozu/flywheel/core/shader/spec/SpecificValueCondition.java index d508feae6..dd81e465c 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/spec/SpecificValueCondition.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/spec/SpecificValueCondition.java @@ -4,7 +4,7 @@ import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class SpecificValueCondition implements IGameStateCondition { diff --git a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java b/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java index 4b4800266..e95073f61 100644 --- a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java +++ b/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java @@ -1,35 +1,35 @@ package com.jozufozu.flywheel.event; -import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.client.renderer.culling.ClippingHelper; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.client.Camera; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.phys.Vec3; import net.minecraftforge.eventbus.api.Event; public class BeginFrameEvent extends Event { - private final ClientWorld world; - private final ActiveRenderInfo info; - private final ClippingHelper clippingHelper; + private final ClientLevel world; + private final Camera info; + private final Frustum clippingHelper; - public BeginFrameEvent(ClientWorld world, ActiveRenderInfo info, ClippingHelper clippingHelper) { + public BeginFrameEvent(ClientLevel world, Camera info, Frustum clippingHelper) { this.world = world; this.info = info; this.clippingHelper = clippingHelper; } - public ClientWorld getWorld() { + public ClientLevel getWorld() { return world; } - public ActiveRenderInfo getInfo() { + public Camera getInfo() { return info; } - public ClippingHelper getClippingHelper() { + public Frustum getClippingHelper() { return clippingHelper; } - public Vector3d getCameraPos() { + public Vec3 getCameraPos() { return info.getPosition(); } } diff --git a/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java b/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java index 1b2b37961..a4b454362 100644 --- a/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java +++ b/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java @@ -7,8 +7,8 @@ import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.light.LightUpdater; import net.minecraft.client.Minecraft; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.world.IWorld; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.level.LevelAccessor; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.TickEvent; @@ -40,10 +40,10 @@ public class ForgeEvents { @SubscribeEvent public static void onLoadWorld(WorldEvent.Load event) { - IWorld world = event.getWorld(); + LevelAccessor world = event.getWorld(); if (Backend.isFlywheelWorld(world)) { - InstancedRenderDispatcher.loadAllInWorld((ClientWorld) world); + InstancedRenderDispatcher.loadAllInWorld((ClientLevel) world); } } diff --git a/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java b/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java index aad67e6fd..27136570c 100644 --- a/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java +++ b/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java @@ -2,18 +2,18 @@ package com.jozufozu.flywheel.event; import javax.annotation.Nullable; -import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraftforge.eventbus.api.Event; public class ReloadRenderersEvent extends Event { - private final ClientWorld world; + private final ClientLevel world; - public ReloadRenderersEvent(ClientWorld world) { + public ReloadRenderersEvent(ClientLevel world) { this.world = world; } @Nullable - public ClientWorld getWorld() { + public ClientLevel getWorld() { return world; } } diff --git a/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java b/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java index e47f2886c..25573406c 100644 --- a/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java +++ b/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java @@ -4,26 +4,26 @@ import javax.annotation.Nullable; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.state.RenderLayer; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.RenderTypeBuffers; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.client.renderer.RenderBuffers; +import net.minecraft.client.multiplayer.ClientLevel; +import com.mojang.math.Matrix4f; import net.minecraftforge.eventbus.api.Event; public class RenderLayerEvent extends Event { - private final ClientWorld world; + private final ClientLevel world; public final RenderType type; - public final MatrixStack stack; + public final PoseStack stack; public final Matrix4f viewProjection; - public final RenderTypeBuffers buffers; + public final RenderBuffers buffers; public final double camX; public final double camY; public final double camZ; public final RenderLayer layer; - public RenderLayerEvent(ClientWorld world, RenderType type, MatrixStack stack, RenderTypeBuffers buffers, double camX, double camY, double camZ) { + public RenderLayerEvent(ClientLevel world, RenderType type, PoseStack stack, RenderBuffers buffers, double camX, double camY, double camZ) { this.world = world; this.type = type; this.stack = stack; @@ -47,7 +47,7 @@ public class RenderLayerEvent extends Event { return layer; } - public ClientWorld getWorld() { + public ClientLevel getWorld() { return world; } diff --git a/src/main/java/com/jozufozu/flywheel/light/BasicProvider.java b/src/main/java/com/jozufozu/flywheel/light/BasicProvider.java index ac3af492c..6ddc4d5fd 100644 --- a/src/main/java/com/jozufozu/flywheel/light/BasicProvider.java +++ b/src/main/java/com/jozufozu/flywheel/light/BasicProvider.java @@ -3,28 +3,28 @@ package com.jozufozu.flywheel.light; import java.util.Map; import java.util.WeakHashMap; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockDisplayReader; -import net.minecraft.world.LightType; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.LightLayer; public class BasicProvider implements LightProvider { - private static final Map wrappers = new WeakHashMap<>(); + private static final Map wrappers = new WeakHashMap<>(); - public static BasicProvider get(IBlockDisplayReader world) { + public static BasicProvider get(BlockAndTintGetter world) { return wrappers.computeIfAbsent(world, BasicProvider::new); } - private final BlockPos.Mutable pos = new BlockPos.Mutable(); + private final BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(); - private final IBlockDisplayReader reader; + private final BlockAndTintGetter reader; - public BasicProvider(IBlockDisplayReader reader) { + public BasicProvider(BlockAndTintGetter reader) { this.reader = reader; } @Override - public int getLight(LightType type, int x, int y, int z) { + public int getLight(LightLayer type, int x, int y, int z) { return reader.getBrightness(type, pos.set(x, y, z)); } } diff --git a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java index 54d646e22..48ee19f44 100644 --- a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java @@ -28,7 +28,7 @@ import com.jozufozu.flywheel.backend.gl.GlTexture; import com.jozufozu.flywheel.backend.gl.GlTextureUnit; import com.jozufozu.flywheel.backend.gl.versioned.RGPixelFormat; -import net.minecraft.world.LightType; +import net.minecraft.world.level.LightLayer; public class GPULightVolume extends LightVolume { @@ -128,7 +128,7 @@ public class GPULightVolume extends LightVolume { } } - public void onLightUpdate(LightProvider world, LightType type, ImmutableBox changedVolume) { + public void onLightUpdate(LightProvider world, LightLayer type, ImmutableBox changedVolume) { super.onLightUpdate(world, type, changedVolume); bufferDirty = true; } diff --git a/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java b/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java index 13fbe1d41..c1285e138 100644 --- a/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java +++ b/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java @@ -2,11 +2,11 @@ package com.jozufozu.flywheel.light; import com.jozufozu.flywheel.util.RenderUtil; -import net.minecraft.util.Direction; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.SectionPos; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.core.Direction; +import net.minecraft.world.phys.AABB; +import net.minecraft.core.BlockPos; +import net.minecraft.core.SectionPos; +import net.minecraft.core.Vec3i; public class GridAlignedBB implements ImmutableBox { private int minX; @@ -33,7 +33,7 @@ public class GridAlignedBB implements ImmutableBox { return new GridAlignedBB(-radius, -radius, -radius, radius + 1, radius + 1, radius + 1); } - public static GridAlignedBB from(AxisAlignedBB aabb) { + public static GridAlignedBB from(AABB aabb) { int minX = (int) Math.floor(aabb.minX); int minY = (int) Math.floor(aabb.minY); int minZ = (int) Math.floor(aabb.minZ); @@ -77,7 +77,7 @@ public class GridAlignedBB implements ImmutableBox { this.maxZ = maxZ; } - public void translate(Vector3i by) { + public void translate(Vec3i by) { translate(by.getX(), by.getY(), by.getZ()); } @@ -91,7 +91,7 @@ public class GridAlignedBB implements ImmutableBox { } public void mirrorAbout(Direction.Axis axis) { - Vector3i axisVec = Direction.get(Direction.AxisDirection.POSITIVE, axis) + Vec3i axisVec = Direction.get(Direction.AxisDirection.POSITIVE, axis) .getNormal(); int flipX = axisVec.getX() - 1; int flipY = axisVec.getY() - 1; @@ -176,7 +176,7 @@ public class GridAlignedBB implements ImmutableBox { maxZ = Math.max(this.maxZ, other.getMaxZ()); } - public void unionAssign(AxisAlignedBB other) { + public void unionAssign(AABB other) { minX = Math.min(this.minX, (int) Math.floor(other.minX)); minY = Math.min(this.minY, (int) Math.floor(other.minY)); minZ = Math.min(this.minZ, (int) Math.floor(other.minZ)); @@ -185,7 +185,7 @@ public class GridAlignedBB implements ImmutableBox { maxZ = Math.max(this.maxZ, (int) Math.ceil(other.maxZ)); } - public void assign(AxisAlignedBB other) { + public void assign(AABB other) { minX = (int) Math.floor(other.minX); minY = (int) Math.floor(other.minY); minZ = (int) Math.floor(other.minZ); @@ -294,11 +294,11 @@ public class GridAlignedBB implements ImmutableBox { return this; } - public GridAlignedBB setMax(Vector3i v) { + public GridAlignedBB setMax(Vec3i v) { return setMax(v.getX(), v.getY(), v.getZ()); } - public GridAlignedBB setMin(Vector3i v) { + public GridAlignedBB setMin(Vec3i v) { return setMin(v.getX(), v.getY(), v.getZ()); } @@ -343,7 +343,7 @@ public class GridAlignedBB implements ImmutableBox { } @Override - public boolean sameAs(AxisAlignedBB other) { + public boolean sameAs(AABB other) { return minX == Math.floor(other.minX) && minY == Math.floor(other.minY) && minZ == Math.floor(other.minZ) @@ -398,8 +398,8 @@ public class GridAlignedBB implements ImmutableBox { } @Override - public AxisAlignedBB toAABB() { - return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ); + public AABB toAABB() { + return new AABB(minX, minY, minZ, maxX, maxY, maxZ); } @Override diff --git a/src/main/java/com/jozufozu/flywheel/light/ILightUpdateListener.java b/src/main/java/com/jozufozu/flywheel/light/ILightUpdateListener.java index ac0f8d3f1..dbb6bbfeb 100644 --- a/src/main/java/com/jozufozu/flywheel/light/ILightUpdateListener.java +++ b/src/main/java/com/jozufozu/flywheel/light/ILightUpdateListener.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.light; -import net.minecraft.world.LightType; +import net.minecraft.world.level.LightLayer; public interface ILightUpdateListener { @@ -11,7 +11,7 @@ public interface ILightUpdateListener { /** * Called when a light updates in a chunk the implementor cares about. */ - void onLightUpdate(LightProvider world, LightType type, ImmutableBox changed); + void onLightUpdate(LightProvider world, LightLayer type, ImmutableBox changed); /** * Called when the server sends light data to the client. @@ -20,8 +20,8 @@ public interface ILightUpdateListener { default void onLightPacket(LightProvider world, int chunkX, int chunkZ) { GridAlignedBB changedVolume = GridAlignedBB.from(chunkX, chunkZ); - onLightUpdate(world, LightType.BLOCK, changedVolume); + onLightUpdate(world, LightLayer.BLOCK, changedVolume); - onLightUpdate(world, LightType.SKY, changedVolume); + onLightUpdate(world, LightLayer.SKY, changedVolume); } } diff --git a/src/main/java/com/jozufozu/flywheel/light/ImmutableBox.java b/src/main/java/com/jozufozu/flywheel/light/ImmutableBox.java index 7ae6ac5e2..935a521dc 100644 --- a/src/main/java/com/jozufozu/flywheel/light/ImmutableBox.java +++ b/src/main/java/com/jozufozu/flywheel/light/ImmutableBox.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.light; import static com.jozufozu.flywheel.util.RenderUtil.isPowerOf2; -import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.world.phys.AABB; public interface ImmutableBox { int getMinX(); @@ -42,7 +42,7 @@ public interface ImmutableBox { return getMinX() == other.getMinX() && getMinY() == other.getMinY() && getMinZ() == other.getMinZ() && getMaxX() == other.getMaxX() && getMaxY() == other.getMaxY() && getMaxZ() == other.getMaxZ(); } - default boolean sameAs(AxisAlignedBB other) { + default boolean sameAs(AABB other) { return getMinX() == Math.floor(other.minX) && getMinY() == Math.floor(other.minY) && getMinZ() == Math.floor(other.minZ) @@ -119,8 +119,8 @@ public interface ImmutableBox { } } - default AxisAlignedBB toAABB() { - return new AxisAlignedBB(getMinX(), getMinY(), getMinZ(), getMaxX(), getMaxY(), getMaxZ()); + default AABB toAABB() { + return new AABB(getMinX(), getMinY(), getMinZ(), getMaxX(), getMaxY(), getMaxZ()); } default GridAlignedBB copy() { diff --git a/src/main/java/com/jozufozu/flywheel/light/LightProvider.java b/src/main/java/com/jozufozu/flywheel/light/LightProvider.java index 226c4afa8..c95a04df7 100644 --- a/src/main/java/com/jozufozu/flywheel/light/LightProvider.java +++ b/src/main/java/com/jozufozu/flywheel/light/LightProvider.java @@ -1,12 +1,12 @@ package com.jozufozu.flywheel.light; import net.minecraft.client.renderer.LightTexture; -import net.minecraft.world.LightType; +import net.minecraft.world.level.LightLayer; public interface LightProvider { - int getLight(LightType type, int x, int y, int z); + int getLight(LightLayer type, int x, int y, int z); default int getPackedLight(int x, int y, int z) { - return LightTexture.pack(getLight(LightType.BLOCK, x, y, z), getLight(LightType.SKY, x, y, z)); + return LightTexture.pack(getLight(LightLayer.BLOCK, x, y, z), getLight(LightLayer.SKY, x, y, z)); } } diff --git a/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java b/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java index 7307c21f4..44ac3575d 100644 --- a/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java +++ b/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java @@ -8,18 +8,18 @@ import java.util.stream.Stream; import com.jozufozu.flywheel.util.WeakHashSet; import it.unimi.dsi.fastutil.longs.LongSet; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.SectionPos; -import net.minecraft.world.IBlockDisplayReader; -import net.minecraft.world.LightType; +import net.minecraft.core.BlockPos; +import net.minecraft.core.SectionPos; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.LightLayer; /** * Keeps track of what chunks/sections each listener is in, so we can update exactly what needs to be updated. */ public class LightUpdater { - private static final Map light = new HashMap<>(); - public static LightUpdater get(IBlockDisplayReader world) { + private static final Map light = new HashMap<>(); + public static LightUpdater get(BlockAndTintGetter world) { return light.computeIfAbsent(world, LightUpdater::new); } @@ -29,7 +29,7 @@ public class LightUpdater { private final WeakContainmentMultiMap sections = new WeakContainmentMultiMap<>(); private final WeakContainmentMultiMap chunks = new WeakContainmentMultiMap<>(); - public LightUpdater(IBlockDisplayReader world) { + public LightUpdater(BlockAndTintGetter world) { provider = BasicProvider.get(world); } @@ -90,7 +90,7 @@ public class LightUpdater { * @param type The type of light that changed. * @param sectionPos A long representing the section position where light changed. */ - public void onLightUpdate(LightType type, long sectionPos) { + public void onLightUpdate(LightLayer type, long sectionPos) { Set set = sections.get(sectionPos); if (set == null || set.isEmpty()) return; diff --git a/src/main/java/com/jozufozu/flywheel/light/LightVolume.java b/src/main/java/com/jozufozu/flywheel/light/LightVolume.java index 148a04b04..84c1d2083 100644 --- a/src/main/java/com/jozufozu/flywheel/light/LightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/LightVolume.java @@ -4,8 +4,8 @@ import java.nio.ByteBuffer; import org.lwjgl.system.MemoryUtil; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.LightType; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LightLayer; public class LightVolume implements ImmutableBox, ILightUpdateListener { @@ -66,15 +66,15 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { } @Override - public void onLightUpdate(LightProvider world, LightType type, ImmutableBox changedVolume) { + public void onLightUpdate(LightProvider world, LightLayer type, ImmutableBox changedVolume) { if (lightData == null) return; GridAlignedBB vol = changedVolume.copy(); if (!vol.intersects(getVolume())) return; vol.intersectAssign(getVolume()); // compute the region contained by us that has dirty lighting data. - if (type == LightType.BLOCK) copyBlock(world, vol); - else if (type == LightType.SKY) copySky(world, vol); + if (type == LightLayer.BLOCK) copyBlock(world, vol); + else if (type == LightLayer.SKY) copySky(world, vol); } @Override @@ -101,8 +101,8 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { int shiftZ = box.getMinZ(); box.forEachContained((x, y, z) -> { - int blockLight = world.getLight(LightType.BLOCK, x, y, z); - int skyLight = world.getLight(LightType.SKY, x, y, z); + int blockLight = world.getLight(LightLayer.BLOCK, x, y, z); + int skyLight = world.getLight(LightLayer.SKY, x, y, z); writeLight(x - shiftX, y - shiftY, z - shiftZ, blockLight, skyLight); }); @@ -119,7 +119,7 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { int zShift = box.getMinZ(); worldVolume.forEachContained((x, y, z) -> { - int light = world.getLight(LightType.BLOCK, x, y, z); + int light = world.getLight(LightLayer.BLOCK, x, y, z); writeBlock(x - xShift, y - yShift, z - zShift, light); }); @@ -136,7 +136,7 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { int zShift = box.getMinZ(); worldVolume.forEachContained((x, y, z) -> { - int light = world.getLight(LightType.SKY, x, y, z); + int light = world.getLight(LightLayer.SKY, x, y, z); writeSky(x - xShift, y - yShift, z - zShift, light); }); @@ -148,7 +148,7 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { * @param worldVolume the region in the world to copy data from. */ public void copyLight(LightProvider world, ImmutableBox worldVolume) { - BlockPos.Mutable pos = new BlockPos.Mutable(); + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(); int xShift = box.getMinX(); int yShift = box.getMinY(); @@ -157,8 +157,8 @@ public class LightVolume implements ImmutableBox, ILightUpdateListener { worldVolume.forEachContained((x, y, z) -> { pos.set(x, y, z); - int block = world.getLight(LightType.BLOCK, x, y, z); - int sky = world.getLight(LightType.SKY, x, y, z); + int block = world.getLight(LightLayer.BLOCK, x, y, z); + int sky = world.getLight(LightLayer.SKY, x, y, z); writeLight(x - xShift, y - yShift, z - zShift, block, sky); }); diff --git a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java index dcc929ec5..e6d7d24b3 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java @@ -12,17 +12,17 @@ import com.google.common.collect.Lists; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.Entity; -import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.entity.Entity; +import net.minecraft.util.ClassInstanceMultiMap; -@Mixin(WorldRenderer.class) +@Mixin(LevelRenderer.class) 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;")) - private Iterable filterEntities(ClientWorld world) { + private Iterable filterEntities(ClientLevel world) { Iterable entities = world.entitiesForRendering(); if (Backend.getInstance() .canUseInstancing()) { @@ -39,7 +39,7 @@ public class CancelEntityRenderMixin { @Group(name = "entityFilter") @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ClassInheritanceMultiMap;iterator()Ljava/util/Iterator;")) - private Iterator filterEntitiesOF(ClassInheritanceMultiMap classInheritanceMultiMap) { + private Iterator filterEntitiesOF(ClassInstanceMultiMap classInheritanceMultiMap) { if (Backend.getInstance() .canUseInstancing()) { diff --git a/src/main/java/com/jozufozu/flywheel/mixin/CancelTileEntityRenderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/CancelTileEntityRenderMixin.java index fbc0b5b5f..4cc209091 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/CancelTileEntityRenderMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/CancelTileEntityRenderMixin.java @@ -11,7 +11,7 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; -import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -26,10 +26,10 @@ public class CancelTileEntityRenderMixin { * doing unnecessary light lookups and frustum checks. */ @Inject(at = @At("RETURN"), method = "getRenderableBlockEntities", cancellable = true) - private void noRenderInstancedTiles(CallbackInfoReturnable> cir) { + private void noRenderInstancedTiles(CallbackInfoReturnable> cir) { if (Backend.getInstance() .canUseInstancing()) { - List tiles = cir.getReturnValue(); + List tiles = cir.getReturnValue(); InstancedRenderRegistry r = InstancedRenderRegistry.getInstance(); tiles.removeIf(r::shouldSkipRender); diff --git a/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java index 28301ea18..f73973d77 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/FastChunkProviderMixin.java @@ -12,34 +12,34 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.jozufozu.flywheel.backend.Backend; -import net.minecraft.client.multiplayer.ClientChunkProvider; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.network.PacketBuffer; -import net.minecraft.world.biome.BiomeContainer; -import net.minecraft.world.chunk.AbstractChunkProvider; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.ChunkStatus; -import net.minecraft.world.chunk.IChunk; +import net.minecraft.client.multiplayer.ClientChunkCache; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.level.chunk.ChunkBiomeContainer; +import net.minecraft.world.level.chunk.ChunkSource; +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.level.chunk.ChunkStatus; +import net.minecraft.world.level.chunk.ChunkAccess; -@Mixin(ClientChunkProvider.class) -public abstract class FastChunkProviderMixin extends AbstractChunkProvider { +@Mixin(ClientChunkCache.class) +public abstract class FastChunkProviderMixin extends ChunkSource { @Shadow @Final - private ClientWorld level; + private ClientLevel level; @Unique private int lastX; @Unique private int lastZ; @Unique - private IChunk lastChunk; + private ChunkAccess lastChunk; @Inject(method = "getChunk", at = @At("HEAD"), cancellable = true) - public void returnCachedChunk(int x, int z, ChunkStatus status, boolean create, CallbackInfoReturnable cir) { + public void returnCachedChunk(int x, int z, ChunkStatus status, boolean create, CallbackInfoReturnable cir) { if (Backend.getInstance().chunkCachingEnabled && status.isOrAfter(ChunkStatus.FULL)) { synchronized (level) { if (lastChunk != null && x == lastX && z == lastZ) { @@ -51,7 +51,7 @@ public abstract class FastChunkProviderMixin extends AbstractChunkProvider { @Inject(method = "getChunk", at = @At("RETURN")) - public void cacheChunk(int x, int z, ChunkStatus status, boolean create, CallbackInfoReturnable cir) { + public void cacheChunk(int x, int z, ChunkStatus status, boolean create, CallbackInfoReturnable cir) { if (Backend.getInstance().chunkCachingEnabled && status.isOrAfter(ChunkStatus.FULL)) { synchronized (level) { lastChunk = cir.getReturnValue(); @@ -71,7 +71,7 @@ public abstract class FastChunkProviderMixin extends AbstractChunkProvider { } @Inject(method = "replaceWithPacketData", at = @At("HEAD")) - public void invalidateOnPacket(int x, int z, BiomeContainer p_228313_3_, PacketBuffer p_228313_4_, CompoundNBT p_228313_5_, int p_228313_6_, boolean p_228313_7_, CallbackInfoReturnable cir) { + 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) { if (Backend.getInstance().chunkCachingEnabled) { synchronized (level) { if (x == lastX && z == lastZ) lastChunk = null; @@ -80,7 +80,7 @@ public abstract class FastChunkProviderMixin extends AbstractChunkProvider { } @Redirect(method = "isTickingChunk", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientChunkProvider;hasChunk(II)Z")) - public boolean redirectTicking(ClientChunkProvider clientChunkProvider, int x, int z) { + public boolean redirectTicking(ClientChunkCache clientChunkProvider, int x, int z) { if (Backend.getInstance().chunkCachingEnabled) { synchronized (level) { if (lastChunk != null && x == lastX && z == lastZ) return true; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java index 357ec5a64..847134b22 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java @@ -5,23 +5,23 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.Camera; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.LightTexture; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.client.renderer.LevelRenderer; +import com.mojang.math.Matrix4f; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -@Mixin(WorldRenderer.class) +@Mixin(LevelRenderer.class) public class FixFabulousDepthMixin { @Inject(method = "renderLevel", at = @At(value = "INVOKE", ordinal = 1, target = "Lnet/minecraft/client/shader/ShaderGroup;process(F)V")) - private void disableTransparencyShaderDepth(MatrixStack p_228426_1_, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, ActiveRenderInfo p_228426_6_, GameRenderer p_228426_7_, LightTexture p_228426_8_, Matrix4f p_228426_9_, CallbackInfo ci) { + private void disableTransparencyShaderDepth(PoseStack p_228426_1_, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, Camera p_228426_6_, GameRenderer p_228426_7_, LightTexture p_228426_8_, Matrix4f p_228426_9_, CallbackInfo ci) { GlStateManager._depthMask(false); } } diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java index 2215abca1..3cbb7d3b2 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java @@ -15,37 +15,37 @@ import com.jozufozu.flywheel.core.crumbling.CrumblingRenderer; import com.jozufozu.flywheel.event.BeginFrameEvent; import com.jozufozu.flywheel.event.ReloadRenderersEvent; import com.jozufozu.flywheel.event.RenderLayerEvent; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.block.BlockState; -import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.client.Camera; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.RenderTypeBuffers; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.culling.ClippingHelper; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.vector.Matrix4f; -import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.client.renderer.RenderBuffers; +import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.BlockPos; +import com.mojang.math.Matrix4f; +import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; @OnlyIn(Dist.CLIENT) -@Mixin(WorldRenderer.class) +@Mixin(LevelRenderer.class) public class RenderHooksMixin { @Shadow - private ClientWorld level; + private ClientLevel level; @Shadow @Final - private RenderTypeBuffers renderBuffers; + private RenderBuffers renderBuffers; @Inject(at = @At("HEAD"), method = "setupRender") - private void setupRender(ActiveRenderInfo info, ClippingHelper clippingHelper, boolean p_228437_3_, int frameCount, boolean isSpectator, CallbackInfo ci) { + private void setupRender(Camera info, Frustum clippingHelper, boolean p_228437_3_, int frameCount, boolean isSpectator, CallbackInfo ci) { MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, info, clippingHelper)); } @@ -55,9 +55,9 @@ public class RenderHooksMixin { * This should probably be a forge event. */ @Inject(at = @At("TAIL"), method = "renderChunkLayer") - private void renderLayer(RenderType type, MatrixStack stack, double camX, double camY, double camZ, CallbackInfo ci) { + private void renderLayer(RenderType type, PoseStack stack, double camX, double camY, double camZ, CallbackInfo ci) { - RenderTypeBuffers renderBuffers = this.renderBuffers; + RenderBuffers renderBuffers = this.renderBuffers; MinecraftForge.EVENT_BUS.post(new RenderLayerEvent(level, type, stack, renderBuffers, camX, camY, camZ)); @@ -77,7 +77,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 ), method = "renderLevel") - private void renderBlockBreaking(MatrixStack stack, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, ActiveRenderInfo info, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f p_228426_9_, CallbackInfo ci) { + 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() .available()) return; @@ -87,7 +87,7 @@ public class RenderHooksMixin { viewProjection.multiplyBackward(Backend.getInstance() .getProjectionMatrix()); - Vector3d cameraPos = info.getPosition(); + Vec3 cameraPos = info.getPosition(); CrumblingRenderer.renderBreaking(level, viewProjection, cameraPos.x, cameraPos.y, cameraPos.z); if (!OptifineHandler.usingShaders()) GL20.glUseProgram(0); diff --git a/src/main/java/com/jozufozu/flywheel/mixin/ShaderCloseMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/ShaderCloseMixin.java index 76cdbd04f..ea641e03f 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/ShaderCloseMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/ShaderCloseMixin.java @@ -11,8 +11,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.backend.OptifineHandler; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.VideoSettingsScreen; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.VideoSettingsScreen; @Mixin(Minecraft.class) public class ShaderCloseMixin { diff --git a/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java index 54059dae3..84c52b577 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/StoreProjectionMatrixMixin.java @@ -7,10 +7,10 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.backend.Backend; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.renderer.GameRenderer; -import net.minecraft.util.math.vector.Matrix4f; +import com.mojang.math.Matrix4f; @Mixin(GameRenderer.class) public abstract class StoreProjectionMatrixMixin { @@ -23,7 +23,7 @@ public abstract class StoreProjectionMatrixMixin { * 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")) - private void projectionMatrixReady(float p_228378_1_, long p_228378_2_, MatrixStack p_228378_4_, CallbackInfo ci) { + 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/TileRemoveMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/TileRemoveMixin.java index 61e9afe53..491079b29 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/TileRemoveMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/TileRemoveMixin.java @@ -10,20 +10,20 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.Level; -@Mixin(TileEntity.class) +@Mixin(BlockEntity.class) public class TileRemoveMixin { @Shadow @Nullable - protected World level; + protected Level level; @Inject(at = @At("TAIL"), method = "setRemoved") private void onRemove(CallbackInfo ci) { - if (level instanceof ClientWorld) InstancedRenderDispatcher.getTiles(this.level) - .remove((TileEntity) (Object) this); + if (level instanceof ClientLevel) InstancedRenderDispatcher.getTiles(this.level) + .remove((BlockEntity) (Object) this); } } diff --git a/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java index 49762dc64..c6e081f76 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/TileWorldHookMixin.java @@ -13,16 +13,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -@Mixin(value = World.class, priority = 1100) // this and create.mixins.json have high priority to load after Performant +@Mixin(value = Level.class, priority = 1100) // this and create.mixins.json have high priority to load after Performant public class TileWorldHookMixin { - final World self = (World) (Object) this; + final Level self = (Level) (Object) this; @Shadow @Final @@ -30,10 +30,10 @@ public class TileWorldHookMixin { @Shadow @Final - protected Set blockEntitiesToUnload; + protected Set blockEntitiesToUnload; @Inject(at = @At("TAIL"), method = "addBlockEntity") - private void onAddTile(TileEntity te, CallbackInfoReturnable cir) { + private void onAddTile(BlockEntity te, CallbackInfoReturnable cir) { if (isClientSide) { InstancedRenderDispatcher.getTiles(self) .queueAdd(te); @@ -46,8 +46,8 @@ public class TileWorldHookMixin { @Inject(at = @At(value = "INVOKE", target = "Ljava/util/Set;clear()V", ordinal = 0), method = "tickBlockEntities") private void onChunkUnload(CallbackInfo ci) { if (isClientSide) { - InstanceManager kineticRenderer = InstancedRenderDispatcher.getTiles(self); - for (TileEntity tile : blockEntitiesToUnload) { + InstanceManager kineticRenderer = InstancedRenderDispatcher.getTiles(self); + for (BlockEntity tile : blockEntitiesToUnload) { kineticRenderer.remove(tile); } } diff --git a/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java index 76d13a3a8..55c0e6ae2 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java @@ -10,20 +10,20 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.jozufozu.flywheel.core.atlas.AtlasInfo; -import net.minecraft.client.renderer.texture.AtlasTexture; -import net.minecraft.profiler.IProfiler; -import net.minecraft.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; +import net.minecraft.client.renderer.texture.TextureAtlas; +import net.minecraft.util.profiling.ProfilerFiller; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.resources.ResourceLocation; -@Mixin(AtlasTexture.class) +@Mixin(TextureAtlas.class) public abstract class AtlasDataMixin { @Shadow public abstract ResourceLocation location(); @Inject(method = "prepareToStitch", at = @At("RETURN")) - public void stealAtlasData(IResourceManager resourceManager, Stream locationStream, IProfiler profiler, int mipMapLevels, CallbackInfoReturnable cir) { - AtlasTexture.SheetData value = cir.getReturnValue(); + public void stealAtlasData(ResourceManager resourceManager, Stream locationStream, ProfilerFiller profiler, int mipMapLevels, CallbackInfoReturnable cir) { + TextureAtlas.Preparations value = cir.getReturnValue(); SheetDataAccessor dataAccessor = (SheetDataAccessor) value; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/atlas/SheetDataAccessor.java b/src/main/java/com/jozufozu/flywheel/mixin/atlas/SheetDataAccessor.java index d959b088f..8ab5bc643 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/atlas/SheetDataAccessor.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/atlas/SheetDataAccessor.java @@ -3,9 +3,9 @@ package com.jozufozu.flywheel.mixin.atlas; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import net.minecraft.client.renderer.texture.AtlasTexture; +import net.minecraft.client.renderer.texture.TextureAtlas; -@Mixin(AtlasTexture.SheetData.class) +@Mixin(TextureAtlas.Preparations.class) public interface SheetDataAccessor { @Accessor("width") diff --git a/src/main/java/com/jozufozu/flywheel/mixin/light/LightUpdateMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/light/LightUpdateMixin.java index f7a50f36e..b4b97fe20 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/light/LightUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/light/LightUpdateMixin.java @@ -7,17 +7,17 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.light.LightUpdater; -import net.minecraft.client.multiplayer.ClientChunkProvider; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.util.math.SectionPos; -import net.minecraft.world.LightType; -import net.minecraft.world.chunk.AbstractChunkProvider; +import net.minecraft.client.multiplayer.ClientChunkCache; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.SectionPos; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.chunk.ChunkSource; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -@Mixin(ClientChunkProvider.class) -public abstract class LightUpdateMixin extends AbstractChunkProvider { +@Mixin(ClientChunkCache.class) +public abstract class LightUpdateMixin extends ChunkSource { /** * JUSTIFICATION: This method is called after a lighting tick once per subchunk where a @@ -26,9 +26,9 @@ public abstract class LightUpdateMixin extends AbstractChunkProvider { * and we should too. */ @Inject(at = @At("HEAD"), method = "onLightUpdate") - private void onLightUpdate(LightType type, SectionPos pos, CallbackInfo ci) { - ClientChunkProvider thi = ((ClientChunkProvider) (Object) this); - ClientWorld world = (ClientWorld) thi.getLevel(); + private void onLightUpdate(LightLayer type, SectionPos pos, CallbackInfo ci) { + ClientChunkCache thi = ((ClientChunkCache) (Object) this); + ClientLevel world = (ClientLevel) thi.getLevel(); LightUpdater.get(world) .onLightUpdate(type, pos.asLong()); diff --git a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java index 2d7f2243b..5bb3b1a94 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java @@ -9,17 +9,17 @@ import com.jozufozu.flywheel.backend.RenderWork; import com.jozufozu.flywheel.light.LightUpdater; import net.minecraft.client.Minecraft; -import net.minecraft.client.network.play.ClientPlayNetHandler; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.network.play.server.SUpdateLightPacket; +import net.minecraft.client.multiplayer.ClientPacketListener; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.network.protocol.game.ClientboundLightUpdatePacket; -@Mixin(ClientPlayNetHandler.class) +@Mixin(ClientPacketListener.class) public class NetworkLightUpdateMixin { @Inject(at = @At("TAIL"), method = "handleLightUpdatePacked") - private void onLightPacket(SUpdateLightPacket packet, CallbackInfo ci) { + private void onLightPacket(ClientboundLightUpdatePacket packet, CallbackInfo ci) { RenderWork.enqueue(() -> { - ClientWorld world = Minecraft.getInstance().level; + ClientLevel world = Minecraft.getInstance().level; if (world == null) return; diff --git a/src/main/java/com/jozufozu/flywheel/util/AngleHelper.java b/src/main/java/com/jozufozu/flywheel/util/AngleHelper.java index 706e1999f..7dbddb193 100644 --- a/src/main/java/com/jozufozu/flywheel/util/AngleHelper.java +++ b/src/main/java/com/jozufozu/flywheel/util/AngleHelper.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.util; -import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; +import net.minecraft.core.Direction; +import net.minecraft.core.Direction.Axis; public class AngleHelper { diff --git a/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java b/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java index 24d41fde3..e5339d3e2 100644 --- a/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java +++ b/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java @@ -1,11 +1,11 @@ package com.jozufozu.flywheel.util; -import net.minecraft.client.renderer.model.BakedQuad; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.util.math.vector.Vector2f; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.client.renderer.block.model.BakedQuad; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.VertexFormat; +import com.mojang.blaze3d.vertex.VertexFormatElement; +import net.minecraft.world.phys.Vec2; +import com.mojang.math.Vector3f; public class BakedQuadWrapper { private final FormatCache formatCache = new FormatCache(); @@ -76,8 +76,8 @@ public class BakedQuadWrapper { return Float.intBitsToFloat(vertexData[vertexIndex * formatCache.vertexSize + formatCache.texture + 1]); } - public Vector2f getTex(int vertexIndex) { - return new Vector2f(getTexU(vertexIndex), getTexV(vertexIndex)); + public Vec2 getTex(int vertexIndex) { + return new Vec2(getTexU(vertexIndex), getTexV(vertexIndex)); } public int getLight(int vertexIndex) { @@ -145,7 +145,7 @@ public class BakedQuadWrapper { setTexV(vertexIndex, v); } - public void setTex(int vertexIndex, Vector2f tex) { + public void setTex(int vertexIndex, Vec2 tex) { setTex(vertexIndex, tex.x, tex.y); } @@ -176,7 +176,7 @@ public class BakedQuadWrapper { } private static class FormatCache { - private static final VertexFormat FORMAT = DefaultVertexFormats.BLOCK; + private static final VertexFormat FORMAT = DefaultVertexFormat.BLOCK; public FormatCache() { refresh(); diff --git a/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java b/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java index 5e2c2fdb3..5caa1034d 100644 --- a/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java +++ b/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java @@ -4,8 +4,8 @@ import java.nio.ByteBuffer; import com.mojang.datafixers.util.Pair; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.vertex.VertexFormat; +import com.mojang.blaze3d.vertex.BufferBuilder; +import com.mojang.blaze3d.vertex.VertexFormat; public class BufferBuilderReader { diff --git a/src/main/java/com/jozufozu/flywheel/util/ChunkUtil.java b/src/main/java/com/jozufozu/flywheel/util/ChunkUtil.java index 2adea96e6..e6612b054 100644 --- a/src/main/java/com/jozufozu/flywheel/util/ChunkUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/ChunkUtil.java @@ -2,16 +2,16 @@ package com.jozufozu.flywheel.util; import javax.annotation.Nullable; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.ChunkSection; +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.level.chunk.LevelChunkSection; public class ChunkUtil { - public static boolean isValidSection(@Nullable Chunk chunk, int sectionY) { + public static boolean isValidSection(@Nullable LevelChunk chunk, int sectionY) { if (chunk == null) return false; // TODO: 1.17 - ChunkSection[] sections = chunk.getSections(); + LevelChunkSection[] sections = chunk.getSections(); return sectionY >= 0 && sectionY < sections.length; } diff --git a/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java b/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java index 2417604bb..857207939 100644 --- a/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java @@ -2,12 +2,12 @@ package com.jozufozu.flywheel.util; import java.util.function.Supplier; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Matrix3f; -import net.minecraft.util.math.vector.Matrix4f; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.core.Direction; +import com.mojang.math.Matrix3f; +import com.mojang.math.Matrix4f; +import com.mojang.math.Vector3f; public class RenderUtil { @@ -42,7 +42,7 @@ public class RenderUtil { return Math.sqrt(lengthSqr(x, y, z)); } - public static float[] writeMatrixStack(MatrixStack stack) { + public static float[] writeMatrixStack(PoseStack stack) { return writeMatrixStack(stack.last() .pose(), stack.last() .normal()); @@ -57,9 +57,9 @@ public class RenderUtil { return new float[]{model.m00, model.m10, model.m20, model.m30, model.m01, model.m11, model.m21, model.m31, model.m02, model.m12, model.m22, model.m32, model.m03, model.m13, model.m23, model.m33,}; } - public static Supplier rotateToFace(Direction facing) { + public static Supplier rotateToFace(Direction facing) { return () -> { - MatrixStack stack = new MatrixStack(); + PoseStack stack = new PoseStack(); // MatrixStacker.of(stack) // .centre() // .rotateY(AngleHelper.horizontalAngle(facing)) diff --git a/src/main/java/com/jozufozu/flywheel/util/ResourceUtil.java b/src/main/java/com/jozufozu/flywheel/util/ResourceUtil.java index e04c1cc46..476ff33c8 100644 --- a/src/main/java/com/jozufozu/flywheel/util/ResourceUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/ResourceUtil.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.util; -import net.minecraft.util.ResourceLocation; +import net.minecraft.resources.ResourceLocation; public class ResourceUtil { diff --git a/src/main/java/com/jozufozu/flywheel/util/WorldAttached.java b/src/main/java/com/jozufozu/flywheel/util/WorldAttached.java index a91acb0e8..002ad3d86 100644 --- a/src/main/java/com/jozufozu/flywheel/util/WorldAttached.java +++ b/src/main/java/com/jozufozu/flywheel/util/WorldAttached.java @@ -8,20 +8,20 @@ import java.util.function.Function; import javax.annotation.Nonnull; -import net.minecraft.world.IWorld; +import net.minecraft.world.level.LevelAccessor; public class WorldAttached { - private final Map attached; - private final Function factory; + private final Map attached; + private final Function factory; - public WorldAttached(Function factory) { + public WorldAttached(Function factory) { this.factory = factory; attached = new HashMap<>(); } @Nonnull - public T get(IWorld world) { + public T get(LevelAccessor world) { T t = attached.get(world); if (t != null) return t; T entry = factory.apply(world); @@ -29,7 +29,7 @@ public class WorldAttached { return entry; } - public void put(IWorld world, T entry) { + public void put(LevelAccessor world, T entry) { attached.put(world, entry); } @@ -37,7 +37,7 @@ public class WorldAttached { * Replaces the entry with a new one from the factory and returns the new entry. */ @Nonnull - public T replace(IWorld world) { + public T replace(LevelAccessor world) { attached.remove(world); return get(world); @@ -47,7 +47,7 @@ public class WorldAttached { * Replaces the entry with a new one from the factory and returns the new entry. */ @Nonnull - public T replace(IWorld world, Consumer finalizer) { + public T replace(LevelAccessor world, Consumer finalizer) { T remove = attached.remove(world); if (remove != null) @@ -61,7 +61,7 @@ public class WorldAttached { * * @param finalizer Do something with all of the world-value pairs */ - public void empty(BiConsumer finalizer) { + public void empty(BiConsumer finalizer) { attached.forEach(finalizer); attached.clear(); } diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java b/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java index 32c962af1..591ab3a41 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java +++ b/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java @@ -1,32 +1,32 @@ package com.jozufozu.flywheel.util.transform; -import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.util.math.vector.Quaternion; +import com.mojang.math.Quaternion; public class MatrixTransformStack implements TransformStack { - private final MatrixStack internal; + private final PoseStack internal; public MatrixTransformStack() { - this(new MatrixStack()); + this(new PoseStack()); } - public MatrixTransformStack(MatrixStack internal) { + public MatrixTransformStack(PoseStack internal) { this.internal = internal; } - public static MatrixTransformStack of(MatrixStack ms) { + public static MatrixTransformStack of(PoseStack ms) { return new MatrixTransformStack(ms); } - public MatrixStack unwrap() { + public PoseStack unwrap() { return internal; } public MatrixTransformStack setIdentity() { if (internal.clear()) { - MatrixStack.Entry last = internal.last(); + PoseStack.Pose last = internal.last(); last.normal() .setIdentity(); diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java b/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java index f1e247de7..8bbe0c03d 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java +++ b/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java @@ -1,13 +1,13 @@ package com.jozufozu.flywheel.util.transform; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3f; -import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.core.Direction; +import com.mojang.math.Quaternion; +import net.minecraft.world.phys.Vec3; +import com.mojang.math.Vector3f; +import net.minecraft.core.Vec3i; public interface TransformStack { - Vector3d CENTER = new Vector3d(0.5, 0.5, 0.5); + Vec3 CENTER = new Vec3(0.5, 0.5, 0.5); TransformStack translate(double x, double y, double z); @@ -84,11 +84,11 @@ public interface TransformStack { return translate(0, 0, z); } - default TransformStack translate(Vector3i vec) { + default TransformStack translate(Vec3i vec) { return translate(vec.getX(), vec.getY(), vec.getZ()); } - default TransformStack translate(Vector3d vec) { + default TransformStack translate(Vec3 vec) { return translate(vec.x, vec.y, vec.z); } @@ -96,7 +96,7 @@ public interface TransformStack { return translate(vec.x(), vec.y(), vec.z()); } - default TransformStack translateBack(Vector3d vec) { + default TransformStack translateBack(Vec3 vec) { return translate(-vec.x, -vec.y, -vec.z); } diff --git a/src/main/java/com/jozufozu/flywheel/util/vec/Vec3.java b/src/main/java/com/jozufozu/flywheel/util/vec/Vec3.java index d9f6f3414..4bd8e309f 100644 --- a/src/main/java/com/jozufozu/flywheel/util/vec/Vec3.java +++ b/src/main/java/com/jozufozu/flywheel/util/vec/Vec3.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.util.vec; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3f; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; public class Vec3 { public static final Vec3 NEGATIVE_X = new Vec3(-1.0F, 0.0F, 0.0F); diff --git a/src/main/java/com/jozufozu/flywheel/util/vec/Vec4.java b/src/main/java/com/jozufozu/flywheel/util/vec/Vec4.java index 34cb79ed7..b4f5cb663 100644 --- a/src/main/java/com/jozufozu/flywheel/util/vec/Vec4.java +++ b/src/main/java/com/jozufozu/flywheel/util/vec/Vec4.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.util.vec; -import net.minecraft.util.math.vector.Quaternion; +import com.mojang.math.Quaternion; public class Vec4 { diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java index d16b71c95..cddfddec7 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java @@ -8,19 +8,19 @@ import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; -import net.minecraft.client.renderer.tileentity.BellTileEntityRenderer; -import net.minecraft.tileentity.BellTileEntity; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.client.renderer.blockentity.BellRenderer; +import net.minecraft.world.level.block.entity.BellBlockEntity; +import net.minecraft.util.Mth; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; -public class BellInstance extends TileEntityInstance implements IDynamicInstance { +public class BellInstance extends TileEntityInstance implements IDynamicInstance { private final OrientedData bell; private float lastRingTime = Float.NaN; - public BellInstance(MaterialManager materialManager, BellTileEntity tile) { + public BellInstance(MaterialManager materialManager, BellBlockEntity tile) { super(materialManager, tile); bell = createBellInstance() @@ -36,7 +36,7 @@ public class BellInstance extends TileEntityInstance implements lastRingTime = ringTime; if (tile.shaking) { - float angle = MathHelper.sin(ringTime / (float) Math.PI) / (4.0F + ringTime / 3.0F); + float angle = Mth.sin(ringTime / (float) Math.PI) / (4.0F + ringTime / 3.0F); Vector3f ringAxis = tile.clickDirection.getCounterClockWise().step(); @@ -65,7 +65,7 @@ public class BellInstance extends TileEntityInstance implements private static ModelPart createBellModel() { return ModelPart.builder(32, 32) - .sprite(BellTileEntityRenderer.BELL_RESOURCE_LOCATION.sprite()) + .sprite(BellRenderer.BELL_RESOURCE_LOCATION.sprite()) .cuboid() .start(5.0F, 6.0F, 5.0F) .size(6.0F, 7.0F, 6.0F) diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java index 3c6cb67a6..905f86fee 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java @@ -16,27 +16,27 @@ import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import it.unimi.dsi.fastutil.floats.Float2FloatFunction; -import net.minecraft.block.AbstractChestBlock; -import net.minecraft.block.Block; -import net.minecraft.block.ChestBlock; -import net.minecraft.client.renderer.Atlases; -import net.minecraft.client.renderer.model.RenderMaterial; -import net.minecraft.state.properties.ChestType; -import net.minecraft.tileentity.ChestTileEntity; -import net.minecraft.tileentity.IChestLid; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityMerger; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.world.level.block.AbstractChestBlock; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.ChestBlock; +import net.minecraft.client.renderer.Sheets; +import net.minecraft.client.resources.model.Material; +import net.minecraft.world.level.block.state.properties.ChestType; +import net.minecraft.world.level.block.entity.ChestBlockEntity; +import net.minecraft.world.level.block.entity.LidBlockEntity; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.DoubleBlockCombiner; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; -public class ChestInstance extends TileEntityInstance implements IDynamicInstance { +public class ChestInstance extends TileEntityInstance implements IDynamicInstance { private final MatrixTransformStack stack = new MatrixTransformStack(); private final OrientedData body; private final ModelData lid; private final Float2FloatFunction lidProgress; - private final RenderMaterial renderMaterial; + private final Material renderMaterial; @Nonnull private final ChestType chestType; private final Quaternion baseRotation; @@ -49,7 +49,7 @@ public class ChestInstance extends TileEntityI Block block = blockState.getBlock(); chestType = blockState.hasProperty(ChestBlock.TYPE) ? blockState.getValue(ChestBlock.TYPE) : ChestType.SINGLE; - renderMaterial = Atlases.chooseMaterial(tile, chestType, isChristmas()); + renderMaterial = Sheets.chooseMaterial(tile, chestType, isChristmas()); body = baseInstance() .setPosition(getInstancePosition()); @@ -68,7 +68,7 @@ public class ChestInstance extends TileEntityI AbstractChestBlock chestBlock = (AbstractChestBlock) block; - TileEntityMerger.ICallbackWrapper wrapper = chestBlock.combine(blockState, world, getWorldPosition(), true); + DoubleBlockCombiner.NeighborCombineResult wrapper = chestBlock.combine(blockState, world, getWorldPosition(), true); this.lidProgress = wrapper.apply(ChestBlock.opennessCombiner(tile)); diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java index cbc05106e..39b23584a 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java @@ -12,15 +12,15 @@ import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; -import net.minecraft.block.BlockRenderType; -import net.minecraft.block.BlockState; -import net.minecraft.entity.item.minecart.AbstractMinecartEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.phys.Vec3; +import com.mojang.math.Vector3f; -public class MinecartInstance extends EntityInstance implements IDynamicInstance, ITickableInstance { +public class MinecartInstance extends EntityInstance implements IDynamicInstance, ITickableInstance { private static final ResourceLocation MINECART_LOCATION = new ResourceLocation("textures/entity/minecart.png"); @@ -56,13 +56,13 @@ public class MinecartInstance extends EntityIn float pt = AnimationTickHolder.getPartialTicks(); stack.translate( - MathHelper.lerp(pt, entity.xOld, entity.getX()), - MathHelper.lerp(pt, entity.yOld, entity.getY()), - MathHelper.lerp(pt, entity.zOld, entity.getZ()) + Mth.lerp(pt, entity.xOld, entity.getX()), + Mth.lerp(pt, entity.yOld, entity.getY()), + Mth.lerp(pt, entity.zOld, entity.getZ()) ); - float yaw = MathHelper.lerp(pt, entity.yRotO, entity.yRot); + float yaw = Mth.lerp(pt, entity.yRotO, entity.yRot); long i = (long)entity.getId() * 493286711L; i = i * i * 4392167121L + i * 98761L; @@ -71,14 +71,14 @@ public class MinecartInstance extends EntityIn float f2 = (((float)(i >> 24 & 7L) + 0.5F) / 8 - 0.5F) * 0.004F; stack.translate(f, f1, f2); stack.nudge(entity.getId()); - double d0 = MathHelper.lerp(pt, entity.xOld, entity.getX()); - double d1 = MathHelper.lerp(pt, entity.yOld, entity.getY()); - double d2 = MathHelper.lerp(pt, entity.zOld, entity.getZ()); - Vector3d vector3d = entity.getPos(d0, d1, d2); - float f3 = MathHelper.lerp(pt, entity.xRotO, entity.xRot); + double d0 = Mth.lerp(pt, entity.xOld, entity.getX()); + 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); if (vector3d != null) { - Vector3d vector3d1 = entity.getPosOffs(d0, d1, d2, 0.3F); - Vector3d vector3d2 = entity.getPosOffs(d0, d1, d2, -0.3F); + Vec3 vector3d1 = entity.getPosOffs(d0, d1, d2, 0.3F); + Vec3 vector3d2 = entity.getPosOffs(d0, d1, d2, -0.3F); if (vector3d1 == null) { vector3d1 = vector3d; } @@ -88,7 +88,7 @@ public class MinecartInstance extends EntityIn } stack.translate(vector3d.x - d0, (vector3d1.y + vector3d2.y) / 2.0D - d1, vector3d.z - d2); - Vector3d vector3d3 = vector3d2.add(-vector3d1.x, -vector3d1.y, -vector3d1.z); + Vec3 vector3d3 = vector3d2.add(-vector3d1.x, -vector3d1.y, -vector3d1.z); if (vector3d3.length() != 0.0D) { vector3d3 = vector3d3.normalize(); yaw = (float)(Math.atan2(vector3d3.z, vector3d3.x) * 180.0D / Math.PI); @@ -106,7 +106,7 @@ public class MinecartInstance extends EntityIn } if (f5 > 0) { - stack.multiply(Vector3f.XP.rotationDegrees(MathHelper.sin(f5) * f5 * f6 / 10 * (float)entity.getHurtDir())); + stack.multiply(Vector3f.XP.rotationDegrees(Mth.sin(f5) * f5 * f6 / 10 * (float)entity.getHurtDir())); } int j = entity.getDisplayOffset(); @@ -137,7 +137,7 @@ public class MinecartInstance extends EntityIn } private ModelData getContents() { - if (blockstate.getRenderShape() == BlockRenderType.INVISIBLE) + if (blockstate.getRenderShape() == RenderShape.INVISIBLE) return null; return materialManager.defaultSolid() diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/RenderStates.java b/src/main/java/com/jozufozu/flywheel/vanilla/RenderStates.java index 54b6389c9..826a3892f 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/RenderStates.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/RenderStates.java @@ -4,11 +4,11 @@ import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.backend.state.NoCullRenderState; import com.jozufozu.flywheel.backend.state.RenderState; -import net.minecraft.client.renderer.Atlases; +import net.minecraft.client.renderer.Sheets; public class RenderStates { public static final IRenderState SHULKER = RenderState.builder() - .texture(Atlases.SHULKER_SHEET) + .texture(Sheets.SHULKER_SHEET) .addState(NoCullRenderState.INSTANCE) .build(); } diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java index 0ff3aaabc..334778b89 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java @@ -9,16 +9,16 @@ import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; -import net.minecraft.block.ShulkerBoxBlock; -import net.minecraft.client.renderer.Atlases; +import net.minecraft.world.level.block.ShulkerBoxBlock; +import net.minecraft.client.renderer.Sheets; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.item.DyeColor; -import net.minecraft.tileentity.ShulkerBoxTileEntity; -import net.minecraft.util.Direction; -import net.minecraft.util.math.vector.Quaternion; -import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity; +import net.minecraft.core.Direction; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; -public class ShulkerBoxInstance extends TileEntityInstance implements IDynamicInstance { +public class ShulkerBoxInstance extends TileEntityInstance implements IDynamicInstance { private final TextureAtlasSprite texture; @@ -28,14 +28,14 @@ public class ShulkerBoxInstance extends TileEntityInstance private float lastProgress = Float.NaN; - public ShulkerBoxInstance(MaterialManager materialManager, ShulkerBoxTileEntity tile) { + public ShulkerBoxInstance(MaterialManager materialManager, ShulkerBoxBlockEntity tile) { super(materialManager, tile); DyeColor color = tile.getColor(); if (color == null) { - texture = Atlases.DEFAULT_SHULKER_TEXTURE_LOCATION.sprite(); + texture = Sheets.DEFAULT_SHULKER_TEXTURE_LOCATION.sprite(); } else { - texture = Atlases.SHULKER_TEXTURE_LOCATION.get(color.getId()).sprite(); + texture = Sheets.SHULKER_TEXTURE_LOCATION.get(color.getId()).sprite(); } Quaternion rotation = getDirection().getRotation(); diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java b/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java index 99ec95d9f..c14a6ed04 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java @@ -2,8 +2,8 @@ package com.jozufozu.flywheel.vanilla; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import net.minecraft.entity.EntityType; -import net.minecraft.tileentity.TileEntityType; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.block.entity.BlockEntityType; /** * TODO: @@ -30,21 +30,21 @@ public class VanillaInstances { public static void init() { InstancedRenderRegistry r = InstancedRenderRegistry.getInstance(); - r.tile(TileEntityType.CHEST) + r.tile(BlockEntityType.CHEST) .setSkipRender(true) .factory(ChestInstance::new); - r.tile(TileEntityType.ENDER_CHEST) + r.tile(BlockEntityType.ENDER_CHEST) .setSkipRender(true) .factory(ChestInstance::new); - r.tile(TileEntityType.TRAPPED_CHEST) + r.tile(BlockEntityType.TRAPPED_CHEST) .setSkipRender(true) .factory(ChestInstance::new); - r.tile(TileEntityType.BELL) + r.tile(BlockEntityType.BELL) .setSkipRender(true) .factory(BellInstance::new); - r.tile(TileEntityType.SHULKER_BOX) + r.tile(BlockEntityType.SHULKER_BOX) .setSkipRender(true) .factory(ShulkerBoxInstance::new); diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 734b4c7e1..44cf85f73 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,40 +1,40 @@ # Don't jitter when game is paused -public net.minecraft.client.Minecraft field_193996_ah #renderPartialTicksPaused +public net.minecraft.client.Minecraft f_91013_ #renderPartialTicksPaused # Expose fog state for use in flywheel shaders public com.mojang.blaze3d.platform.GlStateManager$FogState -public com.mojang.blaze3d.platform.GlStateManager field_225663_h_ #FOG +public com.mojang.blaze3d.platform.GlStateManager f_84068_ #FOG public com.mojang.blaze3d.platform.GlStateManager$BooleanState -public com.mojang.blaze3d.platform.GlStateManager$BooleanState field_179201_b #field_179201_b +public com.mojang.blaze3d.platform.GlStateManager$BooleanState f_84586_ #field_179201_b # For uploading matrices as vertex attributes. -public net.minecraft.util.math.vector.Matrix3f field_226097_a_ #a00 -public net.minecraft.util.math.vector.Matrix3f field_226098_b_ #a01 -public net.minecraft.util.math.vector.Matrix3f field_226099_c_ #a02 -public net.minecraft.util.math.vector.Matrix3f field_226100_d_ #a10 -public net.minecraft.util.math.vector.Matrix3f field_226101_e_ #a11 -public net.minecraft.util.math.vector.Matrix3f field_226102_f_ #a12 -public net.minecraft.util.math.vector.Matrix3f field_226103_g_ #a20 -public net.minecraft.util.math.vector.Matrix3f field_226104_h_ #a21 -public net.minecraft.util.math.vector.Matrix3f field_226105_i_ #a22 +public com.mojang.math.Matrix3f f_8134_ #a00 +public com.mojang.math.Matrix3f f_8135_ #a01 +public com.mojang.math.Matrix3f f_8136_ #a02 +public com.mojang.math.Matrix3f f_8137_ #a10 +public com.mojang.math.Matrix3f f_8138_ #a11 +public com.mojang.math.Matrix3f f_8139_ #a12 +public com.mojang.math.Matrix3f f_8140_ #a20 +public com.mojang.math.Matrix3f f_8141_ #a21 +public com.mojang.math.Matrix3f f_8142_ #a22 -public net.minecraft.util.math.vector.Matrix4f field_226575_a_ #a00 -public net.minecraft.util.math.vector.Matrix4f field_226576_b_ #a01 -public net.minecraft.util.math.vector.Matrix4f field_226577_c_ #a02 -public net.minecraft.util.math.vector.Matrix4f field_226578_d_ #a03 -public net.minecraft.util.math.vector.Matrix4f field_226579_e_ #a10 -public net.minecraft.util.math.vector.Matrix4f field_226580_f_ #a11 -public net.minecraft.util.math.vector.Matrix4f field_226581_g_ #a12 -public net.minecraft.util.math.vector.Matrix4f field_226582_h_ #a13 -public net.minecraft.util.math.vector.Matrix4f field_226583_i_ #a20 -public net.minecraft.util.math.vector.Matrix4f field_226584_j_ #a21 -public net.minecraft.util.math.vector.Matrix4f field_226585_k_ #a22 -public net.minecraft.util.math.vector.Matrix4f field_226586_l_ #a23 -public net.minecraft.util.math.vector.Matrix4f field_226587_m_ #a30 -public net.minecraft.util.math.vector.Matrix4f field_226588_n_ #a31 -public net.minecraft.util.math.vector.Matrix4f field_226589_o_ #a32 -public net.minecraft.util.math.vector.Matrix4f field_226590_p_ #a33 +public com.mojang.math.Matrix4f f_27603_ #a00 +public com.mojang.math.Matrix4f f_27604_ #a01 +public com.mojang.math.Matrix4f f_27605_ #a02 +public com.mojang.math.Matrix4f f_27606_ #a03 +public com.mojang.math.Matrix4f f_27607_ #a10 +public com.mojang.math.Matrix4f f_27608_ #a11 +public com.mojang.math.Matrix4f f_27609_ #a12 +public com.mojang.math.Matrix4f f_27610_ #a13 +public com.mojang.math.Matrix4f f_27611_ #a20 +public com.mojang.math.Matrix4f f_27612_ #a21 +public com.mojang.math.Matrix4f f_27613_ #a22 +public com.mojang.math.Matrix4f f_27614_ #a23 +public com.mojang.math.Matrix4f f_27615_ #a30 +public com.mojang.math.Matrix4f f_27616_ #a31 +public com.mojang.math.Matrix4f f_27617_ #a32 +public com.mojang.math.Matrix4f f_27618_ #a33 # For fancy breaking overlay rendering -public net.minecraft.client.renderer.WorldRenderer field_228407_B_ #blockBreakingProgressions +public net.minecraft.client.renderer.LevelRenderer f_109409_ #blockBreakingProgressions \ No newline at end of file