9
0
mirror of https://github.com/Auxilor/Reforges.git synced 2025-12-23 17:09:32 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Auxilor
3ddf466f2d libreforge-updater 2022-11-01 16:23:07 +00:00
Auxilor
ca41b54daa libreforge-updater 2022-10-28 11:34:59 +01:00
Auxilor
ff9e16a25f libreforge-updater 2022-10-26 22:10:30 +01:00
Auxilor
c0d94f6150 Fix 2022-10-24 17:09:11 +01:00
Auxilor
4b3bf30a9b Fix 2022-10-24 17:08:49 +01:00
Auxilor
4c1ee554b4 libreforge-updater 2022-10-24 17:05:03 +01:00
Auxilor
695d90c793 Fixed reforge stone bug 2022-10-24 12:54:51 +01:00
9 changed files with 46 additions and 229 deletions

View File

@@ -44,8 +44,8 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:6.43.0'
implementation 'com.willfp:libreforge:3.114.1'
compileOnly 'com.willfp:eco:6.44.0'
implementation 'com.willfp:libreforge:3.117.0'
implementation 'org.joml:joml:1.10.4'
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,14 +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>
<!-- Effects don't need javadoc. -->
<suppress files="[\\/]reforges[\\/]reforges[\\/]" checks="MissingJavadocMethod"/>
<suppress files="[\\/]reforges[\\/]reforges[\\/]" checks="JavadocVariable"/>
<!-- Fields don't need javadoc -->
<suppress files="Reforges.java" checks="JavadocVariable"/>
</suppressions>

View File

@@ -277,7 +277,7 @@ object ReforgeGUI {
)
onRender { player, menu ->
menu.addState(
menu.setState(
player, "item_to_reforge", menu.getCaptiveItem(
player,
plugin.configYml.getInt("gui.item-slot.row"),
@@ -285,7 +285,7 @@ object ReforgeGUI {
)
)
menu.addState(
menu.setState(
player, "reforge_stone", menu.getCaptiveItem(
player,
plugin.configYml.getInt("gui.stone-slot.row"),
@@ -308,16 +308,20 @@ object ReforgeGUI {
ReforgeStatus.INVALID_ITEM
} else {
val reforgeStone = stone.reforgeStone
if (reforgeStone != null && reforgeStone.canBeAppliedTo(item)) {
cost = reforgeStone.stonePrice.toDouble()
ReforgeStatus.ALLOW_STONE
} else {
if (reforgeStone == null) {
ReforgeStatus.ALLOW
} else {
if (reforgeStone.canBeAppliedTo(item)) {
cost = reforgeStone.stonePrice.toDouble()
ReforgeStatus.ALLOW_STONE
} else {
ReforgeStatus.INVALID_ITEM
}
}
}
}
menu.addState(player, "reforge_status", PricedReforgeStatus(status, cost))
menu.setState(player, "reforge_status", PricedReforgeStatus(status, cost))
}
onClose { event, menu ->

View File

@@ -30,13 +30,15 @@ class Reforge(
val targets = config.getStrings("targets").mapNotNull { ReforgeTargets.getByName(it) }.toSet()
override val effects = config.getSubsections("effects").mapNotNull {
Effects.compile(it, "Reforge ID $id")
}.toSet()
override val effects = Effects.compile(
config.getSubsections("effects"),
"Reforge $id"
)
override val conditions = config.getSubsections("conditions").mapNotNull {
Conditions.compile(it, "Reforge ID $id")
}.toSet()
override val conditions = Conditions.compile(
config.getSubsections("conditions"),
"Reforge $id"
)
val requiresStone = config.getBool("stone.enabled")

View File

@@ -3,7 +3,7 @@ package com.willfp.reforges.reforges
import com.google.common.collect.HashBiMap
import com.google.common.collect.ImmutableSet
import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.config.TransientConfig
import com.willfp.eco.core.config.readConfig
import com.willfp.eco.core.config.updating.ConfigUpdater
import com.willfp.libreforge.chains.EffectChains
import com.willfp.reforges.ReforgesPlugin
@@ -54,7 +54,7 @@ object Reforges {
@ConfigUpdater
@JvmStatic
fun update(plugin: ReforgesPlugin) {
val reforgesYml = TransientConfig(File(plugin.dataFolder, "reforges.yml"), ConfigType.YAML)
val reforgesYml = File(plugin.dataFolder, "reforges.yml").readConfig(ConfigType.YAML)
for (config in reforgesYml.getSubsections("chains")) {
EffectChains.compile(config, "Chains")

View File

@@ -179,6 +179,13 @@ cannot-afford-type:
sound: "BLOCK_NOTE_BLOCK_PLING"
pitch: 0.5
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 g_souls) then you can map them to nice names to be shown to players.
example_point: "Nicely Formatted Point"

View File

@@ -3,20 +3,11 @@ messages:
no-permission: "&cYou don't have permission to do this!"
not-player: "&cThis command must be run by a player"
invalid-command: "&cUnknown subcommand!"
reloaded: "Reloaded! (Restart if you're removed reforges!) Took %time%ms"
insufficient-money: "&cYou don't have enough money for this!"
insufficient-xp: "&cYou don't have enough xp levels for this!"
applied-reforge: "Applied %reforge%&r reforge!"
needs-player: "&cYou must specify a player"
invalid-player: "&cInvalid player!"
needs-stone: "&cYou must specify a reforge stone"
invalid-stone: "&cInvalid reforge!"
give-success: "Gave &a%reforge%&r reforge stone to &a%recipient%"
on-cooldown: "&cThis reforge is on cooldown! &fTime left: &a%seconds% seconds"
reloaded: "Reloaded!"
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%"
invalid-reforge: "&cInvalid reforge!"
needs-reforge: "&cYou must specify a reforge"
cannot-afford-price: "&cYou can't afford to do this! &fPrice: %price%"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
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"
lrcdb-import-error: "&cError importing config: &f%message%"
@@ -26,6 +17,17 @@ messages:
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%"
insufficient-money: "&cYou don't have enough money for this!"
insufficient-xp: "&cYou don't have enough xp levels for this!"
applied-reforge: "Applied %reforge%&r reforge!"
needs-player: "&cYou must specify a player"
invalid-player: "&cInvalid player!"
needs-stone: "&cYou must specify a reforge stone"
invalid-stone: "&cInvalid reforge!"
give-success: "Gave &a%reforge%&r reforge stone to &a%recipient%"
invalid-reforge: "&cInvalid reforge!"
needs-reforge: "&cYou must specify a reforge"
menu:
title: "Reforge Item"
close: "&cClose"

View File

@@ -1,4 +1,4 @@
#libreforge-updater
#Fri Oct 21 19:25:56 BST 2022
version=5.65.1
#Tue Nov 01 16:23:07 GMT 2022
version=5.68.0
plugin-name=Reforges