mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
add generic wrench handling to fully transparently support BC & COFH wrenches, and add a bonus IC2 wrench support.
This commit is contained in:
1 parent
d73796ad4d
commit
f6f7678f8b
15 files changed
+408
-124
No files matched your search
@@ -2,9 +2,19 @@ package mekanism.api;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
|
||||
public interface IMekWrench
|
||||
{
|
||||
boolean canUseWrench(ItemStack stack, EntityPlayer player, BlockPos pos);
|
||||
|
||||
/* easier compat with BC */
|
||||
default boolean canUseWrench(EntityPlayer player, EnumHand hand, ItemStack stack, RayTraceResult rayTrace)
|
||||
{
|
||||
return canUseWrench(stack, player, rayTrace.getBlockPos() != null ? rayTrace.getBlockPos() : BlockPos.ORIGIN);
|
||||
}
|
||||
|
||||
default void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace){}
|
||||
}
|
||||
Reference in new issue
Block a user