|
|
|
protected Optional<PointOfOrigin> getPointOfOrigin(AbstractStargateEntity stargate, Variant stargateVariant) |
|
{ |
|
ClientPacketListener clientPacketListener = minecraft.getConnection(); |
|
RegistryAccess registries = clientPacketListener.registryAccess(); |
|
Registry<PointOfOrigin> pointOfOriginRegistry = registries.registryOrThrow(PointOfOrigin.REGISTRY_KEY); |
|
|
|
if(stargateVariant.symbols().permanentPointOfOrigin().isPresent()) |
|
return Optional.ofNullable(pointOfOriginRegistry.get(stargateVariant.symbols().permanentPointOfOrigin().get())); |
|
else |
|
{ |
|
String pointOfOrigin = stargate.getPointOfOrigin(); |
|
|
|
if(isLocationValid(pointOfOrigin)) |
|
return Optional.ofNullable(pointOfOriginRegistry.get(new ResourceLocation(pointOfOrigin))); |
|
} |
|
|
|
return Optional.empty(); |
|
} |
|
|
|
protected ResourceLocation getPointOfOriginTexture(Optional<PointOfOrigin> pointOfOrigin) |
|
{ |
|
if(pointOfOrigin.isPresent()) |
|
return pointOfOrigin.get().texture(); |
|
|
|
return EMPTY_LOCATION; |
|
} |
|
|
|
protected Optional<Symbols> getSymbols(AbstractStargateEntity stargate, Variant stargateVariant) |
|
{ |
|
ClientPacketListener clientPacketListener = minecraft.getConnection(); |
|
RegistryAccess registries = clientPacketListener.registryAccess(); |
|
Registry<Symbols> symbolRegistry = registries.registryOrThrow(Symbols.REGISTRY_KEY); |
|
|
|
if(stargateVariant.symbols().permanentPointOfOrigin().isPresent()) |
|
return Optional.ofNullable(symbolRegistry.get(stargateVariant.symbols().permanentSymbols().get())); |
|
else |
|
{ |
|
String symbols = stargate.getSymbols(); |
|
|
|
if(isLocationValid(symbols)) |
|
return Optional.ofNullable(symbolRegistry.get(new ResourceLocation(symbols))); |
|
} |
|
|
|
return Optional.empty(); |
|
} |
|
|
Specifically L84