-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add BC, AE, EIO, Thermal wrench support
- Loading branch information
1 parent
b95530b
commit e6d8481
Showing
8 changed files
with
222 additions
and
14 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/api/java/appeng/api/implementations/items/IAEWrench.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package appeng.api.implementations.items; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
/** | ||
* Implemented on AE's wrench(s) as a substitute for if BC's API is not | ||
* available. | ||
*/ | ||
public interface IAEWrench { | ||
|
||
/** | ||
* Check if the wrench can be used. | ||
* | ||
* @param player wrenching player | ||
* @param pos of block. | ||
* | ||
* @return true if wrench can be used | ||
*/ | ||
boolean canWrench(ItemStack wrench, EntityPlayer player, BlockPos pos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com | ||
* | ||
* The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which | ||
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */ | ||
package buildcraft.api.tools; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.math.RayTraceResult; | ||
|
||
/*** Implement this interface on subclasses of Item to have that item work as a wrench for buildcraft */ | ||
public interface IToolWrench { | ||
|
||
/*** Called to ensure that the wrench can be used. | ||
* | ||
* @param player - The player doing the wrenching | ||
* @param hand - Which hand was holding the wrench | ||
* @param wrench - The item stack that holds the wrench | ||
* @param rayTrace - The object that is being wrenched | ||
* | ||
* @return true if wrenching is allowed, false if not */ | ||
boolean canWrench(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace); | ||
|
||
/*** Callback after the wrench has been used. This can be used to decrease durability or for other purposes. | ||
* | ||
* @param player - The player doing the wrenching | ||
* @param hand - Which hand was holding the wrench | ||
* @param wrench - The item stack that holds the wrench | ||
* @param rayTrace - The object that is being wrenched */ | ||
void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cofh.api.item; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
public interface IToolHammer { | ||
|
||
boolean isUsable(ItemStack item, EntityLivingBase user, BlockPos pos); | ||
boolean isUsable(ItemStack item, EntityLivingBase user, Entity entity); | ||
void toolUsed(ItemStack item, EntityLivingBase user, BlockPos pos); | ||
void toolUsed(ItemStack item, EntityLivingBase user, Entity entity); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/api/java/crazypants/enderio/api/tool/IConduitControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package crazypants.enderio.api.tool; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public interface IConduitControl { | ||
|
||
/** | ||
* Controls whether the overlay is shown and the player can change the display mode. | ||
* | ||
* @param stack | ||
* The itemstack | ||
* @param player | ||
* The player holding the itemstack | ||
* @return True if the overlay should be rendered and the player should be able to change modes. False otherwise. | ||
*/ | ||
boolean showOverlay(@Nonnull ItemStack stack, @Nonnull EntityPlayer player); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/api/java/crazypants/enderio/api/tool/IHideFacades.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package crazypants.enderio.api.tool; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public interface IHideFacades { | ||
|
||
boolean shouldHideFacades(@Nonnull ItemStack stack, @Nonnull EntityPlayer player); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package crazypants.enderio.api.tool; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public interface ITool extends IHideFacades { | ||
|
||
boolean canUse(@Nonnull EnumHand stack, @Nonnull EntityPlayer player, @Nonnull BlockPos pos); | ||
|
||
void used(@Nonnull EnumHand stack, @Nonnull EntityPlayer player, @Nonnull BlockPos pos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters