Made AliLinks save, added Jar file

This commit is contained in:
alisolarflare 2016-08-21 14:27:04 -04:00
parent 8967e39084
commit 79a18d02dd
4 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View file

@ -4,7 +4,6 @@
.mtj.tmp/ .mtj.tmp/
# Package Files # # Package Files #
*.jar
*.war *.war
*.ear *.ear

BIN
AliPresents.jar Normal file

Binary file not shown.

View file

@ -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);
} }
} }

View file

@ -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;