mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-03-13 06:59:14 +01:00
Add emerald blocks to stackables.yml, fix entity death & levelling bug
This commit is contained in:
parent
3b2c41861e
commit
6775dd3759
@ -5,6 +5,7 @@ import me.goodandevil.skyblock.api.event.island.IslandLevelChangeEvent;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandLevel;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
import me.goodandevil.skyblock.island.IslandWorld;
|
||||
import me.goodandevil.skyblock.stackable.Stackable;
|
||||
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.world.WorldManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -46,9 +48,18 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
public void calculatePoints(Player player, Island island) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
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.prepareInitial();
|
||||
|
||||
|
@ -231,6 +231,8 @@ public class Block implements Listener {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Materials materials = Materials.getMaterials(block.getType(), block.getData());
|
||||
if (materials == null)
|
||||
return;
|
||||
|
||||
if (materials.equals(Materials.SPAWNER)) {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners") || Bukkit.getPluginManager().isPluginEnabled("WildStacker"))
|
||||
@ -241,9 +243,6 @@ public class Block implements Listener {
|
||||
materials = Materials.getSpawner(spawnerType);
|
||||
}
|
||||
|
||||
if (materials == null)
|
||||
return;
|
||||
|
||||
long materialAmount = 0;
|
||||
IslandLevel level = island.getLevel();
|
||||
|
||||
|
@ -567,13 +567,12 @@ public class Entity implements Listener {
|
||||
// Certain entities shouldn't drop twice the amount
|
||||
if (livingEntity instanceof Player
|
||||
|| livingEntity instanceof ArmorStand
|
||||
|| livingEntity instanceof Horse
|
||||
|| livingEntity instanceof ElderGuardian) {
|
||||
|| livingEntity instanceof Horse) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (NMSUtil.getVersionNumber() > 8) {
|
||||
if (livingEntity instanceof Donkey || livingEntity instanceof Mule)
|
||||
if (livingEntity instanceof Donkey || livingEntity instanceof Mule || livingEntity instanceof ElderGuardian)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -625,7 +624,7 @@ public class Entity implements Listener {
|
||||
|
||||
for (ItemStack is : event.getDrops())
|
||||
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.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner,
|
||||
"NaturalMobSpawning")) {
|
||||
if (!skyblock.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner, "NaturalMobSpawning")) {
|
||||
livingEntity.remove();
|
||||
}
|
||||
}
|
||||
|
@ -463,6 +463,8 @@ Command:
|
||||
Message: "&eScanning island level: &b%percent%"
|
||||
Finished:
|
||||
Message: "&aIsland level scan complete!"
|
||||
NotOnIsland:
|
||||
Message: "&bSkyBlock &8| &cError&8: &cYou cannot initiate an island scan without being on your island."
|
||||
Owner:
|
||||
Yourself:
|
||||
Message: "&bSkyBlock &8| &cError&8: &eYou are not an Island owner."
|
||||
|
@ -1,4 +1,5 @@
|
||||
Stackables:
|
||||
- DIAMOND_BLOCK
|
||||
- IRON_BLOCK
|
||||
- GOLD_BLOCK
|
||||
- GOLD_BLOCK
|
||||
- EMERALD_BLOCK
|
||||
|
Loading…
Reference in New Issue
Block a user