Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MythicCraft
MythicCosmetics
Commits
8a89afb9
Commit
8a89afb9
authored
2 years ago
by
Ashijin
Browse files
Options
Download
Email Patches
Plain Diff
Added config option General.EquipDelay
parent
98102d9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
plugin/src/main/java/io/lumine/cosmetics/config/Configuration.java
...c/main/java/io/lumine/cosmetics/config/Configuration.java
+6
-0
plugin/src/main/java/io/lumine/cosmetics/managers/AbstractCosmetic.java
...n/java/io/lumine/cosmetics/managers/AbstractCosmetic.java
+8
-1
plugin/src/main/resources/config.yml
plugin/src/main/resources/config.yml
+2
-0
No files found.
plugin/src/main/java/io/lumine/cosmetics/config/Configuration.java
View file @
8a89afb9
...
...
@@ -28,6 +28,8 @@ public class Configuration extends ReloadableModule<MCCosmeticsPlugin> implement
private
static
final
EnumProp
<
StorageDriver
>
STORAGE_DRIVER
=
Property
.
Enum
(
Scope
.
CONFIG
,
StorageDriver
.
class
,
"Storage.Driver"
,
StorageDriver
.
JSON
);
private
static
final
SqlCredentialsProp
SQL_CREDENTIALS
=
Property
.
SqlCredentials
(
Scope
.
CONFIG
,
"Storage"
);
private
static
final
IntProp
EQUIP_DELAY
=
Property
.
Int
(
Scope
.
CONFIG
,
"General.EquipDelay"
,
0
);
@Getter
private
boolean
allowingMetrics
=
true
;
public
Configuration
(
MCCosmeticsPlugin
plugin
)
{
...
...
@@ -77,6 +79,10 @@ public class Configuration extends ReloadableModule<MCCosmeticsPlugin> implement
return
SQL_CREDENTIALS
.
get
(
this
);
}
public
int
getEquipDelay
()
{
return
EQUIP_DELAY
.
get
(
this
);
}
private
void
generateDefaultConfigFiles
()
{
final
var
menuFolder
=
new
File
(
plugin
.
getDataFolder
(),
"menus"
);
final
var
packFolder
=
new
File
(
plugin
.
getDataFolder
(),
"packs"
);
...
...
This diff is collapsed.
Click to expand it.
plugin/src/main/java/io/lumine/cosmetics/managers/AbstractCosmetic.java
View file @
8a89afb9
...
...
@@ -12,6 +12,7 @@ import io.lumine.cosmetics.commands.CommandHelper;
import
io.lumine.cosmetics.config.Scope
;
import
io.lumine.cosmetics.constants.Permissions
;
import
io.lumine.cosmetics.menus.CosmeticMenu
;
import
io.lumine.utils.Schedulers
;
import
io.lumine.utils.config.properties.Property
;
import
io.lumine.utils.config.properties.types.*
;
import
io.lumine.utils.items.ItemFactory
;
...
...
@@ -140,7 +141,13 @@ public abstract class AbstractCosmetic extends Cosmetic {
manager
.
equipMannequin
(
mannequin
,
new
EquippedCosmetic
(
this
));
CommandHelper
.
sendSuccess
(
player
,
"Set wardrobe "
+
type
+
" to "
+
getDisplay
());
}
else
{
prof
.
equip
(
this
);
if
(
MCCosmeticsPlugin
.
inst
().
getConfiguration
().
getEquipDelay
()
>
0
)
{
Schedulers
.
sync
().
runLater
(()
->
{
prof
.
equip
(
this
);
},
MCCosmeticsPlugin
.
inst
().
getConfiguration
().
getEquipDelay
());
}
else
{
prof
.
equip
(
this
);
}
CommandHelper
.
sendSuccess
(
player
,
"Set your "
+
type
+
" to "
+
getDisplay
());
}
player
.
closeInventory
();
...
...
This diff is collapsed.
Click to expand it.
plugin/src/main/resources/config.yml
View file @
8a89afb9
Configuration
:
Storage
:
Driver
:
JSON
General
:
EquipDelay
:
0
Sprays
:
Sound
:
'
entity.cat.hiss'
Volume
:
1.0
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment