Potential fix for PhanaticD

This commit is contained in:
boy0001 2015-03-31 14:34:18 +11:00
parent bcc366fc3c
commit c2acdc5f5c
6 changed files with 23 additions and 11 deletions

View File

@ -178,7 +178,7 @@ 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((short) (X + x), (short) (Z + z)); final PlotLoc loc = new PlotLoc((X + x), (Z + z));
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()) {
@ -216,7 +216,7 @@ public class HybridGen extends PlotGenerator {
} }
setBlock(x, this.plotheight, z, this.plotfloors); setBlock(x, this.plotheight, z, this.plotfloors);
if (this.plotworld.PLOT_SCHEMATIC) { if (this.plotworld.PLOT_SCHEMATIC) {
final PlotLoc loc = new PlotLoc((short) absX, (short) absZ); final PlotLoc loc = new PlotLoc(absX, absZ);
final HashMap<Short, Short> blocks = this.plotworld.G_SCH.get(loc); final HashMap<Short, Short> blocks = this.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()) {
@ -241,7 +241,7 @@ public class HybridGen extends PlotGenerator {
} }
} }
if (this.plotworld.ROAD_SCHEMATIC_ENABLED) { if (this.plotworld.ROAD_SCHEMATIC_ENABLED) {
final PlotLoc loc = new PlotLoc((short) absX, (short) absZ); final PlotLoc loc = new PlotLoc(absX, absZ);
final HashMap<Short, Short> blocks = this.plotworld.G_SCH.get(loc); final HashMap<Short, Short> blocks = this.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()) {

View File

@ -143,7 +143,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
int x = item.x; int x = item.x;
int y = item.y; int y = item.y;
int z = item.z; int z = item.z;
PlotLoc loc = new PlotLoc((short) x, (short) z); PlotLoc loc = new PlotLoc(x, z);
if (!G_SCH_STATE.containsKey(loc)) { if (!G_SCH_STATE.containsKey(loc)) {
G_SCH_STATE.put(loc, new HashSet<PlotItem>()); G_SCH_STATE.put(loc, new HashSet<PlotItem>());
} }

View File

@ -82,7 +82,7 @@ public abstract class PlotGenerator extends ChunkGenerator {
if (biomes != null) { if (biomes != null) {
biomes.setBiome(x, z, biome); biomes.setBiome(x, z, biome);
} }
final PlotLoc loc = new PlotLoc((short) (X + x), (short) (Z + z)); final PlotLoc loc = new PlotLoc((X + x), (Z + z));
final HashMap<Short, Short> blocks = ChunkManager.GENERATE_BLOCKS.get(loc); final HashMap<Short, Short> blocks = ChunkManager.GENERATE_BLOCKS.get(loc);
for (final Entry<Short, Short> entry : blocks.entrySet()) { for (final Entry<Short, Short> entry : blocks.entrySet()) {
setBlock(x, entry.getKey(), z, entry.getValue()); setBlock(x, entry.getKey(), z, entry.getValue());
@ -97,7 +97,13 @@ public abstract class PlotGenerator extends ChunkGenerator {
for (Entry<PlotLoc, HashMap<Short, Short>> entry : ChunkManager.GENERATE_BLOCKS.entrySet()) { for (Entry<PlotLoc, HashMap<Short, Short>> entry : ChunkManager.GENERATE_BLOCKS.entrySet()) {
for (Entry<Short, Short> entry2 : entry.getValue().entrySet()) { for (Entry<Short, Short> entry2 : entry.getValue().entrySet()) {
loc = entry.getKey(); loc = entry.getKey();
setBlock(loc.x - X, entry2.getKey(), loc.z- Z, entry2.getValue()); int xx = loc.x - X;
int zz = loc.z - Z;
if (xx >= 0 && xx < 16) {
if (zz >= 0 && zz < 16) {
setBlock(xx, entry2.getKey(), zz, entry2.getValue());
}
}
} }
} }
} }

View File

@ -1,10 +1,10 @@
package com.intellectualcrafters.plot.object; package com.intellectualcrafters.plot.object;
public class PlotLoc { public class PlotLoc {
public short x; public int x;
public short z; public int z;
public PlotLoc(final short x, final short z) { public PlotLoc(final int x, final int z) {
this.x = x; this.x = x;
this.z = z; this.z = z;
} }

View File

@ -42,7 +42,13 @@ public abstract class PlotPopulator extends BlockPopulator {
for (Entry<PlotLoc, HashMap<Short, Byte>> entry : ChunkManager.GENERATE_DATA.entrySet()) { for (Entry<PlotLoc, HashMap<Short, Byte>> entry : ChunkManager.GENERATE_DATA.entrySet()) {
for (Entry<Short, Byte> entry2 : entry.getValue().entrySet()) { for (Entry<Short, Byte> entry2 : entry.getValue().entrySet()) {
loc = entry.getKey(); loc = entry.getKey();
setBlock(loc.x - X, entry2.getKey(), loc.z - Z, entry2.getValue()); int xx = loc.x - X;
int zz = loc.z - Z;
if (xx >= 0 && xx < 16) {
if (zz >= 0 && zz < 16) {
setBlock(xx, entry2.getKey(), zz, entry2.getValue());
}
}
} }
} }
} }

View File

@ -747,7 +747,7 @@ public class BukkitChunkManager extends ChunkManager {
} }
} }
} }
final PlotLoc loc = new PlotLoc((short) x, (short) z); final PlotLoc loc = new PlotLoc(x, z);
GENERATE_BLOCKS.put(loc, ids); GENERATE_BLOCKS.put(loc, ids);
GENERATE_DATA.put(loc, datas); GENERATE_DATA.put(loc, datas);
} }