mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 18:46:35 +01:00
Updating permissions and such
This commit is contained in:
parent
b73da10f65
commit
bd497a5e7f
@ -1,9 +1,13 @@
|
|||||||
package com.sekwah.advancedportals.spigot;
|
package com.sekwah.advancedportals.spigot;
|
||||||
|
|
||||||
import com.sekwah.advancedportals.core.CoreListeners;
|
import com.sekwah.advancedportals.core.CoreListeners;
|
||||||
|
import com.sekwah.advancedportals.core.data.PortalLocation;
|
||||||
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
|
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
public class Listeners implements Listener {
|
public class Listeners implements Listener {
|
||||||
@ -21,4 +25,15 @@ public class Listeners implements Listener {
|
|||||||
coreListeners.playerJoin(new PlayerContainer(event.getPlayer()));
|
coreListeners.playerJoin(new PlayerContainer(event.getPlayer()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onItemInteract(PlayerInteractEvent event) {
|
||||||
|
if ((event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) && event.getItem() != null) {
|
||||||
|
Location blockloc = event.getClickedBlock().getLocation();
|
||||||
|
this.coreListeners.playerInteractWithBlock(new PlayerContainer(event.getPlayer()), event.getMaterial().toString(),
|
||||||
|
event.getItem().getItemMeta().getDisplayName(),
|
||||||
|
new PortalLocation(blockloc.getBlockX(), blockloc.getBlockY(), blockloc.getBlockZ()),
|
||||||
|
event.getAction() == Action.LEFT_CLICK_BLOCK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user