Skip to content

Commit

Permalink
Merge pull request #406 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn committed Jul 6, 2021
2 parents 04f4934 + 2328131 commit ea82b6a
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 12 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
chmod +x gradlew
wget "https://jitpack.io/com/github/MilkBowl/VaultAPI/1.7/VaultAPI-1.7.jar"
mvn install:install-file -Dfile=VaultAPI-1.7.jar -DgroupId=net.milkbowlvault -DartifactId=VaultAPI -Dversion=1.7 -Dpackaging=jar
./gradlew build pluginJar
./gradlew build pluginJarSlim
- name: Publish Test Report
run: |
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
./gradlew clean publishToNexus
./gradlew closeAndReleaseRepository
./gradlew clean
./gradlew shadowJar pluginJar
./gradlew shadowJar pluginJarSlim
java -jar blockball-tools/build/libs/Deploy.jar --snapshot ${{ secrets.DISCORD_WEBHOOK_SNAPSHOT }}
java -jar blockball-tools/build/libs/Deploy.jar --snapshot ${{ secrets.DISCORD_WEBHOOK_CHANNEL }}
Expand Down Expand Up @@ -118,6 +118,17 @@ jobs:
asset_name: BlockBall.jar
asset_content_type: application/jar

- name: Upload Bukkit Slim Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/blockball-bukkit-plugin/build/libs/blockball-bukkit-plugin-${{ env.RELEASE_VERSION }}-slim.jar
asset_name: BlockBall-Slim.jar
asset_content_type: application/jar

Documentation:
runs-on: ubuntu-latest
if: "contains(github.ref, 'master')"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get install maven -y
RUN apt-get install wget -y
RUN apt-get install git -y
RUN wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
RUN java -jar BuildTools.jar --rev 1.17 --remapped
RUN java -jar BuildTools.jar --rev 1.17.1 --remapped

# 3. Build plugin for 1.8 - 1.17 with jdk16
FROM adoptopenjdk/openjdk16 AS plugin-jdk16
Expand All @@ -37,9 +37,9 @@ RUN ./gradlew build pluginJar --no-daemon
# 4. Launch a minecraft server with jdk16 and plugin
FROM adoptopenjdk/openjdk16
# Change to the current plugin version present in build.gradle
ENV PLUGIN_VERSION=6.25.2
ENV PLUGIN_VERSION=6.25.3
# Change to the server version you want to test.
ENV SERVER_VERSION=1.17-R0.1-SNAPSHOT/spigot-1.17-R0.1-SNAPSHOT.jar
ENV SERVER_VERSION=1.17.1-R0.1-SNAPSHOT/spigot-1.17.1-R0.1-SNAPSHOT.jar
# Port of the Minecraft Server.
EXPOSE 25565
# Port for Remote Debugging
Expand Down
29 changes: 28 additions & 1 deletion blockball-bukkit-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks.withType<ShadowJar> {

relocate("org.intellij", "com.github.shynixn.blockball.lib.org.intelli")
relocate("org.jetbrains", "com.github.shynixn.blockball.lib.org.jetbrains")
relocate("org.bstats", "com.github.shynixn.blockball.lib.org.bstats")
relocate("org.bstats", "com.github.shynixn.blockball.externallib.org.bstats")
relocate("javax.inject", "com.github.shynixn.blockball.lib.javax.inject")
relocate("javax.annotation", "com.github.shynixn.blockball.lib.javax.annotation")
relocate("org.checkerframework", "com.github.shynixn.blockball.lib.org.checkerframework")
Expand Down Expand Up @@ -77,6 +77,33 @@ tasks.register("pluginJar", Exec::class.java) {
}
}

tasks.register("pluginJarSlim", ShadowJar::class.java) {
// Change the output folder of the plugin.
//destinationDir = File("C:/temp/plugins")
dependsOn("pluginJar")
from(zipTree(File(projectDir.absolutePath + "/build/libs/" + (tasks.getByName("jar") as Jar).archiveName)))
archiveName = "${baseName}-${version}-slim.${extension}"

relocate("com.github.shynixn.blockball.lib.kotlin", "kotlin")

relocate("com.github.shynixn.blockball.lib.org.intellij", "org.intellij")
relocate("com.github.shynixn.blockball.lib.org.jetbrains", "org.jetbrains")
relocate("com.github.shynixn.blockball.lib.javax.inject", "javax.inject")
relocate("com.github.shynixn.blockball.lib.javax.annotation", "javax.annotation")
relocate("com.github.shynixn.blockball.lib.org.checkerframework", "org.checkerframework")
relocate("com.github.shynixn.blockball.lib.org.aopalliance", "org.aopalliance")
relocate("com.github.shynixn.blockball.lib.org.slf4j", "org.slf4j")

relocate("com.github.shynixn.blockball.lib.com.github.shynixn.mccoroutine", "com.github.shynixn.mccoroutine")
relocate("com.github.shynixn.blockball.lib.com.google", "com.google")
relocate("com.github.shynixn.blockball.lib.com.zaxxer", "com.zaxxer")
relocate("com.github.shynixn.blockball.lib.org.apache", "org.apache")

exclude("com/github/shynixn/blockball/lib/**/*")
exclude("plugin.yml")
rename("plugin-1.17.yml", "plugin.yml")
}

repositories {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi")
maven("https://maven.sk89q.com/repo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ class PacketJavaProtocolServiceImpl @Inject constructor(
pluginProxy.findClazz("net.minecraft.server.VERSION.PacketPlayOutEntityVelocity")
}
}
private val intArrayListConstructor by lazy {
pluginProxy.findClazz("org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList")
.getDeclaredConstructor(IntArray::class.java)
}
private val packetPlayOutEntityDestroyIntListConstructor by lazy {
packetPlayOutEntityDestroyClazz.getDeclaredConstructor(pluginProxy.findClazz("org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntList"))
}

/**
* Sends a velocity packet.
Expand Down Expand Up @@ -83,8 +90,13 @@ class PacketJavaProtocolServiceImpl @Inject constructor(
val buffer = Unpooled.buffer()

if (pluginProxy.getServerVersion().isVersionSameOrGreaterThan(Version.VERSION_1_17_R1)) {
val packet = packetPlayOutEntityDestroyClazz.getDeclaredConstructor(Int::class.java)
.newInstance(entityId)
val packet = try {
val intList = intArrayListConstructor.newInstance(intArrayOf(entityId))
packetPlayOutEntityDestroyIntListConstructor.newInstance(intList)
} catch (e: Exception) {
throw RuntimeException("BlockBall does not support 1.17.0. Upgrade to 1.17.1.!", e)
}

proxyService.sendPacket(player, packet)
} else {
writeId(buffer, 1)
Expand Down
38 changes: 38 additions & 0 deletions blockball-bukkit-plugin/src/main/resources/plugin-1.17.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: BlockBall
version: 6.25.3
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
softdepend: [WorldEdit, BossBarAPI, PlaceholderAPI, Vault]
commands:
blockball:
description: Opens the arena creation UI.
usage: /<command>
permission: blockball.command.admin
permission-message: You don't have permission.
blockballstop:
description: Stops a running blockball game.
usage: /<command> <id/name>
permission: blockball.command.admin
permission-message: You don't have permission.
blockballbungeecord:
description: Adds a new bungeecord sign for connecting to other BlockBall servers.
usage: /<command> <server>
permission: blockball.command.admin
permission-message: You don't have permission.
blockballreload:
description: Reloads Blockball configuration and restarts all games.
usage: /<command>
permission: blockball.command.reload
permission-message: You don't have permission.
libraries:
- 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20'
- 'com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:1.5.0'
- 'com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:1.5.0'
- 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
- 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.9'
- 'org.slf4j:slf4j-jdk14:1.7.25'
- 'com.zaxxer:HikariCP:3.2.0'
- 'com.google.inject:guice:5.0.1'
- 'commons-io:commons-io:2.6'
- 'com.google.code.gson:gson:2.8.6'
2 changes: 1 addition & 1 deletion blockball-bukkit-plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 6.25.2
version: 6.25.3
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tasks.register("printVersion") {

subprojects {
group 'com.github.shynixn.blockball'
version '6.25.2'
version '6.25.3'

sourceCompatibility = 1.8

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = '6.25.2'
version = '6.25.3'
# The full version, including alpha/beta/rc tags.
release = '6.25.2'
release = '6.25.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit ea82b6a

Please sign in to comment.