mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2024-11-21 11:26:13 +01:00
Modified Painting listener to listen for Hanging entities events instead
This commit is contained in:
parent
f9e55356dc
commit
4d064cb7f1
2
pom.xml
2
pom.xml
@ -68,7 +68,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.3.1-R1.0</version>
|
||||
<version>1.4.7-R1.0</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -18,15 +18,15 @@
|
||||
*/
|
||||
package ru.tehkode.modifyworld.handlers;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
||||
import org.bukkit.event.painting.PaintingBreakEvent;
|
||||
import org.bukkit.event.painting.PaintingPlaceEvent;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import ru.tehkode.modifyworld.ModifyworldListener;
|
||||
import ru.tehkode.modifyworld.PlayerInformer;
|
||||
@ -56,21 +56,16 @@ public class BlockListener extends ModifyworldListener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPaintingBreak(PaintingBreakEvent event) {
|
||||
if (!(event instanceof PaintingBreakByEntityEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
PaintingBreakByEntityEvent pbee = (PaintingBreakByEntityEvent) event;
|
||||
if (pbee.getRemover() instanceof Player
|
||||
&& permissionDenied((Player) pbee.getRemover(), "modifyworld.blocks.destroy", Material.PAINTING)) {
|
||||
public void onHangingBreakByEntity(HangingBreakByEntityEvent event) {
|
||||
if (event.getRemover() instanceof Player
|
||||
&& permissionDenied((Player) event.getRemover(), "modifyworld.blocks.destroy", event.getEntity().getType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPaintingPlace(PaintingPlaceEvent event) {
|
||||
if (permissionDenied(event.getPlayer(), "modifyworld.blocks.place", Material.PAINTING)) {
|
||||
public void onPaintingPlace(HangingPlaceEvent event) {
|
||||
if (permissionDenied(event.getPlayer(), "modifyworld.blocks.place", event.getEntity().getType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user