reformatted all src files (#141)
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
package appeng.hooks;
|
||||
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.items.tools.powered.ToolMatterCannon;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
@@ -29,45 +32,35 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.items.tools.powered.ToolMatterCannon;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem {
|
||||
|
||||
public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem
|
||||
{
|
||||
@Override
|
||||
protected ItemStack dispenseStack(final IBlockSource dispenser, ItemStack dispensedItem) {
|
||||
final Item i = dispensedItem.getItem();
|
||||
if (i instanceof ToolMatterCannon) {
|
||||
final EnumFacing enumfacing = dispenser.getBlockState().getValue(BlockDispenser.FACING);
|
||||
AEPartLocation dir = AEPartLocation.INTERNAL;
|
||||
for (final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS) {
|
||||
if (enumfacing.getFrontOffsetX() == d.xOffset && enumfacing.getFrontOffsetY() == d.yOffset && enumfacing.getFrontOffsetZ() == d.zOffset) {
|
||||
dir = d;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack dispenseStack( final IBlockSource dispenser, ItemStack dispensedItem )
|
||||
{
|
||||
final Item i = dispensedItem.getItem();
|
||||
if( i instanceof ToolMatterCannon )
|
||||
{
|
||||
final EnumFacing enumfacing = dispenser.getBlockState().getValue( BlockDispenser.FACING );
|
||||
AEPartLocation dir = AEPartLocation.INTERNAL;
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
if( enumfacing.getFrontOffsetX() == d.xOffset && enumfacing.getFrontOffsetY() == d.yOffset && enumfacing.getFrontOffsetZ() == d.zOffset )
|
||||
{
|
||||
dir = d;
|
||||
}
|
||||
}
|
||||
final ToolMatterCannon tm = (ToolMatterCannon) i;
|
||||
|
||||
final ToolMatterCannon tm = (ToolMatterCannon) i;
|
||||
final World w = dispenser.getWorld();
|
||||
if (w instanceof WorldServer) {
|
||||
final EntityPlayer p = Platform.getPlayer((WorldServer) w);
|
||||
Platform.configurePlayer(p, dir, dispenser.getBlockTileEntity());
|
||||
|
||||
final World w = dispenser.getWorld();
|
||||
if( w instanceof WorldServer )
|
||||
{
|
||||
final EntityPlayer p = Platform.getPlayer( (WorldServer) w );
|
||||
Platform.configurePlayer( p, dir, dispenser.getBlockTileEntity() );
|
||||
p.posX += dir.xOffset;
|
||||
p.posY += dir.yOffset;
|
||||
p.posZ += dir.zOffset;
|
||||
|
||||
p.posX += dir.xOffset;
|
||||
p.posY += dir.yOffset;
|
||||
p.posZ += dir.zOffset;
|
||||
|
||||
dispensedItem = tm.onItemRightClick( w, p, null ).getResult();
|
||||
}
|
||||
}
|
||||
return dispensedItem;
|
||||
}
|
||||
dispensedItem = tm.onItemRightClick(w, p, null).getResult();
|
||||
}
|
||||
}
|
||||
return dispensedItem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user