Merge pull request 'Adapt to CommonDB' (#139) from commonDB into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #139 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
4e6fa7cd42
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.bausystem.features.world;
|
package de.steamwar.bausystem.features.world;
|
||||||
|
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
|
import de.steamwar.sql.SchematicData;
|
||||||
import de.steamwar.sql.SchematicNode;
|
import de.steamwar.sql.SchematicNode;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -37,7 +38,7 @@ public class ClipboardListener implements Listener {
|
|||||||
try {
|
try {
|
||||||
SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, 0);
|
SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, 0);
|
||||||
if (schematic != null) {
|
if (schematic != null) {
|
||||||
schematic.loadToPlayer(e.getPlayer());
|
new SchematicData(schematic).loadToPlayer(e.getPlayer());
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// ignore cause players do all kind of stuff with schematics.... like massively oversized schems
|
// ignore cause players do all kind of stuff with schematics.... like massively oversized schems
|
||||||
@ -54,7 +55,7 @@ public class ClipboardListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
schematic.saveFromPlayer(e.getPlayer());
|
new SchematicData(schematic).saveFromPlayer(e.getPlayer());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
if (newSchem) {
|
if (newSchem) {
|
||||||
schematic.delete();
|
schematic.delete();
|
||||||
|
@ -53,7 +53,7 @@ public class StopCommand extends SWCommand {
|
|||||||
if (Permission.hasPermission(player, Permission.WORLD)) {
|
if (Permission.hasPermission(player, Permission.WORLD)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
SteamwarUser steamwarUser = SteamwarUser.get(player);
|
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
|
||||||
if (steamwarUser.getUserGroup().isAdminGroup()) {
|
if (steamwarUser.getUserGroup().isAdminGroup()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import de.steamwar.bausystem.region.utils.RegionType;
|
|||||||
import de.steamwar.bausystem.shared.SizedStack;
|
import de.steamwar.bausystem.shared.SizedStack;
|
||||||
import de.steamwar.bausystem.utils.FlatteningWrapper;
|
import de.steamwar.bausystem.utils.FlatteningWrapper;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.sql.SchematicData;
|
||||||
import de.steamwar.sql.SchematicNode;
|
import de.steamwar.sql.SchematicNode;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -457,7 +458,7 @@ public class Region {
|
|||||||
tempFile = prototype.getSkinMap().get(skin).getTestblockSchematicFile();
|
tempFile = prototype.getSkinMap().get(skin).getTestblockSchematicFile();
|
||||||
pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2);
|
pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2);
|
||||||
} else {
|
} else {
|
||||||
clipboard = schematic.load();
|
clipboard = new SchematicData(schematic).load();
|
||||||
int dz = Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ());
|
int dz = Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ());
|
||||||
if (dz < 2 || dz > prototype.getTestblock().getSizeZ()) {
|
if (dz < 2 || dz > prototype.getTestblock().getSizeZ()) {
|
||||||
pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2);
|
pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2);
|
||||||
@ -482,7 +483,7 @@ public class Region {
|
|||||||
|
|
||||||
EditSession editSession = null;
|
EditSession editSession = null;
|
||||||
if (schematic != null) {
|
if (schematic != null) {
|
||||||
editSession = paste(clipboard != null ? clipboard : schematic.load(), pastePoint, pasteOptions);
|
editSession = paste(clipboard != null ? clipboard : new SchematicData(schematic).load(), pastePoint, pasteOptions);
|
||||||
} else {
|
} else {
|
||||||
editSession = paste(tempFile, pastePoint, pasteOptions);
|
editSession = paste(tempFile, pastePoint, pasteOptions);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren