diff --git a/build.gradle b/build.gradle index 992b17818..77e321386 100644 --- a/build.gradle +++ b/build.gradle @@ -31,11 +31,11 @@ version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildnumber}" : '') group = 'com.jozufozu.flywheel' archivesBaseName = 'flywheel-forge' -java.toolchain.languageVersion = JavaLanguageVersion.of(16) +java.toolchain.languageVersion = JavaLanguageVersion.of(17) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { - mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}" + mappings channel: 'official', version: "${minecraft_version}" // TODO: waiting for parchment 1.18 runs { client { diff --git a/gradle.properties b/gradle.properties index 58c6330b9..f267992ed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ 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.1.0 +mc_update_version = 1.18 +minecraft_version = 1.18 +forge_version = 38.0.15 # build dependency versions forgegradle_version = 5.1.+ diff --git a/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java b/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java index b73eef7f1..03369f6c5 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java +++ b/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java @@ -4,7 +4,7 @@ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.client.event.RenderLevelLastEvent; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @@ -15,7 +15,7 @@ public class RenderWork { @SubscribeEvent(priority = EventPriority.LOWEST) - public static void onRenderWorldLast(RenderWorldLastEvent event) { + public static void onRenderWorldLast(RenderLevelLastEvent event) { while (!runs.isEmpty()) { runs.remove() .run(); diff --git a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java index fc91f3b8d..b6c0d53ad 100644 --- a/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java +++ b/src/main/java/com/jozufozu/flywheel/config/BooleanConfigCommand.java @@ -6,7 +6,7 @@ import com.mojang.brigadier.builder.ArgumentBuilder; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.fmllegacy.network.PacketDistributor; +import net.minecraftforge.network.PacketDistributor; public class BooleanConfigCommand { diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java index ef79eda16..31525410c 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java @@ -4,12 +4,12 @@ import com.mojang.brigadier.CommandDispatcher; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; +import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fmlserverevents.FMLServerStartingEvent; public class FlwCommands { @SubscribeEvent - public static void onServerStarting(FMLServerStartingEvent event) { + public static void onServerStarting(ServerStartingEvent event) { 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 45207b3aa..97c4a0e46 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwPackets.java @@ -3,9 +3,9 @@ package com.jozufozu.flywheel.config; import com.jozufozu.flywheel.Flywheel; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.fmllegacy.network.NetworkDirection; -import net.minecraftforge.fmllegacy.network.NetworkRegistry; -import net.minecraftforge.fmllegacy.network.simple.SimpleChannel; +import net.minecraftforge.network.NetworkDirection; +import net.minecraftforge.network.NetworkRegistry; +import net.minecraftforge.network.simple.SimpleChannel; public class FlwPackets { public static final ResourceLocation CHANNEL_NAME = new ResourceLocation(Flywheel.ID, "network"); diff --git a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java index 86f2562c5..19853d9db 100644 --- a/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java +++ b/src/main/java/com/jozufozu/flywheel/config/SConfigureBooleanPacket.java @@ -4,7 +4,7 @@ package com.jozufozu.flywheel.config; import java.util.function.Supplier; import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.fmllegacy.network.NetworkEvent; +import net.minecraftforge.network.NetworkEvent; /** * Thanks, @zelophed diff --git a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java index f84693eb3..6340e8441 100644 --- a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java +++ b/src/main/java/com/jozufozu/flywheel/core/PartialModel.java @@ -8,7 +8,7 @@ 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; +import net.minecraftforge.client.model.ForgeModelBakery; /** * A helper class for loading and accessing json models. @@ -38,7 +38,7 @@ public class PartialModel { public static void onModelRegistry(ModelRegistryEvent event) { for (PartialModel partial : ALL) - ModelLoader.addSpecialModel(partial.getLocation()); + ForgeModelBakery.addSpecialModel(partial.getLocation()); tooLate = true; } diff --git a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java index 6f6157799..a08f27ab8 100644 --- a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java +++ b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java @@ -29,7 +29,7 @@ public class StitchedSprite { } public static void onTextureStitchPre(TextureStitchEvent.Pre event) { - ResourceLocation atlasLocation = event.getMap().location(); + ResourceLocation atlasLocation = event.getAtlas().location(); List sprites = ALL.get(atlasLocation); if (sprites != null) { for (StitchedSprite sprite : sprites) { @@ -39,7 +39,7 @@ public class StitchedSprite { } public static void onTextureStitchPost(TextureStitchEvent.Post event) { - TextureAtlas atlas = event.getMap(); + TextureAtlas atlas = event.getAtlas(); ResourceLocation atlasLocation = atlas.location(); List sprites = ALL.get(atlasLocation); if (sprites != null) { 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 5cc93692f..bdbb738e8 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java @@ -34,7 +34,7 @@ public class ModelUtil { BufferBuilder builder = new BufferBuilder(DefaultVertexFormat.BLOCK.getIntegerSize()); builder.begin(QUADS, DefaultVertexFormat.BLOCK); - ForgeHooksClient.setRenderLayer(layer); + ForgeHooksClient.setRenderType(layer); ModelBlockRenderer.enableCaching(); for (StructureTemplate.StructureBlockInfo info : blocks) { BlockState state = info.state; @@ -53,7 +53,7 @@ public class ModelUtil { ms.popPose(); } ModelBlockRenderer.clearCache(); - ForgeHooksClient.setRenderLayer(null); + ForgeHooksClient.setRenderType(null); builder.end(); return builder; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java index 7a9c82540..ca534b44d 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java @@ -46,8 +46,8 @@ public class RenderHooksMixin { private RenderBuffers renderBuffers; @Inject(at = @At("HEAD"), method = "setupRender") - 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)); + private void setupRender(Camera camera, Frustum frustum, boolean queue, boolean isSpectator, CallbackInfo ci) { + MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, camera, frustum)); } /** 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 0992907e3..d38d18fdc 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java @@ -16,7 +16,7 @@ import net.minecraft.network.protocol.game.ClientboundLightUpdatePacket; @Mixin(ClientPacketListener.class) public class NetworkLightUpdateMixin { - @Inject(at = @At("TAIL"), method = "handleLightUpdatePacked") + @Inject(at = @At("TAIL"), method = "handleLightUpdatePacket") private void onLightPacket(ClientboundLightUpdatePacket packet, CallbackInfo ci) { RenderWork.enqueue(() -> { ClientLevel world = Minecraft.getInstance().level; diff --git a/src/main/java/com/jozufozu/flywheel/util/StreamUtil.java b/src/main/java/com/jozufozu/flywheel/util/StreamUtil.java index c2dcd844a..dd1b4d70a 100644 --- a/src/main/java/com/jozufozu/flywheel/util/StreamUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/StreamUtil.java @@ -11,11 +11,8 @@ import java.nio.channels.ReadableByteChannel; import org.lwjgl.system.MemoryUtil; -import com.mojang.blaze3d.systems.RenderSystem; - public class StreamUtil { public static String readToString(InputStream is) { - RenderSystem.assertThread(RenderSystem::isOnRenderThread); ByteBuffer bytebuffer = null; try { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 7012cd059..5e2744c9f 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader = "javafml" -loaderVersion = "[37,)" +loaderVersion = "[38,)" issueTrackerURL = "https://github.com/Jozufozu/Flywheel/issues" license = "MIT" @@ -17,13 +17,13 @@ A modern engine for modded minecraft. [[dependencies.flywheel]] modId = "forge" mandatory = true -versionRange = "[37,)" +versionRange = "[38,)" ordering = "NONE" side = "BOTH" [[dependencies.flywheel]] modId = "minecraft" mandatory = true -versionRange = "[1.17,1.18)" +versionRange = "[1.18,1.19)" ordering = "NONE" side = "BOTH"