mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java
This commit is contained in:
commit
a843203ca3
28
.github/ISSUE_TEMPLATE.md
vendored
28
.github/ISSUE_TEMPLATE.md
vendored
@ -1,12 +1,22 @@
|
||||
# Bug report template (Follow this template unless you are making a feature request.)
|
||||
**Debug paste link**:
|
||||
# Bug report template
|
||||
<!--- In order to create a valid issue report you have to follow this template. -->
|
||||
<!--- Incomplete reports might be marked as invalid. -->
|
||||
<!--- You may remove it if you are posting a feature request. -->
|
||||
**Debug paste link:**
|
||||
<!--- Enter /plot debugpaste in game or in your console and copy the output here -->
|
||||
|
||||
**Description of the problem:**
|
||||
|
||||
|
||||
**How to replicate:**
|
||||
<!--- If you can reproduce the issue please tell us as detailed as possible step by step how to do that -->
|
||||
|
||||
**Checklist**:
|
||||
<!-- Make sure you have completed the following steps (put an "X" between of brackets): -->
|
||||
- [] I included a `/plot debugpaste` link
|
||||
- [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/PlotSquared/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- [] I made sure I am using an up-to-date version of PlotSquared
|
||||
- [] I Made sure the bug/error is not caused by any other plugin
|
||||
|
||||
**Description of the problem:**
|
||||
|
||||
**How to replicate**:
|
||||
|
||||
Make sure you've completed the following steps (put an X between of brackets):
|
||||
- [] Include `/plot debugpaste`
|
||||
- [] Made sure there aren't duplicates of this report [(Use Search)](https://github.com/IntellectualSites/PlotSquared/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||
- [] Made sure you're using an up-to-date version of PlotSquared
|
||||
- [] Made sure the bug/error isn't caused by any other plugin
|
||||
|
@ -223,12 +223,12 @@ public class MainCommand extends Command {
|
||||
// Trim command
|
||||
args = Arrays.copyOfRange(args, 1, args.length);
|
||||
}
|
||||
if (args.length >= 2 && args[0].charAt(0) == '-') {
|
||||
if (args.length >= 2 && !args[0].isEmpty() && args[0].charAt(0) == '-') {
|
||||
switch (args[0].substring(1)) {
|
||||
case "f":
|
||||
confirm = new RunnableVal3<Command, Runnable, Runnable>() {
|
||||
@Override
|
||||
public void run(final Command cmd, final Runnable success, final Runnable failure) {
|
||||
public void run(Command cmd, Runnable success, Runnable failure) {
|
||||
if (EconHandler.manager != null) {
|
||||
PlotArea area = player.getApplicablePlotArea();
|
||||
if (area != null) {
|
||||
|
@ -163,6 +163,13 @@ public class SQLManager implements AbstractDB {
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
try {
|
||||
if (connection.isClosed()) {
|
||||
return false;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
try (PreparedStatement stmt = this.connection.prepareStatement("SELECT 1")) {
|
||||
stmt.executeQuery();
|
||||
return true;
|
||||
@ -2934,13 +2941,8 @@ public class SQLManager implements AbstractDB {
|
||||
|
||||
@Override
|
||||
public void validateAllPlots(Set<Plot> toValidate) {
|
||||
try {
|
||||
if (this.connection.isClosed() || this.closed) {
|
||||
this.closed = false;
|
||||
this.connection = this.database.forceConnection();
|
||||
}
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
if (!isValid()) {
|
||||
reconnect();
|
||||
}
|
||||
PS.debug("$1All DB transactions during this session are being validated (This may take a while if corrections need to be made)");
|
||||
commit();
|
||||
|
@ -29,6 +29,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue;
|
||||
import com.intellectualcrafters.plot.util.expiry.ExpireManager;
|
||||
import com.intellectualcrafters.plot.util.expiry.PlotAnalysis;
|
||||
import com.plotsquared.listener.PlotListener;
|
||||
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.PathIterator;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
@ -46,7 +47,6 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* The plot class<br>
|
||||
@ -767,7 +767,6 @@ public class Plot {
|
||||
@Override
|
||||
public void run() {
|
||||
if (queue.isEmpty()) {
|
||||
AtomicInteger finished = new AtomicInteger(0);
|
||||
Runnable run = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -464,11 +465,14 @@ public abstract class PlotArea {
|
||||
}
|
||||
|
||||
public Set<Plot> getPlotsAbs(final UUID uuid) {
|
||||
if (uuid == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
final HashSet<Plot> myPlots = new HashSet<>();
|
||||
foreachPlotAbs(new RunnableVal<Plot>() {
|
||||
@Override
|
||||
public void run(Plot value) {
|
||||
if (value.owner.equals(uuid)) {
|
||||
if (uuid.equals(value.owner)) {
|
||||
myPlots.add(value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user