Skip to content

Commit

Permalink
Merge pull request #411 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 28, 2021
2 parents 7763982 + 5831356 commit ea72469
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 64 deletions.
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 jdk16 and plugin
FROM adoptopenjdk/openjdk16
# Change to the current plugin version present in build.gradle
ENV PLUGIN_VERSION=6.25.4
ENV PLUGIN_VERSION=6.26.0
# Change to the server version you want to test.
ENV SERVER_VERSION=1.17.1-R0.1-SNAPSHOT/spigot-1.17.1-R0.1-SNAPSHOT.jar
# Port of the Minecraft Server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ enum class MenuCommand(val key: MenuPageKey, private val internalCommand: String
BALL_SOUNDACTION_CALLBACK(MenuPageKey.BALL, "sound-callback"),

BALL_SKIN(MenuPageKey.BALL, "skin"),
BALL_SLIME(MenuPageKey.BALL, "slimev"),
BALL_INTERACTION_HITBOX(MenuPageKey.BALL, "inhitbox"),
BALL_KICKPASS_HITBOX(MenuPageKey.BALL, "kphitbox"),
BALL_TOGGLE_CARRYABLE(MenuPageKey.BALL, "tgl-car"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,7 @@ import com.github.shynixn.blockball.api.business.enumeration.BallActionType
import com.github.shynixn.blockball.api.business.enumeration.BallSize

/**
* Created by Shynixn 2018.
* <p>
* Version 1.2
* <p>
* MIT License
* <p>
* Copyright (c) 2018 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.
* Ball properties.
*/
interface BallMeta {
/**
Expand All @@ -41,6 +17,11 @@ interface BallMeta {
*/
var enabledPass: Boolean

/**
* If set to true, the slime is visible instead of the ball.
*/
var isSlimeVisible: Boolean

/**
* Is the moving into the ball enabled?
*/
Expand Down
4 changes: 2 additions & 2 deletions blockball-bukkit-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ tasks.register("pluginJar", Exec::class.java) {
val targetJarFile = File(destinationDir, archiveName)

val obsMapping =
"java -jar ${file.absolutePath} -i \"$sourceJarFile\" -o \"$obfJarFile\" -m \"\$HOME/.m2/repository/org/spigotmc/minecraft-server/1.17-R0.1-SNAPSHOT/minecraft-server-1.17-R0.1-SNAPSHOT-maps-mojang.txt\" --reverse" +
"&& java -jar ${file.absolutePath} -i \"$obfJarFile\" -o \"$targetJarFile\" -m \"\$HOME/.m2/repository/org/spigotmc/minecraft-server/1.17-R0.1-SNAPSHOT/minecraft-server-1.17-R0.1-SNAPSHOT-maps-spigot.csrg\""
"java -jar ${file.absolutePath} -i \"$sourceJarFile\" -o \"$obfJarFile\" -m \"\$HOME/.m2/repository/org/spigotmc/minecraft-server/1.17.1-R0.1-SNAPSHOT/minecraft-server-1.17.1-R0.1-SNAPSHOT-maps-mojang.txt\" --reverse" +
"&& java -jar ${file.absolutePath} -i \"$obfJarFile\" -o \"$targetJarFile\" -m \"\$HOME/.m2/repository/org/spigotmc/minecraft-server/1.17.1-R0.1-SNAPSHOT/minecraft-server-1.17.1-R0.1-SNAPSHOT-maps-spigot.csrg\""

if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")) {
commandLine = listOf("cmd", "/c", obsMapping.replace("\$HOME", "%userprofile%"))
Expand Down
4 changes: 2 additions & 2 deletions blockball-bukkit-plugin/bukkit-nms-117R1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ dependencies {
implementation(project(":blockball-api"))
implementation(project(":blockball-core"))
compileOnly("com.google.inject:guice:5.0.1")
compileOnly("org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:remapped-mojang")
testCompile("org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:remapped-mojang")
compileOnly("org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:remapped-mojang")
testCompile("org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:remapped-mojang")
}
2 changes: 1 addition & 1 deletion blockball-bukkit-plugin/src/main/resources/plugin-1.17.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 6.25.4
version: 6.26.0
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 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.4
version: 6.26.0
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class BallSettingsPage : Page(BallSettingsPage.ID, MainSettingsPage.ID) {
ballMeta.skin = args[2]
} else if (command == MenuCommand.BALL_SIZE_CALLBACK && args.size == 3) {
ballMeta.size = BallSize.values()[args[2].toInt()]
} else if (command == MenuCommand.BALL_SLIME) {
ballMeta.isSlimeVisible = !ballMeta.isSlimeVisible
} else if (command == MenuCommand.BALL_INTERACTION_HITBOX && args.size == 3 && args[2].toDoubleOrNull() != null) {
ballMeta.interactionHitBoxSize = args[2].toDouble()
} else if (command == MenuCommand.BALL_KICKPASS_HITBOX && args.size == 3 && args[2].toDoubleOrNull() != null) {
Expand Down Expand Up @@ -109,6 +111,11 @@ class BallSettingsPage : Page(BallSettingsPage.ID, MainSettingsPage.ID) {
.setClickAction(ChatClickAction.RUN_COMMAND, MenuCommand.LIST_BALLSIZES.command)
.setHoverText("Opens the selectionbox for ball sizes.")
.builder().nextLine()
.component("- Slime Visible: " + ballMeta.isSlimeVisible).builder()
.component(MenuClickableItem.SELECT.text).setColor(MenuClickableItem.TOGGLE.color)
.setClickAction(ChatClickAction.RUN_COMMAND, MenuCommand.BALL_SLIME.command)
.setHoverText("Toggles if the slime hitbox is rendered instead of the ball helmet.")
.builder().nextLine()
.component("- Interaction Hitbox Size: " + ballMeta.interactionHitBoxSize).builder()
.component(MenuClickableItem.EDIT.text).setColor(MenuClickableItem.EDIT.color)
.setClickAction(ChatClickAction.SUGGEST_COMMAND, MenuCommand.BALL_INTERACTION_HITBOX.command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ class BallDesignEntity(val entityId: Int) {
*/
fun spawn(player: Any, position: Position) {
packetService.sendEntitySpawnPacket(player, entityId, "ARMOR_STAND", position)
packetService.sendEntityEquipmentPacket(player, entityId, CompatibilityArmorSlotType.HELMET, helmetItemStack)

if (!ball.meta.isSlimeVisible) {
packetService.sendEntityEquipmentPacket(
player,
entityId,
CompatibilityArmorSlotType.HELMET,
helmetItemStack
)
}

packetService.sendEntityMetaDataPacket(player, entityId, EntityMetadataImpl {
this.isInvisible = true
this.isSmall = ball.meta.size == BallSize.SMALL
Expand Down Expand Up @@ -115,6 +124,10 @@ class BallDesignEntity(val entityId: Int) {
if (angle != null) {
rotation = angle

if (ball.meta.isSlimeVisible) {
return
}

for (player in players) {
packetService.sendEntityMetaDataPacket(player, entityId, EntityMetadataImpl {
this.armorstandHeadRotation = rotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,17 @@ class BallHitboxEntity(val entityId: Int) {
*/
fun spawn(player: Any, position: Position) {
packetService.sendEntitySpawnPacket(player, entityId, "SLIME", position)
packetService.sendEntityMetaDataPacket(player, entityId, EntityMetadataImpl {
this.isInvisible = true
this.slimeSize = meta.kickPassHitBoxSize.toInt()
})

if (meta.isSlimeVisible) {
packetService.sendEntityMetaDataPacket(player, entityId, EntityMetadataImpl {
this.slimeSize = meta.kickPassHitBoxSize.toInt()
})
} else {
packetService.sendEntityMetaDataPacket(player, entityId, EntityMetadataImpl {
this.isInvisible = true
this.slimeSize = meta.kickPassHitBoxSize.toInt()
})
}
}

/**
Expand Down Expand Up @@ -147,7 +154,7 @@ class BallHitboxEntity(val entityId: Int) {
requestTeleport = false

// Visible position makes the slime hitbox better align with the ball.
val visiblePosition = position.clone().add(0.0, -0.5, 0.0)
val visiblePosition = position.clone().add(0.0, -0.5, 0.0).add(0.0, meta.hitBoxRelocation, 0.0)
for (player in players) {
packetService.sendEntityTeleportPacket(player, entityId, visiblePosition)
}
Expand Down Expand Up @@ -286,7 +293,7 @@ class BallHitboxEntity(val entityId: Int) {
this.position = targetPosition

// Visible position makes the slime hitbox better align with the ball.
val visiblePosition = position.clone().add(0.0, -0.5, 0.0)
val visiblePosition = position.clone().add(0.0, -0.5, 0.0).add(0.0, meta.hitBoxRelocation, 0.0)
for (player in players) {
packetService.sendEntityTeleportPacket(player, entityId, visiblePosition)
}
Expand All @@ -307,7 +314,7 @@ class BallHitboxEntity(val entityId: Int) {
this.isOnGround = false

// Visible position makes the slime hitbox better align with the ball.
val visiblePosition = position.clone().add(0.0, -0.5, 0.0)
val visiblePosition = position.clone().add(0.0, -0.5, 0.0).add(0.0, meta.hitBoxRelocation, 0.0)
for (player in players) {
packetService.sendEntityTeleportPacket(player, entityId, visiblePosition)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,90 +42,96 @@ class BallMetaEntity(
@YamlSerialize(orderNumber = 1, value = "size")
override var size: BallSize = BallSize.NORMAL

/**
* If set to true, the slime is visible instead of the ball.
*/
@YamlSerialize(orderNumber = 3, value = "slime-visible")
override var isSlimeVisible: Boolean = false

/**
* Size of the hitbox used for interaction detecting.
*/
@YamlSerialize(orderNumber = 3, value = "interaction-hitbox-size")
@YamlSerialize(orderNumber = 4, value = "interaction-hitbox-size")
override var interactionHitBoxSize: Double = 2.0

/**
* Size of the hitbox used for kicking and passing detecting.
*/
@YamlSerialize(orderNumber = 4, value = "kickpass-hitbox-size")
@YamlSerialize(orderNumber = 5, value = "kickpass-hitbox-size")
override var kickPassHitBoxSize: Double = 5.0

/**
* Delay in ticks until the ball executes the kick pass request by the player.
* Is useful for magnus force calculation.
*/
@YamlSerialize(orderNumber = 5, value = "kickpass-delay-ticks")
@YamlSerialize(orderNumber = 6, value = "kickpass-delay-ticks")
override var kickPassDelay: Int = 5

/**
* Amount of ticks until the ball can intercept interaction again after
* performing 1 interaction.
*/
@YamlSerialize(orderNumber = 6, value = "interaction-cooldown-ticks")
@YamlSerialize(orderNumber = 7, value = "interaction-cooldown-ticks")
override var interactionCoolDown: Int = 20


/** Should the ball rotate? */
@YamlSerialize(orderNumber = 7, value = "rotating")
@YamlSerialize(orderNumber = 8, value = "rotating")
override var rotating: Boolean = true

/**
* Is leftclick kicking the ball enabled?
*/
@YamlSerialize(orderNumber = 8, value = "enable-kick")
@YamlSerialize(orderNumber = 9, value = "enable-kick")
override var enabledKick: Boolean = true

/**
* Is the rightclick passing the ball enabled?
*/
@YamlSerialize(orderNumber = 9, value = "enable-pass")
@YamlSerialize(orderNumber = 10, value = "enable-pass")
override var enabledPass: Boolean = true

/**
* Is the moving into the ball enabled?
*/
@YamlSerialize(orderNumber = 10, value = "enable-interact")
@YamlSerialize(orderNumber = 11, value = "enable-interact")
override var enabledInteract: Boolean = true

/**
* Hitbox relocation value for ground heights.
*/
@YamlSerialize(orderNumber = 11, value = "hitbox-relocation")
@YamlSerialize(orderNumber = 12, value = "hitbox-relocation")
override var hitBoxRelocation: Double = 0.0

/**
* Should the ball always bounce of walls?
*/
@YamlSerialize(orderNumber = 12, value = "always-bounce")
@YamlSerialize(orderNumber = 13, value = "always-bounce")
override var alwaysBounce: Boolean = true

/**
* Movement modifier.
*/
@YamlSerialize(orderNumber = 13, value = "modifiers")
@YamlSerialize(orderNumber = 14, value = "modifiers")
override val movementModifier: MovementConfigurationEntity = MovementConfigurationEntity()

/**
* Particle effects.
*/
@YamlSerialize(orderNumber = 14, value = "particle-effects", implementation = ParticleEntity::class)
@YamlSerialize(orderNumber = 15, value = "particle-effects", implementation = ParticleEntity::class)
override val particleEffects: MutableMap<BallActionType, Particle> = HashMap()

/**
* Particle effects.
*/
@YamlSerialize(orderNumber = 15, value = "sound-effects", implementation = SoundEntity::class)
@YamlSerialize(orderNumber = 16, value = "sound-effects", implementation = SoundEntity::class)
override val soundEffects: MutableMap<BallActionType, Sound> = HashMap()

/** Spawning delay. */
@YamlSerialize(orderNumber = 16, value = "spawn-delay")
@YamlSerialize(orderNumber = 17, value = "spawn-delay")
override var delayInTicks: Int = 0

/** Spawnpoint of the ball. */
@YamlSerialize(orderNumber = 17, value = "spawnpoint", implementation = PositionEntity::class)
@YamlSerialize(orderNumber = 18, value = "spawnpoint", implementation = PositionEntity::class)
override var spawnpoint: Position? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ArenaFileRepositoryTest {
val actualDataLength = FileUtils.readFileToString(File("build/repository-test/arena/arena_1.yml"), "UTF-8")

// Assert
Assertions.assertEquals(9515, actualDataLength.length)
Assertions.assertEquals(9542, actualDataLength.length)
}

/**
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.4'
version '6.26.0'

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.4'
version = '6.26.0'
# The full version, including alpha/beta/rc tags.
release = '6.25.4'
release = '6.26.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 1 addition & 0 deletions docs/source/customizing/ball.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Properties

* Size: Size of the ball. Can be NORMAL or SMALL.
* Skin: Name of a player using this skin or a skin URL.
* Slime Visible: Should a slime be rendered instead of the ball skin? A good option for Bedrock based servers. Adjust the size of the ball using the 'KickPass Hitbox Size' value and the position of the hitbox using the 'hitbox-relocation' (can only be found in the arena_x.yml file) value.
* Interaction Hitbox Size: Size of the ball hitbox intercepting player movements. Does not have an impact on left or right clicking the ball.
* KickPass Hitbox Size: Size of the ball hitbox intercepting player left clicks and right clicks. Does not have an impact on player movements.
* KickPass Delay: Delay in ticks until the ball executes the movement action after being clicked.
Expand Down
24 changes: 19 additions & 5 deletions docs/source/gettingstarted/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@ Java

Java 8 - Java Latest can be used to run BlockBall.

Spigot/CraftBukkit/Sponge
~~~~~~~~~~~~~~~~~~~~~~~~~
Spigot
~~~~~~

* Spigot ✔
* PaperSpigot ✔
* Sponge ✘ (not compatible)
The plugin is fully compatible to Spigot and Paper (Spigot) ✔

Sponge
~~~~~~

The plugin is not compatible to sponge. ✘

Bedrock
~~~~~~~

The plugin is partially compatible to Bedrock using `Geyser <https://geysermc.org/>`__. ✔

1. Continue with the BlockBall guide and come back here once you can play a game on a Java server
2. Setup `Geyser <https://geysermc.org/>`__
3. Join the server using a Bedrock based Minecraft client (e.g. Smartphone, Windows)
4. Join a game and observe that it is fully playable (ball skin is not rendered)
5. Switch the ball to a slime. See ball wiki page.
6. Play with a slime ball instead of the player head.

PlaceholderAPI
~~~~~~~~~
Expand Down

0 comments on commit ea72469

Please sign in to comment.