Fixes #715
This commit is contained in:
parent
921ca83ed2
commit
356c5431ec
|
@ -8,6 +8,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.boydti.fawe.util.ReflectionUtils;
|
import com.boydti.fawe.util.ReflectionUtils;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
|
@ -189,9 +190,9 @@ public class BukkitChunk_1_10 extends CharFaweChunk<Chunk, BukkitQueue_1_10> {
|
||||||
if (ent instanceof EntityPlayer) {
|
if (ent instanceof EntityPlayer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
int j = FaweCache.CACHE_J[y][z][x];
|
int j = FaweCache.CACHE_J[y][z][x];
|
||||||
String id = EntityTypes.b(ent);
|
String id = EntityTypes.b(ent);
|
||||||
|
@ -280,9 +281,9 @@ public class BukkitChunk_1_10 extends CharFaweChunk<Chunk, BukkitQueue_1_10> {
|
||||||
if (entity instanceof net.minecraft.server.v1_10_R1.EntityPlayer) {
|
if (entity instanceof net.minecraft.server.v1_10_R1.EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
int y = (int) Math.round(entity.locY);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
if (copy != null) {
|
if (copy != null) {
|
||||||
|
|
|
@ -789,9 +789,9 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.boydti.fawe.util.ReflectionUtils;
|
import com.boydti.fawe.util.ReflectionUtils;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
|
@ -81,9 +82,9 @@ public class BukkitChunk_1_11 extends CharFaweChunk<Chunk, com.boydti.fawe.bukki
|
||||||
if (ent instanceof EntityPlayer) {
|
if (ent instanceof EntityPlayer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
int j = FaweCache.CACHE_J[y][z][x];
|
int j = FaweCache.CACHE_J[y][z][x];
|
||||||
String id = EntityTypes.b(ent);
|
String id = EntityTypes.b(ent);
|
||||||
|
@ -278,9 +279,9 @@ public class BukkitChunk_1_11 extends CharFaweChunk<Chunk, com.boydti.fawe.bukki
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
int y = (int) Math.round(entity.locY);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
if (copy != null) {
|
if (copy != null) {
|
||||||
|
|
|
@ -791,9 +791,9 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.boydti.fawe.util.ReflectionUtils;
|
import com.boydti.fawe.util.ReflectionUtils;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
|
@ -81,9 +82,9 @@ public class BukkitChunk_1_12 extends CharFaweChunk<Chunk, BukkitQueue_1_12> {
|
||||||
if (ent instanceof EntityPlayer || BukkitQueue_0.getAdapter() == null) {
|
if (ent instanceof EntityPlayer || BukkitQueue_0.getAdapter() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
int j = FaweCache.CACHE_J[y][z][x];
|
int j = FaweCache.CACHE_J[y][z][x];
|
||||||
String id = EntityTypes.b(ent);
|
String id = EntityTypes.b(ent);
|
||||||
|
@ -270,6 +271,8 @@ public class BukkitChunk_1_12 extends CharFaweChunk<Chunk, BukkitQueue_1_12> {
|
||||||
} else {
|
} else {
|
||||||
Collection<Entity> ents = entities[i];
|
Collection<Entity> ents = entities[i];
|
||||||
if (!ents.isEmpty()) {
|
if (!ents.isEmpty()) {
|
||||||
|
int layerYStart = i << 4;
|
||||||
|
int layerYEnd = layerYStart + 15;
|
||||||
char[] array = this.getIdArray(i);
|
char[] array = this.getIdArray(i);
|
||||||
if (array == null) continue;
|
if (array == null) continue;
|
||||||
Iterator<Entity> iter = ents.iterator();
|
Iterator<Entity> iter = ents.iterator();
|
||||||
|
@ -278,10 +281,10 @@ public class BukkitChunk_1_12 extends CharFaweChunk<Chunk, BukkitQueue_1_12> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
if (y > layerYEnd || y < layerYStart) continue;
|
||||||
int y = (int) Math.round(entity.locY);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
if (y < 0 || y > 255) continue;
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
if (copy != null) {
|
if (copy != null) {
|
||||||
copy.storeEntity(entity);
|
copy.storeEntity(entity);
|
||||||
|
|
|
@ -832,9 +832,9 @@ public class BukkitQueue_1_12 extends BukkitQueue_0<net.minecraft.server.v1_12_R
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
import com.sk89q.jnbt.StringTag;
|
import com.sk89q.jnbt.StringTag;
|
||||||
|
@ -189,9 +190,9 @@ public class BukkitChunk_1_7 extends CharFaweChunk<Chunk, BukkitQueue17> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
int y = (int) Math.round(entity.locY);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -406,9 +406,9 @@ public class BukkitQueue17 extends BukkitQueue_0<net.minecraft.server.v1_7_R4.Ch
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
import com.sk89q.jnbt.StringTag;
|
import com.sk89q.jnbt.StringTag;
|
||||||
|
@ -116,9 +117,9 @@ public class BukkitChunk_1_8 extends CharFaweChunk<Chunk, BukkitQueue18R3> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
int y = (int) Math.round(entity.locY);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -397,9 +397,9 @@ public class BukkitQueue18R3 extends BukkitQueue_0<net.minecraft.server.v1_8_R3.
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.boydti.fawe.util.ReflectionUtils;
|
import com.boydti.fawe.util.ReflectionUtils;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
|
@ -216,9 +217,9 @@ public class BukkitChunk_1_9 extends CharFaweChunk<Chunk, BukkitQueue_1_9_R1> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.locX) & 15);
|
int x = (MathMan.roundInt(entity.locX) & 15);
|
||||||
int z = ((int) Math.round(entity.locZ) & 15);
|
int z = (MathMan.roundInt(entity.locZ) & 15);
|
||||||
int y = (int) Math.round(entity.locY);
|
int y = MathMan.roundInt(entity.locY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -744,9 +744,9 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.locX) & 15);
|
int x = (MathMan.roundInt(ent.locX) & 15);
|
||||||
int z = ((int) Math.round(ent.locZ) & 15);
|
int z = (MathMan.roundInt(ent.locZ) & 15);
|
||||||
int y = ((int) Math.round(ent.locY) & 0xFF);
|
int y = (MathMan.roundInt(ent.locY) & 0xFF);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -53,9 +53,9 @@ public class SurfaceSpline implements Brush {
|
||||||
final double splinelength = interpol.arcLength(0, 1);
|
final double splinelength = interpol.arcLength(0, 1);
|
||||||
for (double loop = 0; loop <= 1; loop += 1D / splinelength / quality) {
|
for (double loop = 0; loop <= 1; loop += 1D / splinelength / quality) {
|
||||||
final Vector tipv = interpol.getPosition(loop);
|
final Vector tipv = interpol.getPosition(loop);
|
||||||
final int tipx = (int) Math.round(tipv.getX());
|
final int tipx = MathMan.roundInt(tipv.getX());
|
||||||
final int tipz = (int) tipv.getZ();
|
final int tipz = (int) tipv.getZ();
|
||||||
int tipy = (int) Math.round(tipv.getY());
|
int tipy = MathMan.roundInt(tipv.getY());
|
||||||
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, 0, maxY);
|
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, 0, maxY);
|
||||||
if (tipy == -1) continue;
|
if (tipy == -1) continue;
|
||||||
if (radius == 0) {
|
if (radius == 0) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.object.HasFaweQueue;
|
import com.boydti.fawe.object.HasFaweQueue;
|
||||||
import com.boydti.fawe.object.extent.FastWorldEditExtent;
|
import com.boydti.fawe.object.extent.FastWorldEditExtent;
|
||||||
import com.boydti.fawe.util.ExtentTraverser;
|
import com.boydti.fawe.util.ExtentTraverser;
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.DoubleTag;
|
import com.sk89q.jnbt.DoubleTag;
|
||||||
import com.sk89q.jnbt.LongTag;
|
import com.sk89q.jnbt.LongTag;
|
||||||
|
@ -64,9 +65,9 @@ public class MutableEntityChange implements Change {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DoubleTag> pos = (List<DoubleTag>) map.get("Pos").getValue();
|
List<DoubleTag> pos = (List<DoubleTag>) map.get("Pos").getValue();
|
||||||
int x = (int) Math.round(pos.get(0).getValue());
|
int x = MathMan.roundInt(pos.get(0).getValue());
|
||||||
int y = (int) Math.round(pos.get(1).getValue());
|
int y = MathMan.roundInt(pos.get(1).getValue());
|
||||||
int z = (int) Math.round(pos.get(2).getValue());
|
int z = MathMan.roundInt(pos.get(2).getValue());
|
||||||
UUID uuid = new UUID(most, least);
|
UUID uuid = new UUID(most, least);
|
||||||
fwee.getQueue().removeEntity(x, y, z, uuid);
|
fwee.getQueue().removeEntity(x, y, z, uuid);
|
||||||
} else {
|
} else {
|
||||||
|
@ -101,9 +102,9 @@ public class MutableEntityChange implements Change {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DoubleTag> pos = (List<DoubleTag>) posTag.getValue();
|
List<DoubleTag> pos = (List<DoubleTag>) posTag.getValue();
|
||||||
int x = (int) Math.round(pos.get(0).getValue());
|
int x = MathMan.roundInt(pos.get(0).getValue());
|
||||||
int y = (int) Math.round(pos.get(1).getValue());
|
int y = MathMan.roundInt(pos.get(1).getValue());
|
||||||
int z = (int) Math.round(pos.get(2).getValue());
|
int z = MathMan.roundInt(pos.get(2).getValue());
|
||||||
queue.setEntity(x, y, z, tag);
|
queue.setEntity(x, y, z, tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package com.sk89q.worldedit;
|
package com.sk89q.worldedit;
|
||||||
|
|
||||||
|
import com.boydti.fawe.util.MathMan;
|
||||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -102,7 +103,7 @@ public class Vector2D implements Serializable {
|
||||||
* @return the x coordinate
|
* @return the x coordinate
|
||||||
*/
|
*/
|
||||||
public int getBlockX() {
|
public int getBlockX() {
|
||||||
return (int) Math.round(getX());
|
return MathMan.roundInt(getX());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +141,7 @@ public class Vector2D implements Serializable {
|
||||||
* @return the z coordinate
|
* @return the z coordinate
|
||||||
*/
|
*/
|
||||||
public int getBlockZ() {
|
public int getBlockZ() {
|
||||||
return (int) Math.round(getZ());
|
return MathMan.roundInt(getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -181,9 +181,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -356,9 +356,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -189,9 +189,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -432,9 +432,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -189,9 +189,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -558,9 +558,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -176,9 +176,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -438,9 +438,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -99,9 +99,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -300,9 +300,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -180,9 +180,9 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (y < 0 || y > 255) continue;
|
if (y < 0 || y > 255) continue;
|
||||||
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
if (array[FaweCache.CACHE_J[y][z][x]] != 0) {
|
||||||
nmsWorld.removeEntity(entity);
|
nmsWorld.removeEntity(entity);
|
||||||
|
|
|
@ -354,9 +354,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -192,9 +192,9 @@ public class SpongeChunk_1_12 extends CharFaweChunk<Chunk, SpongeQueue_1_12> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,9 +448,9 @@ public class SpongeQueue_1_12 extends NMSMappedFaweQueue<World, net.minecraft.wo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
|
@ -192,9 +192,9 @@ public class SpongeChunk_1_11 extends CharFaweChunk<Chunk, SpongeQueue_1_11> {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(entity.posX) & 15);
|
int x = (MathMan.roundInt(entity.posX) & 15);
|
||||||
int z = ((int) Math.round(entity.posZ) & 15);
|
int z = (MathMan.roundInt(entity.posZ) & 15);
|
||||||
int y = (int) Math.round(entity.posY);
|
int y = MathMan.roundInt(entity.posY);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -445,9 +445,9 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue<World, net.minecraft.wo
|
||||||
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
if (ent instanceof EntityPlayer || (!createdEntities.isEmpty() && createdEntities.contains(ent.getUniqueID()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int x = ((int) Math.round(ent.posX) & 15);
|
int x = (MathMan.roundInt(ent.posX) & 15);
|
||||||
int z = ((int) Math.round(ent.posZ) & 15);
|
int z = (MathMan.roundInt(ent.posZ) & 15);
|
||||||
int y = (int) Math.round(ent.posY);
|
int y = MathMan.roundInt(ent.posY);
|
||||||
int i = FaweCache.CACHE_I[y][z][x];
|
int i = FaweCache.CACHE_I[y][z][x];
|
||||||
char[] array = fs.getIdArray(i);
|
char[] array = fs.getIdArray(i);
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
|
|
Loading…
Reference in New Issue