Bug fix,
Could not pass event AsyncPlayerChatEvent to EnderBank v1.20.1.a.1 java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.hasItemMeta()" because "item" is null
This commit is contained in:
parent
597ee7e756
commit
0e7b4c5d8b
@ -36,5 +36,14 @@
|
|||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="lib" path="/home/phil/.m2/repository/org/spigotmc/spigot-api/1.21.4-R0.1-SNAPSHOT/spigot-api-1.21.4-R0.1-SNAPSHOT.jar" sourcepath="/home/phil/.m2/repository/org/spigotmc/spigot-api/1.21.4-R0.1-SNAPSHOT/spigot-api-1.21.4-R0.1-SNAPSHOT-sources.jar">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="maven.groupId" value="org.spigotmc"/>
|
||||||
|
<attribute name="maven.artifactId" value="spigot-api"/>
|
||||||
|
<attribute name="maven.version" value="1.21.4-R0.1-SNAPSHOT"/>
|
||||||
|
<attribute name="maven.scope" value="provided"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@ -336,6 +336,11 @@ public class BankStorage {
|
|||||||
public void openSearch(String search, Player opener) {
|
public void openSearch(String search, Player opener) {
|
||||||
//Load up inventory
|
//Load up inventory
|
||||||
this.itemIdentifiers = new ArrayList<Integer>();
|
this.itemIdentifiers = new ArrayList<Integer>();
|
||||||
|
if (items == null)
|
||||||
|
{
|
||||||
|
items=BankStorage.getBank(opener.getUniqueId()).items;
|
||||||
|
|
||||||
|
}
|
||||||
for(int i = 0;i < items.size();i++) {
|
for(int i = 0;i < items.size();i++) {
|
||||||
ItemStack item = items.get(i);
|
ItemStack item = items.get(i);
|
||||||
|
|
||||||
|
|||||||
@ -416,15 +416,15 @@ public class EnderBank extends JavaPlugin implements Listener {
|
|||||||
if(handler.equals("banksearch")) {
|
if(handler.equals("banksearch")) {
|
||||||
queue.remove(queue.size() - 1);
|
queue.remove(queue.size() - 1);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Block b = p.getTargetBlock(null, 10);
|
// Block b = p.getTargetBlock(null, 10);
|
||||||
if(!pf.getBoolean("Must_Look_At_Chest_To_Search") || b.getType().equals(Material.ENDER_CHEST)) {
|
// if(!pf.getBoolean("Must_Look_At_Chest_To_Search") || b.getType().equals(Material.ENDER_CHEST)) {
|
||||||
String search = e.getMessage();
|
String search = e.getMessage();
|
||||||
BankStorage bank = BankStorage.searchDatabase.get(p);
|
BankStorage bank = BankStorage.searchDatabase.get(p);
|
||||||
bank.openSearch(search, p);
|
bank.openSearch(search, p);
|
||||||
}else {
|
// }else {
|
||||||
p.sendMessage(ViperStringUtils.makeColors(formatString(messages.getString("Open_Inventory_Not_Looking_At_Ender"), p.getUniqueId())));
|
// p.sendMessage(ViperStringUtils.makeColors(formatString(messages.getString("Open_Inventory_Not_Looking_At_Ender"), p.getUniqueId())));
|
||||||
// p.sendMessage(EnderBank.notificationString + " You must be looking at an ender chest!");
|
// p.sendMessage(EnderBank.notificationString + " You must be looking at an ender chest!");
|
||||||
}
|
// }
|
||||||
BankStorage.searchDatabase.remove(p);
|
BankStorage.searchDatabase.remove(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user