Added Crashy TilePhantomNode

This commit is contained in:
AlgorithmX2
2014-08-23 01:23:30 -05:00
parent 1545525f04
commit 14bb515bfb
3 changed files with 79 additions and 0 deletions
+2
View File
@@ -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)
+35
View File
@@ -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();
}
}
+42
View File
@@ -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 ) );
}
}
}