Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Questioenr Stuff to legacy & Removed all references to Question…
…er code
- Loading branch information
Showing
11 changed files
with
260 additions
and
271 deletions.
There are no files selected for viewing
File renamed without changes.
82 changes: 41 additions & 41 deletions
82
...kkit/towny/questioner/JoinNationTask.java → ...y/old-questioner-code/JoinNationTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |
68 changes: 34 additions & 34 deletions
68
...bukkit/towny/questioner/JoinTownTask.java → legacy/old-questioner-code/JoinTownTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) { | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
76 changes: 38 additions & 38 deletions
76
...t/towny/questioner/PurgeQuestionTask.java → ...ld-questioner-code/PurgeQuestionTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
64 changes: 32 additions & 32 deletions
64
...uestioner/ResidentNationQuestionTask.java → ...oner-code/ResidentNationQuestionTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() { | ||
|
||
} | ||
|
||
} |
48 changes: 24 additions & 24 deletions
48
...owny/questioner/ResidentQuestionTask.java → ...questioner-code/ResidentQuestionTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() { | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.