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));
}
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);
}
}
}
}
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());
}
}
}
}
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());
}
});
}
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)));
}
Aggregations