3
0

Fix...new event and add one of new

This commit is contained in:
xjboss 2017-07-03 19:13:11 +08:00
parent da0a711d36
commit cbf80d0a8e
2 changed files with 21 additions and 3 deletions

View File

@ -6,13 +6,13 @@ import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.Inventory;
/**
* Created by xjboss on 2017/7/3.
*/
public class ModInventoryMoveFromPlayerEvent extends InventoryMoveItemEvent {
public ModInventoryMoveFromPlayerEvent(IInventory sourceInventory, net.minecraft.item.ItemStack itemStack, PlayerInventory destinationInventory, boolean didSourceInitiate) {
super(new CraftInventory(sourceInventory), CraftItemStack.asCraftMirror(itemStack), new CraftInventoryPlayer((InventoryPlayer)destinationInventory), didSourceInitiate);
public ModInventoryMoveFromPlayerEvent(InventoryPlayer sourceInventory, net.minecraft.item.ItemStack itemStack, IInventory destinationInventory, boolean didSourceInitiate) {
super(new CraftInventoryPlayer(sourceInventory), CraftItemStack.asCraftMirror(itemStack),new CraftInventory(destinationInventory) , didSourceInitiate);
}
}

View File

@ -0,0 +1,18 @@
package kcauldronx.events;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.inventory.PlayerInventory;
/**
* Created by xjboss on 2017/7/3.
*/
public class ModInventoryMoveToPlayerEvent extends InventoryMoveItemEvent {
public ModInventoryMoveToPlayerEvent(IInventory sourceInventory, net.minecraft.item.ItemStack itemStack, PlayerInventory destinationInventory, boolean didSourceInitiate) {
super(new CraftInventory(sourceInventory), CraftItemStack.asCraftMirror(itemStack), new CraftInventoryPlayer((InventoryPlayer)destinationInventory), didSourceInitiate);
}
}