Merge branch 'development'

This commit is contained in:
Brianna 2020-01-21 20:20:18 -05:00
commit fb9f2d0ba7
4 changed files with 10 additions and 9 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>UltimateStacker</artifactId> <artifactId>UltimateStacker</artifactId>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>1.11.3</version> <version>1.11.4</version>
<build> <build>
<defaultGoal>clean install</defaultGoal> <defaultGoal>clean install</defaultGoal>
<finalName>UltimateStacker-${project.version}</finalName> <finalName>UltimateStacker-${project.version}</finalName>
@ -112,7 +112,7 @@
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>Lootables</artifactId> <artifactId>Lootables</artifactId>
<version>1.0.3</version> <version>LATEST</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>

View File

@ -44,6 +44,8 @@ import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.WordUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -140,7 +142,7 @@ public class UltimateStacker extends SongodaPlugin {
for (Material value : Material.values()) { for (Material value : Material.values()) {
itemFile.addDefault("Items." + value.name() + ".Has Hologram", true); itemFile.addDefault("Items." + value.name() + ".Has Hologram", true);
itemFile.addDefault("Items." + value.name() + ".Max Stack Size", -1); itemFile.addDefault("Items." + value.name() + ".Max Stack Size", -1);
itemFile.addDefault("Items." + value.name() + ".Display Name", Methods.formatText(value.name().toLowerCase().replace("_", " "), true)); itemFile.addDefault("Items." + value.name() + ".Display Name", WordUtils.capitalizeFully(value.name().toLowerCase().replace("_", " ")));
} }
itemFile.load(); itemFile.load();
itemFile.saveChanges(); itemFile.saveChanges();

View File

@ -7,7 +7,6 @@ import com.songoda.lootables.Modify;
import com.songoda.lootables.loot.*; import com.songoda.lootables.loot.*;
import com.songoda.ultimatestacker.UltimateStacker; import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.settings.Settings; import com.songoda.ultimatestacker.settings.Settings;
import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*; import org.bukkit.entity.*;
@ -19,15 +18,15 @@ import java.util.List;
public class LootablesManager { public class LootablesManager {
private final Lootables instance; private final Lootables lootables;
private final LootManager lootManager; private final LootManager lootManager;
private final String lootablesDir = UltimateStacker.getInstance().getDataFolder() + File.separator + "lootables"; private final String lootablesDir = UltimateStacker.getInstance().getDataFolder() + File.separator + "lootables";
public LootablesManager() { public LootablesManager() {
this.instance = new Lootables(lootablesDir); this.lootables = new Lootables(lootablesDir);
this.lootManager = new LootManager(instance); this.lootManager = new LootManager(lootables);
} }
public List<Drop> getDrops(LivingEntity entity) { public List<Drop> getDrops(LivingEntity entity) {
@ -57,7 +56,7 @@ public class LootablesManager {
Material material = loot2.getMaterial(); Material material = loot2.getMaterial();
if (material.name().contains("WOOL") && ((Sheep) entity).getColor() != null) { if (material.name().contains("WOOL") && ((Sheep) entity).getColor() != null) {
if (((Sheep) entity).isSheared()) return null; if (((Sheep) entity).isSheared()) return null;
if (instance.isServerVersionAtLeast(com.songoda.lootables.utils.ServerVersion.V1_13)) if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13))
loot2.setMaterial(Material.valueOf(((Sheep) entity).getColor() + "_WOOL")); loot2.setMaterial(Material.valueOf(((Sheep) entity).getColor() + "_WOOL"));
else else
loot2.setData((short) ((Sheep) entity).getColor().getWoolData()); loot2.setData((short) ((Sheep) entity).getColor().getWoolData());

View File

@ -38,7 +38,7 @@ public class SpawnerStack {
&& !plugin.getStackingTask().isWorldDisabled(location.getWorld()) ? 1 : calculateSpawnCount(); && !plugin.getStackingTask().isWorldDisabled(location.getWorld()) ? 1 : calculateSpawnCount();
int maxNearby = amount > 6 ? amount + 3 : 6; int maxNearby = amount > 6 ? amount + 3 : 6;
CreatureSpawner creatureSpawner = (CreatureSpawner) location.getBlock().getState(); CreatureSpawner creatureSpawner = (CreatureSpawner) location.getBlock().getState();
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_12)) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) {
creatureSpawner.setMaxNearbyEntities(maxNearby); creatureSpawner.setMaxNearbyEntities(maxNearby);
creatureSpawner.setSpawnCount(count); creatureSpawner.setSpawnCount(count);
} else { } else {