Added workaround for dispenser logic.

This commit is contained in:
Gunther De Wachter
2017-07-02 06:05:43 +02:00
parent 7398af0e1c
commit 0f86efa3f5
4 changed files with 15 additions and 4 deletions
@@ -47,8 +47,7 @@ public final class DispenserBlockTool extends BehaviorDefaultDispenseItem
final World w = dispenser.getWorld();
if( w instanceof WorldServer )
{
// TODO : Fix dispenser logic.
tm.onItemUse( Platform.getPlayer( (WorldServer) w ), w, dispenser.getBlockPos().offset( enumfacing ), EnumHand.MAIN_HAND, enumfacing, 0.5f, 0.5f, 0.5f );
tm.onItemUse( dispensedItem, Platform.getPlayer( (WorldServer) w ), w, dispenser.getBlockPos().offset( enumfacing ), EnumHand.MAIN_HAND, enumfacing, 0.5f, 0.5f, 0.5f );
}
}
return dispensedItem;
@@ -30,6 +30,8 @@ import net.minecraft.world.World;
public interface IBlockTool
{
// Workaround for dispenser logic.
EnumActionResult onItemUse( ItemStack is, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ );
EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ );
@@ -105,7 +105,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
@Override
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
final ItemStack is = p.getHeldItem(hand);
return this.onItemUse( p.getHeldItem(hand), p, w, pos, hand, side, hitX, hitY, hitZ );
}
@Override
public EnumActionResult onItemUse( ItemStack is, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
final Block blk = w.getBlockState( pos ).getBlock();
ItemStack paintBall = this.getColor( is );
@@ -238,7 +238,12 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
@Override
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
final ItemStack item = p.getHeldItem(hand);
return this.onItemUse( p.getHeldItem(hand), p, w, pos, hand, side, hitX, hitY, hitZ );
}
@Override
public EnumActionResult onItemUse( ItemStack item, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
if( this.getAECurrentPower( item ) > 1600 )
{
if( !p.canPlayerEdit( pos, side, item ) )