Search in sources :

Example 1 with ZoneBoundingBox

use of com.skelril.skree.service.internal.zone.ZoneBoundingBox in project Skree by Skelril.

the class CursedMineInstance method setUp.

private void setUp() {
    Vector3i offset = getRegion().getMinimumPoint();
    entryPoint = new Location<>(getRegion().getExtent(), offset.getX() + 71.5, offset.getY() + 59, offset.getZ() + 86.5);
    floodGate = new ZoneBoundingBox(offset.add(66, 40, 131), new Vector3i(13, 1, 9));
}
Also used : Vector3i(com.flowpowered.math.vector.Vector3i) ZoneBoundingBox(com.skelril.skree.service.internal.zone.ZoneBoundingBox)

Example 2 with ZoneBoundingBox

use of com.skelril.skree.service.internal.zone.ZoneBoundingBox in project Skree by Skelril.

the class ZonePool method load.

public void load() throws IOException, IllegalStateException {
    globalBoxList.clear();
    cacheRegions.clear();
    regionQueue.clear();
    Gson gson = new GsonBuilder().create();
    JsonParser parser = new JsonParser();
    try (BufferedReader reader = Files.newBufferedReader(getCacheFile())) {
        JsonObject object = parser.parse(reader).getAsJsonObject();
        for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
            String manager = entry.getKey();
            JsonArray elements = entry.getValue().getAsJsonArray();
            for (JsonElement element : elements) {
                ZoneBoundingBox boundingBox = gson.fromJson(element, ZoneBoundingBox.class);
                noSaveClaimNew(manager, boundingBox);
                freeToPool(manager, boundingBox);
            }
        }
    }
}
Also used : BufferedReader(java.io.BufferedReader) ZoneBoundingBox(com.skelril.skree.service.internal.zone.ZoneBoundingBox)

Example 3 with ZoneBoundingBox

use of com.skelril.skree.service.internal.zone.ZoneBoundingBox in project Skree by Skelril.

the class FreakyFourInstance method dabombDetonate.

public void dabombDetonate(double percentEffectiveness) {
    ZoneBoundingBox dabomb_RG = getRegion(FreakyFourBoss.DA_BOMB);
    Vector3i min = dabomb_RG.getMinimumPoint();
    Vector3i max = dabomb_RG.getMaximumPoint();
    int minX = min.getX();
    int minY = min.getY();
    int minZ = min.getZ();
    int maxX = max.getX();
    int maxZ = max.getZ();
    int dmgFact = (int) Math.max(3, percentEffectiveness * config.daBombTNTStrength);
    for (int x = minX; x < maxX; ++x) {
        for (int z = minZ; z < maxZ; ++z) {
            if (Probability.getChance(config.daBombTNT)) {
                getRegion().getExtent().triggerExplosion(Explosion.builder().location(new Location<>(getRegion().getExtent(), new Vector3d(x, minY, z))).radius(dmgFact).canCauseFire(false).shouldDamageEntities(true).build(), Cause.source(SkreePlugin.container()).build());
            }
        }
    }
}
Also used : Vector3d(com.flowpowered.math.vector.Vector3d) Vector3i(com.flowpowered.math.vector.Vector3i) ZoneBoundingBox(com.skelril.skree.service.internal.zone.ZoneBoundingBox) Location(org.spongepowered.api.world.Location)

Example 4 with ZoneBoundingBox

use of com.skelril.skree.service.internal.zone.ZoneBoundingBox in project Skree by Skelril.

the class FreakyFourInstance method prepareFrimus.

private void prepareFrimus() {
    ZoneBoundingBox frimus_RG = regions.get(FreakyFourBoss.FRIMUS);
    frimus_RG.forAll(pt -> {
        BlockType originalType = getRegion().getExtent().getBlockType(pt);
        if (originalType == BlockTypes.FIRE || originalType == BlockTypes.FLOWING_LAVA || originalType == BlockTypes.LAVA) {
            getRegion().getExtent().setBlockType(pt, BlockTypes.AIR, Cause.source(SkreePlugin.container()).build());
        }
    });
}
Also used : BlockType(org.spongepowered.api.block.BlockType) ZoneBoundingBox(com.skelril.skree.service.internal.zone.ZoneBoundingBox)

Example 5 with ZoneBoundingBox

use of com.skelril.skree.service.internal.zone.ZoneBoundingBox in project Skree by Skelril.

the class FreakyFourInstance method setUp.

private void setUp() {
    Vector3i offset = region.getMinimumPoint();
    regions.put(FreakyFourBoss.CHARLOTTE, new ZoneBoundingBox(offset.add(72, 7, 1), new Vector3i(22, 5, 41)));
    regions.put(FreakyFourBoss.FRIMUS, new ZoneBoundingBox(offset.add(48, 7, 1), new Vector3i(22, 5, 41)));
    regions.put(FreakyFourBoss.DA_BOMB, new ZoneBoundingBox(offset.add(24, 7, 1), new Vector3i(22, 5, 41)));
    regions.put(FreakyFourBoss.SNIPEE, new ZoneBoundingBox(offset.add(1, 7, 1), new Vector3i(21, 5, 41)));
}
Also used : Vector3i(com.flowpowered.math.vector.Vector3i) ZoneBoundingBox(com.skelril.skree.service.internal.zone.ZoneBoundingBox)

Aggregations

ZoneBoundingBox (com.skelril.skree.service.internal.zone.ZoneBoundingBox)7 Vector3i (com.flowpowered.math.vector.Vector3i)4 Vector3d (com.flowpowered.math.vector.Vector3d)1 BufferedReader (java.io.BufferedReader)1 BlockType (org.spongepowered.api.block.BlockType)1 Entity (org.spongepowered.api.entity.Entity)1 Living (org.spongepowered.api.entity.living.Living)1 Monster (org.spongepowered.api.entity.living.monster.Monster)1 Location (org.spongepowered.api.world.Location)1