mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-02-08 00:21:27 +01:00
Fix error with Shulkerbox filter on MC 1.14
This commit is contained in:
parent
c730c18b05
commit
4b41901c38
5
pom.xml
5
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>Minepacks</artifactId>
|
||||
<version>2.0.5</version>
|
||||
<version>2.0.6</version>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
<name>Minepacks</name>
|
||||
<description>Minepacks is a backpack plugin with different backpack sizes, multi language support and SQLite and MySQL storage support.</description>
|
||||
<url>https://www.spigotmc.org/resources/19286/</url>
|
||||
<inceptionYear>2014</inceptionYear>
|
||||
<licenses>
|
||||
<license>
|
||||
@ -31,7 +32,6 @@
|
||||
</licenses>
|
||||
<properties>
|
||||
<author>GeorgH93</author>
|
||||
<website>https://www.spigotmc.org/resources/19286/</website>
|
||||
<version>${project.version}</version>
|
||||
<dependencies>depend: [ PCGF_PluginLib ]</dependencies>
|
||||
<mainClass>${project.groupId}.${project.artifactId}.Bukkit.${project.artifactId}</mainClass>
|
||||
@ -235,7 +235,6 @@
|
||||
<artifact>at.pcgamingfreaks:PluginLib</artifact>
|
||||
<excludes>
|
||||
<exclude>*.yml</exclude>
|
||||
<exclude>META-INF/*.txt</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: "${project.name}"
|
||||
author: "${author}"
|
||||
website: "${website}"
|
||||
website: "${project.url}"
|
||||
main: "${mainClass}"
|
||||
description: "${project.description}"
|
||||
version: "${version}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2016-2018 GeorgH93
|
||||
* Copyright (C) 2019 GeorgH93
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -102,13 +102,11 @@ public void onInventoryClick(InventoryClickEvent event)
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onInventoryOpen(InventoryOpenEvent event)
|
||||
{
|
||||
if(event.getInventory() != null && event.getInventory().getHolder() != null && event.getInventory().getHolder().getClass().getName().toLowerCase().contains("shulker"))
|
||||
if(event.getInventory().getHolder() != null && event.getInventory().getHolder().getClass().getName().toLowerCase().contains("shulker"))
|
||||
{
|
||||
if(removeExisting)
|
||||
{
|
||||
Block shulkerBlock = ((ShulkerBox) event.getInventory().getHolder()).getBlock();
|
||||
if(shulkerBlock != null)
|
||||
{
|
||||
if(dropExistingContent)
|
||||
{
|
||||
Utils.dropInventory(event.getInventory(), shulkerBlock.getLocation());
|
||||
@ -116,7 +114,6 @@ public void onInventoryOpen(InventoryOpenEvent event)
|
||||
event.getInventory().clear();
|
||||
shulkerBlock.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -200,13 +197,10 @@ private boolean handleShulkerBlock(Block block)
|
||||
if(removeExisting)
|
||||
{
|
||||
ShulkerBox shulkerBox = (ShulkerBox) block.getState();
|
||||
if(shulkerBox != null)
|
||||
{
|
||||
if(dropExistingContent) Utils.dropInventory(shulkerBox.getInventory(), shulkerBox.getLocation());
|
||||
shulkerBox.getInventory().clear();
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -242,6 +236,7 @@ public void onBlockDispense(BlockDispenseEvent event)
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPrepareItemCraftEvent(PrepareItemCraftEvent event)
|
||||
{
|
||||
if(event.getRecipe() == null) return;
|
||||
Material itemType = event.getRecipe().getResult().getType();
|
||||
if(itemType == Material.SHULKER_SHELL || SHULKER_BOX_MATERIALS.contains(itemType))
|
||||
{
|
||||
@ -253,7 +248,6 @@ public void onPrepareItemCraftEvent(PrepareItemCraftEvent event)
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onDrop(PlayerDropItemEvent event)
|
||||
{
|
||||
//TODO null checks
|
||||
Material itemType = event.getItemDrop().getItemStack().getType();
|
||||
if(itemType == Material.SHULKER_SHELL || SHULKER_BOX_MATERIALS.contains(itemType))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user