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

Merge changes to master --release #474

Merged
merged 4 commits into from
Dec 8, 2023
Merged
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN ./gradlew build pluginJar --no-daemon
# 4. Launch a minecraft server with jdk17 and plugin
FROM amazoncorretto:17
# Change to the current plugin version present in build.gradle
ENV PLUGIN_VERSION=6.36.1
ENV PLUGIN_VERSION=6.37.0
# Change to the server version you want to test.
ENV SERVER_VERSION=spigot-1.18.jar
# Port of the Minecraft Server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ interface PluginProxy {
*/
fun sendConsoleMessage(message: String)

/**
* Sets the motd of the server.
*/
fun setMotd(message: String)

/**
* Shutdowns the server.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ interface ScreenMessageService {
* Sets the [title] of the given [player] [P] for the amount of [stay] ticks. Optionally shows a [subTitle] and displays
* a [fadeIn] and [fadeOut] effect in ticks.
*/
fun <P> setTitle(player: P, title: String, subTitle: String = "", fadeIn: Int = 20, stay: Int = 60, fadeOut: Int = 20)
fun <P> setTitle(player: P, title: String, subTitle: String = "", fadeIn: Int, stay: Int, fadeOut: Int)

/**
* Sets the [message] for the given [player] at the actionbar.
*/
fun <P> setActionBar(player: P, message: String)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ package com.github.shynixn.blockball.api.persistence.entity
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
interface BungeeCordGame : MiniGame
interface BungeeCordGame : MiniGame {
var modt: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@ package com.github.shynixn.blockball.api.persistence.entity

import com.github.shynixn.blockball.api.business.enumeration.MatchTimeCloseType

/**
* Created by Shynixn 2020.
* <p>
* Version 1.5
* <p>
* MIT License
* <p>
* Copyright (c) 2020 by Shynixn
* <p>
* 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:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* 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.
*/
interface MatchTimeMeta {
/**
* Should the goals of the teams be switched when this match time gets enabled?
Expand Down Expand Up @@ -62,4 +35,10 @@ interface MatchTimeMeta {
* SubTitle of the message getting played when this match time starts.
*/
var startMessageSubTitle: String
}

var startMessageFadeIn : Int

var startMessageStay : Int

var startMessageFadeOut : Int
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,36 @@ interface TeamMeta {
/** Subtitle of the message getting played when a player scores a goal. */
var scoreMessageSubTitle: String

var scoreMessageFadeIn : Int

var scoreMessageStay : Int

var scoreMessageFadeOut : Int

/** Title of the message getting played when this team wins a match. */
var winMessageTitle: String

/** Subtitle of the message getting played when this team wins a match. */
var winMessageSubTitle: String

var winMessageFadeIn : Int

var winMessageStay : Int

var winMessageFadeOut : Int

/** Title of the message getting played when the match ends in a draw.*/
var drawMessageTitle: String

/** Subtitle of the message getting played when the match ends in a draw. */
var drawMessageSubTitle: String

var drawMessageFadeIn : Int

var drawMessageStay : Int

var drawMessageFadeOut : Int

/** Message getting played when a player joins a match.*/
var joinMessage: String

Expand Down
6 changes: 3 additions & 3 deletions blockball-bukkit-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ tasks.register("pluginJarLatest", ShadowJar::class.java) {
dependsOn("relocatePluginJar")
from(zipTree(File("./build/libs/" + (tasks.getByName("relocatePluginJar") as Jar).archiveName)))
archiveName = "${baseName}-${version}-latest.${extension}"
// destinationDir = File("C:\\temp\\plugins")
// destinationDir = File("C:\\temp\\plugins")

exclude("com/github/shynixn/mcutils/**")
exclude("org/**")
Expand All @@ -110,8 +110,8 @@ dependencies {
implementation(project(":blockball-bukkit-api"))
implementation(project(":blockball-core"))

implementation("com.github.shynixn.mcutils:common:1.0.37")
implementation("com.github.shynixn.mcutils:packet:1.0.52")
implementation("com.github.shynixn.mcutils:common:1.0.40")
implementation("com.github.shynixn.mcutils:packet:1.0.61")

implementation("com.github.shynixn.org.bstats:bstats-bukkit:1.7")
implementation("org.slf4j:slf4j-jdk14:1.7.25")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.github.shynixn.blockball.core.logic.business.extension.translateChatC
import com.github.shynixn.mcutils.common.Version
import com.github.shynixn.mcutils.packet.api.PacketInType
import com.github.shynixn.mcutils.packet.api.PacketService
import com.github.shynixn.mcutils.packet.impl.PacketServiceImpl
import com.github.shynixn.mcutils.packet.impl.service.PacketServiceImpl
import com.google.inject.Guice
import com.google.inject.Injector
import org.apache.commons.io.IOUtils
Expand Down Expand Up @@ -273,29 +273,6 @@ class BlockBallPlugin : JavaPlugin(), PluginProxy {
return this.serverVersion!!
}

/**
* Sets the motd of the server.
*/
override fun setMotd(message: String) {
val builder = java.lang.StringBuilder("[")
builder.append((message.replace("[", "").replace("]", "")))
builder.append(ChatColor.RESET.toString())
builder.append("]")

val minecraftServerClazz = try {
findClazz("net.minecraft.server.MinecraftServer")
} catch (e: Exception) {
findClazz("net.minecraft.server.VERSION.MinecraftServer")
}

val craftServerClazz = findClazz("org.bukkit.craftbukkit.VERSION.CraftServer")
val setModtMethod = minecraftServerClazz.getDeclaredMethod("setMotd", String::class.java)
val getServerConsoleMethod = craftServerClazz.getDeclaredMethod("getServer")

val console = getServerConsoleMethod.invoke(Bukkit.getServer())
setModtMethod.invoke(console, builder.toString().translateChatColors())
}

/**
* Shutdowns the server.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.github.shynixn.blockball.bukkit.logic.business.listener

import com.github.shynixn.blockball.api.business.enumeration.GameType
import com.github.shynixn.blockball.api.business.service.*
import com.github.shynixn.blockball.api.persistence.entity.BungeeCordGame
import com.github.shynixn.blockball.bukkit.logic.business.extension.toPosition
import com.github.shynixn.blockball.core.logic.business.extension.sync
import com.google.inject.Inject
Expand All @@ -11,6 +12,7 @@ import org.bukkit.event.Listener
import org.bukkit.event.block.Action
import org.bukkit.event.player.PlayerInteractEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.server.ServerListPingEvent

/**
* Created by Shynixn 2018.
Expand Down Expand Up @@ -67,6 +69,17 @@ class BungeeCordgameListener @Inject constructor(
}
}

@EventHandler
fun onPingServerEven(event: ServerListPingEvent) {
val game = gameService.getAllGames().find { p -> p.arena.gameType == GameType.BUNGEE }

if (game != null && game is BungeeCordGame) {
if (game.modt.isNotBlank()) {
event.motd = game.modt
}
}
}

/**
* Handles click on signs to create new server signs or to connect players to the server
* written on the sign.
Expand Down Expand Up @@ -94,4 +107,4 @@ class BungeeCordgameListener @Inject constructor(

rightClickManageService.executeWatchers(event.player, event.clickedBlock!!.location)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ class BallDesignEntity(val entityId: Int) {
val item = Item().also {
it.typeName = "PLAYER_HEAD,397"
it.durability = 3
it.nbt = "{SkullOwner:{Id:[I;1,1,1,1],Name:\"FootBall\",Properties:{textures:[{Value:\"${encodingSkinUrl}\"}]}}}"
}

if (ball.meta.itemNbt != null && !ball.meta.itemNbt.isNullOrEmpty()) {
item.nbt = ball.meta.itemNbt
} else {
item.nbt =
"{SkullOwner:{Id:[I;1,1,1,1],Name:\"FootBall\",Properties:{textures:[{Value:\"${encodingSkinUrl}\"}]}}}"
}

val stack = itemService.toItemStack(item)

packetService.sendPacketOutEntityEquipment(player, PacketOutEntityEquipment().also {
Expand Down
61 changes: 0 additions & 61 deletions blockball-bukkit-plugin/src/main/resources/lang/de_de.properties

This file was deleted.

61 changes: 0 additions & 61 deletions blockball-bukkit-plugin/src/main/resources/lang/en_us.properties

This file was deleted.

Loading
Loading