diff --git a/build.gradle b/build.gradle index 4687b83ef..0acdddfce 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'org.parchmentmc.librarian.forgegradle' boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false'); ext.buildnumber = 0 -project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : "custom" +project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'custom' version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildnumber}" : '') group = 'com.jozufozu.flywheel' @@ -43,10 +43,9 @@ minecraft { property 'forge.logging.markers', '' property 'forge.logging.console.level', 'debug' - property 'fml.earlyprogresswindow', 'false' property 'mixin.debug.export', 'true' - arg "-mixin.config=flywheel.mixins.json" + arg '-mixin.config=flywheel.mixins.json' mods { flywheel { @@ -61,7 +60,7 @@ minecraft { property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' - arg "-mixin.config=flywheel.mixins.json" + arg '-mixin.config=flywheel.mixins.json' mods { flywheel { @@ -89,20 +88,20 @@ minecraft { } mixin { - add sourceSets.main, "flywheel.refmap.json" + add sourceSets.main, 'flywheel.refmap.json' } repositories { maven { - name "tterrag maven" - url "https://maven.tterrag.com/" + name 'tterrag maven' + url 'https://maven.tterrag.com/' } } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" - //implementation "org.joml:joml:1.10.1" + //implementation 'org.joml:joml:1.10.1' annotationProcessor 'org.spongepowered:mixin:0.8.4:processor' } @@ -111,14 +110,14 @@ dependencies { jar { manifest { attributes([ - "Specification-Title" : "flywheel", - //"Specification-Vendor": "flywheel authors", - "Specification-Version" : "1", // We are version 1 of ourselves - "Implementation-Title" : project.name, - "Implementation-Version" : project.version, - //"Implementation-Vendor": "flywheel authors", - "MixinConfigs" : "flywheel.mixins.json", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + 'Specification-Title' : 'flywheel', + //'Specification-Vendor': 'flywheel authors', + 'Specification-Version' : '1', // We are version 1 of ourselves + 'Implementation-Title' : project.name, + 'Implementation-Version' : project.version, + //'Implementation-Vendor': 'flywheel authors', + 'MixinConfigs' : 'flywheel.mixins.json', + 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } diff --git a/gradle.properties b/gradle.properties index 876083ad7..8271bf4d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,11 @@ -org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false +org.gradle.jvmargs = -Xmx3G +org.gradle.daemon = false + # mod version info -mod_version=0.3.0 -mc_update_version=1.17 -minecraft_version=1.17.1 -forge_version=37.0.103 +mod_version = 0.3.0 +mc_update_version = 1.17 +minecraft_version = 1.17.1 +forge_version = 37.0.108 # build dependency versions forgegradle_version = 5.1.+ @@ -14,8 +15,8 @@ cursegradle_version = 1.4.0 parchment_version = 2021.10.31 # curseforge info -projectId=486392 -curse_type=beta +projectId = 486392 +curse_type = beta # github info -github_project=Jozufozu/Flywheel +github_project = Jozufozu/Flywheel diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a254..e750102e0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/jozufozu/flywheel/backend/Backend.java b/src/main/java/com/jozufozu/flywheel/backend/Backend.java index a6b40f781..9228aebea 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Backend.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Backend.java @@ -21,8 +21,8 @@ import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; public class Backend { public static final Logger log = LogManager.getLogger(Backend.class); diff --git a/src/main/java/com/jozufozu/flywheel/backend/Loader.java b/src/main/java/com/jozufozu/flywheel/backend/Loader.java index 363dcff13..ced144d19 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Loader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Loader.java @@ -1,5 +1,7 @@ package com.jozufozu.flywheel.backend; +import java.util.Collection; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; @@ -24,12 +26,6 @@ import net.minecraft.server.packs.resources.Resource; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.server.packs.resources.ResourceManagerReloadListener; import net.minecraftforge.fml.ModLoader; -import net.minecraftforge.resource.IResourceType; -import net.minecraftforge.resource.VanillaResourceType; - -import javax.annotation.Nullable; - -import java.util.Collection; /** * The main entity for loading shaders. @@ -128,10 +124,4 @@ public class Loader implements ResourceManagerReloadListener { } } } - - @Nullable - @Override - public IResourceType getResourceType() { - return VanillaResourceType.SHADERS; - } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/PersistentGlBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/PersistentGlBuffer.java index de3dc3e72..6c5188dab 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/PersistentGlBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/PersistentGlBuffer.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.backend.gl.buffer; +import static org.lwjgl.opengl.GL30.GL_MAP_WRITE_BIT; import static org.lwjgl.opengl.GL44.GL_MAP_COHERENT_BIT; import static org.lwjgl.opengl.GL44.GL_MAP_PERSISTENT_BIT; -import static org.lwjgl.opengl.GL44.GL_MAP_WRITE_BIT; import java.nio.ByteBuffer; 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 e4356c2bf..8f9efd7f0 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 @@ -9,14 +9,12 @@ import static org.lwjgl.opengl.GL20.glUseProgram; import java.nio.FloatBuffer; import org.lwjgl.system.MemoryStack; -import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlObject; -import com.jozufozu.flywheel.util.RenderUtil; +import com.mojang.math.Matrix4f; import net.minecraft.resources.ResourceLocation; -import com.mojang.math.Matrix4f; public abstract class GlProgram extends GlObject { private static final FloatBuffer floatBuffer = MemoryStack.stackGet() 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 7608123d3..6d67ae02e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java @@ -12,8 +12,8 @@ import com.jozufozu.flywheel.light.LightProvider; import com.jozufozu.flywheel.light.ListenerStatus; import net.minecraft.core.BlockPos; -import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LightLayer; /** * A general interface providing information about any type of thing that could use Flywheel's instanced rendering. 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 abfc67bad..b10936ca6 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java @@ -12,12 +12,12 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; import com.jozufozu.flywheel.light.LightUpdater; +import com.mojang.math.Vector3f; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; 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 { 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 2fc6de691..c4867c513 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java @@ -10,8 +10,8 @@ import com.jozufozu.flywheel.util.WorldAttached; import net.minecraft.client.Minecraft; 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.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.TickEvent; 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 64e92c3ee..76970613f 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 @@ -9,15 +9,15 @@ import com.jozufozu.flywheel.light.GridAlignedBB; import com.jozufozu.flywheel.light.ILightUpdateListener; import com.jozufozu.flywheel.light.IMovingListener; import com.jozufozu.flywheel.light.LightProvider; +import com.mojang.math.Vector3f; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Vec3i; +import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.entity.BlockEntity; 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 BlockEntity} and the Flywheel backend. 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 2cbca481e..db9ba49ec 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,8 +6,8 @@ import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl; -import net.minecraft.world.entity.Entity; import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; 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 b51e9fddb..f79190e8f 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.world.level.block.state.BlockState; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; /** * The layer between a {@link BlockEntity} and the Flywheel backend. 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 7d1c793d2..40505b260 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,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.world.level.block.entity.BlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; public class TileInstanceManager extends InstanceManager { 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 a7a68133d..af1e2d609 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/Material.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/Material.java @@ -11,8 +11,8 @@ import com.jozufozu.flywheel.util.Pair; import com.jozufozu.flywheel.util.RenderUtil; import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; public interface Material { /** 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 0952c9c21..6aae0c6d1 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java @@ -4,11 +4,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import com.jozufozu.flywheel.backend.gl.error.GlError; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.core.shader.WorldProgram; - import com.mojang.math.Matrix4f; /** 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 74f17e702..639bfb1ed 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.world.inventory.InventoryMenu; import net.minecraft.core.Vec3i; +import net.minecraft.world.inventory.InventoryMenu; public interface MaterialManager { 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 5f0281d54..ff32b3eaf 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialManagerImpl.java @@ -10,13 +10,13 @@ import com.jozufozu.flywheel.backend.state.RenderLayer; import com.jozufozu.flywheel.core.WorldContext; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.util.WeakHashSet; +import com.mojang.math.Matrix4f; 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; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; public class MaterialManagerImpl

implements MaterialManager { 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 8bd0ae82b..bbffa0881 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialRenderer.java @@ -6,7 +6,6 @@ import java.util.function.Supplier; import com.jozufozu.flywheel.backend.instancing.GPUInstancer; import com.jozufozu.flywheel.core.shader.WorldProgram; - import com.mojang.math.Matrix4f; public class MaterialRenderer

{ diff --git a/src/main/java/com/jozufozu/flywheel/backend/model/BufferedModel.java b/src/main/java/com/jozufozu/flywheel/backend/model/BufferedModel.java index 5b5b5026d..e06f7be4b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/model/BufferedModel.java +++ b/src/main/java/com/jozufozu/flywheel/backend/model/BufferedModel.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.backend.model; -import static org.lwjgl.opengl.GL20.glDrawArrays; +import static org.lwjgl.opengl.GL11.glDrawArrays; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlPrimitive; diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/ProtoProgram.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/ProtoProgram.java index 17e7c321a..caa331d79 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/ProtoProgram.java +++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/ProtoProgram.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.backend.pipeline; +import static org.lwjgl.opengl.GL11.GL_TRUE; import static org.lwjgl.opengl.GL20.GL_LINK_STATUS; -import static org.lwjgl.opengl.GL20.GL_TRUE; import static org.lwjgl.opengl.GL20.glAttachShader; import static org.lwjgl.opengl.GL20.glBindAttribLocation; import static org.lwjgl.opengl.GL20.glCreateProgram; 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 b53893a76..88db37083 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.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. diff --git a/src/main/java/com/jozufozu/flywheel/backend/source/error/lines/HeaderLine.java b/src/main/java/com/jozufozu/flywheel/backend/source/error/lines/HeaderLine.java index 85eab0fe4..2488095e8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/source/error/lines/HeaderLine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/source/error/lines/HeaderLine.java @@ -1,7 +1,5 @@ package com.jozufozu.flywheel.backend.source.error.lines; -import com.jozufozu.flywheel.backend.source.error.Level; - public record HeaderLine(String level, CharSequence message) implements ErrorLine { @Override diff --git a/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java b/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java index 31f4d1297..1702dc685 100644 --- a/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java +++ b/src/main/java/com/jozufozu/flywheel/config/BooleanConfig.java @@ -6,12 +6,12 @@ import java.util.function.Supplier; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.OptifineHandler; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; -import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.TextComponent; -import net.minecraft.ChatFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java index 26896166b..9d81f69ce 100644 --- a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java +++ b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java @@ -1,11 +1,11 @@ package com.jozufozu.flywheel.config; +import java.util.function.Supplier; + import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.fmllegacy.network.NetworkEvent; -import java.util.function.Supplier; - /** * Thanks, @zelophed */ diff --git a/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java b/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java index 507800a23..3e4ac15fa 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.world.inventory.InventoryMenu; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; import net.minecraftforge.client.event.TextureStitchEvent; /** diff --git a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java index d965b687d..f84693eb3 100644 --- a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java @@ -23,31 +23,38 @@ import net.minecraftforge.client.model.ModelLoader; */ public class PartialModel { + private static final List ALL = new ArrayList<>(); private static boolean tooLate = false; - private static final List all = new ArrayList<>(); protected final ResourceLocation modelLocation; protected BakedModel bakedModel; public PartialModel(ResourceLocation modelLocation) { - if (tooLate) throw new RuntimeException("PartialModel '" + modelLocation + "' loaded after ModelRegistryEvent"); this.modelLocation = modelLocation; - all.add(this); + ALL.add(this); } public static void onModelRegistry(ModelRegistryEvent event) { - for (PartialModel partial : all) - ModelLoader.addSpecialModel(partial.modelLocation); + for (PartialModel partial : ALL) + ModelLoader.addSpecialModel(partial.getLocation()); tooLate = true; } public static void onModelBake(ModelBakeEvent event) { Map modelRegistry = event.getModelRegistry(); - for (PartialModel partial : all) - partial.bakedModel = modelRegistry.get(partial.modelLocation); + for (PartialModel partial : ALL) + partial.set(modelRegistry.get(partial.getLocation())); + } + + protected void set(BakedModel bakedModel) { + this.bakedModel = bakedModel; + } + + public ResourceLocation getLocation() { + return modelLocation; } public BakedModel get() { diff --git a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java index f8badcd2d..c43f045a6 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.world.inventory.InventoryMenu; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; public class StitchedSprite { 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 afffa920a..01388512b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java +++ b/src/main/java/com/jozufozu/flywheel/core/atlas/AtlasInfo.java @@ -6,8 +6,8 @@ import java.util.Map; import com.jozufozu.flywheel.mixin.atlas.SheetDataAccessor; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.resources.ResourceLocation; 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 61b3d9482..1da5ae75a 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.resources.model.ModelBakery; import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; public class CrumblingProgram extends WorldProgram { protected final int uTextureScale; 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 04ebefdab..14b032e5f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java @@ -17,21 +17,21 @@ import com.jozufozu.flywheel.event.ReloadRenderersEvent; import com.jozufozu.flywheel.mixin.LevelRendererAccessor; import com.jozufozu.flywheel.util.Lazy; import com.jozufozu.flywheel.util.Pair; +import com.mojang.math.Matrix4f; 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.Camera; -import net.minecraft.server.level.BlockDestructionProgress; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.RenderType; -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.multiplayer.ClientLevel; -import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.core.BlockPos; -import com.mojang.math.Matrix4f; +import net.minecraft.server.level.BlockDestructionProgress; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/BasicData.java b/src/main/java/com/jozufozu/flywheel/core/materials/BasicData.java index e6e9c537a..3434b5284 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/BasicData.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/BasicData.java @@ -1,7 +1,5 @@ package com.jozufozu.flywheel.core.materials; -import org.lwjgl.system.MemoryUtil; - import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.backend.instancing.InstanceData; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java b/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java index 97f1aa3cb..2b07cebf0 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.core.materials.model.writer; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; -import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.backend.struct.StructType; +import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.core.materials.model.ModelData; public class UnsafeModelWriter extends UnsafeBufferWriter { 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 7e133cbaa..b43711cf9 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 @@ -3,11 +3,11 @@ package com.jozufozu.flywheel.core.materials.oriented; 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.core.BlockPos; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; +import net.minecraft.core.BlockPos; + public class OrientedData extends BasicData { public float posX; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java index 53204c5bf..b44df9a9d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.core.materials.oriented.writer; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; -import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.backend.struct.StructType; +import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; public class UnsafeOrientedWriter extends UnsafeBufferWriter { 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 bcc5ae06e..15c3e1704 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/BakedModelModel.java @@ -15,14 +15,14 @@ import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.util.VirtualEmptyModelData; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.math.Vector3f; import net.minecraft.client.Minecraft; 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 { 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 2c8c62107..9d63d913f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/BlockModel.java @@ -7,18 +7,18 @@ 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.vertex.BufferBuilder; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.client.Minecraft; -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.block.ModelBlockRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; -import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import net.minecraft.core.Direction; +import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; /** * A model of a single block. 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 824706512..5cc93692f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java @@ -1,26 +1,25 @@ package com.jozufozu.flywheel.core.model; import static com.mojang.blaze3d.vertex.VertexFormat.Mode.QUADS; -import static org.lwjgl.opengl.GL11.GL_QUADS; import java.util.Collection; import java.util.Random; import com.jozufozu.flywheel.util.Lazy; +import com.mojang.blaze3d.vertex.BufferBuilder; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.PoseStack; -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.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.ItemBlockRenderTypes; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.BlockModelShaper; +import net.minecraft.client.renderer.block.ModelBlockRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; -import com.mojang.blaze3d.vertex.DefaultVertexFormat; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.model.data.EmptyModelData; 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 0e8bff487..127cbd2d2 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java @@ -8,13 +8,13 @@ import java.util.List; import java.util.Set; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.core.Direction; import com.mojang.math.Matrix3f; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.core.Direction; + public class PartBuilder { private final float sizeU; 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 80d519dcb..1108ce02d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/Readable.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/Readable.java @@ -1,8 +1,9 @@ package com.jozufozu.flywheel.core.model; -import net.minecraft.core.Direction; import com.mojang.math.Vector3f; +import net.minecraft.core.Direction; + public class Readable { public static class ModelBox { private final TexturedQuad[] quads; 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 6d065f21c..ad8c0a9fb 100644 --- a/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java +++ b/src/main/java/com/jozufozu/flywheel/core/shader/WorldProgram.java @@ -8,11 +8,11 @@ import java.util.List; import com.jozufozu.flywheel.core.shader.extension.IProgramExtension; import com.jozufozu.flywheel.util.AnimationTickHolder; - import com.mojang.blaze3d.platform.Window; +import com.mojang.math.Matrix4f; + import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; -import com.mojang.math.Matrix4f; public class WorldProgram extends ExtensibleGlProgram { protected final int uTime = getUniformLocation("uTime"); diff --git a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java b/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java index e95073f61..2db6271ee 100644 --- a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java +++ b/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.event; import net.minecraft.client.Camera; -import net.minecraft.client.renderer.culling.Frustum; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.culling.Frustum; import net.minecraft.world.phys.Vec3; import net.minecraftforge.eventbus.api.Event; diff --git a/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java b/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java index 53f210c7d..9482f3556 100644 --- a/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java +++ b/src/main/java/com/jozufozu/flywheel/event/RenderLayerEvent.java @@ -5,11 +5,11 @@ import javax.annotation.Nullable; import com.jozufozu.flywheel.backend.state.RenderLayer; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; - -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.RenderBuffers; -import net.minecraft.client.multiplayer.ClientLevel; import com.mojang.math.Matrix4f; + +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.RenderBuffers; +import net.minecraft.client.renderer.RenderType; import net.minecraftforge.eventbus.api.Event; public class RenderLayerEvent extends Event { diff --git a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java index 620a9428e..5dc44ceca 100644 --- a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java @@ -1,27 +1,27 @@ package com.jozufozu.flywheel.light; -import static org.lwjgl.opengl.GL20.GL_LINEAR; -import static org.lwjgl.opengl.GL20.GL_MIRRORED_REPEAT; -import static org.lwjgl.opengl.GL20.GL_TEXTURE0; -import static org.lwjgl.opengl.GL20.GL_TEXTURE4; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_3D; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_MAG_FILTER; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_MIN_FILTER; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_WRAP_R; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_WRAP_S; -import static org.lwjgl.opengl.GL20.GL_TEXTURE_WRAP_T; -import static org.lwjgl.opengl.GL20.GL_UNPACK_ALIGNMENT; -import static org.lwjgl.opengl.GL20.GL_UNPACK_IMAGE_HEIGHT; -import static org.lwjgl.opengl.GL20.GL_UNPACK_ROW_LENGTH; -import static org.lwjgl.opengl.GL20.GL_UNPACK_SKIP_IMAGES; -import static org.lwjgl.opengl.GL20.GL_UNPACK_SKIP_PIXELS; -import static org.lwjgl.opengl.GL20.GL_UNPACK_SKIP_ROWS; -import static org.lwjgl.opengl.GL20.GL_UNSIGNED_BYTE; -import static org.lwjgl.opengl.GL20.glActiveTexture; -import static org.lwjgl.opengl.GL20.glPixelStorei; -import static org.lwjgl.opengl.GL20.glTexImage3D; -import static org.lwjgl.opengl.GL20.glTexParameteri; -import static org.lwjgl.opengl.GL20.glTexSubImage3D; +import static org.lwjgl.opengl.GL11.GL_LINEAR; +import static org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER; +import static org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER; +import static org.lwjgl.opengl.GL11.GL_TEXTURE_WRAP_S; +import static org.lwjgl.opengl.GL11.GL_TEXTURE_WRAP_T; +import static org.lwjgl.opengl.GL11.GL_UNPACK_ALIGNMENT; +import static org.lwjgl.opengl.GL11.GL_UNPACK_ROW_LENGTH; +import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_PIXELS; +import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_ROWS; +import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE; +import static org.lwjgl.opengl.GL11.glPixelStorei; +import static org.lwjgl.opengl.GL11.glTexParameteri; +import static org.lwjgl.opengl.GL12.GL_TEXTURE_3D; +import static org.lwjgl.opengl.GL12.GL_TEXTURE_WRAP_R; +import static org.lwjgl.opengl.GL12.GL_UNPACK_IMAGE_HEIGHT; +import static org.lwjgl.opengl.GL12.GL_UNPACK_SKIP_IMAGES; +import static org.lwjgl.opengl.GL12.glTexImage3D; +import static org.lwjgl.opengl.GL12.glTexSubImage3D; +import static org.lwjgl.opengl.GL13.GL_TEXTURE0; +import static org.lwjgl.opengl.GL13.GL_TEXTURE4; +import static org.lwjgl.opengl.GL13.glActiveTexture; +import static org.lwjgl.opengl.GL14.GL_MIRRORED_REPEAT; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlTexture; diff --git a/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java b/src/main/java/com/jozufozu/flywheel/light/GridAlignedBB.java index c1285e138..1ccdf6a81 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.core.Direction; -import net.minecraft.world.phys.AABB; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.core.SectionPos; import net.minecraft.core.Vec3i; +import net.minecraft.world.phys.AABB; public class GridAlignedBB implements ImmutableBox { private int minX; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java index 1b45c59be..9f101adc4 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/CancelEntityRenderMixin.java @@ -1,7 +1,6 @@ package com.jozufozu.flywheel.mixin; import java.util.ArrayList; -import java.util.Iterator; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -12,10 +11,9 @@ import com.google.common.collect.Lists; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.world.entity.Entity; -import net.minecraft.util.ClassInstanceMultiMap; @Mixin(LevelRenderer.class) public class CancelEntityRenderMixin { diff --git a/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java index 659f1bb0b..9c0978197 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/FixFabulousDepthMixin.java @@ -5,14 +5,14 @@ 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.vertex.PoseStack; import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Matrix4f; import net.minecraft.client.Camera; import net.minecraft.client.renderer.GameRenderer; -import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.LevelRenderer; -import com.mojang.math.Matrix4f; +import net.minecraft.client.renderer.LightTexture; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/InstanceRemoveMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/InstanceRemoveMixin.java index 188019ec5..e0282a5c8 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/InstanceRemoveMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/InstanceRemoveMixin.java @@ -11,8 +11,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; @Mixin(BlockEntity.class) public class InstanceRemoveMixin { diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java index 94176676c..7a9c82540 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java @@ -17,18 +17,18 @@ import com.jozufozu.flywheel.event.ReloadRenderersEvent; import com.jozufozu.flywheel.event.RenderLayerEvent; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; - -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.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.client.Camera; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.client.renderer.RenderBuffers; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; 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 55c0e6ae2..9a9cd1dc2 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/atlas/AtlasDataMixin.java @@ -11,9 +11,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.jozufozu.flywheel.core.atlas.AtlasInfo; 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; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.util.profiling.ProfilerFiller; @Mixin(TextureAtlas.class) public abstract class AtlasDataMixin { 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 5bb3b1a94..0992907e3 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java @@ -9,8 +9,8 @@ import com.jozufozu.flywheel.backend.RenderWork; import com.jozufozu.flywheel.light.LightUpdater; import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientPacketListener; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.multiplayer.ClientPacketListener; import net.minecraft.network.protocol.game.ClientboundLightUpdatePacket; @Mixin(ClientPacketListener.class) diff --git a/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java b/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java index e5339d3e2..d64915050 100644 --- a/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java +++ b/src/main/java/com/jozufozu/flywheel/util/BakedQuadWrapper.java @@ -1,12 +1,13 @@ package com.jozufozu.flywheel.util; -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; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.world.phys.Vec2; + public class BakedQuadWrapper { private final FormatCache formatCache = new FormatCache(); private BakedQuad quad; diff --git a/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java b/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java index 5caa1034d..640506bb6 100644 --- a/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java +++ b/src/main/java/com/jozufozu/flywheel/util/BufferBuilderReader.java @@ -2,10 +2,9 @@ package com.jozufozu.flywheel.util; import java.nio.ByteBuffer; -import com.mojang.datafixers.util.Pair; - import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.VertexFormat; +import com.mojang.datafixers.util.Pair; public class BufferBuilderReader { diff --git a/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java b/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java index 7a06724ab..4897d7888 100644 --- a/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/RenderUtil.java @@ -3,12 +3,11 @@ package com.jozufozu.flywheel.util; import java.util.function.Supplier; import com.mojang.blaze3d.vertex.PoseStack; - -import net.minecraft.core.Direction; -import com.mojang.math.Matrix3f; import com.mojang.math.Matrix4f; import com.mojang.math.Vector3f; +import net.minecraft.core.Direction; + public class RenderUtil { private static final Matrix4f IDENTITY = new Matrix4f(); 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 591ab3a41..5f8604b9e 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java +++ b/src/main/java/com/jozufozu/flywheel/util/transform/MatrixTransformStack.java @@ -1,7 +1,6 @@ package com.jozufozu.flywheel.util.transform; import com.mojang.blaze3d.vertex.PoseStack; - import com.mojang.math.Quaternion; public class MatrixTransformStack implements TransformStack { 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 0a704f90d..f6cdf2ade 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java +++ b/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java @@ -1,10 +1,11 @@ package com.jozufozu.flywheel.util.transform; -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.Direction; import net.minecraft.core.Vec3i; +import net.minecraft.world.phys.Vec3; public interface TransformStack { Vec3 CENTER = new Vec3(0.5, 0.5, 0.5); diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java index b9cfa9c28..22d771e9a 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java @@ -7,13 +7,13 @@ import com.jozufozu.flywheel.core.Materials; 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.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; +import net.minecraft.client.renderer.blockentity.BellRenderer; +import net.minecraft.util.Mth; +import net.minecraft.world.level.block.entity.BellBlockEntity; + public class BellInstance extends TileEntityInstance implements IDynamicInstance { private final OrientedData bell; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java index 1ee1e6485..3ed6547ec 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java @@ -14,20 +14,20 @@ import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; +import com.mojang.math.Quaternion; +import com.mojang.math.Vector3f; import it.unimi.dsi.fastutil.floats.Float2FloatFunction; +import net.minecraft.client.renderer.Sheets; +import net.minecraft.client.resources.model.Material; 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.DoubleBlockCombiner; +import net.minecraft.world.level.block.entity.BlockEntity; 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; +import net.minecraft.world.level.block.state.properties.ChestType; public class ChestInstance extends TileEntityInstance implements IDynamicInstance { diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java index c5d675a54..021c5f069 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java @@ -11,15 +11,15 @@ import com.jozufozu.flywheel.core.model.IModel; import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; +import com.mojang.math.Vector3f; import net.minecraft.core.Vec3i; -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.entity.vehicle.AbstractMinecart; +import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -import com.mojang.math.Vector3f; public class MinecartInstance extends EntityInstance implements IDynamicInstance, ITickableInstance { diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java index 29ac1c79e..a77affd6b 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java @@ -8,16 +8,16 @@ import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.model.ModelPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; - -import net.minecraft.world.level.block.ShulkerBoxBlock; -import net.minecraft.client.renderer.Sheets; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -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; +import net.minecraft.client.renderer.Sheets; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.core.Direction; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.ShulkerBoxBlock; +import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity; + public class ShulkerBoxInstance extends TileEntityInstance implements IDynamicInstance { private final TextureAtlasSprite texture; diff --git a/src/main/resources/flywheel.mixins.json b/src/main/resources/flywheel.mixins.json index 98248ac9c..802354958 100644 --- a/src/main/resources/flywheel.mixins.json +++ b/src/main/resources/flywheel.mixins.json @@ -5,26 +5,24 @@ "compatibilityLevel": "JAVA_16", "refmap": "flywheel.refmap.json", "client": [ - "CancelEntityRenderMixin", - "ChunkRebuildHooksMixin", - "FixFabulousDepthMixin", - "RenderHooksMixin", - "ShaderCloseMixin", "atlas.AtlasDataMixin", "atlas.SheetDataAccessor", "light.LightUpdateMixin", "light.NetworkLightUpdateMixin", - "LevelRendererAccessor", + "matrix.Matrix3fMixin", + "matrix.Matrix4fMixin", + "CancelEntityRenderMixin", + "ChunkRebuildHooksMixin", + "FixFabulousDepthMixin", "InstanceAddMixin", "InstanceRemoveMixin", "LeakChunkStorageArrayMixin", + "LevelRendererAccessor", "PausedPartialTickAccessor", + "RenderHooksMixin", + "ShaderCloseMixin", "ShaderInstanceMixin" ], - "mixins": [ - "matrix.Matrix3fMixin", - "matrix.Matrix4fMixin" - ], "injectors": { "defaultRequire": 1 } diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 95e381309..a9069afef 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,6 @@ { - "pack": { - "description": "flywheel resources", - "pack_format": 6, - "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods." - } + "pack": { + "description": "Flywheel resources", + "pack_format": 7 + } }