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

NeoForge #205

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2ff16af
feat: begin neoforge support
qixils Aug 27, 2024
fce1491
chore: changelog
qixils Aug 27, 2024
c7d7bab
Merge branch 'master' into fabric/1.21.2
qixils Aug 27, 2024
9ecc8e8
fix: entity chaos safeguards
qixils Aug 27, 2024
9b64fea
feat: neoforge loading
qixils Aug 27, 2024
7dbf186
feat: neoforge client loading
qixils Aug 27, 2024
6927689
fix: shaders folder
qixils Aug 27, 2024
8bfcd2c
fix: neoforge version metadata
qixils Aug 27, 2024
4ba545e
feat: neoforge permission node support
qixils Aug 27, 2024
f10374d
fix: dedicated server & lp support
qixils Aug 27, 2024
b9eb047
nitpick
qixils Aug 27, 2024
21155b1
feat: neoforge website
qixils Aug 28, 2024
e055169
fix: accordion margin
qixils Aug 28, 2024
b1735eb
feat: abstract out port instructions
qixils Aug 28, 2024
24a8891
Merge branch 'master' into features/neoforge
qixils Sep 4, 2024
d4dacf5
chore: disable architectury for now
qixils Sep 4, 2024
30bd568
Revert "chore: disable architectury for now"
qixils Sep 4, 2024
12529af
feat: use architectury instead of fabric api
qixils Sep 5, 2024
022c4ef
fix: cloud 2.0 issues
qixils Sep 5, 2024
d59c90b
Revert "feat: use architectury instead of fabric api"
qixils Sep 5, 2024
c18c2b8
chore: give up on architectury
qixils Sep 5, 2024
5dc29e9
fix: 1.21 incompatible
qixils Oct 2, 2024
a41ac1f
wip
qixils Oct 14, 2024
b969818
compiling!
qixils Oct 18, 2024
94ffe84
fix: various issues
qixils Oct 18, 2024
8f1de61
feat: support wip new auth
qixils Oct 29, 2024
e7c2ffc
feat: finish migrating mojmap
qixils Nov 1, 2024
a0c48a0
feat: mojmap 1.21.3
qixils Nov 5, 2024
67834a3
chore: resolve paper dependency issues
qixils Nov 5, 2024
5bfa2f2
feat: paper 1.21.3
qixils Dec 9, 2024
72c6404
chore: adieu, sponge
qixils Dec 9, 2024
1bbfcdc
feat: java 21
qixils Dec 9, 2024
9244cc2
feat: architectury api
qixils Dec 10, 2024
2dc9f72
feat: native networking impl
qixils Dec 12, 2024
14881c1
feat: native networking impl
qixils Dec 14, 2024
0b8b4b1
fix: migrate from ExpectPlatform
qixils Dec 24, 2024
a47dc37
fix: block location teleports during freeze
qixils Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 0 additions & 18 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,6 @@ jobs:
name: crowdcontrol-paper
path: "paper/build/libs/CrowdControl-*.jar"

- name: Upload Sponge 7 Artifact
uses: actions/upload-artifact@v3
with:
name: crowdcontrol-sponge7
path: "sponge-7/build/libs/CrowdControl-*.jar"

- name: Upload Sponge 8 Artifact
uses: actions/upload-artifact@v3
with:
name: crowdcontrol-sponge8
path: "sponge-8/build/libs/CrowdControl-*.jar"

- name: Upload Sponge 11 Artifact
uses: actions/upload-artifact@v3
with:
name: crowdcontrol-sponge11
path: "sponge-11/build/libs/CrowdControl-*.jar"

- name: Upload Fabric Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

A list of all changes made to the software in reverse chronological order.

## 4.0.0

- Redesigned the mod to directly authenticate to Crowd Control and manage your session without needing the app or opened ports
- Implemented workaround for issue with LuckPerms on Paper
- Paper: Fixed *Eat Chorus Fruit* teleporting you into blocks

## 3.7.0

