mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 06:09:05 +00:00
Fixed null pointer exceptions from new custom gui slot commit.
This commit is contained in:
1 parent
586c451f06
commit
e3405d22e9
4 files changed
+25
-10
No files matched your search
@@ -108,9 +108,12 @@ public class ContainerCustomGui extends Container {
|
||||
public ItemStack slotClick(int slotId, int dragType, int clickTypeIn, EntityPlayer player) {
|
||||
if(slotId < 0)
|
||||
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
||||
if(!player.worldObj.isRemote && this.getSlot(slotId) instanceof CustomGuiSlot) {
|
||||
CustomGuiSlot guiSlot = (CustomGuiSlot) this.getSlot(slotId);
|
||||
if(!EventHooks.onCustomGuiSlotClicked((IPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, slotId, guiSlot.guiSlotId, dragType, clickTypeIn)) {
|
||||
if(!player.worldObj.isRemote) {
|
||||
CustomGuiSlot guiSlot = null;
|
||||
if (this.getSlot(slotId) instanceof CustomGuiSlot) {
|
||||
guiSlot = (CustomGuiSlot) this.getSlot(slotId);
|
||||
}
|
||||
if(!EventHooks.onCustomGuiSlotClicked((IPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, slotId, guiSlot, dragType, clickTypeIn)) {
|
||||
ItemStack item = super.slotClick(slotId, dragType, clickTypeIn, player);
|
||||
EntityPlayerMP p = (EntityPlayerMP) player;
|
||||
p.sendContainerToPlayer(this);
|
||||
|
||||
Reference in new issue
Block a user