Search in sources :

Example 1 with FlareColor

use of hellfirepvp.astralsorcery.common.base.patreon.FlareColor in project AstralSorcery by HellFirePvP.

the class ProviderBlockRing method buildEffect.

@Override
public TypeBlockRing buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
    UUID effectUniqueId = UUID.fromString(effectParameters.get(0));
    FlareColor fc = null;
    if (!"null".equals(effectParameters.get(1))) {
        fc = FlareColor.valueOf(effectParameters.get(1));
    }
    float distance = Float.parseFloat(effectParameters.get(2));
    float rotationAngle = Float.parseFloat(effectParameters.get(3));
    int repeats = Integer.parseInt(effectParameters.get(4));
    int tickRotationSpeed = Integer.parseInt(effectParameters.get(5));
    JsonArray jo = (JsonArray) PARSER.parse(effectParameters.get(6));
    HashMap<BlockPos, BlockState> pattern = new HashMap<>();
    for (JsonElement patternElement : jo) {
        JsonObject obj = (JsonObject) patternElement;
        BlockPos pos = new BlockPos(obj.getAsJsonPrimitive("posX").getAsInt(), obj.getAsJsonPrimitive("posY").getAsInt(), obj.getAsJsonPrimitive("posZ").getAsInt());
        Block b = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(obj.getAsJsonPrimitive("block").getAsString()));
        pattern.put(pos, b.getDefaultState());
    }
    return new TypeBlockRing(effectUniqueId, fc, playerUUID, distance, rotationAngle, repeats, tickRotationSpeed, pattern);
}
Also used : HashMap(java.util.HashMap) JsonObject(com.google.gson.JsonObject) TypeBlockRing(hellfirepvp.astralsorcery.common.base.patreon.types.TypeBlockRing) JsonArray(com.google.gson.JsonArray) BlockState(net.minecraft.block.BlockState) JsonElement(com.google.gson.JsonElement) ResourceLocation(net.minecraft.util.ResourceLocation) Block(net.minecraft.block.Block) BlockPos(net.minecraft.util.math.BlockPos) UUID(java.util.UUID) FlareColor(hellfirepvp.astralsorcery.common.base.patreon.FlareColor)

Example 2 with FlareColor

use of hellfirepvp.astralsorcery.common.base.patreon.FlareColor in project AstralSorcery by HellFirePvP.

the class ProviderCelestialWings method buildEffect.

@Override
public TypeCelestialWings buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
    UUID effectUUID = UUID.fromString(effectParameters.get(0));
    FlareColor fc = null;
    if (!"null".equals(effectParameters.get(1))) {
        fc = FlareColor.valueOf(effectParameters.get(1));
    }
    return new TypeCelestialWings(effectUUID, fc, playerUUID);
}
Also used : TypeCelestialWings(hellfirepvp.astralsorcery.common.base.patreon.types.TypeCelestialWings) UUID(java.util.UUID) FlareColor(hellfirepvp.astralsorcery.common.base.patreon.FlareColor)

Example 3 with FlareColor

use of hellfirepvp.astralsorcery.common.base.patreon.FlareColor in project AstralSorcery by HellFirePvP.

the class ProviderFlare method buildEffect.

@Override
public PatreonEffect buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
    UUID effectUUID = UUID.fromString(effectParameters.get(0));
    FlareColor fc = null;
    if (!"null".equals(effectParameters.get(1))) {
        fc = FlareColor.valueOf(effectParameters.get(1));
    }
    return new PatreonEffect(effectUUID, fc);
}
Also used : PatreonEffect(hellfirepvp.astralsorcery.common.base.patreon.PatreonEffect) UUID(java.util.UUID) FlareColor(hellfirepvp.astralsorcery.common.base.patreon.FlareColor)

Example 4 with FlareColor

use of hellfirepvp.astralsorcery.common.base.patreon.FlareColor in project AstralSorcery by HellFirePvP.

the class ProviderNebulaCloud method buildEffect.

@Override
public TypeNebulaCloud buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
    UUID effectUUID = UUID.fromString(effectParameters.get(0));
    FlareColor fc = null;
    if (!"null".equals(effectParameters.get(1))) {
        fc = FlareColor.valueOf(effectParameters.get(1));
    }
    return new TypeNebulaCloud(effectUUID, fc, playerUUID);
}
Also used : TypeNebulaCloud(hellfirepvp.astralsorcery.common.base.patreon.types.TypeNebulaCloud) UUID(java.util.UUID) FlareColor(hellfirepvp.astralsorcery.common.base.patreon.FlareColor)

Example 5 with FlareColor

use of hellfirepvp.astralsorcery.common.base.patreon.FlareColor in project AstralSorcery by HellFirePvP.

the class ProviderStarHalo method buildEffect.

@Override
public TypeStarHalo buildEffect(UUID playerUUID, List<String> effectParameters) throws Exception {
    UUID effectUUID = UUID.fromString(effectParameters.get(0));
    FlareColor fc = null;
    if (!"null".equals(effectParameters.get(1))) {
        fc = FlareColor.valueOf(effectParameters.get(1));
    }
    return new TypeStarHalo(effectUUID, fc, playerUUID);
}
Also used : UUID(java.util.UUID) FlareColor(hellfirepvp.astralsorcery.common.base.patreon.FlareColor) TypeStarHalo(hellfirepvp.astralsorcery.common.base.patreon.types.TypeStarHalo)

Aggregations

FlareColor (hellfirepvp.astralsorcery.common.base.patreon.FlareColor)11 UUID (java.util.UUID)11 ResourceLocation (net.minecraft.util.ResourceLocation)2 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 TextureQuery (hellfirepvp.astralsorcery.client.resource.query.TextureQuery)1 PatreonEffect (hellfirepvp.astralsorcery.common.base.patreon.PatreonEffect)1 TypeBlockRing (hellfirepvp.astralsorcery.common.base.patreon.types.TypeBlockRing)1 TypeCelestialWings (hellfirepvp.astralsorcery.common.base.patreon.types.TypeCelestialWings)1 TypeCrystalFootprints (hellfirepvp.astralsorcery.common.base.patreon.types.TypeCrystalFootprints)1 TypeFlareCrystal (hellfirepvp.astralsorcery.common.base.patreon.types.TypeFlareCrystal)1 TypeHelmetRender (hellfirepvp.astralsorcery.common.base.patreon.types.TypeHelmetRender)1 TypeNebulaCloud (hellfirepvp.astralsorcery.common.base.patreon.types.TypeNebulaCloud)1 TypeStarHalo (hellfirepvp.astralsorcery.common.base.patreon.types.TypeStarHalo)1 TypeStarryPlayerLayer (hellfirepvp.astralsorcery.common.base.patreon.types.TypeStarryPlayerLayer)1 TypeTreeBeaconColor (hellfirepvp.astralsorcery.common.base.patreon.types.TypeTreeBeaconColor)1 TypeWraithWings (hellfirepvp.astralsorcery.common.base.patreon.types.TypeWraithWings)1 HashMap (java.util.HashMap)1 Block (net.minecraft.block.Block)1