-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable forge platform
- Loading branch information
Showing
19 changed files
with
220 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
build/ | ||
eclipse/ | ||
run/ | ||
runs/ | ||
out/ | ||
asm/ | ||
bin/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import net.neoforged.gradle.dsl.common.runs.run.Run | ||
|
||
plugins { | ||
idea | ||
id("net.neoforged.gradle.userdev") version "7.0.+" | ||
} | ||
|
||
setupPlatform() | ||
|
||
dependencies { | ||
implementation("net.neoforged:neoforge:${rootProp["neo"]}") | ||
} | ||
|
||
runs { | ||
val runConfig = Action<Run> { | ||
modSource(sourceSets["main"]) | ||
modSource(sourceSets["testmod"]) | ||
} | ||
|
||
create("client", runConfig) | ||
create("server", runConfig) | ||
} | ||
|
||
tasks.processResources { | ||
inputs.property("version", project.version) | ||
|
||
filesMatching("META-INF/mods.toml") { | ||
expand("version" to project.version) | ||
} | ||
} | ||
|
||
tasks.named<JavaCompile>("compileTestmodJava") { | ||
source(rootProject.sourceSets["testmod"].allSource) | ||
} | ||
|
||
afterEvaluate { | ||
val jar = tasks.jar.get() | ||
val sourcesJar = tasks.sourcesJar.get() | ||
|
||
upload { | ||
curseforge(jar) | ||
modrinth(jar) | ||
maven(jar, sourcesJar) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# CurseForge | ||
cf.endpoint = minecraft.curseforge.com | ||
cf.prefix = [NeoForge] | ||
cf.releaseType = beta | ||
cf.loader = NeoForge | ||
cf.gameVersion = 1.20.2 | ||
|
||
# Modrinth | ||
mr.releaseType = release | ||
mr.loader = neoforge | ||
mr.gameVersion = 1.20.2 |
9 changes: 9 additions & 0 deletions
9
platform/neo/src/main/java/lol/bai/badpackets/impl/neo/NeoBadPackets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package lol.bai.badpackets.impl.neo; | ||
|
||
import lol.bai.badpackets.impl.Constants; | ||
import net.neoforged.fml.common.Mod; | ||
|
||
@Mod(Constants.MOD_ID) | ||
public class NeoBadPackets { | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
platform/neo/src/main/java/lol/bai/badpackets/impl/neo/NeoProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package lol.bai.badpackets.impl.neo; | ||
|
||
import lol.bai.badpackets.impl.Constants; | ||
import lol.bai.badpackets.impl.platform.PlatformProxy; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.protocol.Packet; | ||
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; | ||
import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; | ||
import net.neoforged.neoforge.network.custom.payload.SimplePayload; | ||
|
||
public class NeoProxy extends PlatformProxy { | ||
|
||
@Override | ||
public Packet<?> createVanillaRegisterConfigS2CPacket(FriendlyByteBuf buf) { | ||
return new ClientboundCustomPayloadPacket(SimplePayload.outbound(buf, 0, Constants.MC_REGISTER_CHANNEL)); | ||
} | ||
|
||
@Override | ||
public Packet<?> createVanillaRegisterConfigC2SPacket(FriendlyByteBuf buf) { | ||
return new ServerboundCustomPayloadPacket(SimplePayload.outbound(buf, 0, Constants.MC_REGISTER_CHANNEL)); | ||
} | ||
|
||
@Override | ||
public Packet<?> createVanillaRegisterPlayS2CPacket(FriendlyByteBuf buf) { | ||
return new ClientboundCustomPayloadPacket(SimplePayload.outbound(buf, 0, Constants.MC_REGISTER_CHANNEL)); | ||
} | ||
|
||
@Override | ||
public Packet<?> createVanillaRegisterPlayC2SPacket(FriendlyByteBuf buf) { | ||
return new ServerboundCustomPayloadPacket(SimplePayload.outbound(buf, 0, Constants.MC_REGISTER_CHANNEL)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[1,)" | ||
|
||
license = "Apache-2.0" | ||
issueTrackerURL = "https://github.com/badasintended/badpackets/issues" | ||
|
||
[[mods]] | ||
modId = "badpackets" | ||
version = "${version}" | ||
displayName = "Bad Packets" | ||
description = "Allow packet messaging between multiple modding platform." | ||
authors = "deirn" | ||
logoFile = "badpackets.png" | ||
|
||
[[mixins]] | ||
config = "badpackets.mixins.json" | ||
|
||
[[dependencies.badpackets]] | ||
modId = "minecraft" | ||
mandatory = true | ||
versionRange = "[1.20.2,)" | ||
ordering = "NONE" | ||
side = "BOTH" |
1 change: 1 addition & 0 deletions
1
...m/neo/src/main/resources/META-INF/services/lol.bai.badpackets.impl.platform.PlatformProxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lol.bai.badpackets.impl.neo.NeoProxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"pack": { | ||
"description": "badpackets", | ||
"pack_format": 8 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
platform/neo/src/testmod/java/lol/badpackets/test/neo/ForgeBadPacketTestClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package lol.badpackets.test.neo; | ||
|
||
import lol.bai.badpackets.impl.Constants; | ||
import lol.bai.badpackets.test.BadPacketTest; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.Mod.EventBusSubscriber; | ||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; | ||
|
||
import static net.neoforged.fml.common.Mod.EventBusSubscriber.Bus; | ||
|
||
@EventBusSubscriber(modid = Constants.MOD_ID, bus = Bus.MOD, value = Dist.CLIENT) | ||
public class ForgeBadPacketTestClient { | ||
|
||
@SubscribeEvent | ||
static void setup(FMLClientSetupEvent event) { | ||
BadPacketTest.client(); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
platform/neo/src/testmod/java/lol/badpackets/test/neo/NeoBadPacketTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lol.badpackets.test.neo; | ||
|
||
import lol.bai.badpackets.impl.Constants; | ||
import lol.bai.badpackets.test.BadPacketTest; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.Mod.EventBusSubscriber; | ||
import net.neoforged.fml.common.Mod.EventBusSubscriber.Bus; | ||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; | ||
|
||
@EventBusSubscriber(modid = Constants.MOD_ID, bus = Bus.MOD) | ||
public class NeoBadPacketTest { | ||
|
||
@SubscribeEvent | ||
static void setup(FMLCommonSetupEvent event) { | ||
BadPacketTest.server(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters