mirror of
https://github.com/Auxilor/Reforges.git
synced 2025-12-20 15:39:30 +00:00
Compare commits
154 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdd95f005f | ||
|
|
aec6639725 | ||
|
|
b3f98e2b6e | ||
|
|
8b2c96dc53 | ||
|
|
192bb138ff | ||
|
|
1dc15fcb53 | ||
|
|
94394ecaec | ||
|
|
0cf2d4c810 | ||
|
|
dfed5b996a | ||
|
|
5adf8832a8 | ||
|
|
4335833b7b | ||
|
|
1d1a84991e | ||
|
|
a2752daa07 | ||
|
|
fb5926453c | ||
|
|
252e9472de | ||
|
|
ebde54cb87 | ||
|
|
98aff77ab3 | ||
|
|
3ddf466f2d | ||
|
|
ca41b54daa | ||
|
|
ff9e16a25f | ||
|
|
c0d94f6150 | ||
|
|
4b3bf30a9b | ||
|
|
4c1ee554b4 | ||
|
|
695d90c793 | ||
|
|
a67270c09d | ||
|
|
8f23b22a05 | ||
|
|
7279958cca | ||
|
|
6689c3cf23 | ||
|
|
df8357ac61 | ||
|
|
aa0f06092e | ||
|
|
19083d54b8 | ||
|
|
2a6c2941d8 | ||
|
|
757dffb08d | ||
|
|
277a0bef78 | ||
|
|
c7f8b9f97e | ||
|
|
0f97e2dfc4 | ||
|
|
ae503fd646 | ||
|
|
89df16dabe | ||
|
|
c6dfa1849d | ||
|
|
fb4022dfd9 | ||
|
|
60c785717a | ||
|
|
a3810a9ff8 | ||
|
|
3498b575dc | ||
|
|
8f5668d8c4 | ||
|
|
6cde0ca092 | ||
|
|
d54e4ee8d5 | ||
|
|
65ef2a63d2 | ||
|
|
0d1ea5a7c8 | ||
|
|
7d32350eed | ||
|
|
4361ce0407 | ||
|
|
4267f5bd5d | ||
|
|
a5fc6e7436 | ||
|
|
cc5dfc0b0d | ||
|
|
16082cf3c6 | ||
|
|
0d3485855a | ||
|
|
afaafb5899 | ||
|
|
8fbc672f1f | ||
|
|
19221c8969 | ||
|
|
0f96c5027e | ||
|
|
e58429c9c7 | ||
|
|
f2831f0bcd | ||
|
|
1c84929739 | ||
|
|
67b4e340d8 | ||
|
|
f6b23bf649 | ||
|
|
515d5022ba | ||
|
|
bf0813ae70 | ||
|
|
c5330b79b5 | ||
|
|
e961411808 | ||
|
|
75d8475ece | ||
|
|
9e7d9559d9 | ||
|
|
a58c7c892a | ||
|
|
9eaad16592 | ||
|
|
83690068b2 | ||
|
|
1391cdc978 | ||
|
|
9c6461984e | ||
|
|
340fcb1908 | ||
|
|
7f0f8078aa | ||
|
|
e1c70dd4b4 | ||
|
|
ec3a4215b7 | ||
|
|
4f80c3b5f3 | ||
|
|
55efb74fb4 | ||
|
|
d4efad6cd7 | ||
|
|
4fc10862f6 | ||
|
|
c0b96e58ff | ||
|
|
1bdf9b9f4c | ||
|
|
9baaf37108 | ||
|
|
8b89c16754 | ||
|
|
8ee6b64dec | ||
|
|
507e476de0 | ||
|
|
e4bdc914d6 | ||
|
|
89c11c5d03 | ||
|
|
ace9174713 | ||
|
|
11b755c03e | ||
|
|
e502281fac | ||
|
|
7f5b2e28d4 | ||
|
|
0c77fae5c0 | ||
|
|
67c67fe494 | ||
|
|
91cd161e0f | ||
|
|
0ae01af7cf | ||
|
|
7dd0f35f1f | ||
|
|
e4afc37f45 | ||
|
|
b74a7f1085 | ||
|
|
94d2ab4593 | ||
|
|
9fce6a6d74 | ||
|
|
a84231c13b | ||
|
|
c833cc9b67 | ||
|
|
2018f5c506 | ||
|
|
783b14d650 | ||
|
|
793075a70e | ||
|
|
f1f3d5b014 | ||
|
|
a0af472e17 | ||
|
|
060b981019 | ||
|
|
d559684d7b | ||
|
|
f40cd6f68f | ||
|
|
f185ab58ad | ||
|
|
bed87f4210 | ||
|
|
df9cecc2fd | ||
|
|
72d0e258f4 | ||
|
|
224c243449 | ||
|
|
b925a18ea0 | ||
|
|
801e61c66c | ||
|
|
0c58faf33e | ||
|
|
04cff9070b | ||
|
|
57aee104aa | ||
|
|
bbfeac1cde | ||
|
|
a5b9446afe | ||
|
|
a99e34014f | ||
|
|
3f9ddf08fb | ||
|
|
176b8cae9a | ||
|
|
3cca475d13 | ||
|
|
d4f2f1c7c8 | ||
|
|
87c6481701 | ||
|
|
b184c10f02 | ||
|
|
5428be88ea | ||
|
|
79b96193f1 | ||
|
|
fc68463b5c | ||
|
|
bc5b2dedd3 | ||
|
|
3128091722 | ||
|
|
0887d8af75 | ||
|
|
b879d87720 | ||
|
|
daf5e23b39 | ||
|
|
850455e4c2 | ||
|
|
0e0e986906 | ||
|
|
3b2f77a83b | ||
|
|
5c429ee626 | ||
|
|
3749edc5c1 | ||
|
|
a0b3b62040 | ||
|
|
12b1b99466 | ||
|
|
b4c071fd53 | ||
|
|
93a8937222 | ||
|
|
a565e3d3e7 | ||
|
|
3c92da1998 | ||
|
|
87a240d5d3 | ||
|
|
22b0279057 |
13
build.gradle
13
build.gradle
@@ -4,7 +4,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,18 +40,20 @@ allprojects {
|
||||
|
||||
shadowJar {
|
||||
relocate('com.willfp.libreforge', 'com.willfp.reforges.libreforge')
|
||||
relocate('com.willfp.ecomponent', 'com.willfp.reforges.ecomponent')
|
||||
relocate('org.joml', 'com.willfp.reforges.libreforge.joml')
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.35.1'
|
||||
implementation 'com.willfp:libreforge:3.49.0'
|
||||
compileOnly 'com.willfp:eco:6.46.0'
|
||||
implementation 'com.willfp:libreforge:3.121.0'
|
||||
implementation 'com.willfp:ecomponent:1.3.0'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
||||
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
@@ -60,7 +62,7 @@ allprojects {
|
||||
}
|
||||
|
||||
processResources {
|
||||
filesNotMatching(["**/*.png", "**/models/**", "**/textures/**", "**reforges.yml", "**lang.yml"]) {
|
||||
filesMatching(["**plugin.yml"]) {
|
||||
expand projectVersion: project.version
|
||||
}
|
||||
}
|
||||
@@ -68,6 +70,7 @@ allprojects {
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
freeCompilerArgs += ["-Xjvm-default=all"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -7,29 +7,28 @@ import com.willfp.eco.core.items.Items
|
||||
import com.willfp.libreforge.LibReforgePlugin
|
||||
import com.willfp.reforges.commands.CommandReforge
|
||||
import com.willfp.reforges.commands.CommandReforges
|
||||
import com.willfp.reforges.config.ReforgesYml
|
||||
import com.willfp.reforges.config.TargetYml
|
||||
import com.willfp.reforges.display.ReforgesDisplay
|
||||
import com.willfp.reforges.integrations.talismans.TalismansIntegration
|
||||
import com.willfp.reforges.reforges.Reforges
|
||||
import com.willfp.reforges.reforges.util.ReforgeArgParser
|
||||
import com.willfp.reforges.util.ReforgeEnableListeners
|
||||
import com.willfp.reforges.util.ReforgeLookup
|
||||
import com.willfp.reforges.util.AntiPlaceListener
|
||||
import com.willfp.reforges.util.DiscoverRecipeListener
|
||||
import com.willfp.reforges.util.ReforgeEnableListeners
|
||||
import com.willfp.reforges.util.ReforgeLookup
|
||||
import org.bukkit.event.Listener
|
||||
|
||||
class ReforgesPlugin : LibReforgePlugin() {
|
||||
val targetYml: TargetYml =
|
||||
TargetYml(this)
|
||||
val reforgesYml: ReforgesYml =
|
||||
ReforgesYml(this)
|
||||
|
||||
init {
|
||||
instance = this
|
||||
}
|
||||
|
||||
override fun handleEnableAdditional() {
|
||||
this.copyConfigs("reforges")
|
||||
|
||||
Items.registerArgParser(ReforgeArgParser())
|
||||
registerHolderProvider { ReforgeLookup.provideReforges(it) }
|
||||
}
|
||||
@@ -63,10 +62,6 @@ class ReforgesPlugin : LibReforgePlugin() {
|
||||
)
|
||||
}
|
||||
|
||||
override fun getMinimumEcoVersion(): String {
|
||||
return "6.35.1"
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Instance of Reforges.
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.willfp.reforges.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import com.willfp.libreforge.LibReforgePlugin
|
||||
import com.willfp.libreforge.lrcdb.CommandExport
|
||||
import com.willfp.libreforge.lrcdb.CommandImport
|
||||
import com.willfp.libreforge.lrcdb.ExportableConfig
|
||||
import com.willfp.reforges.reforges.Reforges
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandReforges(plugin: EcoPlugin) : PluginCommand(plugin, "reforges", "reforges.command.reforges", false) {
|
||||
class CommandReforges(plugin: LibReforgePlugin) :
|
||||
PluginCommand(plugin, "reforges", "reforges.command.reforges", false) {
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("invalid-command")
|
||||
@@ -16,5 +21,14 @@ class CommandReforges(plugin: EcoPlugin) : PluginCommand(plugin, "reforges", "re
|
||||
.addSubcommand(CommandGive(plugin))
|
||||
.addSubcommand(CommandOpen(plugin))
|
||||
.addSubcommand(CommandApply(plugin))
|
||||
.addSubcommand(CommandImport("reforges", plugin))
|
||||
.addSubcommand(CommandExport(plugin) {
|
||||
Reforges.values().map {
|
||||
ExportableConfig(
|
||||
it.id,
|
||||
it.config
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.willfp.reforges.config
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.BaseConfig
|
||||
import com.willfp.eco.core.config.ConfigType
|
||||
|
||||
class ReforgesYml(plugin: EcoPlugin) : BaseConfig("reforges", plugin, true, ConfigType.YAML)
|
||||
@@ -3,10 +3,12 @@ package com.willfp.reforges.display
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.display.DisplayPriority
|
||||
import com.willfp.eco.core.display.DisplayProperties
|
||||
import com.willfp.eco.core.fast.FastItemStack
|
||||
import com.willfp.eco.core.fast.fast
|
||||
import com.willfp.eco.util.SkullUtils
|
||||
import com.willfp.eco.util.StringUtils
|
||||
import com.willfp.eco.util.formatEco
|
||||
import com.willfp.eco.util.toJSON
|
||||
import com.willfp.reforges.ReforgesPlugin
|
||||
import com.willfp.reforges.reforges.ReforgeTargets
|
||||
@@ -24,6 +26,7 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
||||
override fun display(
|
||||
itemStack: ItemStack,
|
||||
player: Player?,
|
||||
props: DisplayProperties,
|
||||
vararg args: Any
|
||||
) {
|
||||
val targets = ReforgeTargets.getForItem(itemStack)
|
||||
@@ -44,9 +47,8 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
||||
|
||||
if (reforge == null && stone == null) {
|
||||
if (plugin.configYml.getBool("reforge.show-reforgable")) {
|
||||
if (player != null && plugin.configYml.getBool("reforge.no-reforgable-in-gui")) {
|
||||
val inventory = player.openInventory.topInventory
|
||||
if (inventory.contents.contains(itemStack) && inventory.holder == null) {
|
||||
if (plugin.configYml.getBool("reforge.no-reforgable-in-gui")) {
|
||||
if (props.inGui) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -67,17 +69,17 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
||||
val stoneTexture = SkullUtils.getSkullTexture(stoneMeta)
|
||||
|
||||
if (stoneTexture != null) {
|
||||
try {
|
||||
SkullUtils.setSkullTexture(meta as SkullMeta, stoneTexture)
|
||||
} catch (e: StringIndexOutOfBoundsException) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
itemStack.itemMeta = meta
|
||||
val stoneLore = stone.config.getFormattedStrings("stone.lore").map {
|
||||
"${Display.PREFIX}$it"
|
||||
}.toList()
|
||||
|
||||
val stoneLore = stone.config.getStrings("stone.lore")
|
||||
.map { it.replace("%price%", if (player == null) "" else stone.stonePrice?.getDisplay(player) ?: "") }
|
||||
.formatEco(player)
|
||||
.map { "${Display.PREFIX}$it" }
|
||||
|
||||
lore.addAll(0, stoneLore)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,130 +1,113 @@
|
||||
package com.willfp.reforges.gui
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.emptyConfig
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.eco.core.drops.DropQueue
|
||||
import com.willfp.eco.core.fast.fast
|
||||
import com.willfp.eco.core.gui.captiveSlot
|
||||
import com.willfp.eco.core.gui.menu
|
||||
import com.willfp.eco.core.gui.menu.Menu
|
||||
import com.willfp.eco.core.gui.menu.MenuEvent
|
||||
import com.willfp.eco.core.gui.menu.events.CaptiveItemChangeEvent
|
||||
import com.willfp.eco.core.gui.onEvent
|
||||
import com.willfp.eco.core.gui.slot
|
||||
import com.willfp.eco.core.gui.slot.CustomSlot
|
||||
import com.willfp.eco.core.gui.slot.FillerMask
|
||||
import com.willfp.eco.core.gui.slot.MaskItems
|
||||
import com.willfp.eco.core.gui.slot.Slot
|
||||
import com.willfp.eco.core.integrations.economy.EconomyManager
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||
import com.willfp.eco.util.NumberUtils
|
||||
import com.willfp.eco.core.items.builder.modify
|
||||
import com.willfp.eco.core.items.isEmpty
|
||||
import com.willfp.eco.core.price.ConfiguredPrice
|
||||
import com.willfp.eco.core.sound.PlayableSound
|
||||
import com.willfp.ecomponent.CaptiveItem
|
||||
import com.willfp.ecomponent.menuStateVar
|
||||
import com.willfp.ecomponent.setSlot
|
||||
import com.willfp.reforges.reforges.PriceMultipliers
|
||||
import com.willfp.reforges.reforges.PriceMultipliers.reforgePriceMultiplier
|
||||
import com.willfp.reforges.reforges.Reforge
|
||||
import com.willfp.reforges.reforges.ReforgeTarget
|
||||
import com.willfp.reforges.reforges.ReforgeTargets
|
||||
import com.willfp.reforges.reforges.util.MetadatedReforgeStatus
|
||||
import com.willfp.reforges.util.ReforgeStatus
|
||||
import com.willfp.reforges.util.getRandomReforge
|
||||
import com.willfp.reforges.util.reforge
|
||||
import com.willfp.reforges.util.reforgeStone
|
||||
import com.willfp.reforges.util.timesReforged
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.Sound
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import java.util.*
|
||||
import java.util.Locale
|
||||
import kotlin.math.pow
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
object ReforgeGUI {
|
||||
private lateinit var menu: Menu
|
||||
|
||||
private fun Menu.getReforgeStatus(player: Player): MetadatedReforgeStatus {
|
||||
val captive = this.getCaptiveItems(player)
|
||||
val item = captive.getOrNull(0)
|
||||
val stone = captive.getOrNull(1)
|
||||
private data class ReforgeGUIStatus(
|
||||
val status: ReforgeStatus,
|
||||
val price: ConfiguredPrice,
|
||||
val isStonePrice: Boolean
|
||||
)
|
||||
|
||||
val targets = mutableListOf<ReforgeTarget>()
|
||||
private class ReforgePriceChangeEvent : MenuEvent
|
||||
|
||||
var cost = 0.0
|
||||
val status = if (item == null || item.type == Material.AIR) {
|
||||
ReforgeStatus.NO_ITEM
|
||||
private val Menu.reforgeStatus by menuStateVar(
|
||||
ReforgeGUIStatus(
|
||||
ReforgeStatus.NO_ITEM,
|
||||
ConfiguredPrice.createOrFree(emptyConfig()),
|
||||
false
|
||||
)
|
||||
)
|
||||
|
||||
private class IndicatorSlot(
|
||||
plugin: EcoPlugin
|
||||
) : CustomSlot() {
|
||||
private val slot = slot { player, menu ->
|
||||
val status = menu.reforgeStatus[player].status
|
||||
|
||||
if (status == ReforgeStatus.ALLOW || status == ReforgeStatus.ALLOW_STONE) {
|
||||
Items.lookup(plugin.configYml.getString("gui.show-allowed.allow-material")).item
|
||||
} else {
|
||||
targets.addAll(ReforgeTargets.getForItem(item))
|
||||
if (targets.isEmpty()) {
|
||||
ReforgeStatus.INVALID_ITEM
|
||||
} else {
|
||||
val reforgeStone = stone.reforgeStone
|
||||
if (reforgeStone != null && reforgeStone.canBeAppliedTo(item)) {
|
||||
cost = reforgeStone.stonePrice.toDouble()
|
||||
ReforgeStatus.ALLOW_STONE
|
||||
} else {
|
||||
ReforgeStatus.ALLOW
|
||||
}
|
||||
Items.lookup(plugin.configYml.getString("gui.show-allowed.deny-material")).item
|
||||
}
|
||||
}
|
||||
|
||||
return MetadatedReforgeStatus(status, cost)
|
||||
init {
|
||||
init(slot)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun open(player: Player) {
|
||||
menu.open(player)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ConfigUpdater
|
||||
fun update(plugin: EcoPlugin) {
|
||||
val activatorSlot = slot(ItemStack(Material.ANVIL)) {
|
||||
setUpdater { player, menu, _ ->
|
||||
val (status, specialCost) = menu.getReforgeStatus(player)
|
||||
|
||||
val cost = when {
|
||||
status == ReforgeStatus.ALLOW || (status == ReforgeStatus.ALLOW_STONE && specialCost < 0) -> {
|
||||
val amountOfReforges = menu.getCaptiveItems(player)[0].timesReforged
|
||||
|
||||
plugin.configYml.getDouble("reforge.cost") *
|
||||
plugin.configYml.getDouble("reforge.cost-exponent").pow(amountOfReforges) *
|
||||
PriceMultipliers.getForPlayer(player).multiplier
|
||||
}
|
||||
status == ReforgeStatus.ALLOW_STONE -> {
|
||||
specialCost
|
||||
}
|
||||
else -> 0.0 // Never used, but at least kotlin can shut up
|
||||
}
|
||||
|
||||
var xpCost = plugin.configYml.getInt("reforge.xp-cost")
|
||||
if (status == ReforgeStatus.ALLOW) {
|
||||
val item = menu.getCaptiveItems(player)[0]
|
||||
val reforges = item.timesReforged
|
||||
xpCost *= PriceMultipliers.getForPlayer(player).multiplier.toInt()
|
||||
xpCost *= plugin.configYml.getDouble("reforge.cost-exponent").pow(reforges.toDouble()).toInt()
|
||||
}
|
||||
private class ActivatorSlot(
|
||||
plugin: EcoPlugin,
|
||||
itemToReforge: CaptiveItem,
|
||||
reforgeStone: CaptiveItem
|
||||
) : CustomSlot() {
|
||||
private val slot = slot({ player, menu ->
|
||||
val (status, price) = menu.reforgeStatus[player]
|
||||
|
||||
val configKey = status.configKey
|
||||
|
||||
Items.lookup(plugin.configYml.getString("gui.$configKey.material")).item.apply {
|
||||
this.fast().displayName = plugin.configYml.getFormattedString("gui.$configKey.name")
|
||||
this.fast().lore = plugin.configYml.getFormattedStrings("gui.$configKey.lore").map {
|
||||
it.replace("%cost%", NumberUtils.format(cost))
|
||||
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
||||
Items.lookup(plugin.configYml.getString("gui.$configKey.material")).modify {
|
||||
setDisplayName(plugin.configYml.getString("gui.$configKey.name"))
|
||||
addLoreLines(plugin.configYml.getStrings("gui.$configKey.lore").map {
|
||||
it.replace("%price%", price.getDisplay(player))
|
||||
.replace(
|
||||
"%stone%",
|
||||
menu.getCaptiveItems(player).getOrNull(1).reforgeStone?.name ?: ""
|
||||
reforgeStone[player]?.reforgeStone?.name ?: ""
|
||||
)
|
||||
// Legacy
|
||||
.replace("%cost%", price.getDisplay(player))
|
||||
.replace("%xpcost%", price.getDisplay(player))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}) {
|
||||
onLeftClick { event, _, menu ->
|
||||
val player = event.whoClicked as Player
|
||||
val captive = menu.getCaptiveItems(player)
|
||||
|
||||
val item = captive.getOrNull(0) ?: return@onLeftClick
|
||||
val item = itemToReforge[player] ?: return@onLeftClick
|
||||
val currentReforge = item.reforge
|
||||
|
||||
val targets = ReforgeTargets.getForItem(item)
|
||||
|
||||
|
||||
var usedStone = false
|
||||
|
||||
val stoneInMenu = menu.getCaptiveItems(player).getOrNull(1).reforgeStone
|
||||
val stoneInMenu = reforgeStone[player]?.reforgeStone
|
||||
|
||||
val reforge = if (stoneInMenu != null && stoneInMenu.canBeAppliedTo(item)) {
|
||||
usedStone = true
|
||||
@@ -142,55 +125,22 @@ object ReforgeGUI {
|
||||
return@onLeftClick
|
||||
}
|
||||
|
||||
var cost = 0.0
|
||||
val price = menu.reforgeStatus[player].price
|
||||
|
||||
val reforges = item.timesReforged
|
||||
|
||||
if (EconomyManager.hasRegistrations()) {
|
||||
cost = plugin.configYml.getDouble("reforge.cost")
|
||||
cost *= plugin.configYml.getDouble("reforge.cost-exponent").pow(reforges.toDouble())
|
||||
if (reforge.requiresStone && reforge.stonePrice != -1) {
|
||||
cost = reforge.stonePrice.toDouble()
|
||||
}
|
||||
cost *= PriceMultipliers.getForPlayer(player).multiplier
|
||||
if (!EconomyManager.hasAmount(player, cost)) {
|
||||
player.sendMessage(plugin.langYml.getMessage("insufficient-money"))
|
||||
if (plugin.configYml.getBool("gui.insufficient-money-sound.enabled")) {
|
||||
player.playSound(
|
||||
player.location,
|
||||
Sound.valueOf(
|
||||
plugin.configYml.getString("gui.insufficient-money-sound.id")
|
||||
.uppercase(Locale.getDefault())
|
||||
),
|
||||
1f, plugin.configYml.getDouble("gui.insufficient-money-sound.pitch").toFloat()
|
||||
if (!price.canAfford(player)) {
|
||||
player.sendMessage(
|
||||
plugin.langYml.getMessage("cannot-afford-price").replace("%price%", price.getDisplay(player))
|
||||
)
|
||||
|
||||
if (plugin.configYml.getBool("gui.cannot-afford-sound.enabled")) {
|
||||
PlayableSound.create(
|
||||
plugin.configYml.getSubsection("gui.cannot-afford-sound")
|
||||
)?.playTo(player)
|
||||
}
|
||||
return@onLeftClick
|
||||
}
|
||||
}
|
||||
|
||||
var xpCost = plugin.configYml.getInt("reforge.xp-cost")
|
||||
|
||||
xpCost *= plugin.configYml.getDouble("reforge.cost-exponent").pow(reforges.toDouble()).toInt()
|
||||
xpCost *= PriceMultipliers.getForPlayer(player).multiplier.toInt()
|
||||
if (player.level < xpCost) {
|
||||
player.sendMessage(plugin.langYml.getMessage("insufficient-xp"))
|
||||
if (plugin.configYml.getBool("gui.insufficient-money-sound.enabled")) {
|
||||
player.playSound(
|
||||
player.location,
|
||||
Sound.valueOf(
|
||||
plugin.configYml.getString("gui.insufficient-money-sound.id")
|
||||
.uppercase(Locale.getDefault())
|
||||
),
|
||||
1f, plugin.configYml.getDouble("gui.insufficient-money-sound.pitch").toFloat()
|
||||
)
|
||||
}
|
||||
return@onLeftClick
|
||||
}
|
||||
if (EconomyManager.hasRegistrations()) {
|
||||
EconomyManager.removeMoney(player, cost)
|
||||
}
|
||||
player.level = player.level - xpCost
|
||||
price.pay(player)
|
||||
|
||||
player.sendMessage(plugin.langYml.getMessage("applied-reforge").replace("%reforge%", reforge.name))
|
||||
|
||||
@@ -198,9 +148,9 @@ object ReforgeGUI {
|
||||
item.reforge = reforge
|
||||
|
||||
if (usedStone) {
|
||||
val stone = menu.getCaptiveItems(player)[1]
|
||||
stone.itemMeta = null
|
||||
stone.amount = 0
|
||||
val stone = reforgeStone[player]
|
||||
stone?.itemMeta = null
|
||||
stone?.amount = 0
|
||||
if (plugin.configYml.getBool("gui.stone-sound.enabled")) {
|
||||
player.playSound(
|
||||
player.location,
|
||||
@@ -219,9 +169,38 @@ object ReforgeGUI {
|
||||
1f, plugin.configYml.getDouble("gui.sound.pitch").toFloat()
|
||||
)
|
||||
}
|
||||
|
||||
menu.callEvent(player, ReforgePriceChangeEvent())
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
init(slot)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
object ReforgeGUI {
|
||||
private lateinit var menu: Menu
|
||||
|
||||
private lateinit var itemToReforge: CaptiveItem
|
||||
private lateinit var reforgeStone: CaptiveItem
|
||||
|
||||
private lateinit var defaultPrice: ConfiguredPrice
|
||||
|
||||
@JvmStatic
|
||||
fun open(player: Player) {
|
||||
menu.open(player)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ConfigUpdater
|
||||
fun update(plugin: EcoPlugin) {
|
||||
itemToReforge = CaptiveItem()
|
||||
reforgeStone = CaptiveItem()
|
||||
|
||||
defaultPrice = ConfiguredPrice.createOrFree(plugin.configYml.getSubsection("reforge.price"))
|
||||
|
||||
val maskPattern = plugin.configYml.getStrings("gui.mask.pattern").toTypedArray()
|
||||
|
||||
val maskItems = plugin.configYml.getStrings("gui.mask.materials")
|
||||
@@ -229,31 +208,17 @@ object ReforgeGUI {
|
||||
.toTypedArray()
|
||||
|
||||
menu = menu(plugin.configYml.getInt("gui.rows")) {
|
||||
setTitle(plugin.langYml.getFormattedString("menu.title"))
|
||||
title = plugin.langYml.getFormattedString("menu.title")
|
||||
setMask(FillerMask(MaskItems(*maskItems), *maskPattern))
|
||||
|
||||
val slot = slot(
|
||||
ItemStackBuilder(Material.BLACK_STAINED_GLASS_PANE)
|
||||
.setDisplayName("&r")
|
||||
.build()
|
||||
) {
|
||||
setUpdater { player, menu, _ ->
|
||||
val status = menu.getReforgeStatus(player).status
|
||||
|
||||
if (status == ReforgeStatus.ALLOW || status == ReforgeStatus.ALLOW_STONE) {
|
||||
Items.lookup(plugin.configYml.getString("gui.show-allowed.allow-material")).item
|
||||
} else {
|
||||
Items.lookup(plugin.configYml.getString("gui.show-allowed.deny-material")).item
|
||||
}
|
||||
}
|
||||
}
|
||||
allowChangingHeldItem()
|
||||
|
||||
val allowedPattern = plugin.configYml.getStrings("gui.show-allowed.pattern")
|
||||
for (i in 1..allowedPattern.size) {
|
||||
val row = allowedPattern[i - 1]
|
||||
for (j in 1..9) {
|
||||
if (row[j - 1] != '0') {
|
||||
setSlot(i, j, slot)
|
||||
setSlot(i, j, IndicatorSlot(plugin))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,19 +226,21 @@ object ReforgeGUI {
|
||||
setSlot(
|
||||
plugin.configYml.getInt("gui.item-slot.row"),
|
||||
plugin.configYml.getInt("gui.item-slot.column"),
|
||||
Slot.builder().setCaptive().build()
|
||||
captiveSlot(),
|
||||
bindCaptive = itemToReforge
|
||||
)
|
||||
|
||||
setSlot(
|
||||
plugin.configYml.getInt("gui.stone-slot.row"),
|
||||
plugin.configYml.getInt("gui.stone-slot.column"),
|
||||
Slot.builder().setCaptive().build()
|
||||
captiveSlot(),
|
||||
bindCaptive = reforgeStone
|
||||
)
|
||||
|
||||
setSlot(
|
||||
plugin.configYml.getInt("gui.activator-slot.row"),
|
||||
plugin.configYml.getInt("gui.activator-slot.column"),
|
||||
activatorSlot
|
||||
ActivatorSlot(plugin, itemToReforge, reforgeStone)
|
||||
)
|
||||
|
||||
setSlot(
|
||||
@@ -288,6 +255,60 @@ object ReforgeGUI {
|
||||
}
|
||||
)
|
||||
|
||||
onEvent<ReforgePriceChangeEvent> { player, menu, _ ->
|
||||
val status = menu.reforgeStatus[player]
|
||||
|
||||
val item = itemToReforge[player]
|
||||
|
||||
val reforges = item?.timesReforged ?: 0
|
||||
|
||||
var multiplier = if (status.isStonePrice) 1.0 else {
|
||||
plugin.configYml.getDouble("reforge.cost-exponent")
|
||||
.pow(reforges.toDouble())
|
||||
}
|
||||
|
||||
multiplier *= player.reforgePriceMultiplier
|
||||
|
||||
status.price.setMultiplier(player, multiplier)
|
||||
}
|
||||
|
||||
onEvent<CaptiveItemChangeEvent> { player, menu, _ ->
|
||||
val item = itemToReforge[player]
|
||||
val stone = reforgeStone[player]
|
||||
|
||||
val targets = mutableListOf<ReforgeTarget>()
|
||||
|
||||
var price = defaultPrice
|
||||
|
||||
var isStonePrice = false
|
||||
|
||||
val status = if (item.isEmpty) {
|
||||
ReforgeStatus.NO_ITEM
|
||||
} else {
|
||||
targets.addAll(ReforgeTargets.getForItem(item))
|
||||
if (targets.isEmpty()) {
|
||||
ReforgeStatus.INVALID_ITEM
|
||||
} else {
|
||||
val reforgeStone = stone.reforgeStone
|
||||
if (reforgeStone == null) {
|
||||
ReforgeStatus.ALLOW
|
||||
} else {
|
||||
if (reforgeStone.canBeAppliedTo(item)) {
|
||||
price = reforgeStone.stonePrice ?: defaultPrice
|
||||
isStonePrice = true
|
||||
|
||||
ReforgeStatus.ALLOW_STONE
|
||||
} else {
|
||||
ReforgeStatus.INVALID_ITEM
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu.reforgeStatus[player] = ReforgeGUIStatus(status, price, isStonePrice)
|
||||
menu.callEvent(player, ReforgePriceChangeEvent())
|
||||
}
|
||||
|
||||
onClose { event, menu ->
|
||||
DropQueue(event.player as Player)
|
||||
.addItems(menu.getCaptiveItems(event.player as Player))
|
||||
|
||||
@@ -34,6 +34,10 @@ object PriceMultipliers {
|
||||
return current
|
||||
}
|
||||
|
||||
/** The price multiplier from permissions. */
|
||||
val Player.reforgePriceMultiplier: Double
|
||||
get() = getForPlayer(this).multiplier
|
||||
|
||||
/**
|
||||
* List of all registered multipliers.
|
||||
*
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.willfp.reforges.reforges
|
||||
|
||||
import com.willfp.eco.core.config.config
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.core.items.CustomItem
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||
import com.willfp.eco.core.price.ConfiguredPrice
|
||||
import com.willfp.eco.core.recipe.Recipes
|
||||
import com.willfp.eco.util.StringUtils
|
||||
import com.willfp.libreforge.Holder
|
||||
@@ -14,15 +16,14 @@ import com.willfp.reforges.ReforgesPlugin
|
||||
import com.willfp.reforges.util.reforgeStone
|
||||
import net.kyori.adventure.text.format.TextDecoration
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import java.util.*
|
||||
import java.util.Objects
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class Reforge(
|
||||
override val id: String,
|
||||
internal val config: Config,
|
||||
plugin: ReforgesPlugin
|
||||
) : Holder {
|
||||
override val id = config.getString("id")
|
||||
|
||||
val name = config.getFormattedString("name")
|
||||
|
||||
val namePrefixComponent = StringUtils.toComponent("$name ").decoration(TextDecoration.ITALIC, false)
|
||||
@@ -31,13 +32,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")
|
||||
|
||||
@@ -49,7 +52,21 @@ class Reforge(
|
||||
}
|
||||
}.build()
|
||||
|
||||
val stonePrice = config.getIntOrNull("stone.price") ?: -1
|
||||
val stonePrice = if (config.has("stone.price")) {
|
||||
when {
|
||||
// Legacy support
|
||||
config.getDouble("stone.price") > 0 -> {
|
||||
ConfiguredPrice.createOrFree(
|
||||
config {
|
||||
"value" to config.getDouble("stone.price")
|
||||
"type" to "coins"
|
||||
"display" to "%value%"
|
||||
}
|
||||
)
|
||||
}
|
||||
else -> ConfiguredPrice.createOrFree(config.getSubsection("stone.price"))
|
||||
}
|
||||
} else null
|
||||
|
||||
init {
|
||||
Reforges.addNewReforge(this)
|
||||
|
||||
@@ -33,7 +33,11 @@ object ReforgeTargets {
|
||||
* @return The target.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getForItem(item: ItemStack): List<ReforgeTarget> {
|
||||
fun getForItem(item: ItemStack?): List<ReforgeTarget> {
|
||||
if (item == null) {
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
return registered.values
|
||||
.filter { !it.id.equals("all", ignoreCase = true) }
|
||||
.filter { it.matches(item) }
|
||||
|
||||
@@ -2,9 +2,12 @@ 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.readConfig
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.libreforge.chains.EffectChains
|
||||
import com.willfp.reforges.ReforgesPlugin
|
||||
import java.io.File
|
||||
|
||||
@Suppress("UNUSED")
|
||||
object Reforges {
|
||||
@@ -51,14 +54,22 @@ object Reforges {
|
||||
@ConfigUpdater
|
||||
@JvmStatic
|
||||
fun update(plugin: ReforgesPlugin) {
|
||||
for (config in plugin.reforgesYml.getSubsections("chains")) {
|
||||
val reforgesYml = File(plugin.dataFolder, "reforges.yml").readConfig(ConfigType.YAML)
|
||||
|
||||
for (config in reforgesYml.getSubsections("chains")) {
|
||||
EffectChains.compile(config, "Chains")
|
||||
}
|
||||
|
||||
for (reforge in values()) {
|
||||
removeReforge(reforge)
|
||||
}
|
||||
for (config in plugin.reforgesYml.getSubsections("reforges")) {
|
||||
Reforge(config, plugin)
|
||||
|
||||
for ((id, config) in plugin.fetchConfigs("reforges")) {
|
||||
Reforge(id, config, plugin)
|
||||
}
|
||||
|
||||
for (config in reforgesYml.getSubsections("reforges")) {
|
||||
Reforge(config.getString("id"), config, plugin)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.willfp.reforges.reforges.util
|
||||
|
||||
import com.willfp.reforges.util.ReforgeStatus
|
||||
|
||||
data class MetadatedReforgeStatus(val status: ReforgeStatus, val cost: Double)
|
||||
@@ -40,8 +40,8 @@ class ReforgeEnableListeners(private val plugin: EcoPlugin) : Listener {
|
||||
refresh()
|
||||
val player = event.player
|
||||
for (value in values()) {
|
||||
for ((effect) in value.effects) {
|
||||
effect.disableForPlayer(player)
|
||||
for (effect in value.effects) {
|
||||
effect.disableFor(player)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# Read more about chains: https://plugins.auxilor.io/effects/configuring-an-effect#effect-chains
|
||||
|
||||
chains:
|
||||
- id: example_chain
|
||||
effects:
|
||||
- id: teleport
|
||||
- id: potion_effect
|
||||
args:
|
||||
effect: blindness
|
||||
level: 3
|
||||
duration: 30
|
||||
apply_to_player: true
|
||||
- id: send_message
|
||||
args:
|
||||
message: "&fYou have been teleported!"
|
||||
action_bar: true
|
||||
- id: play_sound
|
||||
args:
|
||||
sound: entity_dragon_fireball_explode
|
||||
pitch: 1.5
|
||||
volume: 4
|
||||
@@ -74,10 +74,6 @@ gui:
|
||||
row: 6
|
||||
column: 5
|
||||
|
||||
# Placeholders:
|
||||
# %cost% - The economy cost
|
||||
# %xp% - The levels required
|
||||
|
||||
allow:
|
||||
material: anvil
|
||||
name: "&aReforge Item"
|
||||
@@ -86,8 +82,8 @@ gui:
|
||||
- '&7it a random item modifier that'
|
||||
- '&7boosts its stats.'
|
||||
- ''
|
||||
- '&7Cost'
|
||||
- '&6\$%cost%'
|
||||
- '&7Price:'
|
||||
- '%price%'
|
||||
- ''
|
||||
- '&eClick to reforge!'
|
||||
allow-stone:
|
||||
@@ -99,8 +95,8 @@ gui:
|
||||
- '&7the %stone%&7 reforge to'
|
||||
- '&7boost its stats.'
|
||||
- ''
|
||||
- '&7Cost'
|
||||
- '&6\$%cost%'
|
||||
- '&7Price:'
|
||||
- '%price%'
|
||||
- ''
|
||||
- '&eClick to reforge!'
|
||||
no-item:
|
||||
@@ -138,9 +134,11 @@ gui:
|
||||
pitch: 0.8
|
||||
|
||||
reforge:
|
||||
cost: 7500
|
||||
xp-cost: 0 # In levels
|
||||
use-player-points: false
|
||||
# See here: https://plugins.auxilor.io/all-plugins/prices
|
||||
price:
|
||||
value: 7500
|
||||
type: coins
|
||||
display: "&6$%value%"
|
||||
|
||||
cost-exponent: 1.15 # (Reforges done ^ cost exponent) * cost
|
||||
|
||||
@@ -179,12 +177,18 @@ 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"
|
||||
|
||||
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements
|
||||
raytrace-distance: 80 # The distance that alt_click should check for a location
|
||||
block-item-drop-place-check: true # If the block_item_drop trigger should only fire on naturally placed blocks (prevents dupes)
|
||||
|
||||
potions:
|
||||
icon:
|
||||
|
||||
@@ -3,21 +3,28 @@ 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!"
|
||||
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%"
|
||||
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%"
|
||||
lrcdb-import-success: "&fImported &a%name%&f! Reload the plugin to install it"
|
||||
must-specify-config-name: "&cYou must specify the config name!"
|
||||
invalid-config-name: "&cInvalid config name!"
|
||||
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%"
|
||||
|
||||
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"
|
||||
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-transmit: "&cYou can't transmit here!"
|
||||
|
||||
menu:
|
||||
title: "Reforge Item"
|
||||
|
||||
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
# Options for lrcdb (https://lrcdb.auxilor.io), a website to share configs
|
||||
# with other server owners, so you can get more configs without making them
|
||||
# yourself!
|
||||
|
||||
author: "Unknown Author" # The name attached to configs you export
|
||||
|
||||
# Options about automatically sharing configs you create
|
||||
share-configs:
|
||||
# If you want all your configs to automatically be publicly available,
|
||||
# set this to true. This really helps out other users!
|
||||
publicly: false
|
||||
|
||||
# If you don't want your configs to be usable to gather information about
|
||||
# plugin usage or to improve the plugins in the future, disable this.
|
||||
# Nothing identifying is shared.
|
||||
enabled: true
|
||||
|
||||
# If you disable share-configs, you can still share select configs publicly
|
||||
# with /reforges export <config>.
|
||||
@@ -10,13 +10,17 @@ depend:
|
||||
- ProtocolLib
|
||||
softdepend:
|
||||
- Vault
|
||||
- EcoSkills
|
||||
- Talismans
|
||||
- AureliumSkills
|
||||
- PlayerPoints
|
||||
- Jobs
|
||||
- EcoArmor
|
||||
- TMMobcoins
|
||||
- EcoEnchants
|
||||
- EcoBosses
|
||||
- Talismans
|
||||
- EcoArmor
|
||||
- EcoItems
|
||||
- EcoSkills
|
||||
- Boosters
|
||||
|
||||
commands:
|
||||
reforges:
|
||||
@@ -42,6 +46,8 @@ permissions:
|
||||
reforges.command.give: true
|
||||
reforges.command.apply: true
|
||||
reforges.command.open: true
|
||||
reforges.command.import: true
|
||||
reforges.command.export: true
|
||||
|
||||
reforges.command.reload:
|
||||
description: Allows reloading the config
|
||||
@@ -61,3 +67,9 @@ permissions:
|
||||
reforges.command.apply:
|
||||
description: Allows the user of /reforges apply.
|
||||
default: op
|
||||
reforges.command.import:
|
||||
description: Allows the user of /reforges import.
|
||||
default: op
|
||||
reforges.command.export:
|
||||
description: Allows the user of /reforges export.
|
||||
default: op
|
||||
|
||||
@@ -1,405 +0,0 @@
|
||||
chains:
|
||||
- id: example_chain
|
||||
effects:
|
||||
- id: teleport
|
||||
- id: potion_effect
|
||||
args:
|
||||
effect: blindness
|
||||
level: 3
|
||||
duration: 30
|
||||
apply_to_player: true
|
||||
- id: send_message
|
||||
args:
|
||||
message: "&fYou have been teleported!"
|
||||
action_bar: true
|
||||
- id: play_sound
|
||||
args:
|
||||
sound: entity_dragon_fireball_explode
|
||||
pitch: 1.5
|
||||
volume: 4
|
||||
|
||||
reforges:
|
||||
- id: acute
|
||||
name: "<gradient:#4776E6>Acute</gradient:#8E54E9>"
|
||||
description:
|
||||
- "&a+2% &fTriple Damage Chance"
|
||||
targets:
|
||||
- axe
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 3
|
||||
chance: 2
|
||||
triggers:
|
||||
- melee_attack
|
||||
conditions: []
|
||||
- id: aerobic
|
||||
name: "<gradient:#B993D6>Aerobic</gradient:#8CA6DB>"
|
||||
description:
|
||||
- "&a+9% &fDamage when shot in air"
|
||||
targets:
|
||||
- bow
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.09
|
||||
triggers:
|
||||
- bow_attack
|
||||
conditions:
|
||||
- id: in_air
|
||||
args:
|
||||
in_air: true
|
||||
- id: dynamic
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>"
|
||||
description:
|
||||
- "&a+5% &fDamage"
|
||||
- "&a+10% &fCrit Damage"
|
||||
targets:
|
||||
- melee
|
||||
stone:
|
||||
enabled: true
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&f Reforge Stone"
|
||||
lore:
|
||||
- "&7Place on the right of the"
|
||||
- "&7reforge menu to apply the"
|
||||
- "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&7 reforge!"
|
||||
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM0YTY1YzY4OWIyZDM2NDA5MTAwYTYwYzJhYjhkM2QwYTY3Y2U5NGVlYTNjMWY3YWM5NzRmZDg5MzU2OGI1ZCJ9fX0=
|
||||
craftable: true
|
||||
recipe:
|
||||
- air
|
||||
- ecoitems:blank_reforge_stone ? air
|
||||
- air
|
||||
- iron_block
|
||||
- daylight_sensor
|
||||
- iron_block
|
||||
- air
|
||||
- phantom_membrane
|
||||
- air
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.05
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: crit_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
triggers:
|
||||
- melee_attack
|
||||
conditions: []
|
||||
- id: evasive
|
||||
name: "<gradient:#EFEFBB>Evasive</gradient:#D4D3DD>"
|
||||
description:
|
||||
- "&a+2% &fIgnore Damage Chance"
|
||||
targets:
|
||||
- armor
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0
|
||||
chance: 2
|
||||
triggers:
|
||||
- take_damage
|
||||
conditions: []
|
||||
- id: gravitated
|
||||
name: "<gradient:#1e3c72>Gravitated</gradient:#2a5298>"
|
||||
description:
|
||||
- "&a+8% &fCritical Damage"
|
||||
targets:
|
||||
- melee
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: crit_multiplier
|
||||
args:
|
||||
multiplier: 1.08
|
||||
triggers:
|
||||
- melee_attack
|
||||
conditions: []
|
||||
- id: light
|
||||
name: "<gradient:#1c92d2>Light</gradient:#f2fcfe>"
|
||||
description:
|
||||
- "&c-5% &fDamage"
|
||||
- "&c-5% &fKnockback"
|
||||
- "&a+10% &fAttack Speed"
|
||||
targets:
|
||||
- melee
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: knockback_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
- id: attack_speed_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
conditions: []
|
||||
- id: nautical
|
||||
name: "<gradient:#373B44>Nautical</gradient:#4286f4>"
|
||||
description:
|
||||
- "&a+20% &fDamage in water"
|
||||
targets:
|
||||
- melee
|
||||
- bow
|
||||
- trident
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.2
|
||||
triggers:
|
||||
- melee_attack
|
||||
- bow_attack
|
||||
- trident_attack
|
||||
conditions:
|
||||
- id: in_water
|
||||
args:
|
||||
in_water: true
|
||||
- id: pointy
|
||||
name: "<gradient:#076585>Pointy</gradient:#ffffff>"
|
||||
description:
|
||||
- "&a+10% &fDamage"
|
||||
targets:
|
||||
- trident
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
triggers:
|
||||
- trident_attack
|
||||
conditions: []
|
||||
- id: prospecting
|
||||
name: "<gradient:#00B4DB>Prospecting</gradient:#0083B0>"
|
||||
description:
|
||||
- "&a+5% &fChance to get &e$$2&f for mining a block"
|
||||
targets:
|
||||
- pickaxe
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: give_money
|
||||
args:
|
||||
amount: 2
|
||||
chance: 5
|
||||
triggers:
|
||||
- mine_block
|
||||
conditions: []
|
||||
- id: reinforced
|
||||
name: "<gradient:#FBD786>Reinforced</gradient:#f7797d>"
|
||||
description:
|
||||
- "&a+4% &fDamage Resistance"
|
||||
targets:
|
||||
- armor
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.96
|
||||
triggers:
|
||||
- take_damage
|
||||
conditions: []
|
||||
- id: rich
|
||||
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>"
|
||||
description:
|
||||
- "&a+$$50 &fFor each mob kill"
|
||||
targets:
|
||||
- trident
|
||||
- bow
|
||||
stone:
|
||||
enabled: true
|
||||
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&f Reforge Stone"
|
||||
lore:
|
||||
- "&7Place on the right of the"
|
||||
- "&7reforge menu to apply the"
|
||||
- "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&7 reforge!"
|
||||
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2RjNTdjNzVhZGYzOWVjNmYwZTA5MTYwNDlkZDk2NzFlOThhOGExZTYwMDEwNGU4NGU2NDVjOTg4OTUwYmQ3In19fQ==
|
||||
craftable: true
|
||||
recipe:
|
||||
- gold_block
|
||||
- trident
|
||||
- gold_block
|
||||
- air
|
||||
- ecoitems:blank_reforge_stone ? obsidian
|
||||
- air
|
||||
- gold_block
|
||||
- bow
|
||||
- gold_block
|
||||
effects:
|
||||
- id: give_money
|
||||
args:
|
||||
amount: 50
|
||||
triggers:
|
||||
- kill
|
||||
conditions: []
|
||||
- id: sharp
|
||||
name: "<gradient:#f12711>Sharp</gradient:#f5af19>"
|
||||
description:
|
||||
- "&a+3% &fDamage"
|
||||
targets:
|
||||
- melee
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.03
|
||||
triggers:
|
||||
- melee_attack
|
||||
conditions: []
|
||||
- id: streamlined
|
||||
name: "<gradient:#74ebd5>Streamlined</gradient:#ACB6E5>"
|
||||
description:
|
||||
- "&a+4% &fDamage"
|
||||
targets:
|
||||
- bow
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.04
|
||||
triggers:
|
||||
- bow_attack
|
||||
conditions: []
|
||||
- id: strong
|
||||
name: "<gradient:#ED213A>Strong</gradient:#93291E>"
|
||||
description:
|
||||
- "&a+2% &fDamage"
|
||||
- "&a+10% &fKnockback"
|
||||
targets:
|
||||
- melee
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.02
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: knockback_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
conditions: []
|
||||
- id: thin
|
||||
name: "<gradient:#D1913C>Thin</gradient:#FFD194>"
|
||||
description:
|
||||
- "&c-5% &fDamage Resistance"
|
||||
- "&a+2.5% &fMovement Speed"
|
||||
targets:
|
||||
- armor
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.05
|
||||
triggers:
|
||||
- take_damage
|
||||
- id: movement_speed_multiplier
|
||||
args:
|
||||
multiplier: 1.025
|
||||
conditions: []
|
||||
- id: tough
|
||||
name: "<gradient:#a73737>Tough</gradient:#7a2828>"
|
||||
description:
|
||||
- "&c+8% &fDamage Resistance"
|
||||
- "&a-5% &fMovement Speed"
|
||||
targets:
|
||||
- armor
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.92
|
||||
triggers:
|
||||
- take_damage
|
||||
- id: movement_speed_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
conditions: []
|
||||
@@ -0,0 +1,56 @@
|
||||
# The ID of the reforge is the name of the .yml file,
|
||||
# for example acute.yml has the ID of acute
|
||||
# You can place reforges anywhere in this folder,
|
||||
# including in subfolders if you want to organize your reforge configs
|
||||
# _example.yml is not loaded.
|
||||
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>" # The display name for the reforge
|
||||
description: # The lore to add to an item with this reforge:
|
||||
- "&a+5% &fDamage"
|
||||
- "&a+10% &fCrit Damage"
|
||||
targets: # The targets that this reforge can be applied to
|
||||
- melee
|
||||
|
||||
# Options for the reforge stone
|
||||
stone:
|
||||
enabled: true # If this reforge requires the use of a reforge stone
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&f Reforge Stone" # The display name of the stone
|
||||
lore: # The lore of the stone
|
||||
- "&7Place on the right of the"
|
||||
- "&7reforge menu to apply the"
|
||||
- "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&7 reforge!"
|
||||
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM0YTY1YzY4OWIyZDM2NDA5MTAwYTYwYzJhYjhkM2QwYTY3Y2U5NGVlYTNjMWY3YWM5NzRmZDg5MzU2OGI1ZCJ9fX0=
|
||||
craftable: true # If the reforge stone should be craftable
|
||||
|
||||
price: # (Optional) The price required to apply this reforge, overrides the default reforge price
|
||||
value: 100000
|
||||
type: coins # See here: https://plugins.auxilor.io/all-plugins/prices
|
||||
display: "&6$%value%"
|
||||
|
||||
recipe: # The recipe for the stone to have
|
||||
- air
|
||||
- ecoitems:blank_reforge_stone ? air
|
||||
- air
|
||||
- iron_block
|
||||
- daylight_sensor
|
||||
- iron_block
|
||||
- air
|
||||
- phantom_membrane
|
||||
- air
|
||||
|
||||
# The effects of the reforge (i.e. the functionality)
|
||||
# See here: https://plugins.auxilor.io/effects/configuring-an-effect
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.05
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: crit_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
triggers:
|
||||
- melee_attack
|
||||
|
||||
# The conditions required to use the reforge
|
||||
conditions: [ ]
|
||||
17
eco-core/core-plugin/src/main/resources/reforges/acute.yml
Normal file
17
eco-core/core-plugin/src/main/resources/reforges/acute.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: "<gradient:#4776E6>Acute</gradient:#8E54E9>"
|
||||
|
||||
description:
|
||||
- "&a+2% &fTriple Damage Chance"
|
||||
|
||||
targets:
|
||||
- axe
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 3
|
||||
chance: 2
|
||||
triggers:
|
||||
- melee_attack
|
||||
|
||||
conditions: []
|
||||
19
eco-core/core-plugin/src/main/resources/reforges/aerobic.yml
Normal file
19
eco-core/core-plugin/src/main/resources/reforges/aerobic.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
name: "<gradient:#B993D6>Aerobic</gradient:#8CA6DB>"
|
||||
|
||||
description:
|
||||
- "&a+9% &fDamage when shot in air"
|
||||
|
||||
targets:
|
||||
- bow
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.09
|
||||
triggers:
|
||||
- bow_attack
|
||||
|
||||
conditions:
|
||||
- id: in_air
|
||||
args:
|
||||
in_air: true
|
||||
48
eco-core/core-plugin/src/main/resources/reforges/dynamic.yml
Normal file
48
eco-core/core-plugin/src/main/resources/reforges/dynamic.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>"
|
||||
|
||||
description:
|
||||
- "&a+5% &fDamage"
|
||||
- "&a+10% &fCrit Damage"
|
||||
|
||||
targets:
|
||||
- melee
|
||||
|
||||
stone:
|
||||
enabled: true
|
||||
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&f Reforge Stone"
|
||||
lore:
|
||||
- "&7Place on the right of the"
|
||||
- "&7reforge menu to apply the"
|
||||
- "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&7 reforge!"
|
||||
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM0YTY1YzY4OWIyZDM2NDA5MTAwYTYwYzJhYjhkM2QwYTY3Y2U5NGVlYTNjMWY3YWM5NzRmZDg5MzU2OGI1ZCJ9fX0=
|
||||
craftable: true
|
||||
|
||||
price:
|
||||
value: 100000
|
||||
type: coins
|
||||
display: "&6$%value%"
|
||||
|
||||
recipe:
|
||||
- air
|
||||
- ecoitems:blank_reforge_stone ? air
|
||||
- air
|
||||
- iron_block
|
||||
- daylight_sensor
|
||||
- iron_block
|
||||
- air
|
||||
- phantom_membrane
|
||||
- air
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.05
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: crit_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
triggers:
|
||||
- melee_attack
|
||||
|
||||
conditions: []
|
||||
17
eco-core/core-plugin/src/main/resources/reforges/evasive.yml
Normal file
17
eco-core/core-plugin/src/main/resources/reforges/evasive.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: "<gradient:#EFEFBB>Evasive</gradient:#D4D3DD>"
|
||||
|
||||
description:
|
||||
- "&a+2% &fIgnore Damage Chance"
|
||||
|
||||
targets:
|
||||
- armor
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0
|
||||
chance: 2
|
||||
triggers:
|
||||
- take_damage
|
||||
|
||||
conditions: []
|
||||
@@ -0,0 +1,16 @@
|
||||
name: "<gradient:#1e3c72>Gravitated</gradient:#2a5298>"
|
||||
|
||||
description:
|
||||
- "&a+8% &fCritical Damage"
|
||||
|
||||
targets:
|
||||
- melee
|
||||
|
||||
effects:
|
||||
- id: crit_multiplier
|
||||
args:
|
||||
multiplier: 1.08
|
||||
triggers:
|
||||
- melee_attack
|
||||
|
||||
conditions: []
|
||||
24
eco-core/core-plugin/src/main/resources/reforges/light.yml
Normal file
24
eco-core/core-plugin/src/main/resources/reforges/light.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
name: "<gradient:#1c92d2>Light</gradient:#f2fcfe>"
|
||||
|
||||
description:
|
||||
- "&c-5% &fDamage"
|
||||
- "&c-5% &fKnockback"
|
||||
- "&a+10% &fAttack Speed"
|
||||
|
||||
targets:
|
||||
- melee
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: knockback_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
- id: attack_speed_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
|
||||
conditions: []
|
||||
@@ -0,0 +1,23 @@
|
||||
name: "<gradient:#373B44>Nautical</gradient:#4286f4>"
|
||||
|
||||
description:
|
||||
- "&a+20% &fDamage in water"
|
||||
|
||||
targets:
|
||||
- melee
|
||||
- bow
|
||||
- trident
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.2
|
||||
triggers:
|
||||
- melee_attack
|
||||
- bow_attack
|
||||
- trident_attack
|
||||
|
||||
conditions:
|
||||
- id: in_water
|
||||
args:
|
||||
in_water: true
|
||||
16
eco-core/core-plugin/src/main/resources/reforges/pointy.yml
Normal file
16
eco-core/core-plugin/src/main/resources/reforges/pointy.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
name: "<gradient:#076585>Pointy</gradient:#ffffff>"
|
||||
|
||||
description:
|
||||
- "&a+10% &fDamage"
|
||||
|
||||
targets:
|
||||
- trident
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
triggers:
|
||||
- trident_attack
|
||||
|
||||
conditions: []
|
||||
@@ -0,0 +1,17 @@
|
||||
name: "<gradient:#00B4DB>Prospecting</gradient:#0083B0>"
|
||||
|
||||
description:
|
||||
- "&a+5% &fChance to get &e$$2&f for mining a block"
|
||||
|
||||
targets:
|
||||
- pickaxe
|
||||
|
||||
effects:
|
||||
- id: give_money
|
||||
args:
|
||||
amount: 2
|
||||
chance: 5
|
||||
triggers:
|
||||
- mine_block
|
||||
|
||||
conditions: []
|
||||
@@ -0,0 +1,16 @@
|
||||
name: "<gradient:#FBD786>Reinforced</gradient:#f7797d>"
|
||||
|
||||
description:
|
||||
- "&a+4% &fDamage Resistance"
|
||||
|
||||
targets:
|
||||
- armor
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.96
|
||||
triggers:
|
||||
- take_damage
|
||||
|
||||
conditions: []
|
||||
37
eco-core/core-plugin/src/main/resources/reforges/rich.yml
Normal file
37
eco-core/core-plugin/src/main/resources/reforges/rich.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>"
|
||||
|
||||
description:
|
||||
- "&a+$$50 &fFor each mob kill"
|
||||
|
||||
targets:
|
||||
- trident
|
||||
- bow
|
||||
|
||||
stone:
|
||||
enabled: true
|
||||
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&f Reforge Stone"
|
||||
lore:
|
||||
- "&7Place on the right of the"
|
||||
- "&7reforge menu to apply the"
|
||||
- "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&7 reforge!"
|
||||
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2RjNTdjNzVhZGYzOWVjNmYwZTA5MTYwNDlkZDk2NzFlOThhOGExZTYwMDEwNGU4NGU2NDVjOTg4OTUwYmQ3In19fQ==
|
||||
craftable: true
|
||||
recipe:
|
||||
- gold_block
|
||||
- trident
|
||||
- gold_block
|
||||
- air
|
||||
- ecoitems:blank_reforge_stone ? obsidian
|
||||
- air
|
||||
- gold_block
|
||||
- bow
|
||||
- gold_block
|
||||
|
||||
effects:
|
||||
- id: give_money
|
||||
args:
|
||||
amount: 50
|
||||
triggers:
|
||||
- kill
|
||||
|
||||
conditions: []
|
||||
21
eco-core/core-plugin/src/main/resources/reforges/sharp.yml
Normal file
21
eco-core/core-plugin/src/main/resources/reforges/sharp.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
name: "<gradient:#f12711>Sharp</gradient:#f5af19>"
|
||||
description:
|
||||
- "&a+3% &fDamage"
|
||||
targets:
|
||||
- melee
|
||||
|
||||
stone:
|
||||
enabled: false
|
||||
name: ''
|
||||
lore: []
|
||||
item: ''
|
||||
craftable: false
|
||||
recipe: []
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.03
|
||||
triggers:
|
||||
- melee_attack
|
||||
conditions: []
|
||||
@@ -0,0 +1,16 @@
|
||||
name: "<gradient:#74ebd5>Streamlined</gradient:#ACB6E5>"
|
||||
|
||||
description:
|
||||
- "&a+4% &fDamage"
|
||||
|
||||
targets:
|
||||
- bow
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.04
|
||||
triggers:
|
||||
- bow_attack
|
||||
|
||||
conditions: []
|
||||
20
eco-core/core-plugin/src/main/resources/reforges/strong.yml
Normal file
20
eco-core/core-plugin/src/main/resources/reforges/strong.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "<gradient:#ED213A>Strong</gradient:#93291E>"
|
||||
|
||||
description:
|
||||
- "&a+2% &fDamage"
|
||||
- "&a+10% &fKnockback"
|
||||
|
||||
targets:
|
||||
- melee
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.02
|
||||
triggers:
|
||||
- melee_attack
|
||||
- id: knockback_multiplier
|
||||
args:
|
||||
multiplier: 1.1
|
||||
|
||||
conditions: []
|
||||
20
eco-core/core-plugin/src/main/resources/reforges/thin.yml
Normal file
20
eco-core/core-plugin/src/main/resources/reforges/thin.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "<gradient:#D1913C>Thin</gradient:#FFD194>"
|
||||
|
||||
description:
|
||||
- "&c-5% &fDamage Resistance"
|
||||
- "&a+2.5% &fMovement Speed"
|
||||
|
||||
targets:
|
||||
- armor
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 1.05
|
||||
triggers:
|
||||
- take_damage
|
||||
- id: movement_speed_multiplier
|
||||
args:
|
||||
multiplier: 1.025
|
||||
|
||||
conditions: []
|
||||
20
eco-core/core-plugin/src/main/resources/reforges/tough.yml
Normal file
20
eco-core/core-plugin/src/main/resources/reforges/tough.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "<gradient:#a73737>Tough</gradient:#7a2828>"
|
||||
|
||||
description:
|
||||
- "&c+8% &fDamage Resistance"
|
||||
- "&a-5% &fMovement Speed"
|
||||
|
||||
targets:
|
||||
- armor
|
||||
|
||||
effects:
|
||||
- id: damage_multiplier
|
||||
args:
|
||||
multiplier: 0.92
|
||||
triggers:
|
||||
- take_damage
|
||||
- id: movement_speed_multiplier
|
||||
args:
|
||||
multiplier: 0.95
|
||||
|
||||
conditions: []
|
||||
@@ -1,4 +1,4 @@
|
||||
#libreforge-updater
|
||||
#Sun May 22 15:27:50 BST 2022
|
||||
version=5.0.0
|
||||
#Wed Nov 23 17:24:59 GMT 2022
|
||||
version=5.73.0
|
||||
plugin-name=Reforges
|
||||
|
||||
Reference in New Issue
Block a user