- AuraPylon: Multiblock fix

This commit is contained in:
HellFirePvP committed 2015-12-06 21:38:38 +01:00
1 parent 313c253ad1
commit 7ba6b7c130
2 files changed
+9 -3

No files matched your search

@@ -104,12 +104,14 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
if(world.getBlockMetadata(x, y, z) != 1) {
Block up = world.getBlock(x, y + 1, z);
return up instanceof BlockAuraPylon && up.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
return up != null && up instanceof BlockAuraPylon && up.onBlockActivated(world, x, y + 1, z, player, side, par7, par8, par9);
}
ItemStack heldItem = player.getHeldItem();
if(!world.isRemote && heldItem != null && heldItem.getItem() instanceof ItemWandCasting &&
ResearchManager.isResearchComplete(player.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_PYLON")) {
TileAuraPylon tileAuraPylon = (TileAuraPylon) world.getTileEntity(x, y - 1, z);
if(MultiblockHelper.isMultiblockPresent(world, x, y, z, RegisteredMultiblocks.auraPylonPattern) &&
!tileAuraPylon.isPartOfMultiblock() &&
ThaumcraftApiHelper.consumeVisFromWandCrafting(player.getCurrentEquippedItem(), player, RegisteredRecipes.costsAuraPylonMultiblock, true)) {
PacketStartAnimation pkt = new PacketStartAnimation(PacketStartAnimation.ID_SPARKLE_SPREAD, x, y, z);
NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32);
@@ -187,7 +187,10 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
}
if(entity == null) return;
if(dummy.getDistanceToEntity(entity) < 1 && !worldObj.isRemote) {
this.crystalEssentiaStack = entity.getEntityItem();
ItemStack inter = entity.getEntityItem();
inter.stackSize--;
this.crystalEssentiaStack = inter.copy();
this.crystalEssentiaStack.stackSize = 1;
EntityPermNoClipItem item = new EntityPermNoClipItem(entity.worldObj, xCoord + 0.5F, yC + 0.3F, zCoord + 0.5F, crystalEssentiaStack, xCoord, yCoord, zCoord);
entity.worldObj.spawnEntityInWorld(item);
@@ -201,7 +204,8 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
holdingAspect = ((ItemCrystalEssence) crystalEssentiaStack.getItem()).getAspects(crystalEssentiaStack).getAspects()[0];
distributeAspectInformation();
entity.setDead();
if(inter.stackSize <= 0) entity.setDead();
entity.noClip = false;
item.delayBeforeCanPickup = 60;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
markDirty();