SteamWar/FightSystem
Archiviert
13
1

Update HellsBells

Dieser Commit ist enthalten in:
yoyosource 2021-05-23 17:07:43 +02:00
Ursprung e181c42b12
Commit 886fbbe535

Datei anzeigen

@ -132,28 +132,14 @@ public class HellsBells {
int zOffset = getLengthStart(direction.getLength(zLength, xLength), direction.getLength(width, length.get()));
int yOffset = getHeightStart();
Point redStart;
Point blueStart;
if (direction.isNorthOrWest()) {
redStart = new Point(Config.RedPasteRegion.getMaxX() - xOffset, Config.RedExtendRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMaxZ() - zOffset);
blueStart = new Point(Config.BluePasteRegion.getMinX() + xOffset, Config.BlueExtendRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMinZ() + zOffset);
} else {
redStart = new Point(Config.RedPasteRegion.getMinX() + xOffset, Config.RedExtendRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMinZ() + zOffset);
blueStart = new Point(Config.BluePasteRegion.getMaxX() - xOffset, Config.BlueExtendRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMaxZ() - zOffset);
}
Point redStart = direction.isNorthOrWest() ? new Point(Config.RedPasteRegion.getMaxX() - xOffset, Config.RedExtendRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMaxZ() - zOffset) : new Point(Config.RedPasteRegion.getMinX() + xOffset, Config.RedExtendRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMinZ() + zOffset);
Point blueStart = direction.isNorthOrWest() ? new Point(Config.BluePasteRegion.getMinX() + xOffset, Config.BlueExtendRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMinZ() + zOffset) : new Point(Config.BluePasteRegion.getMaxX() - xOffset, Config.BlueExtendRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMaxZ() - zOffset);
currentDropping = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), () -> {
int factor = direction.isNorthOrWest() ? 1 : -1;
for (int w = 0; w < width; w++) {
if (direction.isNorthOrWest()) {
world.spawnEntity(redStart.subtractAndToLocation(world, direction.dx * length.get() + w * direction.other().dx, 0, direction.dz * length.get() + w * direction.other().dz), EntityType.PRIMED_TNT);
world.spawnEntity(blueStart.addAndToLocation(world, direction.dx * length.get() + w * direction.other().dx, 0, direction.dz * length.get() + w * direction.other().dz), EntityType.PRIMED_TNT);
} else {
world.spawnEntity(redStart.addAndToLocation(world, direction.dx * length.get() + w * direction.other().dx, 0, direction.dz * length.get() + w * direction.other().dz), EntityType.PRIMED_TNT);
world.spawnEntity(blueStart.subtractAndToLocation(world, direction.dx * length.get() + w * direction.other().dx, 0, direction.dz * length.get() + w * direction.other().dz), EntityType.PRIMED_TNT);
}
world.spawnEntity(redStart.subtractAndToLocation(world, (direction.dx * length.get() + w * direction.other().dx) * factor, 0, (direction.dz * length.get() + w * direction.other().dz) * factor), EntityType.PRIMED_TNT);
world.spawnEntity(blueStart.addAndToLocation(world, (direction.dx * length.get() + w * direction.other().dx) * factor, 0, (direction.dz * length.get() + w * direction.other().dz) * factor), EntityType.PRIMED_TNT);
}
if (length.addAndGet(-2) <= 0) {
currentDropping.cancel();