- Added support for [NeoForge](https://neoforged.net/) 🥳

## 3.6.2

- Fixed missing name and conditions for the _Language Shuffle_ effect
Expand Down
94 changes: 66 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
val nettyVersion: String by project
val mojmapVersion: String by project

plugins {
id("java-library") apply true
id("io.freefair.lombok") version "8.6" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply true
id("fabric-loom") version "1.7-SNAPSHOT" apply false
id("dev.architectury.loom") version "1.9-SNAPSHOT" apply false
id("xyz.jpenilla.run-paper") version "2.3.0" apply false // Adds runServer and runMojangMappedServer tasks for testing
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" apply false // Generates plugin.yml
id("org.spongepowered.gradle.plugin") version "2.2.0" apply false // Generates sponge_plugins.json and runServer task
id("io.papermc.paperweight.userdev") version "1.7.1" apply false
id("architectury-plugin") version "3.4-SNAPSHOT" apply true
}

repositories {
Expand All @@ -20,6 +21,10 @@ java {
targetCompatibility = JavaVersion.VERSION_17
}

architectury {
minecraft = mojmapVersion
}

subprojects {
apply {
plugin("java-library")
Expand All @@ -28,34 +33,48 @@ subprojects {
}

repositories {
mavenCentral()
repositories {
maven(url = "https://files.minecraftforge.net/maven/") {
name = "Minecraft Forge"
}
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots"
}
maven {
name = "Jitpack"
url = uri("https://jitpack.io")
}
maven("https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
maven("https://files.minecraftforge.net/maven/") {
name = "Minecraft Forge"
}
maven("https://maven.neoforged.net/releases") {
name = "NeoForged"
}
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots"
}
maven("https://jitpack.io") {
name = "Jitpack"
}
mavenCentral()
mavenLocal()
}

dependencies {
compileOnly("io.netty:netty-buffer:$nettyVersion")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
val targetJavaVersion = 21
tasks.withType<JavaCompile>().configureEach {
options.release.set(targetJavaVersion)
options.encoding = Charsets.UTF_8.name()
}

tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
// withSourcesJar()
}

val isPlatform = project.name.endsWith("-platform")
val isModded = listOf("mojmap-common", "fabric-platform", "neoforge-platform").contains(project.name)

tasks.shadowJar {
relocate("net.kyori.adventure.text.minimessage", "dev.qixils.relocated.adventure.minimessage")
relocate("net.kyori.adventure.text.serializer.legacy", "dev.qixils.relocated.adventure.serializer.legacy")
Expand All @@ -67,24 +86,18 @@ subprojects {
relocate("javax.annotation", "dev.qixils.relocated.javax.annotation")
relocate("org.checkerframework", "dev.qixils.relocated.checkerframework")

if (project.name != "fabric-platform") {
relocate("cloud.commandframework", "dev.qixils.relocated.cloud")
if (!isModded) {
relocate("org.incendo.cloud", "dev.qixils.relocated.cloud")
}
}



if (project.name.endsWith("-platform")) {
if (isPlatform) {
// inherit resources from common module
sourceSets.main { resources.srcDir(project(":base-common").sourceSets["main"].resources.srcDirs) }

tasks {
// TODO: disable output of non-shaded jars? or make their file names more obvious?
shadowJar {
// exclude Java >8 META-INF files
if (java.targetCompatibility.isJava8) {
exclude("META-INF/versions/")
}
// set name of output file to CrowdControl-XYZ-VERSION.jar
val titleCaseName = project.name[0].uppercaseChar() + project.name.substring(1, project.name.indexOf("-platform"))
archiveBaseName.set("CrowdControl-$titleCaseName")
Expand All @@ -100,4 +113,29 @@ subprojects {
}
}
}

if (isModded) {
repositories {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots") {
name = "Sonatype Snapshots"
}
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots") {
name = "Sonatype Snapshots 2"
}
maven(url = "https://maven.shedaniel.me") {
name = "Shedaniel"
}

exclusiveContent {
forRepository {
maven(url = "https://api.modrinth.com/maven") {
name = "Modrinth"
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
}
}
10 changes: 7 additions & 3 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ val crowdControlVersion: String by project
val adventureVersion: String by project
val adventurePlatformVersion: String by project
val cloudVersion: String by project
val cloudExtrasVersion: String by project
val nettyVersion: String by project

dependencies {
api("dev.qixils.crowdcontrol:crowd-control-receiver:$crowdControlVersion")
// api("dev.qixils.crowdcontrol:crowd-control-receiver:$crowdControlVersion")
api("live.crowdcontrol.cc4j:pubsub:1.0.0-SNAPSHOT")
// api("com.google.code.findbugs:findbugs-annotations:3.0.1")

compileOnly("net.kyori:adventure-api:$adventureVersion")
api("net.kyori:adventure-text-minimessage:$adventureVersion") {
exclude(group = "net.kyori", module = "adventure-api")
Expand All @@ -16,8 +20,8 @@ dependencies {
api("net.kyori:adventure-text-serializer-legacy:$adventureVersion") {
exclude(group = "net.kyori", module = "adventure-api")
}
api("com.github.qixils.cloud:cloud-core:$cloudVersion")
api("com.github.qixils.cloud:cloud-minecraft-extras:$cloudVersion") {
api("org.incendo:cloud-core:$cloudVersion")
api("org.incendo:cloud-minecraft-extras:$cloudExtrasVersion") {
exclude(group = "net.kyori", module = "adventure-api")
}
}
Expand Down
14 changes: 14 additions & 0 deletions common/src/main/java/dev/qixils/crowdcontrol/TrackedEffect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package dev.qixils.crowdcontrol;

import live.crowdcontrol.cc4j.CCPlayer;
import live.crowdcontrol.cc4j.websocket.payload.PublicEffectPayload;
import lombok.Data;
import net.kyori.adventure.audience.Audience;
import org.jetbrains.annotations.NotNull;

@Data
public class TrackedEffect {
private final @NotNull Audience audience;
private final @NotNull PublicEffectPayload request;
private final @NotNull CCPlayer ccPlayer;
}
82 changes: 82 additions & 0 deletions common/src/main/java/dev/qixils/crowdcontrol/TriState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package dev.qixils.crowdcontrol;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* A boolean value that may be unknown.
*
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
public enum TriState {
/**
* The value is {@code true}.
*
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
TRUE(true),
/**
* The value is {@code false}.
*
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
FALSE(false),
/**
* The value is unknown.
*
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
UNKNOWN(null);

private final Boolean value;

TriState(Boolean value) {
this.value = value;
}

/**
* Returns the {@link TriState} equivalent of the given {@link Boolean}.
*
* @param value the {@link Boolean} to convert
* @return the equivalent {@link TriState}
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
@NotNull
public static TriState fromBoolean(@Nullable Boolean value) {
if (value == null)
return UNKNOWN;
else if (value)
return TRUE;
else
return FALSE;
}

/**
* Returns the {@link Boolean} equivalent of this {@code TriState}.
*
* @return boolean equivalent
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
@Nullable
public Boolean getBoolean() {
return value;
}

/**
* Returns the primitive boolean equivalent of this {@code TriState}.
*
* @return primitive boolean equivalent
* @since 3.3.0
*/
@ApiStatus.AvailableSince("3.3.0")
public boolean getPrimitiveBoolean() {
return value != null && value;
}
}
Loading
Loading