libreforge-updater

This commit is contained in:
Auxilor
2022-10-24 17:05:19 +01:00
parent 3ce09bdbea
commit 2dadeba87f
11 changed files with 39 additions and 252 deletions

View File

@@ -62,8 +62,8 @@ allprojects {
} }
dependencies { dependencies {
compileOnly 'com.willfp:eco:6.37.2' compileOnly 'com.willfp:eco:6.44.0'
implementation 'com.willfp:libreforge:3.114.1' implementation 'com.willfp:libreforge:3.115.0'
implementation 'org.joml:joml:1.10.4' implementation 'org.joml:joml:1.10.4'
compileOnly 'org.jetbrains:annotations:23.0.0' compileOnly 'org.jetbrains:annotations:23.0.0'

View File

@@ -1,184 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
- the Javadoc guidelines at
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
https://checkstyle.org (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.
Finally, it is worth reading the documentation.
-->
<module name="Checker">
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppression.xml"/>
</module>
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
https://checkstyle.org/config.html#Checker
<property name="basedir" value="${basedir}"/>
-->
<property name="severity" value="error"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks whether files end with a new line. -->
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks that property files contain the same keys. -->
<!-- See https://checkstyle.org/config_misc.html#Translation -->
<module name="Translation"/>
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="200"/>
</module>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter"/>
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<!-- Checks for Headers -->
<!-- See https://checkstyle.org/config_header.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
<module name="MissingJavadocMethod"/>
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for imports -->
<!-- See https://checkstyle.org/config_imports.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<!-- <module name="MethodLength"/> -->
<module name="ParameterNumber"/>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See https://checkstyle.org/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.org/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<!-- <module name="MagicNumber"/> -->
<module name="MissingSwitchDefault"/>
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Checks for class design -->
<!-- See https://checkstyle.org/config_design.html -->
<!-- <module name="DesignForExtension"/> -->
<module name="FinalClass"/>
<!-- <module name="HideUtilityClassConstructor"/> -->
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<module name="RequireThis"/>
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment"/>
<module name="UpperEll"/>
</module>
</module>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Talismans don't need javadoc. -->
<suppress files="[\\/]talismans[\\/]talismans[\\/]talismans[\\/]" checks="MissingJavadocMethod"/>
<suppress files="[\\/]talismans[\\/]talismans[\\/]talismans[\\/]" checks="JavadocVariable"/>
<!-- Extensions don't need javadoc. -->
<suppress files="[\\/]eco-extensions[\\/]" checks="MissingJavadocMethod"/>
<suppress files="[\\/]eco-extensions[\\/]" checks="JavadocVariable"/>
<!-- Fields don't need javadoc -->
<suppress files="Talismans.java" checks="JavadocVariable"/>
<!-- Modified version of library -->
<suppress files="ArmorEquipEvent.java" checks="JavadocVariable"/>
<suppress files="ArmorEquipEvent.java" checks="MissingJavadocMethod"/>
<suppress files="ArmorEquipEvent.java" checks="JavadocStyle"/>
<suppress files="ArmorListener.java" checks="JavadocVariable"/>
<suppress files="ArmorListener.java" checks="MissingJavadocMethod"/>
<suppress files="ArmorType.java" checks="JavadocVariable"/>
<suppress files="ArmorType.java" checks="MissingJavadocMethod"/>
</suppressions>

View File

@@ -30,14 +30,6 @@ class TalismansPlugin : LibReforgePlugin() {
override fun handleReloadAdditional() { override fun handleReloadAdditional() {
logger.info("${Talismans.values().size} Talismans Loaded") logger.info("${Talismans.values().size} Talismans Loaded")
/*
Broken with talisman bag rn
CustomItem(
this.namespacedKeyFactory.create("any_talisman"),
{ test -> TalismanChecks.getTalismanOnItem(test) != null },
Talismans.values()[0].itemStack
).register()
*/
} }
override fun loadPluginCommands(): List<PluginCommand> { override fun loadPluginCommands(): List<PluginCommand> {
@@ -58,10 +50,6 @@ class TalismansPlugin : LibReforgePlugin() {
return TalismanDisplay(this) return TalismanDisplay(this)
} }
override fun getMinimumEcoVersion(): String {
return "6.36.3"
}
companion object { companion object {
@JvmStatic @JvmStatic
lateinit var instance: TalismansPlugin lateinit var instance: TalismansPlugin

View File

@@ -57,10 +57,12 @@ object TalismanBag {
plugin.namespacedKeyFactory.create("talisman_bag"), plugin.namespacedKeyFactory.create("talisman_bag"),
PersistentDataKeyType.STRING_LIST, PersistentDataKeyType.STRING_LIST,
emptyList() emptyList()
).player() )
for (rows in 1..6) { for (rows in 1..6) {
menus[rows] = menu(rows) { menus[rows] = menu(rows) {
title = plugin.configYml.getFormattedString("bag.title")
for (row in 1..rows) { for (row in 1..rows) {
for (column in 1..9) { for (column in 1..9) {
setSlot(row, column, slot({ player, _ -> setSlot(row, column, slot({ player, _ ->
@@ -83,8 +85,6 @@ object TalismanBag {
} }
} }
setTitle(plugin.configYml.getFormattedString("bag.title"))
onRender { player, menu -> onRender { player, menu ->
val items = menu.getCaptiveItems(player) val items = menu.getCaptiveItems(player)
.filterNot { EmptyTestableItem().matches(it) } .filterNot { EmptyTestableItem().matches(it) }

View File

@@ -36,10 +36,10 @@ class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "talismans.com
amount = args[2].toIntOrNull() ?: 1 amount = args[2].toIntOrNull() ?: 1
} }
val recieverName = args[0] val receiverName = args[0]
val reciever = Bukkit.getPlayer(recieverName) val receiver = Bukkit.getPlayer(receiverName)
if (reciever == null) { if (receiver == null) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player")) sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return return
} }
@@ -54,7 +54,7 @@ class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "talismans.com
var message = plugin.langYml.getMessage("give-success") var message = plugin.langYml.getMessage("give-success")
message = message.replace("%talisman%", talisman.name).replace("%recipient%", reciever.name) message = message.replace("%talisman%", talisman.name).replace("%recipient%", receiver.name)
sender.sendMessage(message) sender.sendMessage(message)
@@ -62,7 +62,7 @@ class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "talismans.com
itemStack.amount = amount itemStack.amount = amount
reciever.inventory.addItem(itemStack) receiver.inventory.addItem(itemStack)
} }
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> { override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {

View File

@@ -1,6 +1,5 @@
package com.willfp.talismans.command package com.willfp.talismans.command
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.impl.PluginCommand import com.willfp.eco.core.command.impl.PluginCommand
import com.willfp.libreforge.LibReforgePlugin import com.willfp.libreforge.LibReforgePlugin
import com.willfp.libreforge.lrcdb.CommandExport import com.willfp.libreforge.lrcdb.CommandExport

View File

@@ -70,13 +70,15 @@ class Talisman(
val lowerLevel: Talisman? val lowerLevel: Talisman?
get() = Talismans.getByID(config.getString("higherLevelOf")) get() = Talismans.getByID(config.getString("higherLevelOf"))
override val effects = config.getSubsections("effects").mapNotNull { override val effects = Effects.compile(
Effects.compile(it, "Talisman ID $id") config.getSubsections("effects"),
}.toSet() "Talisman $id"
)
override val conditions = config.getSubsections("conditions").mapNotNull { override val conditions = Conditions.compile(
Conditions.compile(it, "Talisman ID $id") config.getSubsections("conditions"),
}.toSet() "Talisman $id"
)
init { init {
Talismans.addNewTalisman(this) Talismans.addNewTalisman(this)

View File

@@ -39,7 +39,14 @@ cannot-afford-type:
sound: "BLOCK_NOTE_BLOCK_PLING" sound: "BLOCK_NOTE_BLOCK_PLING"
pitch: 0.5 pitch: 0.5
point-names: # If you have point names that look ugly (eg g_souls) then you can map them to nice names to be shown to players. cannot-afford-price:
in-actionbar: true
sound:
enabled: true
sound: "BLOCK_NOTE_BLOCK_PLING"
pitch: 0.5
point-names: # If you have point names that look ugly (eg souls) then you can map them to nice names to be shown to players.
example_point: "Nicely Formatted Point" example_point: "Nicely Formatted Point"
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements

View File

@@ -2,16 +2,11 @@ messages:
prefix: "&6&lTalismans&r &8» &r" prefix: "&6&lTalismans&r &8» &r"
no-permission: "&cYou don't have permission to do this!" no-permission: "&cYou don't have permission to do this!"
not-player: "&cThis command must be run by a player" not-player: "&cThis command must be run by a player"
invalid-command: "&cUnknown Subcommand!" invalid-command: "&cUnknown subcommand!"
reloaded: "Reloaded! Took %time%ms" reloaded: "Reloaded!"
needs-player: "&cYou must specify a player"
invalid-player: "&cInvalid player!"
needs-talisman: "&cYou must specify a talisman"
invalid-talisman: "&cInvalid talisman!"
invalid-level: "&cLevel doesn't exist!"
give-success: "Gave &a%talisman%&r to &a%recipient%"
cannot-afford: "&cYou can't afford to do this! &fCost: &a$$%cost%" cannot-afford: "&cYou can't afford to do this! &fCost: &a$$%cost%"
cannot-afford-type: "&cYou can't afford to do this! &fCost: &a%cost% %type%" cannot-afford-type: "&cYou can't afford to do this! &fCost: &a%cost% %type%"
cannot-afford-price: "&cYou can't afford to do this! &fPrice: %price%"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds" on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
cannot-transmit: "&cYou can't transmit here!" cannot-transmit: "&cYou can't transmit here!"
must-specify-lrcdb-id: "&cYou must specify the ID of the config to download! Not sure what this means? Go to &alrcdb.auxilor.io" must-specify-lrcdb-id: "&cYou must specify the ID of the config to download! Not sure what this means? Go to &alrcdb.auxilor.io"
@@ -20,4 +15,11 @@ messages:
must-specify-config-name: "&cYou must specify the config name!" must-specify-config-name: "&cYou must specify the config name!"
invalid-config-name: "&cInvalid config name!" invalid-config-name: "&cInvalid config name!"
lrcdb-export-error: "&cError exporting config: &f%message%" lrcdb-export-error: "&cError exporting config: &f%message%"
lrcdb-export-success: "&fExported &a%name%&f! View it on &alrcdb.auxilor.io&f, or share your config ID: &f%id%" lrcdb-export-success: "&fExported &a%name%&f! View it on &alrcdb.auxilor.io&f, or share your config ID: &f%id%"
needs-player: "&cYou must specify a player"
invalid-player: "&cInvalid player!"
needs-talisman: "&cYou must specify a talisman"
invalid-talisman: "&cInvalid talisman!"
invalid-level: "&cLevel doesn't exist!"
give-success: "Gave &a%talisman%&r to &a%recipient%"

View File

@@ -1,4 +1,4 @@
#libreforge-updater #libreforge-updater
#Fri Oct 21 19:26:28 BST 2022 #Mon Oct 24 17:05:19 BST 2022
version=5.123.1 version=5.124.0
plugin-name=Talismans plugin-name=Talismans