remove disableTrample to be put in separate hub protection plugin
This commit is contained in:
@ -3,7 +3,6 @@ package com.pobnellion.pobutils
|
||||
import com.pobnellion.pobutils.modules.CmdModule
|
||||
import com.pobnellion.pobutils.modules.ModuleBase
|
||||
import com.pobnellion.pobutils.modules.disableExplosions.DisableExplosions
|
||||
import com.pobnellion.pobutils.modules.disableTrample.DisableTrample
|
||||
import com.pobnellion.pobutils.modules.formatChat.FormatChat
|
||||
import com.pobnellion.pobutils.modules.hub.Hub
|
||||
import com.pobnellion.pobutils.modules.noJoinMessage.NoJoinMessage
|
||||
@ -25,8 +24,7 @@ class Pobutils : JavaPlugin() {
|
||||
|
||||
override fun onEnable() {
|
||||
registerModule(DisableExplosions(this))
|
||||
registerModule(DisableTrample(this))
|
||||
registerModule(FormatChat(this)) // TODO: test set format config
|
||||
registerModule(FormatChat(this))
|
||||
registerModule(Hub(this))
|
||||
registerModule(NoJoinMessage(this))
|
||||
registerModule(Portals(this))
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
package com.pobnellion.pobutils.modules.disableTrample
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder
|
||||
import com.pobnellion.pobutils.Pobutils
|
||||
import com.pobnellion.pobutils.modules.ModuleBase
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.block.Action
|
||||
import org.bukkit.event.player.PlayerInteractEvent
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
@Suppress("UnstableApiUsage")
|
||||
class DisableTrample(plugin: JavaPlugin) : ModuleBase(plugin) , Listener {
|
||||
override val name: String = "disableTrample"
|
||||
|
||||
override fun register() {
|
||||
plugin.server.pluginManager.registerEvents(this, plugin)
|
||||
}
|
||||
|
||||
override fun reload() { }
|
||||
override fun onDisable() { }
|
||||
override fun onEnable() { }
|
||||
override fun configCmd(): LiteralArgumentBuilder<CommandSourceStack>? { return null }
|
||||
|
||||
@EventHandler
|
||||
fun onTrample(event: PlayerInteractEvent) {
|
||||
if (Pobutils.isEnabled(this.name)
|
||||
&& event.action == Action.PHYSICAL
|
||||
&& event.hand == null
|
||||
&& event.clickedBlock?.type == Material.FARMLAND)
|
||||
event.isCancelled = true
|
||||
}
|
||||
}
|
||||
@ -107,6 +107,7 @@ class Portals(plugin: JavaPlugin) : ModuleBase(plugin), Listener, PluginMessageL
|
||||
val stopModifier = AttributeModifier(NamespacedKey.minecraft("stop"), -1.0, AttributeModifier.Operation.ADD_SCALAR)
|
||||
event.player.getAttribute(Attribute.MOVEMENT_SPEED)!!.addTransientModifier(stopModifier)
|
||||
event.player.getAttribute(Attribute.JUMP_STRENGTH)!!.addTransientModifier(stopModifier)
|
||||
event.player.isFlying = false
|
||||
portalCooldowns[event.player] = event.from
|
||||
|
||||
val message = ByteStreams.newDataOutput()
|
||||
|
||||
Reference in New Issue
Block a user