SteamWar/BauSystem
Archiviert
13
0
Dieser Commit ist enthalten in:
jojo 2021-02-16 11:47:13 +01:00
Ursprung 2635f98afc
Commit 67b40433d8
3 geänderte Dateien mit 106 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,42 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.world;
import org.bukkit.Material;
public class TNTSimulator_12 {
public static Material active() {
return Material.CONCRETE;
}
public static Material notActive() {
return Material.CONCRETE;
}
public static Material repeater() {
return Material.DIODE;
}
public static Material comparator() {
return Material.REDSTONE_COMPARATOR;
}
}

Datei anzeigen

@ -0,0 +1,43 @@
/*
*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.world;
import org.bukkit.Material;
public class TNTSimulator_15 {
public static Material active() {
return Material.LIME_CONCRETE;
}
public static Material notActive() {
return Material.RED_CONCRETE;
}
public static Material repeater() {
return Material.REPEATER;
}
public static Material comparator() {
return Material.COMPARATOR;
}
}

Datei anzeigen

@ -22,6 +22,7 @@
package de.steamwar.bausystem.world; package de.steamwar.bausystem.world;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.core.VersionedCallable;
import de.steamwar.inventory.SWAnvilInv; import de.steamwar.inventory.SWAnvilInv;
import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWInventory;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
@ -189,21 +190,21 @@ public class TNTSimulator {
})); }));
// Repeater before Comparator // Repeater before Comparator
swInventory.setItem(4, new SWItem(tntSpawn.isComparator() ? Material.COMPARATOR : Material.REPEATER, "§7Gezündet durch §8- §e" + (tntSpawn.isComparator() ? "Comparator" : "Repeater"), clickType -> { swInventory.setItem(4, new SWItem(comparatorOrNot(tntSpawn.isComparator()), "§7Gezündet durch §8- §e" + (tntSpawn.isComparator() ? "Comparator" : "Repeater"), clickType -> {
tntSpawn.setComparator(!tntSpawn.isComparator()); tntSpawn.setComparator(!tntSpawn.isComparator());
editTNT(player, tntSpawn); editTNT(player, tntSpawn);
})); }));
// Velocity Settings // Velocity Settings
swInventory.setItem(13, new SWItem(tntSpawn.isxVelocity() ? Material.LIME_CONCRETE : Material.RED_CONCRETE, "§7TNT §eSprung X §8- " + active(tntSpawn.isxVelocity()), clickType -> { swInventory.setItem(13, new SWItem(activeOrNot(tntSpawn.isxVelocity()), "§7TNT §eSprung X §8- " + active(tntSpawn.isxVelocity()), clickType -> {
tntSpawn.setxVelocity(!tntSpawn.isxVelocity()); tntSpawn.setxVelocity(!tntSpawn.isxVelocity());
editTNT(player, tntSpawn); editTNT(player, tntSpawn);
})); }));
swInventory.setItem(22, new SWItem(tntSpawn.isyVelocity() ? Material.LIME_CONCRETE : Material.RED_CONCRETE, "§7TNT §eSprung Y §8- " + active(tntSpawn.isyVelocity()), clickType -> { swInventory.setItem(22, new SWItem(activeOrNot(tntSpawn.isyVelocity()), "§7TNT §eSprung Y §8- " + active(tntSpawn.isyVelocity()), clickType -> {
tntSpawn.setyVelocity(!tntSpawn.isyVelocity()); tntSpawn.setyVelocity(!tntSpawn.isyVelocity());
editTNT(player, tntSpawn); editTNT(player, tntSpawn);
})); }));
swInventory.setItem(31, new SWItem(tntSpawn.iszVelocity() ? Material.LIME_CONCRETE : Material.RED_CONCRETE, "§7TNT §eSprung Z §8- " + active(tntSpawn.iszVelocity()), clickType -> { swInventory.setItem(31, new SWItem(activeOrNot(tntSpawn.iszVelocity()), "§7TNT §eSprung Z §8- " + active(tntSpawn.iszVelocity()), clickType -> {
tntSpawn.setzVelocity(!tntSpawn.iszVelocity()); tntSpawn.setzVelocity(!tntSpawn.iszVelocity());
editTNT(player, tntSpawn); editTNT(player, tntSpawn);
})); }));
@ -268,6 +269,22 @@ public class TNTSimulator {
tntSimulator.TNT_SPAWNS.add(tntSpawn); tntSimulator.TNT_SPAWNS.add(tntSpawn);
} }
private static Material comparatorOrNot(boolean b) {
if (b) {
return VersionedCallable.call(new VersionedCallable<>(TNTSimulator_12::comparator, 8), new VersionedCallable<>(TNTSimulator_15::comparator, 14));
} else {
return VersionedCallable.call(new VersionedCallable<>(TNTSimulator_12::repeater, 8), new VersionedCallable<>(TNTSimulator_15::repeater, 14));
}
}
private static Material activeOrNot(boolean b) {
if (b) {
return VersionedCallable.call(new VersionedCallable<>(TNTSimulator_12::active, 8), new VersionedCallable<>(TNTSimulator_15::active, 14));
} else {
return VersionedCallable.call(new VersionedCallable<>(TNTSimulator_12::notActive, 8), new VersionedCallable<>(TNTSimulator_15::notActive, 14));
}
}
private static String active(boolean b) { private static String active(boolean b) {
return b ? "§aan" : "§caus"; return b ? "§aan" : "§caus";
} }