Add in missing file

This commit is contained in:
AlexTheCoder 2016-05-02 16:33:11 -04:00
parent cdef447b7f
commit 3d98c08a67

View File

@ -0,0 +1,69 @@
package mineplex.hub.modules;
import mineplex.core.MiniPlugin;
import mineplex.core.common.events.ServerShutdownEvent;
import mineplex.core.sponsorbranding.BrandingManager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.ItemFrame;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Manager to handle generation and protection of billboards in the hub
*/
public class BillboardManager extends MiniPlugin
{
private BrandingManager _branding;
public BillboardManager(JavaPlugin plugin, BrandingManager branding)
{
super("Billboard", plugin);
_branding = branding;
generateBoards();
}
private void generateBoards()
{
_branding.createPost(new Location(Bukkit.getWorld("world"), -2, 77, -33), BlockFace.SOUTH, "logitech.jpg");
}
@EventHandler
public void stopBreaking(HangingBreakEvent event)
{
if (event.getEntity() instanceof ItemFrame)
{
event.setCancelled(true);
}
}
@EventHandler
public void stopBreaking(EntityDamageEvent event)
{
if (event.getEntity() instanceof ItemFrame)
{
event.setCancelled(true);
}
}
@EventHandler
public void stopInteract(PlayerInteractEntityEvent event)
{
if (event.getRightClicked() != null && event.getRightClicked() instanceof ItemFrame)
{
event.setCancelled(true);
}
}
@EventHandler
public void handleShutdown(ServerShutdownEvent event)
{
_branding.reset();
}
}