Skip to content

Instantly share code, notes, and snippets.

@Geolykt
Created November 28, 2022 19:39
Show Gist options
  • Save Geolykt/169e04730c971b72c36ca911feb77320 to your computer and use it in GitHub Desktop.
Save Geolykt/169e04730c971b72c36ca911feb77320 to your computer and use it in GitHub Desktop.
.version 61 0
.class public d/g/mc/un/UN
.super org/bukkit/plugin/java/JavaPlugin
.sourcefile "UN.j"
.field private prios Ljava/util/List;
.field private fserr Z
.field private fspnc Z
.method public <init> : ()V
.code stack 3 locals 1
aload 0
dup
invokespecial Method org/bukkit/plugin/java/JavaPlugin <init> ()V
new java/util/ArrayList
dup
invokespecial Method java/util/ArrayList <init> ()V
aload 0
swap
putfield Field d/g/mc/un/UN prios Ljava/util/ArrayList;
invokevirtual Method d/g/mc/un/UN initfs ()V
return
.end code
.end method
.method private initfs : ()V
.code stack 5 locals 1
.catch java/io/IOException from L0 to L1 using L4
.catch java/io/IOException from L1 to L2 using L3
aload 0
invokevirtual Method d/g/mc/un/UN getDataFolder ()Ljava/io/File;
invokevirtual Method java/io/File toPath ()Ljava/nio/file/Path;
invokeinterface InterfaceMethod java/nio/file/Path toAbsolutePath ()Ljava/nio/file/Path; 1
dup
iconst_0
anewarray java/nio/file/LinkOption
invokestatic Method java/nio/file/Files notExists (Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z
ifne L0
pop
return
.stack stack_1 Object java/nio/file/Path
L0: iconst_0
anewarray java/nio/file/attribute/FileAttribute
invokestatic Method java/nio/file/Files createDirectory (Ljava/nio/file/Path;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;
.stack stack_1 Object java/nio/file/Path
L1: ldc "priorities.txt"
invokeinterface InterfaceMethod java/nio/file/Path resolve (Ljava/lang/String;)Ljava/nio/file/Path; 2
iconst_0
anewarray java/nio/file/attribute/FileAttribute
invokestatic Method java/nio/file/Files createFile (Ljava/nio/file/Path;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;
.stack same
L2:
return
L3:
.stack stack_1 Object java/io/IOException
aload 0
iconst_1
putfield Field de/g/mc/un/UN fserr Z
invokevirtual Method java/lang/Throwable printStackTrace ()V
return
L4:
.stack stack_1 Object java/io/IOException
aload 0
iconst_1
dup2
putfield Field de/g/mc/un/UN fserr Z
putfield Field de/g/mc/un/UN fspnc Z
new java/io/UncheckedIOException
dup_x1
swap
invokespecial Method java/io/UncheckedIOException <init> (Ljava/io/IOException;)V
athrow
.end code
.end method
.method private rl : (Ljava/lang/String;)Ljava/util/List;
.code stack 5 locals 2
.catch java/io/IOException from L0 to L1 using L2
L0: aload 0
invokevirtual Method d/g/mc/un/UN getDataFolder ()Ljava/io/File;
invokevirtual Method java/io/File toPath ()Ljava/nio/file/Path;
aload 1
invokeinterface InterfaceMethod java/nio/file/Path resolve (Ljava/lang/String;)Ljava/nio/file/Path; 2
getstatic Field java/nio/charset/StandardCharsets UTF_8 Ljava/nio/charset/Charset;
invokestatic Method java/nio/file/Files readAllLines (Ljava/nio/file/Path;Ljava/nio/charset/Charset;)Ljava/util/List;
L1: areturn
.stack stack_1 Object java/lang/Exception
L2: new java/lang/RuntimeException
dup_x1
swap
invokespecial Method java/io/RuntimeException <init> (Ljava/lang/Throwable;)V
athrow
.end code
.end method
.method public onEnable : ()V
.code stack 5 locals 1
getstatic Field java/lang/System out Ljava/io/PrintStream;
aload 0
ldc "priorities.txt"
invokevirtual Method d/g/mc/un/UN rl (Ljava/lang/String;)Ljava/util/List;
aload 0
getfield Field d/g/mc/un/UN prios Ljava/util/List;
dup
invokeinterface InterfaceMethod java/util/List clear ()V 1
dup_x1
swap
invokeinterface InterfaceMethod java/util/List addAll (Ljava/util/Collection;)Z 2
pop
invokevirtual Method java/io/PrintStream println (Ljava/lang/Object;)V
return
.end code
.end method
.end class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment