FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CommandAPI/misc/minecraftreloadtest.java at dev/regex-mod · CommandAPI/CommandAPI · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
CommandAPI
/
CommandAPI
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
78
Star
651
Code
Issues
46
Pull requests
10
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CommandAPI
/
misc
/
minecraftreloadtest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (30 loc) · 1.34 KB
Breadcrumbs
CommandAPI
/
misc
/
minecraftreloadtest.java
Copy path
File metadata and controls
38 lines (30 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public
void
a
() {
getBrigadierDispatcher
().
register
(
CommandDispatcher
.
a
(
"reload"
)
.
requires
(
clw
->
clw
.
hasPermission
(
2
))
.
executes
((
cmdCtx
) -> {
CommandListenerWrapper
commandlistenerwrapper
=
cmdCtx
.
getSource
();
MinecraftServer
minecraftserver
=
commandlistenerwrapper
.
getServer
();
ResourcePackRepository
resourcepackrepository
=
minecraftserver
.
getResourcePackRepository
();
SaveData
savedata
=
minecraftserver
.
getSaveData
();
Collection
<
String
>
collection
=
resourcepackrepository
.
d
();
resourcepackrepository
.
a
();
Collection
<
String
>
c1
=
Lists
.
newArrayList
(
collection
);
//collection1
Collection
<
String
>
c2
=
savedata
.
D
().
b
();
//collection2
Iterator
<
String
>
iterator
=
resourcepackrepository
.
b
().
iterator
();
while
(
iterator
.
hasNext
()) {
String
s
= (
String
)
iterator
.
next
();
if
(!
c2
.
contains
(
s
) && !
c1
.
contains
(
s
)) {
c1
.
add
(
s
);
}
}
Collection
<
String
>
collection1
=
c1
;
commandlistenerwrapper
.
sendMessage
(
new
ChatMessage
(
"commands.reload.success"
),
true
);
commandlistenerwrapper
.
getServer
().
a
(
collection1
).
exceptionally
((
throwable
) -> {
LogManager
.
getLogger
().
warn
(
"Failed to execute reload"
,
throwable
);
commandlistenerwrapper
.
sendFailureMessage
(
new
ChatMessage
(
"commands.reload.failure"
));
return
null
;
});
return
0
;
})
);
}
Back
|
FazBrowse Home
|
New Git URL