Remove NewInteractionsManager because it's stupid

This commit is contained in:
Sam 2018-07-27 20:58:12 +01:00 committed by Alexander Meech
parent 1583d41d1a
commit 064bc2c412
3 changed files with 2 additions and 87 deletions

View File

@ -1,84 +0,0 @@
package mineplex.core.interactions;
import mineplex.core.MiniPlugin;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Result;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
/**
* Manages interactions with Armor stands, paintings, and in the main hub, taking items out of chests.
*/
public class NewInteractionsManager extends MiniPlugin
{
public NewInteractionsManager()
{
super("Interactions Manager");
registerEvents(this);
}
@EventHandler
public void onInteract(PlayerArmorStandManipulateEvent event)
{
event.setCancelled(true);
}
@EventHandler
public void onClickBrewingStand(PlayerInteractEvent event)
{
if(event.getClickedBlock() != null && event.getClickedBlock().getType() == Material.BREWING_STAND)
{
event.setCancelled(true);
event.setUseInteractedBlock(Result.DENY);
}
}
@EventHandler
public void onPainting(HangingBreakEvent event)
{
event.setCancelled(true);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onChestInteract(InventoryClickEvent event)
{
Player player = (Player) event.getWhoClicked();
Inventory inventory = event.getClickedInventory();
if(inventory == null)
{
return;
}
if(event.getCurrentItem() == null || event.getCurrentItem().getType() == Material.AIR)
{
return;
}
if(inventory.getType() != InventoryType.CHEST)
{
return;
}
if(inventory.getSize() != 27 && inventory.getSize() != 54)
{
return;
}
if(inventory.getTitle() != null)
{
return;
}
event.setCancelled(true);
event.setResult(Result.DENY);
}
}

View File

@ -64,7 +64,6 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.event.GadgetSelectLocationEvent; import mineplex.core.gadget.event.GadgetSelectLocationEvent;
import mineplex.core.hologram.HologramManager; import mineplex.core.hologram.HologramManager;
import mineplex.core.incognito.events.IncognitoHidePlayerEvent; import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
import mineplex.core.interactions.NewInteractionsManager;
import mineplex.core.inventory.InventoryManager; import mineplex.core.inventory.InventoryManager;
import mineplex.core.menu.MenuManager; import mineplex.core.menu.MenuManager;
import mineplex.core.message.PrivateMessageEvent; import mineplex.core.message.PrivateMessageEvent;
@ -198,7 +197,6 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
//new SoccerManager(this, _gadgetManager); //new SoccerManager(this, _gadgetManager);
new MenuManager(_plugin); new MenuManager(_plugin);
new NewInteractionsManager();
AntiSpamManager antiSpam = new AntiSpamManager(); AntiSpamManager antiSpam = new AntiSpamManager();
antiSpam.setMessageFormatter(this); antiSpam.setMessageFormatter(this);

View File

@ -48,6 +48,7 @@ import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.event.world.ChunkUnloadEvent; import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.inventory.BeaconInventory; import org.bukkit.inventory.BeaconInventory;
import org.bukkit.inventory.BrewerInventory;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin; import mineplex.core.ReflectivelyCreateMiniPlugin;
@ -425,7 +426,7 @@ public class HubWorldManager extends MiniPlugin
@EventHandler @EventHandler
public void openBeacon(InventoryOpenEvent event) public void openBeacon(InventoryOpenEvent event)
{ {
if (event.getInventory() instanceof BeaconInventory) if (event.getInventory() instanceof BeaconInventory || event.getInventory() instanceof BrewerInventory)
{ {
event.setCancelled(true); event.setCancelled(true);
} }