More teleport fixes
This commit is contained in:
parent
5e2e6a1e2d
commit
47a7ca7e09
2 changed files with 15 additions and 22 deletions
|
@ -8,17 +8,15 @@ import net.minecraft.util.registry.RegistryKey;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
public class PocketEntrancePointer extends RegistryVertex { // TODO: PocketRiftPointer superclass?
|
||||
public static final Codec<PocketEntrancePointer> CODEC = RecordCodecBuilder.create(instance -> {
|
||||
return instance.group(
|
||||
DynamicSerializableUuid.CODEC.fieldOf("id").forGetter(a -> a.id),
|
||||
World.CODEC.fieldOf("pocketDim").forGetter(a -> a.pocketDim),
|
||||
Codec.INT.fieldOf("pocketId").forGetter(a -> a.pocketId)
|
||||
).apply(instance, (id, pocketDim, pocketId) -> {
|
||||
PocketEntrancePointer pointer = new PocketEntrancePointer(pocketDim, pocketId);
|
||||
pointer.id = id;
|
||||
return pointer;
|
||||
});
|
||||
});
|
||||
public static final Codec<PocketEntrancePointer> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||
DynamicSerializableUuid.CODEC.fieldOf("id").forGetter(a -> a.id),
|
||||
World.CODEC.fieldOf("pocketDim").forGetter(a -> a.pocketDim),
|
||||
Codec.INT.fieldOf("pocketId").forGetter(a -> a.pocketId)
|
||||
).apply(instance, (id, pocketDim, pocketId) -> {
|
||||
PocketEntrancePointer pointer = new PocketEntrancePointer(pocketDim, pocketId);
|
||||
pointer.id = id;
|
||||
return pointer;
|
||||
}));
|
||||
|
||||
public RegistryKey<World> pocketDim;
|
||||
public int pocketId;
|
||||
|
@ -28,9 +26,6 @@ public class PocketEntrancePointer extends RegistryVertex { // TODO: PocketRiftP
|
|||
this.pocketId = pocketId;
|
||||
}
|
||||
|
||||
public PocketEntrancePointer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistryVertexType<? extends RegistryVertex> getType() {
|
||||
return RegistryVertexType.ENTRANCE;
|
||||
|
|
|
@ -12,14 +12,12 @@ import org.dimdev.dimdoors.util.Location;
|
|||
import net.minecraft.util.dynamic.DynamicSerializableUuid;
|
||||
|
||||
public class Rift extends RegistryVertex {
|
||||
public static final Codec<Rift> CODEC = RecordCodecBuilder.create(instance -> {
|
||||
return instance.group(
|
||||
DynamicSerializableUuid.CODEC.fieldOf("id").forGetter(a -> a.id),
|
||||
Location.CODEC.fieldOf("location").forGetter(a -> a.location),
|
||||
Codec.BOOL.fieldOf("isDetached").forGetter(a -> a.isDetached),
|
||||
LinkProperties.CODEC.fieldOf("properties").forGetter(a -> a.properties)
|
||||
).apply(instance, Rift::new);
|
||||
});
|
||||
public static final Codec<Rift> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||
DynamicSerializableUuid.CODEC.fieldOf("id").forGetter(a -> a.id),
|
||||
Location.CODEC.fieldOf("location").forGetter(a -> a.location),
|
||||
Codec.BOOL.fieldOf("isDetached").forGetter(a -> a.isDetached),
|
||||
LinkProperties.CODEC.fieldOf("properties").forGetter(a -> a.properties)
|
||||
).apply(instance, Rift::new));
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
public Location location;
|
||||
|
|
Loading…
Reference in a new issue