v1.13.2 - Gangs -> SQL DB Repo
This commit is contained in:
parent
c9414837ee
commit
739c26af12
|
@ -3,3 +3,4 @@ dependency-reduced-pom.xml
|
||||||
.idea
|
.idea
|
||||||
.circleci
|
.circleci
|
||||||
*.iml
|
*.iml
|
||||||
|
/target/
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>dev.drawethree.xprison</groupId>
|
<groupId>dev.drawethree.xprison</groupId>
|
||||||
<artifactId>X-Prison</artifactId>
|
<artifactId>X-Prison</artifactId>
|
||||||
<version>1.13.1</version>
|
<version>1.13.2</version>
|
||||||
|
|
||||||
<name>XPrison Reloaded</name>
|
<name>XPrison Reloaded</name>
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,7 @@ public class GangsManager {
|
||||||
return GangCreateResult.EVENT_CANCELLED;
|
return GangCreateResult.EVENT_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the async version to create a gang
|
this.plugin.getGangsService().createGangAsync(g); // Use async method
|
||||||
this.plugin.getGangsService().createGangAsync(g);
|
|
||||||
|
|
||||||
PlayerUtils.sendMessage(creator, this.plugin.getConfig().getMessage("gang-created").replace("%name%", TextUtils.applyColor(name)));
|
PlayerUtils.sendMessage(creator, this.plugin.getConfig().getMessage("gang-created").replace("%name%", TextUtils.applyColor(name)));
|
||||||
Players.all().forEach(player -> PlayerUtils.sendMessage(player, this.plugin.getConfig().getMessage("gang-create-broadcast").replace("%gang%", TextUtils.applyColor(g.getName())).replace("%player%", creator.getName())));
|
Players.all().forEach(player -> PlayerUtils.sendMessage(player, this.plugin.getConfig().getMessage("gang-create-broadcast").replace("%gang%", TextUtils.applyColor(g.getName())).replace("%player%", creator.getName())));
|
||||||
|
@ -127,6 +126,7 @@ public class GangsManager {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public GangCreateResult createGang(String name, Player creator) {
|
// public GangCreateResult createGang(String name, Player creator) {
|
||||||
//
|
//
|
||||||
// if (this.getPlayerGang(creator).isPresent()) {
|
// if (this.getPlayerGang(creator).isPresent()) {
|
||||||
|
@ -369,8 +369,7 @@ public class GangsManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
gang.disband();
|
gang.disband();
|
||||||
// Use the async version to delete a gang
|
this.plugin.getGangsService().deleteGangAsync(gang); // Use async method
|
||||||
this.plugin.getGangsService().deleteGangAsync(gang);
|
|
||||||
|
|
||||||
this.gangs.remove(gang.getUuid());
|
this.gangs.remove(gang.getUuid());
|
||||||
Players.all().forEach(player1 -> PlayerUtils.sendMessage(player1, this.plugin.getConfig().getMessage("gang-disband-broadcast").replace("%gang%", gang.getName()).replace("%player%", player.getName())));
|
Players.all().forEach(player1 -> PlayerUtils.sendMessage(player1, this.plugin.getConfig().getMessage("gang-disband-broadcast").replace("%gang%", gang.getName()).replace("%player%", player.getName())));
|
||||||
|
@ -378,6 +377,7 @@ public class GangsManager {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public void disbandGang(Player player, Gang gang, boolean force) {
|
// public void disbandGang(Player player, Gang gang, boolean force) {
|
||||||
//
|
//
|
||||||
// if (!gang.isOwner(player) && !force) {
|
// if (!gang.isOwner(player) && !force) {
|
||||||
|
|
|
@ -110,11 +110,19 @@ public class GangsRepositoryImpl implements GangsRepository {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteGang(Gang g) {
|
public void deleteGang(Gang g) {
|
||||||
this.database.executeSqlAsync("DELETE FROM " + TABLE_NAME + " WHERE ?=?", GANGS_UUID_COLNAME, g.getUuid().toString());
|
String sql = "DELETE FROM " + TABLE_NAME + " WHERE UUID=?";
|
||||||
|
this.database.executeSqlAsync(sql, g.getUuid().toString());
|
||||||
for (GangInvitation gangInvitation : g.getPendingInvites()) {
|
for (GangInvitation gangInvitation : g.getPendingInvites()) {
|
||||||
this.deleteGangInvitation(gangInvitation);
|
this.deleteGangInvitation(gangInvitation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// @Override
|
||||||
|
// public void deleteGang(Gang g) {
|
||||||
|
// this.database.executeSqlAsync("DELETE FROM " + TABLE_NAME + " WHERE ?=?", GANGS_UUID_COLNAME, g.getUuid().toString());
|
||||||
|
// for (GangInvitation gangInvitation : g.getPendingInvites()) {
|
||||||
|
// this.deleteGangInvitation(gangInvitation);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
name: X-Prison
|
name: X-Prison
|
||||||
version: 1.13.1
|
version: 1.13.2
|
||||||
main: dev.drawethree.xprison.XPrison
|
main: dev.drawethree.xprison.XPrison
|
||||||
depend: [ Vault, WorldGuard, WorldEdit, helper ]
|
depend: [ Vault, WorldGuard, WorldEdit, helper ]
|
||||||
softdepend:
|
softdepend:
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue