Spell Work
Need to work on how the EntitySpellProjectile saves its data. Does not work properly. Perhaps it was not registered?
This commit is contained in:
parent
5dcef131dc
commit
112b4e6b53
15 changed files with 314 additions and 92 deletions
|
@ -105,6 +105,7 @@ public class BlockOrientable extends BlockContainer
|
|||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
//Right-click orients the output face. Shift-right-click orients the input face.
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
|
@ -115,25 +116,44 @@ public class BlockOrientable extends BlockContainer
|
|||
|
||||
if (tile instanceof TEOrientable)
|
||||
{
|
||||
//TODO NEEDS WORK
|
||||
if (((TEOrientable) tile).getInputDirection().equals(sideClicked))
|
||||
{
|
||||
((TEOrientable) tile).setInputDirection(((TEOrientable) tile).getOutputDirection());
|
||||
((TEOrientable) tile).setOutputDirection(sideClicked);
|
||||
} else if (((TEOrientable) tile).getOutputDirection().equals(sideClicked))
|
||||
{
|
||||
((TEOrientable) tile).setOutputDirection(((TEOrientable) tile).getInputDirection());
|
||||
((TEOrientable) tile).setInputDirection(sideClicked);
|
||||
} else
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
((TEOrientable) tile).setOutputDirection(sideClicked);
|
||||
} else
|
||||
{
|
||||
((TEOrientable) tile).setOutputDirection(sideClicked.getOpposite());
|
||||
}
|
||||
}
|
||||
TEOrientable newTile = (TEOrientable)tile;
|
||||
if(player.isSneaking())
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection())+1;
|
||||
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(nextSide)==newTile.getOutputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setInputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
}else
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection())+1;
|
||||
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(nextSide)==newTile.getInputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
|
@ -221,4 +241,10 @@ public class BlockOrientable extends BlockContainer
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue