Implemented ghost items for the inventory - will be adjusted.
This commit is contained in:
parent
ec7676a69c
commit
ac919c7882
12 changed files with 424 additions and 66 deletions
|
@ -1,7 +1,5 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -12,10 +10,8 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.routing.IMasterRoutingNode;
|
||||
import WayofTime.bloodmagic.routing.IRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileOutputRoutingNode;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
|
||||
public class BlockOutputRoutingNode extends BlockContainer
|
||||
{
|
||||
|
@ -57,30 +53,37 @@ public class BlockOutputRoutingNode extends BlockContainer
|
|||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
if (world.getTileEntity(pos) instanceof TileOutputRoutingNode)
|
||||
{
|
||||
return false;
|
||||
player.openGui(BloodMagic.instance, Constants.Gui.ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
IRoutingNode node = (IRoutingNode) tile;
|
||||
ChatUtil.sendChat(player, "Master: " + node.getMasterPos().toString());
|
||||
for (BlockPos connPos : node.getConnected())
|
||||
{
|
||||
ChatUtil.sendChat(player, "Connected to: " + connPos.toString());
|
||||
}
|
||||
return true;
|
||||
|
||||
BlockPos masterPos = node.getMasterPos();
|
||||
TileEntity testTile = world.getTileEntity(masterPos);
|
||||
if (testTile instanceof IMasterRoutingNode)
|
||||
{
|
||||
IMasterRoutingNode master = (IMasterRoutingNode) testTile;
|
||||
if (master.isConnected(new LinkedList<BlockPos>(), pos))
|
||||
{
|
||||
ChatUtil.sendChat(player, "Can find the path to the master");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
// if (world.isRemote)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// TileEntity tile = world.getTileEntity(pos);
|
||||
// IRoutingNode node = (IRoutingNode) tile;
|
||||
// ChatUtil.sendChat(player, "Master: " + node.getMasterPos().toString());
|
||||
// for (BlockPos connPos : node.getConnected())
|
||||
// {
|
||||
// ChatUtil.sendChat(player, "Connected to: " + connPos.toString());
|
||||
// }
|
||||
//
|
||||
// BlockPos masterPos = node.getMasterPos();
|
||||
// TileEntity testTile = world.getTileEntity(masterPos);
|
||||
// if (testTile instanceof IMasterRoutingNode)
|
||||
// {
|
||||
// IMasterRoutingNode master = (IMasterRoutingNode) testTile;
|
||||
// if (master.isConnected(new LinkedList<BlockPos>(), pos))
|
||||
// {
|
||||
// ChatUtil.sendChat(player, "Can find the path to the master");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue