parent
47a7ca7e09
commit
b9f82195b4
2 changed files with 22 additions and 15 deletions
|
@ -8,15 +8,17 @@ 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 -> 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 -> {
|
||||
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 RegistryKey<World> pocketDim;
|
||||
public int pocketId;
|
||||
|
@ -26,6 +28,9 @@ public class PocketEntrancePointer extends RegistryVertex { // TODO: PocketRiftP
|
|||
this.pocketId = pocketId;
|
||||
}
|
||||
|
||||
public PocketEntrancePointer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistryVertexType<? extends RegistryVertex> getType() {
|
||||
return RegistryVertexType.ENTRANCE;
|
||||
|
|
|
@ -12,12 +12,14 @@ 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 -> 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 -> {
|
||||
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);
|
||||
});
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
public Location location;
|
||||
|
|
Loading…
Reference in a new issue