mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-31 21:07:47 +01:00
Merge branch 'development'
This commit is contained in:
commit
fb9f2d0ba7
4
pom.xml
4
pom.xml
@ -2,7 +2,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>UltimateStacker</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>1.11.3</version>
|
||||
<version>1.11.4</version>
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>UltimateStacker-${project.version}</finalName>
|
||||
@ -112,7 +112,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>Lootables</artifactId>
|
||||
<version>1.0.3</version>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
|
@ -44,6 +44,8 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -140,7 +142,7 @@ public class UltimateStacker extends SongodaPlugin {
|
||||
for (Material value : Material.values()) {
|
||||
itemFile.addDefault("Items." + value.name() + ".Has Hologram", true);
|
||||
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.saveChanges();
|
||||
|
@ -7,7 +7,6 @@ import com.songoda.lootables.Modify;
|
||||
import com.songoda.lootables.loot.*;
|
||||
import com.songoda.ultimatestacker.UltimateStacker;
|
||||
import com.songoda.ultimatestacker.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.*;
|
||||
@ -19,15 +18,15 @@ import java.util.List;
|
||||
|
||||
public class LootablesManager {
|
||||
|
||||
private final Lootables instance;
|
||||
private final Lootables lootables;
|
||||
|
||||
private final LootManager lootManager;
|
||||
|
||||
private final String lootablesDir = UltimateStacker.getInstance().getDataFolder() + File.separator + "lootables";
|
||||
|
||||
public LootablesManager() {
|
||||
this.instance = new Lootables(lootablesDir);
|
||||
this.lootManager = new LootManager(instance);
|
||||
this.lootables = new Lootables(lootablesDir);
|
||||
this.lootManager = new LootManager(lootables);
|
||||
}
|
||||
|
||||
public List<Drop> getDrops(LivingEntity entity) {
|
||||
@ -57,7 +56,7 @@ public class LootablesManager {
|
||||
Material material = loot2.getMaterial();
|
||||
if (material.name().contains("WOOL") && ((Sheep) entity).getColor() != 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"));
|
||||
else
|
||||
loot2.setData((short) ((Sheep) entity).getColor().getWoolData());
|
||||
|
@ -38,7 +38,7 @@ public class SpawnerStack {
|
||||
&& !plugin.getStackingTask().isWorldDisabled(location.getWorld()) ? 1 : calculateSpawnCount();
|
||||
int maxNearby = amount > 6 ? amount + 3 : 6;
|
||||
CreatureSpawner creatureSpawner = (CreatureSpawner) location.getBlock().getState();
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_12)) {
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) {
|
||||
creatureSpawner.setMaxNearbyEntities(maxNearby);
|
||||
creatureSpawner.setSpawnCount(count);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user