aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
authorquerns <33518699+querns@users.noreply.github.com>2024-09-19 08:53:17 -0500
committerGitHub <noreply@github.com>2024-09-19 15:53:17 +0200
commit7ba0fc903e5d14928d2b894b00a7b7dfc65eee18 (patch)
treeebb230105b63eee5cf116cf48d5827f7542a5c8b /src/main/java/gregtech/api/interfaces
parentc24b78060631ea1868c06aeb3b45fd81218d379e (diff)
downloadGT5-Unofficial-7ba0fc903e5d14928d2b894b00a7b7dfc65eee18.tar.gz
GT5-Unofficial-7ba0fc903e5d14928d2b894b00a7b7dfc65eee18.tar.bz2
GT5-Unofficial-7ba0fc903e5d14928d2b894b00a7b7dfc65eee18.zip
Infinite Spraycan Additions (#3226)
Co-authored-by: Caedis <Caedis@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/IItemBehaviour.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
index 8c5dad6dc2..1f728025a7 100644
--- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
+++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
@@ -9,9 +9,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import com.google.common.collect.ImmutableList;
+
import gregtech.api.enums.SubTag;
import gregtech.api.items.MetaBaseItem;
@@ -21,6 +24,33 @@ public interface IItemBehaviour<E extends Item> {
return false;
}
+ default boolean onMiddleClick(E aItem, ItemStack aStack, EntityPlayer aPlayer) {
+ return false;
+ }
+
+ /**
+ * Suppresses standard block activation for a {@link gregtech.common.blocks.BlockMachines GT machine block}. Put
+ * your item's right click activation in
+ * {@link #onItemUse(Item, ItemStack, EntityPlayer, World, int, int, int, int, float, float, float) onItemUse}
+ * for best results.
+ * <p>
+ * Typically used when the item needs support for the Ring of Loki (from Botania.) If you don't care about that,
+ * using
+ * {@link #onItemUseFirst(Item, ItemStack, EntityPlayer, World, int, int, int, ForgeDirection, float, float, float)
+ * onItemUseFirst}
+ * instead of {@link #onItemUse(Item, ItemStack, EntityPlayer, World, int, int, int, int, float, float, float)
+ * onItemUse}
+ * will act before block activation with a little less overhead.
+ *
+ * @param player the player making the request
+ * @param tileEntity the tile entity that is attempting to be activated
+ * @param side the side of the tile entity that the player clicked on
+ * @return true if standard block activation should be suppressed
+ */
+ default boolean shouldInterruptBlockActivation(EntityPlayer player, TileEntity tileEntity, ForgeDirection side) {
+ return false;
+ }
+
boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
@@ -33,6 +63,10 @@ public interface IItemBehaviour<E extends Item> {
List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+ default List<String> getAdditionalToolTipsWhileSneaking(E aItem, List<String> aList, ItemStack aStack) {
+ return ImmutableList.of();
+ }
+
void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
boolean isItemStackUsable(E aItem, ItemStack aStack);