diff --git a/core/Registration.java b/core/Registration.java index 54800a692..63a391735 100644 --- a/core/Registration.java +++ b/core/Registration.java @@ -92,6 +92,7 @@ import appeng.core.localization.GuiText; import appeng.core.localization.PlayerMessages; import appeng.debug.BlockChunkloader; import appeng.debug.BlockItemGen; +import appeng.debug.BlockPhantomNode; import appeng.debug.ToolDebugCard; import appeng.debug.ToolEraser; import appeng.debug.ToolMeteoritePlacer; @@ -418,6 +419,7 @@ public class Registration addFeature( ToolReplicatorCard.class ); addFeature( BlockItemGen.class ); addFeature( BlockChunkloader.class ); + addFeature( BlockPhantomNode.class ); } private AEItemDefinition addFeature(Class c, Object... Args) diff --git a/debug/BlockPhantomNode.java b/debug/BlockPhantomNode.java new file mode 100644 index 000000000..0e274e795 --- /dev/null +++ b/debug/BlockPhantomNode.java @@ -0,0 +1,35 @@ +package appeng.debug; + +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import appeng.block.AEBaseBlock; +import appeng.core.features.AEFeature; + +public class BlockPhantomNode extends AEBaseBlock +{ + + public BlockPhantomNode() { + super( BlockPhantomNode.class, Material.iron ); + setfeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) ); + setTileEntiy( TilePhantomNode.class ); + } + + @Override + public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) + { + TilePhantomNode tpn = getTileEntity( w, x, y, z ); + tpn.BOOM(); + return true; + } + + @Override + public void registerBlockIcons(IIconRegister iconRegistry) + { + registerNoIcons(); + } + +} diff --git a/debug/TilePhantomNode.java b/debug/TilePhantomNode.java new file mode 100644 index 000000000..924ccf730 --- /dev/null +++ b/debug/TilePhantomNode.java @@ -0,0 +1,42 @@ +package appeng.debug; + +import java.util.EnumSet; + +import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.IGridNode; +import appeng.me.helpers.AENetworkProxy; +import appeng.tile.grid.AENetworkTile; + +public class TilePhantomNode extends AENetworkTile +{ + + protected AENetworkProxy RWAR = null; + boolean crashMode = false; + + @Override + public void onReady() + { + super.onReady(); + RWAR = createProxy(); + RWAR.onReady(); + crashMode = true; + } + + @Override + public IGridNode getGridNode(ForgeDirection dir) + { + if ( !crashMode ) + return super.getGridNode( dir ); + + return RWAR.getNode(); + } + + public void BOOM() + { + if ( RWAR != null ) + { + crashMode = true; + RWAR.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); + } + } +}