mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 23:47:09 +01:00
Update to 1.18
This commit is contained in:
parent
7813eedf61
commit
ca459dd2ca
14 changed files with 26 additions and 29 deletions
|
@ -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 {
|
||||
|
|
|
@ -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.+
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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<CommandSourceStack> dispatcher = event.getServer()
|
||||
.getCommands()
|
||||
.getDispatcher();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<StitchedSprite> 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<StitchedSprite> sprites = ALL.get(atlasLocation);
|
||||
if (sprites != null) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue