;/ give up on the powerTo command for the moment
This commit is contained in:
parent
a9cdd654c4
commit
c6e07dfc5a
2 changed files with 20 additions and 7 deletions
|
@ -96,14 +96,16 @@ public class BlockArmbot extends BlockMachine
|
||||||
public boolean isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side)
|
public boolean isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
TileEntity ent = world.getBlockTileEntity(x, y, z);
|
TileEntity ent = world.getBlockTileEntity(x, y, z);
|
||||||
if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot) ent).isProvidingPowerSide(ForgeDirection.getOrientation(side)); }
|
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot) ent).isProvidingPowerSide(ForgeDirection.getOrientation(side)); }
|
||||||
|
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot) ent).getFacingDirectionFromAngle().getOpposite() == ForgeDirection.getOrientation(side);}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side)
|
public boolean isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
|
|
||||||
return this.isProvidingStrongPower(world, x, y, z, side);
|
return this.isProvidingStrongPower(world, x, y, z, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,14 @@ package assemblyline.common.machine.command;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import universalelectricity.core.vector.Vector3;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import dark.minecraft.helpers.DebugToPlayer;
|
import dark.minecraft.helpers.DebugToPlayer;
|
||||||
import dark.minecraft.helpers.ItemWorldHelper;
|
import dark.minecraft.helpers.ItemWorldHelper;
|
||||||
|
|
||||||
|
@ -27,9 +30,9 @@ public class CommandPowerTo extends Command
|
||||||
this.duration = this.getIntArg(0);
|
this.duration = this.getIntArg(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.duration <= 0)
|
if (this.duration <= 30)
|
||||||
{
|
{
|
||||||
this.duration = 20;
|
this.duration = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,10 +40,15 @@ public class CommandPowerTo extends Command
|
||||||
protected boolean doTask()
|
protected boolean doTask()
|
||||||
{
|
{
|
||||||
super.doTask();
|
super.doTask();
|
||||||
if (this.ticksRan >= duration)
|
if (this.tileEntity.isProvidingPower && this.ticksRan >= duration)
|
||||||
{
|
{
|
||||||
powerBlock(false);
|
powerBlock(false);
|
||||||
return false;
|
return false;
|
||||||
|
}else if(this.tileEntity.isProvidingPower)
|
||||||
|
{
|
||||||
|
Vector3 loc = this.tileEntity.getHandPosition();
|
||||||
|
world.spawnParticle("smoke", loc.x, loc.y , loc.z, 0.0D, 0.0D, 0.0D);
|
||||||
|
world.spawnParticle("flame", loc.x, loc.y , loc.z, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
Block block = Block.blocksList[this.world.getBlockId(tileEntity.getHandPosition().intX(), tileEntity.getHandPosition().intY(), tileEntity.getHandPosition().intZ())];
|
Block block = Block.blocksList[this.world.getBlockId(tileEntity.getHandPosition().intX(), tileEntity.getHandPosition().intY(), tileEntity.getHandPosition().intZ())];
|
||||||
|
@ -72,8 +80,11 @@ public class CommandPowerTo extends Command
|
||||||
this.tileEntity.isProvidingPower = true;
|
this.tileEntity.isProvidingPower = true;
|
||||||
}
|
}
|
||||||
int id = this.tileEntity.worldObj.getBlockId(this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord);
|
int id = this.tileEntity.worldObj.getBlockId(this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord);
|
||||||
Block block = Block.blocksList[id];
|
for (int i = 2; i < 6; i++)
|
||||||
if(block != null) block.onNeighborBlockChange(this.world, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord, this.tileEntity.getFacingDirectionFromAngle().ordinal());
|
{
|
||||||
|
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||||
|
this.world.notifyBlocksOfNeighborChange(this.tileEntity.xCoord + dir.offsetX, this.tileEntity.yCoord + dir.offsetY, this.tileEntity.zCoord + dir.offsetZ, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue