Add emerald blocks to stackables.yml, fix entity death & levelling bug

This commit is contained in:
Esophose 2019-05-09 01:09:15 -06:00
parent 3b2c41861e
commit 6775dd3759
5 changed files with 21 additions and 10 deletions

View File

@ -5,6 +5,7 @@ import me.goodandevil.skyblock.api.event.island.IslandLevelChangeEvent;
import me.goodandevil.skyblock.config.FileManager.Config; import me.goodandevil.skyblock.config.FileManager.Config;
import me.goodandevil.skyblock.island.Island; import me.goodandevil.skyblock.island.Island;
import me.goodandevil.skyblock.island.IslandLevel; import me.goodandevil.skyblock.island.IslandLevel;
import me.goodandevil.skyblock.island.IslandManager;
import me.goodandevil.skyblock.island.IslandWorld; import me.goodandevil.skyblock.island.IslandWorld;
import me.goodandevil.skyblock.stackable.Stackable; import me.goodandevil.skyblock.stackable.Stackable;
import me.goodandevil.skyblock.stackable.StackableManager; import me.goodandevil.skyblock.stackable.StackableManager;
@ -13,6 +14,7 @@ import me.goodandevil.skyblock.utils.version.NMSUtil;
import me.goodandevil.skyblock.utils.version.Sounds; import me.goodandevil.skyblock.utils.version.Sounds;
import me.goodandevil.skyblock.world.WorldManager; import me.goodandevil.skyblock.world.WorldManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.ChunkSnapshot; import org.bukkit.ChunkSnapshot;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -46,9 +48,18 @@ public class LevellingManager {
} }
public void calculatePoints(Player player, Island island) { public void calculatePoints(Player player, Island island) {
IslandManager islandManager = skyblock.getIslandManager();
WorldManager worldManager = skyblock.getWorldManager(); WorldManager worldManager = skyblock.getWorldManager();
StackableManager stackableManager = skyblock.getStackableManager(); StackableManager stackableManager = skyblock.getStackableManager();
if (islandManager.getIslandPlayerAt(player) != island) {
String message = ChatColor.translateAlternateColorCodes('&', this.skyblock.getFileManager()
.getConfig(new File(this.skyblock.getDataFolder(), "language.yml"))
.getFileConfiguration().getString("Command.Island.Level.Scanning.NotOnIsland.Message"));
player.sendMessage(message);
return;
}
Chunk chunk = new Chunk(skyblock, island); Chunk chunk = new Chunk(skyblock, island);
chunk.prepareInitial(); chunk.prepareInitial();

View File

@ -231,6 +231,8 @@ public class Block implements Listener {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
Materials materials = Materials.getMaterials(block.getType(), block.getData()); Materials materials = Materials.getMaterials(block.getType(), block.getData());
if (materials == null)
return;
if (materials.equals(Materials.SPAWNER)) { if (materials.equals(Materials.SPAWNER)) {
if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners") || Bukkit.getPluginManager().isPluginEnabled("WildStacker")) if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners") || Bukkit.getPluginManager().isPluginEnabled("WildStacker"))
@ -241,9 +243,6 @@ public class Block implements Listener {
materials = Materials.getSpawner(spawnerType); materials = Materials.getSpawner(spawnerType);
} }
if (materials == null)
return;
long materialAmount = 0; long materialAmount = 0;
IslandLevel level = island.getLevel(); IslandLevel level = island.getLevel();

View File

@ -567,13 +567,12 @@ public class Entity implements Listener {
// Certain entities shouldn't drop twice the amount // Certain entities shouldn't drop twice the amount
if (livingEntity instanceof Player if (livingEntity instanceof Player
|| livingEntity instanceof ArmorStand || livingEntity instanceof ArmorStand
|| livingEntity instanceof Horse || livingEntity instanceof Horse) {
|| livingEntity instanceof ElderGuardian) {
return; return;
} }
if (NMSUtil.getVersionNumber() > 8) { if (NMSUtil.getVersionNumber() > 8) {
if (livingEntity instanceof Donkey || livingEntity instanceof Mule) if (livingEntity instanceof Donkey || livingEntity instanceof Mule || livingEntity instanceof ElderGuardian)
return; return;
} }
@ -625,7 +624,7 @@ public class Entity implements Listener {
for (ItemStack is : event.getDrops()) for (ItemStack is : event.getDrops())
if (!dontMultiply.contains(is)) if (!dontMultiply.contains(is))
is.setAmount(is.getAmount() * 2); livingEntity.getWorld().dropItemNaturally(livingEntity.getLocation(), is);
} }
} }
} }
@ -669,8 +668,7 @@ public class Entity implements Listener {
} }
if (skyblock.getWorldManager().isIslandWorld(livingEntity.getWorld())) { if (skyblock.getWorldManager().isIslandWorld(livingEntity.getWorld())) {
if (!skyblock.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner, if (!skyblock.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner, "NaturalMobSpawning")) {
"NaturalMobSpawning")) {
livingEntity.remove(); livingEntity.remove();
} }
} }

View File

@ -463,6 +463,8 @@ Command:
Message: "&eScanning island level: &b%percent%" Message: "&eScanning island level: &b%percent%"
Finished: Finished:
Message: "&aIsland level scan complete!" Message: "&aIsland level scan complete!"
NotOnIsland:
Message: "&bSkyBlock &8| &cError&8: &cYou cannot initiate an island scan without being on your island."
Owner: Owner:
Yourself: Yourself:
Message: "&bSkyBlock &8| &cError&8: &eYou are not an Island owner." Message: "&bSkyBlock &8| &cError&8: &eYou are not an Island owner."

View File

@ -2,3 +2,4 @@ Stackables:
- DIAMOND_BLOCK - DIAMOND_BLOCK
- IRON_BLOCK - IRON_BLOCK
- GOLD_BLOCK - GOLD_BLOCK
- EMERALD_BLOCK