Skip to content

Commit

Permalink
Merge pull request #72 from Grzybol/release-4.5.0
Browse files Browse the repository at this point in the history
Release 4.5.0
  • Loading branch information
Grzybol authored Jul 12, 2024
2 parents 260273b + 250d143 commit 58c31e9
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 57 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>betterbox.mine.game</groupId>
<artifactId>BetterElo</artifactId>
<version>4.4.29-SNAPSHOT</version>
<version>4.4.52-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BetterElo</name>
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/betterbox/mine/game/betterelo/BetterElo.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void onEnable() {
customMobsFileManager = new CustomMobsFileManager(folderPath,this, pluginLogger);
pluginLogger.log(PluginLogger.LogLevel.DEBUG,"BetterElo: onEnable: calling customMobsFileManager.loadSpawners()");
customMobsFileManager.loadSpawners();
customMobs = new CustomMobs(pluginLogger,this,customMobsFileManager, fileRewardManager);
customMobs = new CustomMobs(pluginLogger,this,customMobsFileManager, fileRewardManager,this );
pluginLogger.log(PluginLogger.LogLevel.INFO,"Starting spawners scheduler...");
customMobs.startSpawnerScheduler();

Expand All @@ -126,7 +126,7 @@ public void onEnable() {
betterRanksCheaters = new BetterRanksCheaters(this,pluginLogger);
CheaterCheckScheduler cheaterCheckScheduler = new CheaterCheckScheduler(this, betterRanksCheaters, getServer().getScheduler(), pluginLogger);
// Rejestracja listenera eventów
event = new Event(dataManager, pluginLogger,this,betterRanksCheaters,configManager,this,customMobs,fileRewardManager,guiManager);
event = new Event(dataManager, pluginLogger,this,betterRanksCheaters,configManager,this,customMobs,fileRewardManager,guiManager,customMobsFileManager);
getServer().getPluginManager().registerEvents(event, this);
getCommand("be").setExecutor(new BetterEloCommand(this, dataManager, guiManager, pluginLogger, this, configManager,event,PKDB, customMobs, customMobsFileManager));
pluginLogger.log(PluginLogger.LogLevel.DEBUG,"BetterElo: onEnable: Plugin BetterElo został włączony pomyślnie.");
Expand Down Expand Up @@ -610,6 +610,13 @@ public void killAllCustomMobs() {
pluginLogger.log(PluginLogger.LogLevel.INFO, "BetterElo.killAllCustomMobs killed "+killedMobCount+" custom mobs.");
}
public void removeAndKillAllCustomMobs() {
for (CustomMobs.CustomMob customMob : customMobsMap.values()) {
// Sprawdzanie, czy encja jest nadal żywa przed próbą jej zabicia
if (customMob.entity != null && !customMob.entity.isDead()) {
customMob.entity.remove(); // Usuwa encję z świata

}
}
for (CustomMobs.CustomMob customMob : customMobsMap.values()) {
// Sprawdzanie, czy encja jest nadal żywa przed próbą jej zabicia
if (customMob.entity != null && !customMob.entity.isDead()) {
Expand Down Expand Up @@ -645,6 +652,7 @@ public void run() {
customMobs.decreaseMobCount(entry.getValue().spawnerName);
iterator.remove();
String spawnerName = entry.getValue().spawnerName;
customMobs.spawnedMobsMap.remove(entry.getKey().getUniqueId());


if(!entry.getKey().isValid()){
Expand All @@ -665,7 +673,7 @@ public void run() {
}
}
}
}.runTaskTimer(this, 0L, 20L * 60); // Uruchom co 1 minutę (20 ticków = 1 sekunda)
}.runTaskTimer(this, 0L, 20L * 10); // Uruchom co 1 minutę (20 ticków = 1 sekunda)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
break;
case 2:
switch (args[0].toLowerCase()) {
case "forcespawn":
if(sender.isOp()||sender.hasPermission("betterelo.forcespawn")){
customMobs.spawnerForceSpawn(args[1]);
}
break;
case "droptable":
if(sender.isOp()||sender.hasPermission("betterelo.droptable")){
handleCreateDropTable(sender,args[1]);
Expand Down
Loading

0 comments on commit 58c31e9

Please sign in to comment.