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
bb07d922
Commit
bb07d922
authored
2 years ago
by
Ashijin
1
Browse files
Options
Download
Email Patches
Plain Diff
Polishing for wardrobe feature
parent
7f7fab29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
5 deletions
+24
-5
plugin/src/main/java/io/lumine/cosmetics/commands/CommandHelper.java
...main/java/io/lumine/cosmetics/commands/CommandHelper.java
+7
-0
plugin/src/main/java/io/lumine/cosmetics/commands/WardrobeCommand.java
...in/java/io/lumine/cosmetics/commands/WardrobeCommand.java
+6
-2
plugin/src/main/java/io/lumine/cosmetics/players/wardrobe/WardrobeExecutor.java
...o/lumine/cosmetics/players/wardrobe/WardrobeExecutor.java
+8
-0
plugin/src/main/java/io/lumine/cosmetics/players/wardrobe/WardrobeTrackerImpl.java
...umine/cosmetics/players/wardrobe/WardrobeTrackerImpl.java
+3
-3
No files found.
plugin/src/main/java/io/lumine/cosmetics/commands/CommandHelper.java
View file @
bb07d922
...
...
@@ -60,4 +60,11 @@ public class CommandHelper {
player
.
sendMessage
(
" "
);
sendCommandFooter
(
player
);
}
public
static
void
sendEditorMessage
(
CommandSender
player
,
String
...
args
)
{
sendCommandHeader
(
player
);
for
(
String
ss
:
args
)
{
Text
.
sendMessage
(
player
,
Text
.
parse
(
COMMAND_PREFIX
.
get
()).
append
(
Text
.
parse
(
"<white>"
+
ss
)));
}
}
}
This diff is collapsed.
Click to expand it.
plugin/src/main/java/io/lumine/cosmetics/commands/WardrobeCommand.java
View file @
bb07d922
...
...
@@ -31,9 +31,13 @@ public class WardrobeCommand extends Command<MCCosmeticsPlugin> {
public
boolean
onCommand
(
CommandSender
sender
,
String
[]
args
)
{
final
var
player
=
(
Player
)
sender
;
getPlugin
().
getWardrobeManager
()
.
openWardrobe
(
player
)
;
var
manager
=
getPlugin
().
getWardrobeManager
();
CommandHelper
.
sendSuccess
(
sender
,
"Spawned wardrobe"
);
if
(
manager
.
isInWardrobe
(
player
))
{
manager
.
closeWardrobe
(
player
);
}
else
{
manager
.
openWardrobe
(
player
);
}
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
plugin/src/main/java/io/lumine/cosmetics/players/wardrobe/WardrobeExecutor.java
View file @
bb07d922
...
...
@@ -10,6 +10,7 @@ import com.google.common.collect.Maps;
import
io.lumine.cosmetics.MCCosmeticsPlugin
;
import
io.lumine.cosmetics.api.players.wardrobe.Mannequin
;
import
io.lumine.cosmetics.api.players.wardrobe.WardrobeManager
;
import
io.lumine.cosmetics.commands.CommandHelper
;
import
io.lumine.utils.Events
;
import
io.lumine.utils.plugin.ReloadableModule
;
...
...
@@ -43,6 +44,12 @@ public class WardrobeExecutor extends ReloadableModule<MCCosmeticsPlugin> implem
var
tracker
=
createTracker
(
player
);
usingWardrobe
.
put
(
player
,
tracker
);
CommandHelper
.
sendEditorMessage
(
player
,
new
String
[]
{
"<green>You're now in Wardrobe Mode!"
,
"Any cosmetics equipped will go on your mannequin"
,
"To exit, type the command again or walk away"
});
}
public
void
closeWardrobe
(
Player
player
)
{
...
...
@@ -50,6 +57,7 @@ public class WardrobeExecutor extends ReloadableModule<MCCosmeticsPlugin> implem
if
(
tracker
!=
null
)
{
tracker
.
terminate
();
CommandHelper
.
sendSuccess
(
player
,
"You exited Wardrobe Mode"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
plugin/src/main/java/io/lumine/cosmetics/players/wardrobe/WardrobeTrackerImpl.java
View file @
bb07d922
...
...
@@ -52,10 +52,10 @@ public class WardrobeTrackerImpl extends PluginComponent<MCCosmeticsPlugin> impl
this
.
mannequin
=
manager
.
getPlugin
().
getVolatileCodeHandler
().
createMannequin
(
this
,
player
,
location
);
Players
.
playSound
(
player
,
location
,
Sound
.
ENTITY_CHICKEN_EGG
);
Players
.
playSound
(
player
,
location
,
Sound
.
BLOCK_CONDUIT_ACTIVATE
);
Particle
.
CLOUD
.
create
()
.
at
(
location
.
clone
().
add
(
0
,
1
,
0
))
.
amount
(
5
0
)
.
amount
(
10
0
)
.
offset
(
0.5
F
,
1
F
,
0.5
F
)
.
speed
(
0.1
F
)
.
send
(
player
);
...
...
@@ -89,7 +89,7 @@ public class WardrobeTrackerImpl extends PluginComponent<MCCosmeticsPlugin> impl
Players
.
playSound
(
player
,
location
,
Sound
.
BLOCK_CONDUIT_DEACTIVATE
);
Particle
.
ENCHANTMENT_TABLE
.
create
()
.
at
(
location
.
clone
().
add
(
0
,
1
,
0
))
.
amount
(
5
0
)
.
amount
(
20
0
)
.
offset
(
0.5
F
,
1
F
,
0.5
F
)
.
speed
(
0.1
F
)
.
send
(
player
);
...
...
This diff is collapsed.
Click to expand it.
PapaWulf
@PapaWulf
mentioned in issue
#98
·
2 years ago
mentioned in issue
#98
mentioned in issue #98
Toggle commit list
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