Made AliLinks save, added Jar file
This commit is contained in:
parent
8967e39084
commit
79a18d02dd
4 changed files with 8 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,7 +4,6 @@
|
||||||
.mtj.tmp/
|
.mtj.tmp/
|
||||||
|
|
||||||
# Package Files #
|
# Package Files #
|
||||||
*.jar
|
|
||||||
*.war
|
*.war
|
||||||
*.ear
|
*.ear
|
||||||
|
|
||||||
|
|
BIN
AliPresents.jar
Normal file
BIN
AliPresents.jar
Normal file
Binary file not shown.
|
@ -17,8 +17,13 @@ public class AliLinkSubPlug{
|
||||||
this.deserializer = new Deserializer();
|
this.deserializer = new Deserializer();
|
||||||
try{
|
try{
|
||||||
this.linkList = deserializer.loadLinkList();
|
this.linkList = deserializer.loadLinkList();
|
||||||
|
if(this.linkList == null){
|
||||||
|
this.linkList = new ArrayList<Link>();
|
||||||
|
serializer.saveLinkList(this.linkList);
|
||||||
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
linkList = new ArrayList<Link>();
|
linkList = new ArrayList<Link>();
|
||||||
|
serializer.saveLinkList(this.linkList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,15 @@ public class SetAliLink implements CommandExecutor{
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
if (args.length < 4){
|
if (args.length < 4){
|
||||||
subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation()));
|
subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation()));
|
||||||
|
subplugin.serializer.saveLinkList(subplugin.linkList);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){
|
if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){
|
||||||
subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3]))));
|
subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3]))));
|
||||||
|
subplugin.serializer.saveLinkList(subplugin.linkList);
|
||||||
}else{
|
}else{
|
||||||
subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation()));
|
subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation()));
|
||||||
|
subplugin.serializer.saveLinkList(subplugin.linkList);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue