-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from Syrent/development
Add `advancement` support in `prevent` section. (Updated settings.yml version)
- Loading branch information
Showing
12 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version=3.20.0 | ||
version=3.21.0 | ||
plugin-name=VelocityVanish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/ir/syrent/velocityvanish/spigot/listener/PlayerAdvancementDoneListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package ir.syrent.velocityvanish.spigot.listener | ||
|
||
import io.papermc.lib.PaperLib | ||
import ir.syrent.velocityvanish.spigot.VelocityVanishSpigot | ||
import ir.syrent.velocityvanish.spigot.ruom.Ruom | ||
import ir.syrent.velocityvanish.spigot.storage.Settings | ||
import org.bukkit.event.EventHandler | ||
import org.bukkit.event.EventPriority | ||
import org.bukkit.event.Listener | ||
import org.bukkit.event.player.PlayerAdvancementDoneEvent | ||
|
||
class PlayerAdvancementDoneListener( | ||
private val plugin: VelocityVanishSpigot | ||
) : Listener { | ||
|
||
init { | ||
Ruom.registerListener(this) | ||
} | ||
|
||
@EventHandler | ||
private fun onPlayerAdvancementDone(event: PlayerAdvancementDoneEvent) { | ||
if (PaperLib.isPaper() && Settings.preventAdvancement) { | ||
val player = event.player | ||
if (!plugin.vanishedNames.contains(player.name)) return | ||
val advancement = event.advancement | ||
event.message(null) | ||
for (criteria in advancement.criteria) { | ||
player.getAdvancementProgress(advancement).revokeCriteria(criteria) | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ softdepend: | |
- 'PlaceholderAPI' | ||
- 'squaremap' | ||
- 'Essentials' | ||
- 'CMI' | ||
- 'CMI' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"id":"velocityvanish","name":"VelocityVanish","version":"3.20.0","description":"Vanish plugin for velocity servers","url":"syrent.ir","authors":["Syrent"],"dependencies":[],"main":"ir.syrent.velocityvanish.velocity.VelocityVanish"} | ||
{"id":"velocityvanish","name":"VelocityVanish","version":"3.21.0","description":"Vanish plugin for velocity servers","url":"syrent.ir","authors":["Syrent"],"dependencies":[],"main":"ir.syrent.velocityvanish.velocity.VelocityVanish"} |