Stargate Journey

Stargate Journey

5M Downloads

Checking for PoO not, the Permanent Symbol set

cookta2012 opened this issue ยท 2 comments

commented

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

commented

if(stargateVariant.symbols().permanentPointOfOrigin().isPresent())
return Optional.ofNullable(symbolRegistry.get(stargateVariant.symbols().permanentSymbols().get()));

should be

if(stargateVariant.symbols().permanentSymbols.isPresent())
return Optional.ofNullable(symbolRegistry.get(stargateVariant.symbols().permanentSymbols().get()));

commented

Fixed