Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F374199
HLRSubCommand.java
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
HLRSubCommand.java
View Options
package
me.despawningbone.HLR
;
import
java.io.File
;
import
java.util.UUID
;
import
org.bukkit.configuration.file.YamlConfiguration
;
import
org.bukkit.ChatColor
;
import
org.bukkit.command.Command
;
import
org.bukkit.command.CommandExecutor
;
import
org.bukkit.command.CommandSender
;
import
org.bukkit.entity.Player
;
import
org.bukkit.event.player.PlayerJoinEvent
;
public
class
HLRSubCommand
implements
CommandExecutor
{
private
HLRmain
plugin
;
public
HLRSubCommand
(
HLRmain
instance
)
{
plugin
=
instance
;
}
public
void
onPlayerJoin
(
PlayerJoinEvent
event
)
{
File
DataFile
=
new
File
(
plugin
.
getDataFolder
()
+
File
.
separator
+
"Data.yml"
);
Player
player
=
event
.
getPlayer
();
YamlConfiguration
DFile
=
YamlConfiguration
.
loadConfiguration
(
DataFile
);
UUID
uuid
=
player
.
getUniqueId
();
String
suuid
=
uuid
.
toString
();
if
(!
DFile
.
isSet
(
suuid
)){
DFile
.
createSection
(
suuid
);
DFile
.
set
(
suuid
,
false
);
}
}
public
boolean
onCommand
(
CommandSender
sender
,
Command
cmd
,
String
commandLabel
,
String
[]
args
)
{
ConfigHandler
configHandler
=
new
ConfigHandler
(
plugin
);
if
(
args
.
length
<=
0
){
sender
.
sendMessage
(
ChatColor
.
RED
+
"Unknown argument. Please type /HLR help for the help menu."
);
return
true
;
}
else
{
if
(
args
[
0
].
equalsIgnoreCase
(
"help"
))
{
sender
.
sendMessage
(
ChatColor
.
GRAY
+
"-------"
+
ChatColor
.
DARK_AQUA
+
"HLR Help"
+
ChatColor
.
GRAY
+
"-------"
);
sender
.
sendMessage
(
ChatColor
.
RED
+
"/converthopper"
+
ChatColor
.
GRAY
+
" - "
+
ChatColor
.
YELLOW
+
"The main command of this plugin."
);
sender
.
sendMessage
(
ChatColor
.
YELLOW
+
"Converts a normal hopper into a "
+
ChatColor
.
GREEN
+
ChatColor
.
stripColor
(
HLRmain
.
CHname
)
+
ChatColor
.
YELLOW
+
"."
);
sender
.
sendMessage
(
ChatColor
.
GRAY
+
"Alias:"
+
ChatColor
.
YELLOW
+
" /chopper"
);
sender
.
sendMessage
(
ChatColor
.
RED
+
"/HLR help"
+
ChatColor
.
GRAY
+
" - "
+
ChatColor
.
YELLOW
+
"Displays this page."
);
if
(
sender
.
hasPermission
(
"HLR.reload"
))
{
sender
.
sendMessage
(
ChatColor
.
RED
+
"/HLR reload"
+
ChatColor
.
GRAY
+
" - "
+
ChatColor
.
YELLOW
+
"Reloads the config."
);
}
sender
.
sendMessage
(
ChatColor
.
RED
+
"/HLR about"
+
ChatColor
.
GRAY
+
" - "
+
ChatColor
.
YELLOW
+
"Displays the about page."
);
}
else
if
(
args
[
0
].
equalsIgnoreCase
(
"reload"
))
{
if
(
sender
.
hasPermission
(
"HLR.reload"
)){
configHandler
.
reloadConfig
(
sender
,
ChatColor
.
BLUE
+
"HLR has been reloaded."
);
}
else
{
sender
.
sendMessage
(
ChatColor
.
RED
+
"You do not have the permission to use this command."
);
}
}
else
if
(
args
[
0
].
equalsIgnoreCase
(
"about"
))
{
sender
.
sendMessage
(
ChatColor
.
DARK_GRAY
+
"HLR"
+
ChatColor
.
GRAY
+
" Version: "
+
ChatColor
.
GREEN
+
"1.0.0"
);
sender
.
sendMessage
(
ChatColor
.
GOLD
+
"Made by "
+
ChatColor
.
DARK_BLUE
+
"despawningbone"
);
}
else
{
sender
.
sendMessage
(
ChatColor
.
RED
+
"Unknown argument. Please type /HLR help for the help menu."
);
}
}
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 3, 3:45 PM (12 h, 21 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0f/8f/2fea9e144819ce9e44f2baa90293
Attached To
rHLR HLR
Event Timeline
Log In to Comment