From fede238251ab89c1553a928087804b6cc13bb9bb Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Tue, 3 Jun 2014 12:08:33 -0500 Subject: [PATCH] Formation Planes can now Place Heads. --- parts/automation/PartFormationPlane.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index add143f6c..7e89cebad 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemSkull; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -379,7 +380,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( w.getBlock( x, y, z ).isReplaceable( w, x, y, z ) ) { - if ( i instanceof ItemBlock || i instanceof IPlantable ) + if ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull ) { EntityPlayer player = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( player, side, tile ); @@ -388,7 +389,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine worked = true; if ( type == Actionable.MODULATE ) { - if ( i instanceof IPlantable ) + if ( i instanceof IPlantable || i instanceof ItemSkull ) { boolean Worked = false; @@ -396,14 +397,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine Worked = i.onItemUse( is, player, w, x + side.offsetX, y + side.offsetY, z + side.offsetZ, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ ); + if ( Worked == false && side.offsetX == 0 && side.offsetZ == 0 ) + Worked = i.onItemUse( is, player, w, x-side.offsetX, y-side.offsetY, z-side.offsetZ, side.ordinal(), side.offsetX, side.offsetY, side.offsetZ ); + if ( Worked == false && side.offsetY == 0 ) Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ ); if ( Worked == false ) Worked = i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ ); - if ( Worked ) - maxStorage = maxStorage - is.stackSize; + maxStorage = maxStorage - is.stackSize; } else {