Skip to content
Open
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 build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.kruthers"
version = "2.8.0"
version = "2.8.1"
description = "The core plugin used to manage the gamemode 4 public server"

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class WarpCommand(val plugin: Gamemode4Core) {
val warpsSize = warps.size
var i = 0
warps.forEach { (warp, _) ->
val text = MiniMessage.miniMessage().deserialize("<hover:show_text:'<dark_purple>Teleport to $warp" +
val text = MiniMessage.miniMessage().deserialize(" <hover:show_text:'<dark_purple>Teleport to $warp" +
"</dark_purple>'><click:run_command:'/warp $warp'><gold>$warp</gold></click></hover>")

warpsText = warpsText.append(text)
i++
if (i < warpsSize) {
warpsText.append(Component.text(", ", NamedTextColor.GREEN))
warpsText.append(Component.text(",", NamedTextColor.GREEN))
}
}

Expand Down
15 changes: 14 additions & 1 deletion src/main/kotlin/com/kruthers/gamemode4core/events/GriefEvents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.bukkit.entity.EntityType
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.block.BlockBreakEvent
import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.entity.EntityPlaceEvent
import org.bukkit.event.player.PlayerBucketEmptyEvent
Expand All @@ -29,6 +30,9 @@ class GriefEvents(val plugin: Gamemode4Core): Listener {
private val warningTime: Long = 60*60*20
private val blockedBlocks: MutableList<Material> = mutableListOf(Material.TNT,Material.FIRE,Material.LAVA,
Material.WITHER_SKELETON_SKULL,Material.WITHER_SKELETON_WALL_SKULL)
private val blockBrokenBlocks: MutableList<Material> = mutableListOf(Material.CHEST,Material.TRAPPED_CHEST,
Material.BARREL,Material.HOPPER,Material.DISPENSER,Material.DROPPER,
Material.CHEST_MINECART,Material.HOPPER_MINECART)

private val kickMessages: MutableList<String> = mutableListOf(
"Internal exception: java.io.IOException: Received string length longer than the maximum allowed (257>256)",
Expand Down Expand Up @@ -62,7 +66,7 @@ class GriefEvents(val plugin: Gamemode4Core): Listener {
"gm4core.griefwarning"
)
//send discord message
val logChannel: TextChannel? = DiscordSRV.getPlugin().getDestinationTextChannelForGameChannelName("grief-log")
val logChannel: TextChannel? = DiscordSRV.getPlugin().getDestinationTextChannelForGameChannelName("grief-alerts")
if (logChannel != null) {
val embed = EmbedBuilder()
embed.setTitle("Possible grief attempt detected")
Expand All @@ -86,6 +90,15 @@ class GriefEvents(val plugin: Gamemode4Core): Listener {
}
}

@EventHandler
fun onBlockBreakEvent(event: BlockBreakEvent) {
// Block container breaking for first 20 minutes
if (checkPlayTime(event.player, warningTime / 3) && blockBrokenBlocks.contains(event.block.type)) {
event.isCancelled = true
sendWarning(event.player, "tried to break ${event.block.type.name}",event.block.location)
}
}

@EventHandler
fun onEntityPlaceEvent(event: EntityPlaceEvent) {
if (event.player == null) return
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ messages:
<dark_gray>------- ------ -------</dark_gray>
end_brodcast: |
<dark_gray>------- <dark_green>Warning</dark_green> -------</dark_gray>
<dark_aqua>veryone has been release, you are free to move arround again</dark_aqua>
<aqua>Please be carefull and report any issues</aqua>
<dark_aqua>Everyone has been released, you are free to move around again</dark_aqua>
<aqua>Please be careful and report any issues</aqua>
<dark_gray>------- ------ -------</dark_gray>
staff_start: '<staff_prefix> <aqua><name></aqua> <gold>Has frozen everyone in place, run /unfreeze to release them'
staff_end: '<staff_prefix> <aqua><name></aqua> <gold>Has unfrozen everyone'
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ softdepend:
permissions:
gm4core.default:
default: true
description: Base permission ued for core command
description: Base permission used for core command
gm4core.reload:
default: false
description: Used to reload the plugin
gm4core.mode.watch:
default: op
description: Allows you to go into streamer mode and disable notifcations
description: Allows you to go into streamer mode and disable notifications
children:
- gm4core.mode.mod
gm4core.mode.mod:
Expand All @@ -31,7 +31,7 @@ permissions:
description: tpa to locations or people
gm4core.tpa.back:
default: op
description: go back to privous locations
description: go back to previous locations
children:
- gm4core.tpa
gm4core.freeze:
Expand All @@ -42,7 +42,7 @@ permissions:
description: Bypass getting frozen
gm4core.freeze.notify:
default: op
description: Get notified seperatly when a freeze is started and of who started it
description: Get notified separately when a freeze is started and of who started it
gm4core.warp:
default: op
gm4core.warp.manage:
Expand All @@ -51,7 +51,7 @@ permissions:
- gm4core.warp
gm4core.griefwarning:
default: op
description: Warns when a attempted grief has occured
description: Warns when a attempted grief has occurred
gm4core.warnings:
default: true
description: Lists all your warnings
Expand Down