mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
Fix clearing and deleting not restoring plot schematic
This commit is contained in:
parent
2b3a4f738a
commit
835d72063e
@ -170,17 +170,17 @@ public class HybridGen extends PlotGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (region != null) {
|
|
||||||
final int X = cx << 4;
|
int sx = (short) ((this.X) % this.size);
|
||||||
final int Z = cz << 4;
|
int sz = (short) ((this.Z) % this.size);
|
||||||
int sx = ((X) % this.size);
|
|
||||||
int sz = ((Z) % this.size);
|
|
||||||
if (sx < 0) {
|
if (sx < 0) {
|
||||||
sx += this.size;
|
sx += this.size;
|
||||||
}
|
}
|
||||||
if (sz < 0) {
|
if (sz < 0) {
|
||||||
sz += this.size;
|
sz += this.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (region != null) {
|
||||||
for (short x = 0; x < 16; x++) {
|
for (short x = 0; x < 16; x++) {
|
||||||
for (short z = 0; z < 16; z++) {
|
for (short z = 0; z < 16; z++) {
|
||||||
if (biomes != null) {
|
if (biomes != null) {
|
||||||
@ -191,7 +191,9 @@ public class HybridGen extends PlotGenerator {
|
|||||||
setBlock(x, y, z, this.filling);
|
setBlock(x, y, z, this.filling);
|
||||||
}
|
}
|
||||||
setBlock(x, this.plotheight, z, this.plotfloors);
|
setBlock(x, this.plotheight, z, this.plotfloors);
|
||||||
final PlotLoc loc = new PlotLoc((X + x), (Z + z));
|
final int absX = ((sx + x) % this.size);
|
||||||
|
final int absZ = ((sz + z) % this.size);
|
||||||
|
final PlotLoc loc = new PlotLoc(absX, absZ);
|
||||||
final HashMap<Short, Short> blocks = plotworld.G_SCH.get(loc);
|
final HashMap<Short, Short> blocks = plotworld.G_SCH.get(loc);
|
||||||
if (blocks != null) {
|
if (blocks != null) {
|
||||||
for (final Entry<Short, Short> entry : blocks.entrySet()) {
|
for (final Entry<Short, Short> entry : blocks.entrySet()) {
|
||||||
@ -203,14 +205,6 @@ public class HybridGen extends PlotGenerator {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int sx = (short) ((this.X) % this.size);
|
|
||||||
int sz = (short) ((this.Z) % this.size);
|
|
||||||
if (sx < 0) {
|
|
||||||
sx += this.size;
|
|
||||||
}
|
|
||||||
if (sz < 0) {
|
|
||||||
sz += this.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (short x = 0; x < 16; x++) {
|
for (short x = 0; x < 16; x++) {
|
||||||
for (short z = 0; z < 16; z++) {
|
for (short z = 0; z < 16; z++) {
|
||||||
|
@ -112,9 +112,9 @@ public class HybridPop extends PlotPopulator {
|
|||||||
@Override
|
@Override
|
||||||
public void populate(World world, RegionWrapper requiredRegion, PseudoRandom random, int cx, int cz) {
|
public void populate(World world, RegionWrapper requiredRegion, PseudoRandom random, int cx, int cz) {
|
||||||
PlotSquared.getPlotManager(world.getName());
|
PlotSquared.getPlotManager(world.getName());
|
||||||
if (requiredRegion != null) {
|
|
||||||
short sx = (short) ((this.X) % this.size);
|
int sx = (short) ((this.X) % this.size);
|
||||||
short sz = (short) ((this.Z) % this.size);
|
int sz = (short) ((this.Z) % this.size);
|
||||||
if (sx < 0) {
|
if (sx < 0) {
|
||||||
sx += this.size;
|
sx += this.size;
|
||||||
}
|
}
|
||||||
@ -122,6 +122,7 @@ public class HybridPop extends PlotPopulator {
|
|||||||
sz += this.size;
|
sz += this.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requiredRegion != null) {
|
||||||
for (short x = 0; x < 16; x++) {
|
for (short x = 0; x < 16; x++) {
|
||||||
for (short z = 0; z < 16; z++) {
|
for (short z = 0; z < 16; z++) {
|
||||||
if (contains(requiredRegion, x, z)) {
|
if (contains(requiredRegion, x, z)) {
|
||||||
@ -134,7 +135,9 @@ public class HybridPop extends PlotPopulator {
|
|||||||
setBlock(x, (short) this.plotheight, z, this.plotfloors);
|
setBlock(x, (short) this.plotheight, z, this.plotfloors);
|
||||||
}
|
}
|
||||||
if (this.plotworld.PLOT_SCHEMATIC) {
|
if (this.plotworld.PLOT_SCHEMATIC) {
|
||||||
final PlotLoc loc = new PlotLoc((short) (this.X + x), (short) (this.Z + z));
|
final int absX = ((sx + x) % this.size);
|
||||||
|
final int absZ = ((sz + z) % this.size);
|
||||||
|
final PlotLoc loc = new PlotLoc(absX, absZ);
|
||||||
final HashMap<Short, Byte> blocks = this.plotworld.G_SCH_DATA.get(loc);
|
final HashMap<Short, Byte> blocks = this.plotworld.G_SCH_DATA.get(loc);
|
||||||
if (blocks != null) {
|
if (blocks != null) {
|
||||||
for (final short y : blocks.keySet()) {
|
for (final short y : blocks.keySet()) {
|
||||||
@ -155,14 +158,6 @@ public class HybridPop extends PlotPopulator {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int sx = (short) ((this.X) % this.size);
|
|
||||||
int sz = (short) ((this.Z) % this.size);
|
|
||||||
if (sx < 0) {
|
|
||||||
sx += this.size;
|
|
||||||
}
|
|
||||||
if (sz < 0) {
|
|
||||||
sz += this.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (short x = 0; x < 16; x++) {
|
for (short x = 0; x < 16; x++) {
|
||||||
for (short z = 0; z < 16; z++) {
|
for (short z = 0; z < 16; z++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user