Skip to content

Commit

Permalink
Moved Questioenr Stuff to legacy & Removed all references to Question…
Browse files Browse the repository at this point in the history
…er code
  • Loading branch information
Articdive committed Feb 3, 2018
1 parent 3b473a3 commit f81e50a
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 271 deletions.
@@ -1,41 +1,41 @@
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Nation;
import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.palmergames.bukkit.util.ChatTools;

public class JoinNationTask extends ResidentNationQuestionTask {

public JoinNationTask(Resident resident, Nation nation) {

super(resident, nation);
}

@Override
public void run() {

try {
nation.addTown(resident.getTown());
//towny.deleteCache(resident.getName());
TownyUniverse.getDataSource().saveResident(resident);
TownyUniverse.getDataSource().saveTown(resident.getTown());
TownyUniverse.getDataSource().saveNation(nation);

TownyMessaging.sendNationMessage(nation, ChatTools.color(String.format(TownySettings.getLangString("msg_join_nation"), resident.getTown().getName())));
} catch (AlreadyRegisteredException e) {
try {
TownyMessaging.sendResidentMessage(resident, e.getMessage());
} catch (TownyException e1) {
}
} catch (NotRegisteredException e) {
// TODO somehow this person is not the town mayor
e.printStackTrace();
}
}
}
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Nation;
import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.palmergames.bukkit.util.ChatTools;

public class JoinNationTask extends ResidentNationQuestionTask {

public JoinNationTask(Resident resident, Nation nation) {

super(resident, nation);
}

@Override
public void run() {

try {
nation.addTown(resident.getTown());
//towny.deleteCache(resident.getName());
TownyUniverse.getDataSource().saveResident(resident);
TownyUniverse.getDataSource().saveTown(resident.getTown());
TownyUniverse.getDataSource().saveNation(nation);

TownyMessaging.sendNationMessage(nation, ChatTools.color(String.format(TownySettings.getLangString("msg_join_nation"), resident.getTown().getName())));
} catch (AlreadyRegisteredException e) {
try {
TownyMessaging.sendResidentMessage(resident, e.getMessage());
} catch (TownyException e1) {
}
} catch (NotRegisteredException e) {
// TODO somehow this person is not the town mayor
e.printStackTrace();
}
}
}
@@ -1,34 +1,34 @@
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.command.TownCommand;
import com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.util.ChatTools;

public class JoinTownTask extends ResidentTownQuestionTask {

public JoinTownTask(Resident resident, Town town) {

super(resident, town);
}

@Override
public void run() {

try {
TownCommand.townAddResident(town, resident);

TownyMessaging.sendTownMessage(town, ChatTools.color(String.format(TownySettings.getLangString("msg_join_town"), resident.getName())));

} catch (AlreadyRegisteredException e) {
try {
TownyMessaging.sendResidentMessage(resident, e.getMessage());
} catch (TownyException e1) {
}
}
}
}
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.command.TownCommand;
import com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.util.ChatTools;

public class JoinTownTask extends ResidentTownQuestionTask {

public JoinTownTask(Resident resident, Town town) {

super(resident, town);
}

@Override
public void run() {

try {
TownCommand.townAddResident(town, resident);

TownyMessaging.sendTownMessage(town, ChatTools.color(String.format(TownySettings.getLangString("msg_join_town"), resident.getName())));

} catch (AlreadyRegisteredException e) {
try {
TownyMessaging.sendResidentMessage(resident, e.getMessage());
} catch (TownyException e1) {
}
}
}
}
@@ -1,38 +1,38 @@
package com.palmergames.bukkit.towny.questioner;

import org.bukkit.command.CommandSender;

import com.palmergames.bukkit.towny.Towny;
import com.palmergames.bukkit.towny.tasks.ResidentPurge;


public class PurgeQuestionTask extends TownyQuestionTask {

protected Towny towny;
protected CommandSender sender;
protected long time;

public PurgeQuestionTask(Towny plugin, CommandSender sender, long deleteTime) {

this.towny = plugin;
this.sender = sender;
this.time = deleteTime;
}

public CommandSender getSender() {

return sender;
}

public long time() {

return time;
}

@Override
public void run() {

// Run a purge in it's own thread
new ResidentPurge(towny, getSender(), time).start();
}
}
package com.palmergames.bukkit.towny.questioner;

import org.bukkit.command.CommandSender;

import com.palmergames.bukkit.towny.Towny;
import com.palmergames.bukkit.towny.tasks.ResidentPurge;


public class PurgeQuestionTask extends TownyQuestionTask {

protected Towny towny;
protected CommandSender sender;
protected long time;

public PurgeQuestionTask(Towny plugin, CommandSender sender, long deleteTime) {

this.towny = plugin;
this.sender = sender;
this.time = deleteTime;
}

public CommandSender getSender() {

return sender;
}

public long time() {

return time;
}

@Override
public void run() {

// Run a purge in it's own thread
new ResidentPurge(towny, getSender(), time).start();
}
}
@@ -1,32 +1,32 @@
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Nation;

public class ResidentNationQuestionTask extends TownyQuestionTask {

protected Resident resident;
protected Nation nation;

public ResidentNationQuestionTask(Resident resident, Nation nation) {

this.resident = resident;
this.nation = nation;
}

public Resident getResident() {

return resident;
}

public Nation getNation() {

return nation;
}

@Override
public void run() {

}

}
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Nation;

public class ResidentNationQuestionTask extends TownyQuestionTask {

protected Resident resident;
protected Nation nation;

public ResidentNationQuestionTask(Resident resident, Nation nation) {

this.resident = resident;
this.nation = nation;
}

public Resident getResident() {

return resident;
}

public Nation getNation() {

return nation;
}

@Override
public void run() {

}

}
@@ -1,24 +1,24 @@
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.object.Resident;

public class ResidentQuestionTask extends TownyQuestionTask {

protected Resident resident;

public ResidentQuestionTask(Resident resident) {

this.resident = resident;
}

public Resident getResident() {

return resident;
}

@Override
public void run() {

}

}
package com.palmergames.bukkit.towny.questioner;

import com.palmergames.bukkit.towny.object.Resident;

public class ResidentQuestionTask extends TownyQuestionTask {

protected Resident resident;

public ResidentQuestionTask(Resident resident) {

this.resident = resident;
}

public Resident getResident() {

return resident;
}

@Override
public void run() {

}

}

0 comments on commit f81e50a

Please sign in to comment.