Bug fixes
This commit is contained in:
parent
0d337e7b7f
commit
6f3a12ae17
@ -12,7 +12,7 @@ public class Plugin extends JavaPlugin {
|
|||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
String botToken = getConfig().getString("telegram.bot-token");
|
String botToken = getConfig().getString("telegram.bot-token");
|
||||||
long chatId = getConfig().getLong("telegram.chat-id");
|
long chatId = getConfig().getLong("telegram.chat-id");
|
||||||
getLogger().info("Bombezhka mod has been baked by @zelenichai ");
|
getLogger().info("has been baked by @zelenichai ");
|
||||||
|
|
||||||
TelegramMessageListener telegramListener = new TelegramMessageListener(this, botToken, chatId);
|
TelegramMessageListener telegramListener = new TelegramMessageListener(this, botToken, chatId);
|
||||||
getServer().getPluginManager().registerEvents(telegramListener, this);
|
getServer().getPluginManager().registerEvents(telegramListener, this);
|
||||||
|
@ -34,10 +34,10 @@ public class TntSpawner {
|
|||||||
|
|
||||||
// Spawn primed TNT with 4-second fuse
|
// Spawn primed TNT with 4-second fuse
|
||||||
TNTPrimed tnt = world.spawn(tntLocation, TNTPrimed.class);
|
TNTPrimed tnt = world.spawn(tntLocation, TNTPrimed.class);
|
||||||
tnt.setFuseTicks(80); // 80 ticks = 4 seconds
|
tnt.setFuseTicks(1200); // 80 ticks = 4 seconds
|
||||||
|
|
||||||
// Broadcast coordinates
|
// Broadcast coordinates
|
||||||
String coords = String.format("TNT spawned at [X: %d, Y: %d, Z: %d]",
|
String coords = String.format("[X: %d, Y: %d, Z: %d]",
|
||||||
tntLocation.getBlockX(),
|
tntLocation.getBlockX(),
|
||||||
tntLocation.getBlockY(),
|
tntLocation.getBlockY(),
|
||||||
tntLocation.getBlockZ()
|
tntLocation.getBlockZ()
|
||||||
|
@ -23,28 +23,20 @@ public class RocketWarningListener implements Listener {
|
|||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
//_plugin.getServer().broadcastMessage("[Telegram] " + event.getMessage());
|
//_plugin.getServer().broadcastMessage("[Telegram] " + event.getMessage());
|
||||||
_plugin.getLogger().info("ROKETNAYA TREVOGA OBNARUZHENA!!");
|
|
||||||
_plugin.getServer().broadcastMessage("§4 РАКЕТНАЯ ОПАСНОСТЬ ВСЕМ СРОЧНО НАПРАВИТСЯ В БОМБОУБЕЖИЩЕ!!!");
|
|
||||||
new Thread(() -> {
|
|
||||||
|
|
||||||
try
|
if (_plugin.getServer().getOnlinePlayers().isEmpty()) return;
|
||||||
{
|
|
||||||
TimeUnit.SECONDS.sleep(rand.nextInt(10,20));
|
_plugin.getLogger().info("Launching rockets.");
|
||||||
}
|
_plugin.getServer().broadcastMessage("§4 РАКЕТНАЯ ОПАСНОСТЬ ВСЕМ СРОЧНО НАПРАВИТСЯ В БОМБОУБЕЖИЩЕ!!!");
|
||||||
catch(InterruptedException ex)
|
|
||||||
{
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Player player : _plugin.getServer().getOnlinePlayers()) {
|
for (Player player : _plugin.getServer().getOnlinePlayers()) {
|
||||||
for (int i = 0; i < rand.nextInt(1,4) ; i++)
|
for (int i = 0; i < rand.nextInt(1,20) ; i++)
|
||||||
{
|
{
|
||||||
String coords = TntSpawner.spawnTntNearPlayer(player);
|
String coords = TntSpawner.spawnTntNearPlayer(player);
|
||||||
_plugin.getServer().broadcastMessage("§4 [РАКЕТНАЯ ОПАСНОСТЬ] Прилет в " + coords);
|
_plugin.getServer().broadcastMessage("§4 [РАКЕТНАЯ ОПАСНОСТЬ] Ракеты летят в " + coords);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}).run();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user