Skip to content

Commit

Permalink
Added pierce and glove powerup to the actionbar
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
Minemobs committed Jul 20, 2024
1 parent 84707e3 commit 5abb567
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Building minestom
FROM gradle:8.8.0-jdk21 as gradle
FROM gradle:8.8.0-jdk21 AS gradle
RUN mkdir /gradlebuild
WORKDIR /gradlebuild
COPY . .
Expand All @@ -11,6 +11,6 @@ WORKDIR /app
COPY --from=gradle /gradlebuild/build/libs/bomberman-all.jar .

LABEL authors="minemobs"
LABEL version="0.1.1"
LABEL version="1.0.0"
EXPOSE 25565
ENTRYPOINT ["java", "-jar", "/app/bomberman-all.jar"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
bomberman:
image: sunderia/bomberman:0.1.3
image: sunderia/bomberman:1.0.0
restart: unless-stopped
# environment:
# VELOCITY_SECRET: YLIyDwyeyxdQTDGz0Guyp971AYVnN7yu # if omitted, the server will disable velocity support
Expand Down
17 changes: 11 additions & 6 deletions src/main/kotlin/fr/sunderia/bomberman/Bomberman.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import java.util.*
import java.util.logging.Level
import java.util.logging.Logger
import kotlin.math.abs
import kotlin.math.sign


fun main() {
Expand Down Expand Up @@ -230,6 +229,10 @@ class Bomberman {
.hoverEvent(HoverEvent.showText(Component.text("Will execute the command /game")))
.clickEvent(ClickEvent.runCommand("/game")))
)
player.sendResourcePacks(ResourcePackRequest.resourcePackRequest().packs(ResourcePackInfo.resourcePackInfo()
.hash(resourcePackSha1!!)
.uri(URI.create("https://raw.githubusercontent.com/Sunderia/Bomberman/main/bomberman.zip"))
))
}
if(!it.spawnInstance.hasTag(Tag.Boolean("game"))) return@addListener
player.inventory.addItemStack(ItemStack.of(Material.TNT).with {
Expand All @@ -241,16 +244,18 @@ class Bomberman {
powerMap[player.uuid] = 2
player.scheduler().scheduleTask({
if(!player.instance.hasTag(Tag.Boolean("game"))) return@scheduleTask
val hasBoxingGlove = player.hasTag(PowerupTags.BOXING_GLOVE.getBool())
val hasPierce = player.hasTag(PowerupTags.PIERCE.getBool())
player.sendActionBar(
Component.join(JoinConfiguration.separator(Component.text(" ")),
Component.text("\uE000").style { it.font(Key.key("bomberman", "font")) },
Component.text(": ${powerMap[player.uuid]}")
Component.text(": ${powerMap[player.uuid]}"),
Component.text(" ${if(hasBoxingGlove) "" else "" } ").color(if(hasBoxingGlove) NamedTextColor.GREEN else NamedTextColor.RED),
Component.text("\uE001").style { it.font(Key.key("bomberman", "font")) },
Component.text(" ${if(hasPierce) "" else "" } ").color(if(hasPierce) NamedTextColor.GREEN else NamedTextColor.RED),
Component.text("\uE002").style { it.font(Key.key("bomberman", "font")) }
).style { it.font(Key.key("default")) })
}, TaskSchedule.immediate(), TaskSchedule.tick(10))
player.sendResourcePacks(ResourcePackRequest.resourcePackRequest().packs(ResourcePackInfo.resourcePackInfo()
.hash(resourcePackSha1!!)
.uri(URI.create("https://raw.githubusercontent.com/Sunderia/Bomberman/main/bomberman.zip"))
))
}

gameNode.addListener(PlayerDeathEvent::class.java) { event ->
Expand Down

0 comments on commit 5abb567

Please sign in to comment.