mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Fix legacy conversion of block lists
This commit is contained in:
parent
9e0c226632
commit
9fe9c2662b
@ -141,16 +141,22 @@ import java.util.Map.Entry;
|
|||||||
//
|
//
|
||||||
if (sum < 100) {
|
if (sum < 100) {
|
||||||
final int remaining = 100 - sum;
|
final int remaining = 100 - sum;
|
||||||
final int perUnassigned = remaining / unassigned.size();
|
if (unassigned.isEmpty()) {
|
||||||
for (final PlotBlock block : unassigned) {
|
// If there are no unassigned values, we just add it to the first value
|
||||||
temp.put(block, perUnassigned);
|
final Entry<PlotBlock, Integer> entry = temp.entrySet().iterator().next();
|
||||||
sum += perUnassigned;
|
temp.put(entry.getKey(), (entry.getValue() + 1 + remaining));
|
||||||
}
|
} else {
|
||||||
// Make sure there isn't a tiny difference remaining
|
final int perUnassigned = remaining / unassigned.size();
|
||||||
if (sum < 100) {
|
for (final PlotBlock block : unassigned) {
|
||||||
final int difference = 100 - sum;
|
temp.put(block, perUnassigned);
|
||||||
temp.put(unassigned.get(0), perUnassigned + difference);
|
sum += perUnassigned;
|
||||||
sum = 100;
|
}
|
||||||
|
// Make sure there isn't a tiny difference remaining
|
||||||
|
if (sum < 100) {
|
||||||
|
final int difference = 100 - sum;
|
||||||
|
temp.put(unassigned.get(0), perUnassigned + difference);
|
||||||
|
sum = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!unassigned.isEmpty()) {
|
} else if (!unassigned.isEmpty()) {
|
||||||
C.BUCKET_ENTRIES_IGNORED.send(ConsolePlayer.getConsole());
|
C.BUCKET_ENTRIES_IGNORED.send(ConsolePlayer.getConsole());
|
||||||
|
@ -1423,7 +1423,7 @@ public class Plot {
|
|||||||
}
|
}
|
||||||
PlotArea plotworld = getArea();
|
PlotArea plotworld = getArea();
|
||||||
if (plotworld.SCHEMATIC_ON_CLAIM) {
|
if (plotworld.SCHEMATIC_ON_CLAIM) {
|
||||||
Schematic sch = null;
|
Schematic sch;
|
||||||
try {
|
try {
|
||||||
if (schematic == null || schematic.isEmpty()) {
|
if (schematic == null || schematic.isEmpty()) {
|
||||||
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
|
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
|
||||||
|
Loading…
Reference in New Issue
Block a user