mirror of
https://github.com/songoda/EpicFarming.git
synced 2025-02-25 17:01:29 +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:
|
variables:
|
||||||
name: "EpicFarming"
|
name: "EpicFarming"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "2.2"
|
version: "2.2.1"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -38,7 +38,7 @@ public class HookManager {
|
|||||||
if (pluginManager.isPluginEnabled("RedProtect")) this.register(HookRedProtect::new);
|
if (pluginManager.isPluginEnabled("RedProtect")) this.register(HookRedProtect::new);
|
||||||
if (pluginManager.isPluginEnabled("Towny")) this.register(HookTowny::new);
|
if (pluginManager.isPluginEnabled("Towny")) this.register(HookTowny::new);
|
||||||
if (pluginManager.isPluginEnabled("USkyBlock")) this.register(HookUSkyBlock::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);
|
if (pluginManager.isPluginEnabled("WorldGuard")) this.register(HookWorldGuard::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,26 +38,23 @@ public class BlockListeners implements Listener {
|
|||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockFade(BlockFadeEvent e) {
|
public void onBlockFade(BlockFadeEvent e) {
|
||||||
try {
|
try {
|
||||||
if (checkForFarm(e.getBlock().getLocation())) {
|
if (checkForFarm(e.getBlock().getLocation())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Debugger.runReport(ex);
|
Debugger.runReport(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onGrow(BlockGrowEvent e) {
|
public void onGrow(BlockGrowEvent e) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (checkForFarm(e.getNewState().getLocation())) {
|
if (checkForFarm(e.getNewState().getLocation())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Debugger.runReport(ex);
|
Debugger.runReport(ex);
|
||||||
}
|
}
|
||||||
@ -152,7 +149,7 @@ public class BlockListeners implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
try {
|
try {
|
||||||
if (event.getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
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) {
|
public void onSpawn(ItemSpawnEvent event) {
|
||||||
Item item = event.getEntity();
|
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) {
|
public void onSpawn(SheepRegrowWoolEvent event) {
|
||||||
if (instance.getEntityTask().getTicksLived().containsKey(event.getEntity())) {
|
if (instance.getEntityTask().getTicksLived().containsKey(event.getEntity())) {
|
||||||
event.setCancelled(true);
|
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) {
|
public void onBlockExplode(BlockExplodeEvent event) {
|
||||||
try {
|
try {
|
||||||
if (event.getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
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.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
@ -21,7 +22,7 @@ public class InteractListeners implements Listener {
|
|||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockInteract(PlayerInteractEvent e) {
|
public void onBlockInteract(PlayerInteractEvent e) {
|
||||||
try {
|
try {
|
||||||
if (e.getClickedBlock() == null || e.getClickedBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
if (e.getClickedBlock() == null || e.getClickedBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Farm Block Material")))
|
||||||
|
Loading…
Reference in New Issue
Block a user