Improve build tooling + bring back Forge (#108)

This commit is contained in:
Dylan Xaldin authored and GitHub committed 2021-07-27 23:00:05 -07:00
1 parent e80df2186a
commit 132023f7e0
28 files changed
+511 -438

No files matched your search

+5
View File
@@ -35,6 +35,11 @@ jobs:
with:
name: Fabric
path: "fabric/build/libs/Chunky-*.jar"
- name: Upload Forge
uses: actions/upload-artifact@v2
with:
name: Forge
path: "forge/build/libs/Chunky-*.jar"
- name: Upload Sponge
uses: actions/upload-artifact@v2
with:
+193 -28
View File
@@ -1,17 +1,166 @@
# User-specific stuff
.idea/
*.iml
*.ipr
# Created by https://www.toptal.com/developers/gitignore/api/windows,linux,macos,java,gradle,intellij+all,eclipse,visualstudiocode,netbeans
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,macos,java,gradle,intellij+all,eclipse,visualstudiocode,netbeans
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
### Eclipse Patch ###
# Spring Boot Tooling
.sts4-cache/
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
@@ -21,6 +170,9 @@ atlassian-ide-plugin.xml
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
@@ -33,6 +185,7 @@ atlassian-ide-plugin.xml
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
@@ -47,6 +200,7 @@ hs_err_pid*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
@@ -55,6 +209,7 @@ hs_err_pid*
# Icon must end with two \r
Icon
# Thumbnails
._*
@@ -74,6 +229,29 @@ Network Trash Folder
Temporary Items
.apdisk
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### VisualStudioCode ###
.vscode/*
*.code-workspace
# Local History for Visual Studio Code
.history/
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
@@ -99,35 +277,22 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml
# Gradle
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Cache of project
.gradletasknamecache
**/build/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Common working directory
run/
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
**/build/
# End of https://www.toptal.com/developers/gitignore/api/windows,linux,macos,java,gradle,intellij+all,eclipse,visualstudiocode,netbeans
-45
View File
@@ -1,45 +0,0 @@
subprojects {
plugins.apply("java-library")
plugins.apply("maven-publish")
group = 'org.popcraft'
project.ext.majorVersion = '1'
project.ext.minorVersion = '2'
project.ext.patchVersion = commitsSinceLastTag()
project.ext.fullVersion = project.ext.majorVersion + '.' + project.ext.minorVersion + '.' + project.ext.patchVersion
version = project.ext.fullVersion
[tasks.withType(JavaCompile), tasks.withType(Javadoc)].forEach { type ->
type.configureEach {
it.options.encoding = "UTF-8"
}
}
java {
withSourcesJar()
def targetJava = 8
targetCompatibility = JavaVersion.toVersion(targetJava)
sourceCompatibility = JavaVersion.toVersion(targetJava)
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
}
String commitsSinceLastTag() {
def tagDescription = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = tagDescription
}
tagDescription = tagDescription.toString()
if (tagDescription.indexOf('-') < 0) {
return 0;
}
return tagDescription.split('-')[1]
}
+73
View File
@@ -0,0 +1,73 @@
import java.io.ByteArrayOutputStream
plugins {
id("java-library")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.0.0"
}
subprojects {
plugins.apply("java-library")
plugins.apply("maven-publish")
plugins.apply("com.github.johnrengelman.shadow")
group = "${project.property("group")}"
version = "${project.property("version")}.${commitsSinceLastTag()}"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
withSourcesJar()
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
jar {
archiveClassifier.set("noshade")
}
shadowJar {
archiveClassifier.set("")
archiveFileName.set("${rootProject.name.capitalize()}-${project.version}.jar")
}
build {
dependsOn(shadowJar)
}
}
publishing {
repositories {
if (project.hasProperty("mavenUsername") && project.hasProperty("mavenPassword")) {
maven {
credentials {
username = "${project.property("mavenUsername")}"
password = "${project.property("mavenPassword")}"
}
url = uri("https://repo.codemc.io/repository/maven-releases/")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = project.name
version = "${project.version}"
from(components["java"])
}
}
}
}
fun commitsSinceLastTag(): String {
val tagDescription = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags")
standardOutput = tagDescription
}
if (tagDescription.toString().indexOf('-') < 0) {
return "0"
}
return tagDescription.toString().split('-')[1]
}
-63
View File
@@ -1,63 +0,0 @@
plugins {
id 'com.github.johnrengelman.shadow'
}
repositories {
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots'
}
maven {
url 'https://papermc.io/repo/repository/maven-public'
}
}
dependencies {
implementation project(':common')
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT'
implementation 'io.papermc:paperlib:1.0.6'
}
processResources {
filesMatching("plugin.yml") {
expand 'projectVersion': project.ext.fullVersion
}
}
jar {
archiveClassifier.set("unshaded")
}
shadowJar {
archiveClassifier.set(null)
archiveFileName.set("Chunky-${project.ext.fullVersion}.jar")
relocate 'io.papermc.lib', 'org.popcraft.chunky.lib.paperlib'
}
artifacts {
archives shadowJar
}
publishing {
repositories {
if (project.hasProperty('mavenUsername') && project.hasProperty('mavenPassword'))
maven {
credentials {
username = project.mavenUsername
password = project.mavenPassword
}
def releasesRepoUrl = 'https://repo.codemc.io/repository/maven-releases/'
def snapshotsRepoUrl = 'https://repo.codemc.io/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
publications {
maven(MavenPublication) {
groupId = 'org.popcraft'
artifactId = 'chunky-bukkit'
version = project.ext.fullVersion
from components.java
}
}
}
+27
View File
@@ -0,0 +1,27 @@
repositories {
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://papermc.io/repo/repository/maven-public")
}
dependencies {
compileOnly(group = "org.spigotmc", name = "spigot-api", version = "1.17.1-R0.1-SNAPSHOT")
implementation(group = "io.papermc", name = "paperlib", version = "1.0.6")
implementation(project(":chunky-common"))
}
tasks {
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name.capitalize(),
"version" to project.version,
"group" to project.group,
"author" to project.property("author"),
"description" to project.property("description"),
)
}
}
shadowJar {
relocate("io.papermc.lib", "${project.group}.${rootProject.name}.lib.paperlib")
}
}
+6 -6
View File
@@ -1,11 +1,11 @@
name: Chunky
version: ${projectVersion}
main: org.popcraft.chunky.ChunkyBukkit
api-version: "1.13"
name: ${name}
version: ${version}
main: ${group}.chunky.ChunkyBukkit
api-version: 1.13
softdepend: [dynmap, BlueMap, Pl3xMap, WorldBorder]
load: POSTWORLD
authors: [pop4959]
description: Pre-generates chunks, quickly, efficiently, and safely
authors: [${author}]
description: ${description}
website: https://www.spigotmc.org/resources/chunky.81534/
commands:
chunky:
-43
View File
@@ -1,43 +0,0 @@
repositories {
maven {
url 'https://repo.mikeprimm.com'
}
maven {
url 'https://repo.pl3x.net'
}
maven {
url 'https://jitpack.io'
}
}
dependencies {
testImplementation 'junit:junit:4.13.1'
testImplementation 'com.google.code.gson:gson:2.8.6'
compileOnly 'us.dynmap:dynmap-api:3.0'
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:v1.3.0'
compileOnly 'net.pl3x.map:pl3xmap-api:1.0.0-SNAPSHOT'
compileOnly 'com.github.Brettflan:WorldBorder:c0d1772418'
}
publishing {
repositories {
if (project.hasProperty('mavenUsername') && project.hasProperty('mavenPassword'))
maven {
credentials {
username = project.mavenUsername
password = project.mavenPassword
}
def releasesRepoUrl = 'https://repo.codemc.io/repository/maven-releases/'
def snapshotsRepoUrl = 'https://repo.codemc.io/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
publications {
maven(MavenPublication) {
groupId = 'org.popcraft'
artifactId = 'chunky-common'
version = project.ext.fullVersion
from components.java
}
}
}
+15
View File
@@ -0,0 +1,15 @@
repositories {
mavenCentral()
maven("https://repo.mikeprimm.com")
maven("https://repo.pl3x.net")
maven("https://jitpack.io")
}
dependencies {
compileOnly(group = "us.dynmap", name = "dynmap-api", version = "3.1")
compileOnly(group = "com.github.BlueMap-Minecraft", name = "BlueMapAPI", version = "v1.6.0")
compileOnly(group = "net.pl3x.map", name = "pl3xmap-api", version = "1.0.0-SNAPSHOT")
compileOnly(group = "com.github.Brettflan", name = "WorldBorder", version = "c0d1772418")
testImplementation(group = "junit", name = "junit", version = "4.13.2")
testImplementation(group = "com.google.code.gson", name = "gson", version = "2.8.7")
}
-53
View File
@@ -1,53 +0,0 @@
plugins {
id 'com.github.johnrengelman.shadow'
id 'fabric-loom' version '0.8-SNAPSHOT'
}
configurations {
implementation.extendsFrom shade
}
repositories {
mavenLocal()
}
dependencies {
shade(project(':common'))
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
def targetJava = 16
targetCompatibility = JavaVersion.toVersion(targetJava)
sourceCompatibility = JavaVersion.toVersion(targetJava)
}
tasks {
jar {
archiveClassifier.set("dev")
}
shadowJar {
archiveClassifier.set("shadow")
configurations = [project.configurations.shade]
}
remapJar {
archiveClassifier.set(null)
input.set(shadowJar.archiveFile)
archiveFileName.set("Chunky-${project.version}.jar")
}
build {
dependsOn(remapJar)
}
}
+44
View File
@@ -0,0 +1,44 @@
plugins {
id("fabric-loom") version "0.8-SNAPSHOT"
}
dependencies {
minecraft(group = "com.mojang", name = "minecraft", version = "1.17.1")
mappings(group = "net.fabricmc", name = "yarn", version = "1.17.1+build.31", classifier = "v2")
modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.11.6")
modImplementation(group = "net.fabricmc.fabric-api", name = "fabric-api", version = "0.37.1+1.17")
implementation(project(":chunky-common"))
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
}
}
tasks {
processResources {
filesMatching("fabric.mod.json") {
expand(
"id" to rootProject.name,
"version" to project.version,
"name" to rootProject.name.capitalize(),
"description" to project.property("description"),
"author" to project.property("author"),
"github" to project.property("github")
)
}
}
shadowJar {
dependencies {
include(project(":chunky-common"))
}
exclude("mappings/")
archiveClassifier.set("dev")
archiveFileName.set(null as String?)
}
remapJar {
input.set(shadowJar.get().archiveFile)
archiveFileName.set("${rootProject.name.capitalize()}-${project.version}.jar")
}
}
-8
View File
@@ -1,8 +0,0 @@
# Increases the memory available to gradle.
org.gradle.jvmargs=-Xmx4G
# Fabric Properties
# https://modmuss50.me/fabric.html
minecraft_version=1.17.1-rc2
yarn_mappings=1.17.1-rc2+build.2
loader_version=0.11.6
fabric_version=0.36.1+1.17
Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 56 KiB

+9 -8
View File
@@ -1,18 +1,18 @@
{
"schemaVersion": 1,
"id": "chunky",
"id": "${id}",
"version": "${version}",
"name": "Chunky",
"description": "Pre-generates chunks, quickly, efficiently, and safely",
"name": "${name}",
"description": "${description}",
"authors": [
"pop4959"
"${author}"
],
"contact": {
"website": "https://www.curseforge.com/minecraft/mc-mods/chunky-pregenerator",
"homepage": "https://www.curseforge.com/minecraft/mc-mods/chunky-pregenerator",
"repo": "https://github.com/pop4959/Chunky",
"sources": "https://github.com/pop4959/Chunky",
"issues": "https://github.com/pop4959/Chunky/issues"
"repo": "${github}",
"sources": "${github}",
"issues": "${github}/issues"
},
"license": "GPLv3",
"icon": "assets/chunky/icon.png",
@@ -31,7 +31,8 @@
"depends": {
"fabricloader": ">=0.11.3",
"fabric": "*",
"minecraft": ">=1.17.0"
"minecraft": ">=1.17.0",
"java": ">=16"
},
"custom": {
"modmenu": {
-65
View File
@@ -1,65 +0,0 @@
buildscript {
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.+', changing: true
}
}
plugins {
id 'com.github.johnrengelman.shadow'
}
plugins.apply("net.minecraftforge.gradle")
group = 'org.popcraft'
minecraft {
mappings channel: 'snapshot', version: '20210309-1.16.5'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
compile.extendsFrom shade
}
dependencies {
shade(project(":common"))
minecraft 'net.minecraftforge:forge:1.16.5-36.1.13'
}
tasks {
jar {
archiveClassifier.set("unshaded")
}
shadowJar {
archiveClassifier.set(null)
archiveFileName.set("Chunky-${project.version}.jar")
configurations = [project.configurations.shade]
}
build {
dependsOn(shadowJar)
}
}
jar {
manifest {
attributes([
"Specification-Title" : "chunky",
"Specification-Vendor" : "pop4959",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "pop4959",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
afterEvaluate {
reobf {
shadowJar {
mappings = createMcpToSrg.output
}
}
}
+46
View File
@@ -0,0 +1,46 @@
plugins {
id("dev.architectury.loom") version "0.7.2-SNAPSHOT"
}
dependencies {
minecraft(group = "com.mojang", name = "minecraft", version = "1.16.5")
mappings(group = "de.oceanlabs.mcp", name = "mcp_snapshot", version = "20210309-1.16.5")
forge(group = "net.minecraftforge", name = "forge", version = "1.16.5-36.1.13")
implementation(project(":chunky-common"))
}
tasks {
processResources {
filesMatching("META-INF/mods.toml") {
expand(
"github" to project.property("github"),
"id" to rootProject.name,
"version" to project.version,
"name" to rootProject.name.capitalize(),
"author" to project.property("author"),
"description" to project.property("description")
)
}
}
jar {
manifest {
attributes(mapOf(
"Implementation-Title" to rootProject.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to project.property("author")
))
}
}
shadowJar {
dependencies {
include(project(":chunky-common"))
}
exclude("mappings/")
archiveClassifier.set("dev")
archiveFileName.set(null as String?)
}
remapJar {
input.set(shadowJar.get().archiveFile)
archiveFileName.set("${rootProject.name.capitalize()}-${project.version}.jar")
}
}
+1 -2
View File
@@ -1,2 +1 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
loom.platform=forge
@@ -12,8 +12,8 @@ import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.popcraft.chunky.command.ChunkyCommand;
import org.popcraft.chunky.platform.ForgePlatform;
import org.popcraft.chunky.platform.ForgeSender;
import org.popcraft.chunky.platform.ForgeServer;
import org.popcraft.chunky.platform.Sender;
import org.popcraft.chunky.platform.impl.GsonConfig;
import org.popcraft.chunky.util.Limit;
@@ -42,14 +42,14 @@ public class ChunkyForge {
@SubscribeEvent
public void onServerStarting(FMLServerStartingEvent event) {
MinecraftServer server = event.getServer();
this.chunky = new Chunky(new ForgePlatform(this, server));
this.chunky = new Chunky(new ForgeServer(this, server));
File configFile = new File(event.getServer().getDataDirectory(), "config/chunky.json");
chunky.setConfig(new GsonConfig(chunky, configFile));
chunky.setLanguage(chunky.getConfig().getLanguage());
chunky.loadCommands();
Limit.set(chunky.getConfig());
if (chunky.getConfig().getContinueOnRestart()) {
chunky.getCommands().get("continue").execute(chunky.getPlatform().getServer().getConsoleSender(), new String[]{});
chunky.getCommands().get("continue").execute(chunky.getServer().getConsoleSender(), new String[]{});
}
Command<CommandSource> command = context -> {
Sender sender = new ForgeSender(context.getSource());
@@ -166,7 +166,7 @@ public class ChunkyForge {
public void onServerStopping(FMLServerStoppingEvent event) {
chunky.getConfig().saveTasks();
chunky.getGenerationTasks().values().forEach(generationTask -> generationTask.stop(false));
chunky.getPlatform().getServer().getScheduler().cancelTasks();
chunky.getServer().getScheduler().cancelTasks();
}
public Chunky getChunky() {
@@ -1,17 +0,0 @@
package org.popcraft.chunky.platform;
import net.minecraft.server.MinecraftServer;
import org.popcraft.chunky.ChunkyForge;
public class ForgePlatform implements Platform {
private Server server;
public ForgePlatform(ChunkyForge plugin, MinecraftServer server) {
this.server = new ForgeServer(plugin, server);
}
@Override
public Server getServer() {
return server;
}
}
@@ -3,12 +3,14 @@ package org.popcraft.chunky.platform;
import net.minecraft.util.Unit;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.border.WorldBorder;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.server.ChunkHolder;
import net.minecraft.world.server.ChunkManager;
import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.server.TicketType;
import net.minecraft.world.storage.FolderName;
import org.popcraft.chunky.ChunkyForge;
import org.popcraft.chunky.util.Coordinate;
@@ -82,10 +84,26 @@ public class ForgeWorld implements World {
return new ForgeBorder(worldBorder);
}
@Override
public Optional<Path> getEntitiesDirectory() {
return getDirectory("entities");
}
@Override
public Optional<Path> getPOIDirectory() {
return getDirectory("poi");
}
@Override
public Optional<Path> getRegionDirectory() {
ChunkManager chunkManager = world.getChunkProvider().chunkManager;
Path regionDirectory = chunkManager.dimensionDirectory.toPath().resolve("region");
return Files.exists(regionDirectory) ? Optional.of(regionDirectory) : Optional.empty();
return getDirectory("region");
}
private Optional<Path> getDirectory(final String name) {
if (name == null) {
return Optional.empty();
}
Path directory = DimensionType.getDimensionFolder(world.getDimensionKey(), world.getServer().func_240776_a_(FolderName.DOT).toFile()).toPath().normalize().resolve(name);
return Files.exists(directory) ? Optional.of(directory) : Optional.empty();
}
}
+7 -9
View File
@@ -1,17 +1,15 @@
modLoader="javafml"
loaderVersion="[36,)"
license="GNU GPLv3"
issueTrackerURL="https://github.com/pop4959/Chunky/issues"
issueTrackerURL="${github}/issues"
[[mods]]
modId="chunky"
version="${file.jarVersion}"
displayName="Chunky"
displayURL="https://github.com/pop4959/Chunky"
modId="${id}"
version="${version}"
displayName="${name}"
displayURL="${github}"
logoFile="icon.png"
authors="pop4959"
description='''
Pre-generates chunks, quickly, efficiently, and safely
'''
authors="${author}"
description="${description}"
[[dependencies.chunky]]
modId="forge"
mandatory=true
Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 56 KiB

+6
View File
@@ -0,0 +1,6 @@
org.gradle.jvmargs=-Xmx1G
group=org.popcraft
version=1.2
description=Pre-generates chunks, quickly, efficiently, and safely
github=https://github.com/pop4959/Chunky
author=pop4959
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-31
View File
@@ -1,31 +0,0 @@
// This block is required by Fabric
pluginManagement {
repositories {
gradlePluginPortal()
maven { url "https://maven.fabricmc.net" }
maven { url "https://files.minecraftforge.net/maven" }
}
// default plugin versions
plugins {
id("com.github.johnrengelman.shadow") version "7.0.0"
}
}
rootProject.name = 'chunky'
include('common')
[
'bukkit',
'sponge',
//'forge',
'fabric'
].forEach {
platform(it)
}
void platform(String name) {
include("chunky-$name")
project(":chunky-$name").projectDir = file(name)
}
+21
View File
@@ -0,0 +1,21 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
maven("https://maven.minecraftforge.net")
maven("https://maven.architectury.dev/")
}
}
rootProject.name = "chunky"
sequenceOf(
"common",
"bukkit",
"fabric",
"forge",
"sponge"
).forEach {
include("${rootProject.name}-$it")
project(":${rootProject.name}-$it").projectDir = file(it)
}
-52
View File
@@ -1,52 +0,0 @@
import org.spongepowered.gradle.plugin.config.PluginLoaders
import org.spongepowered.plugin.metadata.PluginDependency
plugins {
id 'org.spongepowered.gradle.plugin' version '1.1.1'
id 'com.github.johnrengelman.shadow'
}
sponge {
apiVersion('8.0.0')
plugin('chunky') {
loader(PluginLoaders.JAVA_PLAIN)
displayName('Chunky')
mainClass('org.popcraft.chunky.ChunkySponge')
description('Pre-generates chunks, quickly, efficiently, and safely')
links {
homepage('https://github.com/pop4959/Chunky')
source('https://github.com/pop4959/Chunky')
issues('https://github.com/pop4959/Chunky/issues')
}
contributor('pop4959') {
description('Lead Developer')
}
dependency("spongeapi") {
loadOrder(PluginDependency.LoadOrder.AFTER)
optional(false)
}
}
}
repositories {
maven {
url 'https://repo.codemc.org/repository/maven-public'
}
}
dependencies {
implementation project(':common')
}
jar {
archiveClassifier.set("unshaded")
}
shadowJar {
archiveClassifier.set(null)
archiveFileName.set("Chunky-${project.version}.jar")
}
artifacts {
archives shadowJar
}
+32
View File
@@ -0,0 +1,32 @@
import org.spongepowered.gradle.plugin.config.PluginLoaders
import org.spongepowered.plugin.metadata.PluginDependency
plugins {
id("org.spongepowered.gradle.plugin") version "1.1.1"
}
dependencies {
implementation(project(":chunky-common"))
}
sponge {
apiVersion("8.0.0")
plugin(rootProject.name) {
loader(PluginLoaders.JAVA_PLAIN)
displayName(rootProject.name.capitalize())
mainClass("${project.group}.${rootProject.name}.ChunkySponge")
description("${project.property("description")}")
links {
homepage("${project.property("github")}")
source("${project.property("github")}")
issues("${project.property("github")}/issues")
}
contributor("${project.property("author")}") {
description("Lead Developer")
}
dependency("spongeapi") {
loadOrder(PluginDependency.LoadOrder.AFTER)
optional(false)
}
}
}