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

[WIP] Port to Fabric #144

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3213ae6
Upgrade the Fabric version and rewrite the code.
hanbings Jun 29, 2023
b4de30c
Migrate the completed code of version 1.19.2.
hanbings Jun 29, 2023
614e347
fabric: some events.
hanbings Jun 30, 2023
6717fdb
Merge branch 'WiIIiam278:master' into master
hanbings Jul 1, 2023
323b0ae
Updated open source license to Apache 2.0.
hanbings Jul 1, 2023
77d7d45
Add Plan analyzer support.
hanbings Jul 1, 2023
8d638d1
Merge branch 'WiIIiam278:master' into master
hanbings Sep 6, 2023
37461f0
Merge branch 'WiIIiam278:master' into master
hanbings Sep 12, 2023
125a6c1
Fix build.
hanbings Sep 12, 2023
f5028b2
Merge branch 'master' into dev/fabric
WiIIiam278 Sep 23, 2023
96639f7
`UnsupportedOperationException`
WiIIiam278 Sep 23, 2023
36ba15d
More fabric implementation work, update to v3's structure
WiIIiam278 Sep 23, 2023
9ab4880
Suppress compiler warnings
WiIIiam278 Sep 23, 2023
7fb3418
Add commands, adjust registration order
WiIIiam278 Sep 23, 2023
8af5af4
Merge branch 'master' into dev/fabric
WiIIiam278 Sep 23, 2023
553c82e
Inventory and ender chest data/serializers
WiIIiam278 Sep 23, 2023
0a3c7ca
Update license headers
WiIIiam278 Sep 23, 2023
83fc337
Fixup shaded library relocations
WiIIiam278 Sep 23, 2023
eb5a870
Merge branch 'master' into dev/fabric
WiIIiam278 Sep 23, 2023
65e2d8e
Merge branch 'master' into dev/fabric
WiIIiam278 Sep 23, 2023
a9a9f59
Merge branch 'master' into master
WiIIiam278 Oct 1, 2023
44ca49a
Merge branch 'master' into dev/fabric
WiIIiam278 Oct 5, 2023
8c4b278
Merge remote-tracking branch 'hanbings/master' into dev/fabric
WiIIiam278 Oct 5, 2023
8041b75
Merge branch 'master' into master
WiIIiam278 Oct 6, 2023
8e3b900
Merge branch 'master' into dev/fabric
WiIIiam278 Oct 13, 2023
cedbba0
Merge remote-tracking branch 'hanbings/master' into dev/fabric
WiIIiam278 Oct 13, 2023
6f32483
Fix build
WiIIiam278 Oct 13, 2023
9f3c377
Potion effects & location serializers
WiIIiam278 Oct 14, 2023
531de61
Catch `Files.createDirectory(path);` in `#getDataFolder`
WiIIiam278 Oct 14, 2023
00b3adc
Merge branch 'master' into master
WiIIiam278 Oct 14, 2023
27ef962
Update fabric.mod.json metadata, correct icon
WiIIiam278 Oct 14, 2023
1f44ab5
Merge branch 'master' into master
WiIIiam278 Nov 3, 2023
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
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ subprojects {
from '../LICENSE'
}

if (['bukkit', 'plugin'].contains(project.name)) {
if (['fabric'].contains(project.name)) {
compileJava.options.release.set 17
}

if (['bukkit', 'plugin', 'fabric'].contains(project.name)) {
shadowJar {
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
Expand Down
5 changes: 3 additions & 2 deletions common/src/main/java/net/william278/husksync/HuskSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -121,7 +122,7 @@ public interface HuskSync {
* @param name the path to the resource
* @return the {@link InputStream} of the resource
*/
InputStream getResource(@NotNull String name);
InputStream getResource(@NotNull String name) throws IOException;

/**
* Log a message to the console
Expand Down Expand Up @@ -158,7 +159,7 @@ default void debug(@NotNull String message, @NotNull Throwable... throwable) {
* @return the plugin data folder as a {@link File}
*/
@NotNull
File getDataFolder();
File getDataFolder() throws IOException;

/**
* Returns a future returning the latest plugin {@link Version} if the plugin is out-of-date
Expand Down
63 changes: 63 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
}

apply plugin: 'fabric-loom'
loom.serverOnlyMinecraftJar()

repositories {
maven { url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}

dependencies {
minecraft "com.mojang:minecraft:${fabric_minecraft_version}"
mappings "net.fabricmc:yarn:${fabric_yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
modImplementation include('net.kyori:adventure-platform-fabric:5.9.0-SNAPSHOT')
modImplementation include('de.themoep:minedown-adventure:1.7.1-SNAPSHOT')

implementation include('redis.clients:jedis:' + jedis_version)
implementation include('com.mysql:mysql-connector-j:' + mysql_driver_version)

compileOnly 'org.jetbrains:annotations:24.0.1'
compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'net.william278:Annotaml:2.0.1'

shadow project(path: ":common")
}

shadowJar {
configurations = [project.configurations.shadow]
destinationDirectory.set(file("$projectDir/build/libs"))

exclude('net.fabricmc:.*')
exclude('net.kyori:.*')
exclude '/mappings/*'

relocate 'org.apache.commons.io', 'net.william278.huskhomes.libraries.commons.io'
relocate 'org.apache.commons.text', 'net.william278.huskhomes.libraries.commons.text'
relocate 'org.apache.commons.lang3', 'net.william278.huskhomes.libraries.commons.lang3'
relocate 'de.themoep', 'net.william278.huskhomes.libraries'
relocate 'org.jetbrains', 'net.william278.huskhomes.libraries'
relocate 'org.intellij', 'net.william278.huskhomes.libraries'
relocate 'com.zaxxer', 'net.william278.huskhomes.libraries'
relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml'
relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown'
relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml'
relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml'
relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson'
}

remapJar {
dependsOn tasks.shadowJar
mustRunAfter tasks.shadowJar
inputFile = shadowJar.archiveFile.get()
addNestedDependencies = true

destinationDirectory.set(file("$rootDir/target/"))
archiveClassifier.set('')
}

shadowJar.finalizedBy(remapJar)
Loading