Bound tools
Fix errors Fix Fix Patch Patch
This commit is contained in:
parent
6c6d8067bf
commit
aa0f7d81a0
33 changed files with 880 additions and 31 deletions
|
@ -2,9 +2,11 @@ package WayofTime.bloodmagic.api;
|
|||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
|
@ -13,6 +15,8 @@ public class ItemStackWrapper {
|
|||
public final Item item;
|
||||
public final int stackSize;
|
||||
public final int meta;
|
||||
@Setter
|
||||
public NBTTagCompound nbtTag;
|
||||
|
||||
public ItemStackWrapper(Item item, int stackSize) {
|
||||
this(item, stackSize, 0);
|
||||
|
@ -50,4 +54,10 @@ public class ItemStackWrapper {
|
|||
public String toString() {
|
||||
return stackSize + "x" + item.getUnlocalizedName() + "@" + this.meta;
|
||||
}
|
||||
|
||||
public ItemStack toStack(int count) {
|
||||
ItemStack result = new ItemStack(item, count, meta);
|
||||
result.setTagCompound(nbtTag);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package WayofTime.bloodmagic.api.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public class BoundToolEvent extends Event {
|
||||
|
||||
public EntityPlayer player;
|
||||
|
||||
public BoundToolEvent(EntityPlayer player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Charge extends BoundToolEvent {
|
||||
|
||||
public ItemStack result;
|
||||
|
||||
public Charge(EntityPlayer player, ItemStack result) {
|
||||
super(player);
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Release extends BoundToolEvent {
|
||||
|
||||
public final ItemStack boundTool;
|
||||
public int charge;
|
||||
|
||||
public Release(EntityPlayer player, ItemStack boundTool, int charge) {
|
||||
super(player);
|
||||
this.boundTool = boundTool;
|
||||
this.charge = charge;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue