MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / hotloaded

Method hotloaded

src/main/java/com/volmit/adapt/Adapt.java:292–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

290 }
291
292 public static void hotloaded() {
293 J.s(() -> {
294 instance.guiLeftovers.values().forEach(window -> {
295 HandlerList.unregisterAll((Listener) window);
296 window.close();
297 });
298 instance.stop();
299 instance.start();
300
301 instance.getGuiLeftovers().forEach((s, window) -> {
302
303 if (window.getTag() != null) {
304 if (window.getTag().equals("/")) {
305 SkillsGui.open(Bukkit.getPlayer(UUID.fromString(s)));
306 } else {
307 String[] split = window.getTag().split("\\Q/\\E");
308 if (split.length == 2) {
309 if (split[0].equals("skill")) {
310 instance.getAdaptServer().getSkillRegistry().getSkill(split[1]).openGui(Bukkit.getPlayer(UUID.fromString(s)));
311 }
312 } else if (split.length == 3) {
313 if (split[0].equals("skill")) {
314 try {
315 instance.getAdaptServer().getSkillRegistry().getSkill(split[1]).getAdaptations().where(a -> a.getId().equals(split[2])).get(0).openGui(Bukkit.getPlayer(UUID.fromString(s)));
316
317 } catch (Throwable e) {
318 instance.getAdaptServer().getSkillRegistry().getSkill(split[1]).openGui(Bukkit.getPlayer(UUID.fromString(s)));
319 }
320 }
321 }
322 }
323
324 }
325 });
326
327 }, 20);
328 }
329}

Callers 2

onTickMethod · 0.95
onTickMethod · 0.95

Calls 15

sMethod · 0.95
openMethod · 0.95
getAdaptationsMethod · 0.80
closeMethod · 0.65
stopMethod · 0.65
startMethod · 0.65
getTagMethod · 0.65
getPlayerMethod · 0.65
openGuiMethod · 0.65
getSkillMethod · 0.65
getMethod · 0.65
getIdMethod · 0.65

Tested by

no test coverage detected