Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.6 #2

Open
wants to merge 2 commits into
base: 1.20.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions allProjects.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ allprojects {
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

repositories {
// Other repositories can go above or below Modrinth's. We don't need priority :)
Expand Down Expand Up @@ -65,16 +65,16 @@ allprojects {
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

implementation "maven.modrinth:embeddium:0.3.25+mc1.20.4"
compileOnly "maven.modrinth:oculus:1.20.1-1.7.0"
implementation "maven.modrinth:embeddium:ktzp4Wfg"
compileOnly "maven.modrinth:oculus:vVuYfukI"
//compileOnly files(new File(rootDir, "libs/iris-1.6.10.jar"))

implementation "maven.modrinth:cloth-config:13.0.121+neoforge"
implementation "maven.modrinth:cloth-config:PjKtC8lG"

// implementation "io.github.llamalad7:mixinextras-neoforge:0.2.1" // Now already included with newest NEO

compileOnly "com.jozufozu.flywheel:flywheel-forge-1.20.1:1.0.0-beta-88" // No current version available yet
compileOnly "com.jozufozu.flywheel:flywheel-forge-1.20.1:1.0.0-alpha-83" // No current version available yet

implementation "maven.modrinth:pehkui:3.8.2+1.20.4-neoforge"// No current version available yet
implementation "maven.modrinth:pehkui:vKeyKfkC"// No current version available yet
}
}
25 changes: 13 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.155'
id 'net.neoforged.gradle.mixin' version '7.0.155'
id 'net.neoforged.gradle.userdev' version '7.0.142'
id 'net.neoforged.gradle.mixin' version '7.0.142'
}

apply from: "allProjects.gradle"
Expand Down Expand Up @@ -37,15 +37,16 @@ minecraft.accessTransformers.entry 'public net.minecraft.client.multiplayer.Clie

// Neo only transformers
minecraft.accessTransformers.entry 'public net.minecraft.world.entity.EntityType$Builder dimensions'
//sourceSets {
// main {
// java {
// srcDir "q_misc_util/src/main/java"
// srcDir "imm_ptl_core/src/main/java"
// srcDir "src/main/java"
// }
// }
//}
sourceSets {
main {
java {
srcDir "src/main/java"
}
resources {
srcDir "src/main/resources"
}
}
}

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
Expand Down Expand Up @@ -162,7 +163,7 @@ tasks.withType(ProcessResources).configureEach {
]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Move Iris compat to 1.7.0. Change default nether portal mode to adaptive. Maybe fix issue with bobby.
Possibly fix https://github.com/iPortalTeam/MiniScaledMod/issues/35
Binary file removed example_custom_portal_gen.zip
Binary file not shown.
28 changes: 10 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ org.gradle.parallel=false

# Mod Properties
# don't forget to change changelog.md after bumping version
mod_version=5.1.8
mod_version=5.1.7
maven_group=qouteall
archives_base_name=immersive-portals

modmenu_version=9.0.0-pre.1
cloth_config_version=13.0.114
sodium_path=maven.modrinth:sodium:mc1.20.4-0.5.8
iris_path=maven.modrinth:iris:1.7.0+1.20.4
iris_path=maven.modrinth:iris:1.6.17+1.20.4
gravity_changer_version=cd4e3377
pehkui_version=3.7.5
dimlib_version=v1.0.2-mc1.20.4
Expand All @@ -23,7 +23,7 @@ enable_gravity_changer=false
enable_test_mod=false
enable_geckolib=false

minecraft_version=1.20.4
minecraft_version=1.20.6
yarn_mappings=1.20.4+build.1
loader_version=0.15.1

Expand Down Expand Up @@ -55,13 +55,13 @@ fabric_version=0.91.2+1.20.4
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.4,1.21)
minecraft_version_range=[1.20.6,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.4.237
neo_version=20.6.119
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[20.4,)
neo_version_range=[20.6,)
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[1,)
loader_version_range=[2,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
Expand All @@ -76,10 +76,8 @@ loader_version_range=[1,)
#
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
mapping_channel=official
# The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel.
mapping_version=1.20.4
neogradle.subsystems.parchment.minecraftVersion=1.20.6
neogradle.subsystems.parchment.mappingsVersion=2024.05.01


## Mod Properties
Expand All @@ -102,10 +100,4 @@ mod_description=See through portals and travel between dimensions seamlessly.
# Pack version - this changes each minecraft release, in general.
pack_format_number=18
# A URL to refer people to when problems occur with this mod
issue_tracker_url=https://github.com/iPortalTeam/ImmersivePortalsModForNeo/issues



## Neo Properties
neogradle.subsystems.parchment.minecraftVersion=1.20.4
neogradle.subsystems.parchment.mappingsVersion=2024.04.14
issue_tracker_url=https://github.com/iPortalTeam/ImmersivePortalsModForNeo/issues
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ pluginManagement {
url = 'https://jitpack.io'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
40 changes: 21 additions & 19 deletions src/main/java/de/nick1st/imm_ptl/networking/Payloads.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
package de.nick1st.imm_ptl.networking;

import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent;
import net.neoforged.neoforge.network.registration.IPayloadRegistrar;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import net.neoforged.neoforge.network.handling.ServerPayloadContext;
import net.neoforged.neoforge.network.registration.PayloadRegistrar;
import qouteall.imm_ptl.core.network.ImmPtlNetworkConfig;
import qouteall.imm_ptl.core.network.ImmPtlNetworking;
import qouteall.imm_ptl.core.network.PacketRedirection;
import qouteall.imm_ptl.core.platform_specific.IPModEntry;

public class Payloads {
@SubscribeEvent
public static void register(final RegisterPayloadHandlerEvent event) {
final IPayloadRegistrar registrar = event.registrar(IPModEntry.MODID);
public static void register(final RegisterPayloadHandlersEvent event) {
final PayloadRegistrar registrar = event.registrar(IPModEntry.MODID);

// Configuration
registrar.configuration(ImmPtlNetworkConfig.S2CConfigStartPacket.ID,
ImmPtlNetworkConfig.S2CConfigStartPacket::read,
handler -> handler.client(ImmPtlNetworkConfig.S2CConfigStartPacket::handle));
registrar.configurationToClient(ImmPtlNetworkConfig.S2CConfigStartPacket.TYPE,
ImmPtlNetworkConfig.S2CConfigStartPacket.CODEC,
ImmPtlNetworkConfig.S2CConfigStartPacket::handle);

registrar.configuration(ImmPtlNetworkConfig.C2SConfigCompletePacket.ID,
ImmPtlNetworkConfig.C2SConfigCompletePacket::read,
handler -> handler.server(ImmPtlNetworkConfig.C2SConfigCompletePacket::handle));
registrar.configurationToServer(ImmPtlNetworkConfig.C2SConfigCompletePacket.TYPE,
ImmPtlNetworkConfig.C2SConfigCompletePacket.CODEC,
ImmPtlNetworkConfig.C2SConfigCompletePacket::handle);

// Play
registrar.play(ImmPtlNetworking.TeleportPacket.ID, ImmPtlNetworking.TeleportPacket::read, handler ->
handler.server(ImmPtlNetworking.TeleportPacket::handle));
registrar.play(ImmPtlNetworking.GlobalPortalSyncPacket.ID, ImmPtlNetworking.GlobalPortalSyncPacket::read, handler ->
handler.client(ImmPtlNetworking.GlobalPortalSyncPacket::handle));
registrar.play(ImmPtlNetworking.PortalSyncPacket.ID, ImmPtlNetworking.PortalSyncPacket::read, handler ->
handler.client(ImmPtlNetworking.PortalSyncPacket::handle));

final IPayloadRegistrar redirector = event.registrar("i");
redirector.play(PacketRedirection.payloadId, PacketRedirection.Payload::read, handler -> handler.client(PacketRedirection.Payload::handle));
registrar.playToServer(ImmPtlNetworking.TeleportPacket.TYPE, ImmPtlNetworking.TeleportPacket.CODEC, ((teleportPacket, iPayloadContext) -> teleportPacket.handle((ServerPayloadContext) iPayloadContext)));

registrar.playToClient(ImmPtlNetworking.GlobalPortalSyncPacket.TYPE, ImmPtlNetworking.GlobalPortalSyncPacket.CODEC, (globalPortalSyncPacket, iPayloadContext) -> globalPortalSyncPacket.handle());

registrar.playToClient(ImmPtlNetworking.PortalSyncPacket.TYPE, ImmPtlNetworking.PortalSyncPacket.CODEC, (p, c) ->
p.handle());

final PayloadRegistrar redirector = event.registrar("i");
redirector.playToClient(PacketRedirection.Payload.TYPE, PacketRedirection.Payload.CODEC, (p, c) -> p.handle((ClientGamePacketListener) c.listener()));
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package de.nick1st.q_misc_util.networking;

import net.neoforged.neoforge.network.handling.PlayPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadHandler;
import qouteall.q_misc_util.MiscNetworking;

public class ClientPayloadHandler {
public class ClientPayloadHandler implements IPayloadHandler<MiscNetworking.DimIdSyncPacket> {
private static final ClientPayloadHandler INSTANCE = new ClientPayloadHandler();

public static ClientPayloadHandler getInstance() {
return INSTANCE;
}

public void handleDimIdSync(final MiscNetworking.DimIdSyncPacket dimIdSyncPacket, final PlayPayloadContext payloadContext) {
@Override
public void handle(final MiscNetworking.DimIdSyncPacket dimIdSyncPacket, final IPayloadContext payloadContext) {
dimIdSyncPacket.handleOnNetworkingThread();
}
}

This file was deleted.

20 changes: 7 additions & 13 deletions src/main/java/de/nick1st/q_misc_util/networking/Payloads.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
package de.nick1st.q_misc_util.networking;

import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent;
import net.neoforged.neoforge.network.registration.IPayloadRegistrar;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import net.neoforged.neoforge.network.registration.PayloadRegistrar;
import qouteall.q_misc_util.ImplRemoteProcedureCall;
import qouteall.q_misc_util.MiscHelper;
import qouteall.q_misc_util.MiscNetworking;
import qouteall.q_misc_util.MiscUtilModEntry;

public class Payloads {
@SubscribeEvent
public static void register(final RegisterPayloadHandlerEvent event) {
final IPayloadRegistrar registrar = event.registrar(MiscUtilModEntry.MOD_ID);
registrar.play(MiscNetworking.DimIdSyncPacket.ID, MiscNetworking.DimIdSyncPacket::read, handler ->
handler.client(ClientPayloadHandler.getInstance()::handleDimIdSync));
public static void register(final RegisterPayloadHandlersEvent event) {
final PayloadRegistrar registrar = event.registrar(MiscUtilModEntry.MOD_ID);
registrar.playToClient(MiscNetworking.DimIdSyncPacket.TYPE, MiscNetworking.DimIdSyncPacket.CODEC, ClientPayloadHandler.getInstance());

registrar.play(MiscNetworking.id_stcRemote, ImplRemoteProcedureCall::clientReadPacketAndGetHandler, handler ->
handler.client((payload, context) -> MiscHelper.executeOnRenderThread(payload.runnable)));

registrar.play(MiscNetworking.id_ctsRemote, ImplRemoteProcedureCall::serverReadPacket, handler ->
handler.server((payload, context) -> MiscHelper.executeOnServerThread(context.player().get().getServer(),
ImplRemoteProcedureCall.handleServerPayload(payload, context))));
registrar.playToClient(ImplRemoteProcedureCall.S2CRPCPayload.TYPE, ImplRemoteProcedureCall.S2CRPCPayload.CODEC, ImplRemoteProcedureCall.S2CRPCPayload::handle);
registrar.playToServer(ImplRemoteProcedureCall.C2SRPCPayload.TYPE, ImplRemoteProcedureCall.C2SRPCPayload.CODEC, ImplRemoteProcedureCall.C2SRPCPayload::handle);
}
}
1 change: 0 additions & 1 deletion src/main/java/qouteall/imm_ptl/core/IPGlobal.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class IPGlobal {


/**
* This is different to {@link ClientTickEvents#END_CLIENT_TICK}
* It fires right after ticking client world, which is earlier than the Fabric event.
*/
public static class PostClientTickEvent extends Event {}
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/qouteall/imm_ptl/core/IPMcHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.protocol.Packet;
import net.minecraft.util.Tuple;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ClipContext;
Expand Down Expand Up @@ -315,19 +314,12 @@ public static boolean isNvidiaVideocard() {
}

public static FriendlyByteBuf bytesToBuf(byte[] packetBytes) {
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.wrappedBuffer(packetBytes));
return buf;
return new FriendlyByteBuf(Unpooled.wrappedBuffer(packetBytes));
}

public static byte[] bufToBytes(FriendlyByteBuf buf) {
byte[] packetBytes = new byte[buf.readableBytes()];
buf.readBytes(packetBytes);
return packetBytes;
}

public static byte[] packetToBytes(Packet<?> packet) {
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
packet.write(buf);
return bufToBytes(buf);
}
}
6 changes: 3 additions & 3 deletions src/main/java/qouteall/imm_ptl/core/IPModMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.RegisterCommandsEvent;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import net.neoforged.neoforge.registries.RegisterEvent;
import org.slf4j.Logger;
import qouteall.imm_ptl.core.block_manipulation.BlockManipulationServer;
Expand Down Expand Up @@ -65,7 +65,7 @@ public static void init(IEventBus eventBus) {

Helper.LOGGER.info("Immersive Portals Mod Initializing");

eventBus.addListener(RegisterPayloadHandlerEvent.class, Payloads::register);
eventBus.addListener(RegisterPayloadHandlersEvent.class, Payloads::register);
ImmPtlNetworkConfig.init(eventBus);

NeoForge.EVENT_BUS.addListener(IPGlobal.PostClientTickEvent.class, postClientTickEvent -> IPGlobal.CLIENT_TASK_LIST.processTasks());
Expand Down Expand Up @@ -101,7 +101,7 @@ public static void init(IEventBus eventBus) {
BlockManipulationServer.init();

NeoForge.EVENT_BUS.addListener(RegisterCommandsEvent.class, event -> {
PortalCommand.register(event.getDispatcher());
PortalCommand.register(event.getDispatcher(), event.getBuildContext());
});

// @Nick1st moved to IPModEntry (those are registry functions)
Expand Down
Loading