Merge branch 'development'

This commit is contained in:
Brianna 2020-04-16 03:26:55 -04:00
commit 51ef3c06dd
10 changed files with 19 additions and 15 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -8,6 +8,7 @@ import org.bukkit.entity.LivingEntity;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;
import org.bukkit.entity.Entity;
@ -72,16 +73,16 @@ public class ActiveMinionHolder implements IActiveHolder {
// this.livingEntityMap.clear();
// grab list of all valid entities by UUID that can be removed
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> ServerUtils.get().getEntity(e.getValue())))
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream().filter(Objects::nonNull)
.collect(Collectors.toMap(Map.Entry::getKey, e -> ServerUtils.get().getEntity(e.getValue())))
.entrySet().stream()
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(
e.getValue().getLocation().getBlockX() >> 4,
e.getValue().getLocation().getBlockZ() >> 4))
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
// remove everything we can
toRemove.entrySet().stream().forEach(e -> {
toRemove.entrySet().forEach(e -> {
e.getValue().remove();
livingEntityMap.remove(e.getKey());
});

View File

@ -81,7 +81,7 @@ public class BossDamageListener implements Listener {
player = (Player) shooter;
}
if (player == null) return;
if (player == null || activeBossHolder == null) return;
double currentDamage = activeBossHolder.getMapOfDamagingUsers().getOrDefault(player.getUniqueId(), 0.0);
BossDamageEvent bossDamageEvent = new BossDamageEvent(activeBossHolder, livingEntity, livingEntity.getEyeLocation(), damage);

View File

@ -4,7 +4,6 @@ import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.epicbosses.utils.IConverter;
import com.songoda.epicbosses.utils.exceptions.NotImplementedException;
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import java.util.List;
@ -24,7 +23,11 @@ public class ItemStackHolderConverter implements IConverter<ItemStackHolder, Con
Integer amount = (Integer) configurationSection.get("amount", null);
CompatibleMaterial material = CompatibleMaterial.getMaterial(configurationSection.getString("type", null));
String type = material.getMaterial() == null ? "STONE" : material.getMaterial().name();
String type;
if (material == null)
type = "STONE";
else
type = material.getMaterial() == null ? "STONE" : material.getMaterial().name();
Short durability = (Short) configurationSection.get("durability", null);
if (material.getData() != -1) durability = (short) material.getData();

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.10</version>
<version>1.2.11</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,7 +4,7 @@
<groupId>com.songoda.epicbosses</groupId>
<artifactId>EpicBosses</artifactId>
<packaging>pom</packaging>
<version>1.2.10</version>
<version>1.2.11</version>
<modules>
<module>api-modules/FactionsM</module>
@ -16,7 +16,7 @@
</modules>
<properties>
<plugin.version>1.2.10</plugin.version>
<plugin.version>1.2.11</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.EpicBosses</plugin.main>
<plugin.author>Songoda</plugin.author>