3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-24 18:10:08 +01:00

Made everything that uses canPassThrough use data values.

Dieser Commit ist enthalten in:
TomyLobo 2013-06-23 21:04:23 +02:00
Ursprung b612de3429
Commit 921c354db7
3 geänderte Dateien mit 15 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -620,7 +620,8 @@ public class EditSession {
for (int y = maxY; y >= minY; --y) {
Vector pt = new Vector(x, y, z);
int id = getBlockType(pt);
if (naturalOnly ? BlockType.isNaturalTerrainBlock(id) : !BlockType.canPassThrough(id)) {
int data = getBlockData(pt);
if (naturalOnly ? BlockType.isNaturalTerrainBlock(id, data) : !BlockType.canPassThrough(id, data)) {
return y;
}
}
@ -2480,6 +2481,7 @@ public class EditSession {
loop: for (int y = world.getMaxY(); y >= 1; --y) {
final Vector pt = new Vector(x, y, z);
final int id = getBlockType(pt);
final int data = getBlockData(pt);
switch (id) {
case BlockID.DIRT:
@ -2497,7 +2499,7 @@ public class EditSession {
default:
// ...and all non-passable blocks
if (!BlockType.canPassThrough(id)) {
if (!BlockType.canPassThrough(id, data)) {
break loop;
}
}
@ -2971,7 +2973,7 @@ public class EditSession {
while (!queue.isEmpty()) {
final BlockVector current = queue.removeFirst();
if (!BlockType.canPassThrough(getBlockType(current))) {
if (!BlockType.canPassThrough(getBlockType(current), getBlockData(current))) {
continue;
}

Datei anzeigen

@ -22,6 +22,7 @@ package com.sk89q.worldedit;
import java.io.File;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.blocks.ItemID;
@ -79,7 +80,7 @@ public abstract class LocalPlayer {
byte free = 0;
while (y <= world.getMaxY() + 2) {
if (BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
++free;
} else {
free = 0;
@ -114,8 +115,8 @@ public abstract class LocalPlayer {
while (y >= 0) {
final Vector pos = new Vector(x, y, z);
final int id = world.getBlockType(pos);
if (!BlockType.canPassThrough(id)) {
final int data = world.getBlockData(pos);
final int data = world.getBlockData(pos);
if (!BlockType.canPassThrough(id, data)) {
setPosition(new Vector(x + 0.5, y + BlockType.centralTopLimit(id, data), z + 0.5));
return;
}
@ -150,7 +151,7 @@ public abstract class LocalPlayer {
byte spots = 0;
while (y <= world.getMaxY() + 2) {
if (BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
++free;
} else {
free = 0;
@ -192,7 +193,7 @@ public abstract class LocalPlayer {
byte free = 0;
while (y >= 1) {
if (BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
++free;
} else {
free = 0;
@ -245,7 +246,7 @@ public abstract class LocalPlayer {
while (y <= world.getMaxY()) {
// Found a ceiling!
if (!BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
int platformY = Math.max(initialY, y - 3 - clearance);
world.setBlockType(new Vector(x, platformY, z), BlockID.GLASS);
setPosition(new Vector(x + 0.5, platformY + 1, z + 0.5));
@ -274,7 +275,7 @@ public abstract class LocalPlayer {
LocalWorld world = getPosition().getWorld();
while (y <= world.getMaxY() + 2) {
if (!BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
break; // Hit something
} else if (y > maxY + 1) {
break;
@ -488,7 +489,7 @@ public abstract class LocalPlayer {
boolean inFree = false;
while ((block = hitBlox.getNextBlock()) != null) {
boolean free = BlockType.canPassThrough(world.getBlockType(block));
boolean free = BlockType.canPassThrough(world.getBlock(block));
if (firstBlock) {
firstBlock = false;

Datei anzeigen

@ -145,7 +145,7 @@ public class TargetBlock {
* @return Block
*/
public BlockWorldVector getSolidTargetBlock() {
while (getNextBlock() != null && BlockType.canPassThrough(world.getBlockType(getCurrentBlock()))) ;
while (getNextBlock() != null && BlockType.canPassThrough(world.getBlock(getCurrentBlock()))) ;
return getCurrentBlock();
}