diff options
| author | Lance5057 <Lance5057@gmail.com> | 2018-06-05 22:13:46 -0500 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2018-06-05 22:13:46 -0500 |
| commit | c00efedf54aa760be041762be388f7f8adaab553 (patch) | |
| tree | a1325c8b09ea1fde6d162f73839d9f2be069245c /src/main/java/lance5057/tDefense/util/ArmorEvent.java | |
| parent | f428bdd45dbe00fd0b674bce6ed7623caedca804 (diff) | |
Armor Rendering Part 1master
Diffstat (limited to 'src/main/java/lance5057/tDefense/util/ArmorEvent.java')
| -rw-r--r-- | src/main/java/lance5057/tDefense/util/ArmorEvent.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/main/java/lance5057/tDefense/util/ArmorEvent.java b/src/main/java/lance5057/tDefense/util/ArmorEvent.java deleted file mode 100644 index d83a930..0000000 --- a/src/main/java/lance5057/tDefense/util/ArmorEvent.java +++ /dev/null @@ -1,65 +0,0 @@ -package lance5057.tDefense.util; - -import com.google.common.collect.ImmutableList; - -import lance5057.tDefense.core.tools.bases.ArmorBase; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.NonNullList; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; -import slimeknights.tconstruct.library.materials.Material; - -/** - * Base class for all tinkers events - */ -public abstract class ArmorEvent extends Event { - - /** - * Fired when a tool is built. - * This happens every time a tool is loaded as well as when the player actually builds the tool. - * You can make changes to the tag compound and it'll land on the resulting tool, but its itemstack is not available. - */ - public static class OnItemBuilding extends ArmorEvent { - - public NBTTagCompound tag; - public final ImmutableList<Material> materials; - public final ArmorBase tool; - - public OnItemBuilding(NBTTagCompound tag, ImmutableList<Material> materials, ArmorBase tool) { - this.tag = tag; - this.materials = materials; - this.tool = tool; - } - - public static OnItemBuilding fireEvent(NBTTagCompound tag, ImmutableList<Material> materials, ArmorBase tool) { - OnItemBuilding event = new OnItemBuilding(tag, materials, tool); - MinecraftForge.EVENT_BUS.post(event); - return event; - } - } - - /** - * Fired when the player tries to replace a toolpart. - * You can modify the input items to achieve different results, this will not modify the actual items in the game. - * If you're modifying the list itself, make sure to put new items into originally empty indices to prevent the usage of other items in the input. Just append to the list. - * You can not modify the tool that's getting modified - */ - @Cancelable - public static class OnToolPartReplacement extends ArmorEvent { - - /** The items in the tool station. Can be manipulated. */ - public NonNullList<ItemStack> replacementParts; - public ItemStack toolStack; - - public OnToolPartReplacement(NonNullList<ItemStack> replacementParts, ItemStack toolStack) { - this.replacementParts = replacementParts; - this.toolStack = toolStack.copy(); - } - - public static boolean fireEvent(NonNullList<ItemStack> replacementParts, ItemStack toolStack) { - return !MinecraftForge.EVENT_BUS.post(new OnToolPartReplacement(replacementParts, toolStack)); - } - } -}
\ No newline at end of file |
