[NO-ORBIT] Unified Porting Branch
This commit is contained in:
22
patches/1.20.4/Forge/build.gradle.patch
Normal file
22
patches/1.20.4/Forge/build.gradle.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
--- a/Forge/build.gradle
|
||||
+++ b/Forge/build.gradle
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
dependencies {
|
||||
// Compat
|
||||
- // NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
+ modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -104,8 +104,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md")
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[Forge 1.20.6] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.20.6")
|
||||
+ setDisplayName("[Forge 1.20.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.20.4")
|
||||
setLoaders("forge")
|
||||
setArtifact(remapJar)
|
||||
setCurseEnvironment("both")
|
@@ -0,0 +1,20 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java
|
||||
@@ -3,6 +3,7 @@
|
||||
import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
import com.hypherionmc.craterlib.common.ForgeServerEvents;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
+import com.hypherionmc.craterlib.compat.Vanish;
|
||||
import com.hypherionmc.craterlib.core.networking.CraterPacketNetwork;
|
||||
import com.hypherionmc.craterlib.core.networking.data.PacketSide;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
@@ -32,5 +33,9 @@
|
||||
LateInitEvent event = new LateInitEvent(new BridgedMinecraft(), BridgedOptions.of(Minecraft.getInstance().options));
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
});
|
||||
+
|
||||
+ if (ModloaderEnvironment.INSTANCE.isModLoaded("vmod")) {
|
||||
+ MinecraftForge.EVENT_BUS.register(new Vanish());
|
||||
+ }
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
--- /dev/null
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java
|
||||
@@ -1,0 +1,25 @@
|
||||
+package com.hypherionmc.craterlib.compat;
|
||||
+
|
||||
+import com.hypherionmc.craterlib.api.events.server.CraterPlayerEvent;
|
||||
+import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
+import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
+import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
+import redstonedubstep.mods.vanishmod.api.PlayerVanishEvent;
|
||||
+
|
||||
+public class Vanish {
|
||||
+
|
||||
+ public Vanish() {
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ @SubscribeEvent
|
||||
+ public void vanishevent(PlayerVanishEvent event) {
|
||||
+ if (event.isVanished()) {
|
||||
+ CraterEventBus.INSTANCE.postEvent(new CraterPlayerEvent.PlayerLoggedOut(BridgedPlayer.of(event.getEntity())));
|
||||
+ } else {
|
||||
+ CraterEventBus.INSTANCE.postEvent(new CraterPlayerEvent.PlayerLoggedIn(BridgedPlayer.of(event.getEntity())));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
@@ -0,0 +1,11 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
@@ -22,7 +22,7 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
- method = "lambda$handleChat$5",
|
||||
+ method = "lambda$handleChat$6",
|
||||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
@@ -0,0 +1,11 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/network/CraterForgeNetworkHandler.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/network/CraterForgeNetworkHandler.java
|
||||
@@ -36,7 +36,7 @@
|
||||
protected <T> void registerPacket(PacketHolder<T> holder) {
|
||||
if (CHANNELS.get(holder.messageType()) == null) {
|
||||
SimpleChannel channel = ChannelBuilder
|
||||
- .named(holder.type().id())
|
||||
+ .named(holder.type().toMojang())
|
||||
.clientAcceptedVersions((a, b) -> true)
|
||||
.serverAcceptedVersions((a, b) -> true)
|
||||
.networkProtocolVersion(1)
|
@@ -0,0 +1,25 @@
|
||||
--- a/Forge/src/main/resources/META-INF/mods.toml
|
||||
+++ b/Forge/src/main/resources/META-INF/mods.toml
|
||||
@@ -1,5 +1,5 @@
|
||||
modLoader = "javafml"
|
||||
-loaderVersion = "[50,)"
|
||||
+loaderVersion = "[49,)"
|
||||
license = "MIT"
|
||||
issueTrackerURL = "https://github.com/firstdarkdev/craterLib/issues"
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
[[dependencies.${ mod_id }]]
|
||||
modId = "forge"
|
||||
mandatory = true
|
||||
- versionRange = "[50,)"
|
||||
+ versionRange = "[49,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.${ mod_id }]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
- versionRange = "[1.20.6,1.21)"
|
||||
+ versionRange = "[1.20.4,1.20.5)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
Reference in New Issue
Block a user