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

Initial velocity support #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public enum ResourcePackStatus {
* parse the resource-pack URL.
*
* <p>A valid resource-pack URL MUST be parseable by
* the {@link java.net.URL(String))} constructor and
* the {@link java.net.URL#URL(String)} constructor and
* MUST have a 'HTTPS' or 'HTTP' protocol. In any other
* case, this status is received.</p>
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
/*
* This file is part of creative-central, licensed under the MIT license
*
* Copyright (c) 2021-2023 Unnamed Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package team.unnamed.creative.central.common.util;
/*
* This file is part of creative-central, licensed under the MIT license
*
* Copyright (c) 2021-2023 Unnamed Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package team.unnamed.creative.central.common.util;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;

/**
* Utility class for working with
Expand Down Expand Up @@ -85,7 +86,24 @@ public static void pipeToFile(
InputStream input,
File outputFile
) throws IOException {
try (OutputStream output = new BufferedOutputStream(Files.newOutputStream(outputFile.toPath()))) {
pipeToFile(input, outputFile.toPath());
}

/**
* Reads and writes the data from the
* given {@code input} to the given {@code outputFile}
*
* <p>Note that this method doesn't close
* the given input stream</p>
*
* @throws IOException If an error occurs while
* reading or writing the data
*/
public static void pipeToFile(
InputStream input,
Path outputFile
) throws IOException {
try (OutputStream output = new BufferedOutputStream(Files.newOutputStream(outputFile))) {
pipe(input, output);
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=team.unnamed
version=1.3.0
version=1.3.1
description=The resource-pack unifier for Minecraft: Java Edition servers.

repositoryName=ossrh
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ includePrefixed("api")
includePrefixed("common")
includePrefixed("bukkit")
//includePrefixed("minestom")
includePrefixed("velocity")

fun includePrefixed(name: String) {
val kebabName = name.replace(':', '-')
Expand Down
40 changes: 40 additions & 0 deletions velocity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
id("creative.dist-conventions")
}

repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
implementation(libs.creative.serializer.minecraft)
implementation(project(":creative-central-api"))
implementation(project(":creative-central-common"))
compileOnly("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")


implementation("org.bstats:bstats-velocity:3.0.2") // bstats
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

tasks {
shadowJar {
dependencies {
// all these dependencies are provided by the server
exclude(dependency("com.google.code.gson:gson"))
exclude(dependency("net.kyori:adventure-api"))
exclude(dependency("net.kyori:adventure-key"))
exclude(dependency("net.kyori:examination-api"))
exclude(dependency("net.kyori:examination-string"))

// relocate bstats
relocate("org.bstats", "team.unnamed.creative.central.bukkit.lib.bstats")
}
}
}
Loading