mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-27 21:15:28 +01:00
Fix breaking farm item in claims (fabledskyblock included)
This commit is contained in:
parent
02f227ebd9
commit
1a050da104
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicFarming"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "2.2"
|
||||
version: "2.2.1"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -38,7 +38,7 @@ public class HookManager {
|
||||
if (pluginManager.isPluginEnabled("RedProtect")) this.register(HookRedProtect::new);
|
||||
if (pluginManager.isPluginEnabled("Towny")) this.register(HookTowny::new);
|
||||
if (pluginManager.isPluginEnabled("USkyBlock")) this.register(HookUSkyBlock::new);
|
||||
if (pluginManager.isPluginEnabled("SkyBlock")) this.register(HookSkyBlockEarth::new);
|
||||
if (pluginManager.isPluginEnabled("FabledSkyBlock")) this.register(HookSkyBlockEarth::new);
|
||||
if (pluginManager.isPluginEnabled("WorldGuard")) this.register(HookWorldGuard::new);
|
||||
}
|
||||
|
||||
|
@ -38,26 +38,23 @@ public class BlockListeners implements Listener {
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockFade(BlockFadeEvent e) {
|
||||
try {
|
||||
if (checkForFarm(e.getBlock().getLocation())) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
Debugger.runReport(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onGrow(BlockGrowEvent e) {
|
||||
try {
|
||||
|
||||
if (checkForFarm(e.getNewState().getLocation())) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
Debugger.runReport(ex);
|
||||
}
|
||||
@ -152,7 +149,7 @@ public class BlockListeners implements Listener {
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
try {
|
||||
if (event.getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
||||
@ -188,7 +185,7 @@ public class BlockListeners implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onSpawn(ItemSpawnEvent event) {
|
||||
Item item = event.getEntity();
|
||||
|
||||
@ -208,7 +205,7 @@ public class BlockListeners implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onSpawn(SheepRegrowWoolEvent event) {
|
||||
if (instance.getEntityTask().getTicksLived().containsKey(event.getEntity())) {
|
||||
event.setCancelled(true);
|
||||
@ -219,7 +216,7 @@ public class BlockListeners implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockExplode(BlockExplodeEvent event) {
|
||||
try {
|
||||
if (event.getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
||||
|
@ -6,6 +6,7 @@ import com.songoda.epicfarming.utils.Debugger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
@ -21,7 +22,7 @@ public class InteractListeners implements Listener {
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockInteract(PlayerInteractEvent e) {
|
||||
try {
|
||||
if (e.getClickedBlock() == null || e.getClickedBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
||||
|
Loading…
Reference in New Issue
Block a user