mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-26 04:06:00 +01:00
Merge branch 'development'
This commit is contained in:
commit
8ce5959753
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>skyblock</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.14</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -493,10 +493,12 @@ public class EntityListeners implements Listener {
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
|
||||
if (plugin.getWorldManager().isIslandWorld(livingEntity.getWorld())) {
|
||||
if (!plugin.getWorldManager().isIslandWorld(livingEntity.getWorld())) return;
|
||||
|
||||
Island island = islandManager.getIslandAtLocation(livingEntity.getLocation());
|
||||
|
||||
if (island != null) {
|
||||
if (island == null) return;
|
||||
|
||||
List<Upgrade> upgrades = plugin.getUpgradeManager().getUpgrades(Upgrade.Type.Drops);
|
||||
|
||||
if (upgrades != null && upgrades.size() > 0 && upgrades.get(0).isEnabled() && island.isUpgrade(Upgrade.Type.Drops)) {
|
||||
@ -530,12 +532,11 @@ public class EntityListeners implements Listener {
|
||||
}
|
||||
|
||||
for (ItemStack is : event.getDrops())
|
||||
if (!dontMultiply.contains(is))
|
||||
for (ItemStack is2 : dontMultiply)
|
||||
if (!is2.isSimilar(is))
|
||||
livingEntity.getWorld().dropItemNaturally(livingEntity.getLocation(), is);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onEntityTargetLivingEntity(EntityTargetLivingEntityEvent event) {
|
||||
|
@ -26,6 +26,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.Levelled;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -62,9 +63,13 @@ public class InteractListeners implements Listener {
|
||||
IslandLevelManager levellingManager = plugin.getLevellingManager();
|
||||
if (!worldManager.isIslandWorld(block.getWorld())) return;
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK &&
|
||||
worldManager.getIslandWorld(block.getWorld()).equals(IslandWorld.Nether) &&
|
||||
event.getItem().getType().equals(Material.WATER_BUCKET)) {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK
|
||||
&& worldManager.getIslandWorld(block.getWorld()).equals(IslandWorld.Nether)
|
||||
&& (event.getItem().getType().equals(Material.WATER_BUCKET)
|
||||
|| event.getItem().getType().equals(Material.TROPICAL_FISH_BUCKET)
|
||||
|| event.getItem().getType().equals(Material.COD_BUCKET)
|
||||
|| event.getItem().getType().equals(Material.SALMON_BUCKET)
|
||||
|| event.getItem().getType().equals(Material.PUFFERFISH_BUCKET))) {
|
||||
Location blockLoc = block.getLocation();
|
||||
|
||||
Island island = islandManager.getIslandAtLocation(blockLoc);
|
||||
@ -85,6 +90,13 @@ public class InteractListeners implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
CompatibleMaterial type = CompatibleMaterial.getMaterial(block);
|
||||
|
||||
if (type.name().contains("SLAB")) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
FileManager.Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
IslandWorld world = worldManager.getIslandWorld(block.getWorld());
|
||||
@ -121,14 +133,8 @@ public class InteractListeners implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (configLoad.getBoolean("Island.Nether.AllowNetherWater", false)) {
|
||||
event.setCancelled(true);
|
||||
if (configLoad.getBoolean("Island.Nether.AllowNetherWater", false))
|
||||
block.setType(Material.WATER, true);
|
||||
block.getWorld().playSound(block.getLocation(), CompatibleSound.ITEM_BUCKET_EMPTY.getSound(), 1f, 1f);
|
||||
if (!event.getPlayer().getGameMode().equals(GameMode.CREATIVE)) {
|
||||
event.getItem().setType(Material.BUCKET);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user