Various work on getting Doors working.

This commit is contained in:
Waterpicker 2020-05-09 02:50:29 -05:00
parent 25ebb8b0e6
commit 5846493b55
7 changed files with 16 additions and 2 deletions

View file

@ -212,7 +212,12 @@ public class PocketTemplate {
if (tile instanceof RiftBlockEntity) {
LOGGER.debug("Rift found in schematic at " + pos);
RiftBlockEntity rift = (RiftBlockEntity) tile;
rift.getDestination().setLocation(new Location((ServerWorld) rift.getWorld(), rift.getPos()));
rift
.getDestination()
.setLocation(
new Location(
(ServerWorld) rift.getWorld(),
rift.getPos()));
rifts.add(rift);
} else if (tile instanceof Inventory) {
Inventory inventory = (Inventory) tile;

View file

@ -18,6 +18,8 @@ import java.util.UUID;
public class EscapeTarget extends VirtualTarget implements EntityTarget { // TODO: createRift option
protected boolean canEscapeLimbo = false;
public EscapeTarget() {}
public EscapeTarget(boolean canEscapeLimbo) {
this.canEscapeLimbo = canEscapeLimbo;
}

View file

@ -8,6 +8,8 @@ import org.dimdev.annotatednbt.AnnotatedNbt;
public class GlobalReference extends RiftReference {
@Saved protected Location target;
public GlobalReference() {};
public GlobalReference(Location target) {
this.target = target;
}

View file

@ -9,6 +9,8 @@ import org.dimdev.annotatednbt.AnnotatedNbt;
public class LocalReference extends RiftReference {
@Saved protected BlockPos target;
public LocalReference() {}
public LocalReference(BlockPos target) {
this.target = target;
}

View file

@ -7,6 +7,8 @@ public abstract class RestoringTarget extends VirtualTarget {
private VirtualTarget wrappedDestination;
public RestoringTarget() {};
@Override
public void fromTag(CompoundTag nbt) {
super.fromTag(nbt);

View file

@ -16,6 +16,7 @@ import java.util.Set;
* (see shouldInvalidate)
*/
public abstract class RiftReference extends VirtualTarget {
public RiftReference() {}
// Helper methods to create a certain type of reference, defaulting to
// a global destination if not possible

View file

@ -21,7 +21,7 @@ public final class Pocket {
public Pocket(int id, ServerWorld world, int x, int z) {
this.id = id;
this.world = world;
new BlockBox(x * 16, 0, z * 16, (x + 1) * 16, 0, (z + 1) * 16);
box = new BlockBox(x * 16, 0, z * 16, (x + 1) * 16, 0, (z + 1) * 16);
}
boolean isInBounds(BlockPos pos) {