Skip to content
Permalink
Browse files

Added Tesla Coil

  • Loading branch information...
Ri5ux Ri5ux
Ri5ux authored and Ri5ux committed Jul 16, 2019
1 parent 1084da5 commit d8d75b87f81aa0445b1577b8675eae0548e6e300
@@ -42,6 +42,7 @@
import org.avp.block.BlockStasisMechanism;
import org.avp.block.BlockSupplyCrate;
import org.avp.block.BlockTempleSpawner;
import org.avp.block.BlockTeslaCoil;
import org.avp.block.BlockTransformer;
import org.avp.block.BlockTreeFern;
import org.avp.block.BlockTurret;
@@ -60,10 +61,10 @@
import org.avp.block.skulls.BlockBiomaskTracker;
import org.avp.block.skulls.BlockHeadAethon;
import org.avp.block.skulls.BlockHeadGigerAlien;
import org.avp.block.skulls.BlockSkullNeomorph;
import org.avp.block.skulls.BlockSkullProtomorph;
import org.avp.block.skulls.BlockSkullEngineer;
import org.avp.block.skulls.BlockSkullMatriarch;
import org.avp.block.skulls.BlockSkullNeomorph;
import org.avp.block.skulls.BlockSkullProtomorph;
import org.avp.block.skulls.BlockSkullSpaceJockey;
import org.avp.block.skulls.BlockSkullXenomorph;
import org.avp.block.skulls.BlockSkullXenomorphWarrior;
@@ -234,6 +235,7 @@
public static final Block cryoTube = new BlockCryostasisTube(Material.IRON).setHardness(10F).setResistance(15.0F).setLightOpacity(4).setCreativeTab(Tab.MAIN).setRegistryName("cryostasistube");
public static final Block lightPanel = new BlockLightPanel(Material.IRON).setHardness(1.5F).setResistance(2.0F).setCreativeTab(Tab.MAIN).setRegistryName("lightpanel");
public static final Block ccflTube = new BlockCCFLTube(Material.IRON).setHardness(0.5F).setResistance(1.0F).setCreativeTab(Tab.MAIN).setRegistryName("ccfltube");
public static final Block teslaCoil = new BlockTeslaCoil(Material.IRON).setHardness(0.5F).setResistance(1.0F).setCreativeTab(Tab.MAIN).setRegistryName("teslacoil");
public static final Block networkRack = new BlockNetworkRack(Material.IRON).setHardness(3.2F).setResistance(2.6F).setCreativeTab(Tab.MAIN).setRegistryName("networkrack");
public static final Block powercell = new BlockPowercell(Material.IRON).setHardness(3.2F).setResistance(2.6F).setCreativeTab(Tab.MAIN).setRegistryName("powercell");
public static final Block redstoneSensor = new BlockRedstoneSensor(Material.IRON).setHardness(3.2F).setResistance(2.6F).setCreativeTab(Tab.MAIN).setRegistryName("redstonesensor");
@@ -94,6 +94,7 @@
import org.avp.tile.TileEntitySolarPanel;
import org.avp.tile.TileEntityStasisMechanism;
import org.avp.tile.TileEntitySupplyCrate;
import org.avp.tile.TileEntityTeslaCoil;
import org.avp.tile.TileEntityTransformer;
import org.avp.tile.TileEntityTurret;
import org.avp.tile.TileEntityWorkstation;
@@ -317,6 +318,7 @@ public void registerTileEntities()
GameRegistry.registerTileEntity(TileEntityReflective.class, new ResourceLocation(AliensVsPredator.Properties.ID, "tile.avp.reflective"));
GameRegistry.registerTileEntity(TileEntityGroundFern.class, new ResourceLocation(AliensVsPredator.Properties.ID, "tile.avp.groundfern"));
GameRegistry.registerTileEntity(TileEntityTreeFern.class, new ResourceLocation(AliensVsPredator.Properties.ID, "tile.avp.treefern"));
GameRegistry.registerTileEntity(TileEntityTeslaCoil.class, new ResourceLocation(AliensVsPredator.Properties.ID, "tile.avp.tesacoil"));
}

private void registerSpawns()
@@ -0,0 +1,90 @@
package org.avp.block;

import org.avp.tile.TileEntityCCFLTube;
import org.avp.tile.TileEntityTeslaCoil;

import com.asx.mdx.lib.world.entity.Entities;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockTeslaCoil extends Block
{
public BlockTeslaCoil(Material material)
{
super(material);
}

@Override
public boolean isTranslucent(IBlockState state)
{
return false;
}

@Override
public boolean isBlockNormalCube(IBlockState state)
{
return true;
}

@Override
public boolean isTopSolid(IBlockState state)
{
return true;
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
}

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
super.onBlockPlacedBy(world, pos, state, placer, stack);

TileEntityTeslaCoil teslaCoil = (TileEntityTeslaCoil) world.getTileEntity(pos);

if (teslaCoil != null)
{
teslaCoil.setRotationYAxis(Entities.getEntityFacingRotY(placer));
teslaCoil.setRotationXAxis(Entities.getEntityFacingRotX(placer));
world.markBlockRangeForRenderUpdate(pos, pos);
}
}

@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}

@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.INVISIBLE;
}

@Override
public TileEntity createTileEntity(World world, IBlockState state)
{
return new TileEntityTeslaCoil();
}

@Override
public boolean hasTileEntity(IBlockState state)
{
return true;
}
}
@@ -113,6 +113,7 @@
import org.avp.client.render.items.RenderItemSummoner;
import org.avp.client.render.items.RenderItemSupplyChute;
import org.avp.client.render.items.RenderItemSupplyCrate;
import org.avp.client.render.items.RenderItemTeslaCoil;
import org.avp.client.render.items.RenderItemTransformer;
import org.avp.client.render.items.RenderItemTreeFern;
import org.avp.client.render.items.RenderItemTurret;
@@ -165,6 +166,7 @@
import org.avp.client.render.tile.RenderSolarPanel;
import org.avp.client.render.tile.RenderStasisMechanism;
import org.avp.client.render.tile.RenderSupplyCrate;
import org.avp.client.render.tile.RenderTeslaCoil;
import org.avp.client.render.tile.RenderTransformer;
import org.avp.client.render.tile.RenderTurret;
import org.avp.client.render.tile.RenderWorkstation;
@@ -263,6 +265,7 @@
import org.avp.tile.TileEntitySolarPanel;
import org.avp.tile.TileEntityStasisMechanism;
import org.avp.tile.TileEntitySupplyCrate;
import org.avp.tile.TileEntityTeslaCoil;
import org.avp.tile.TileEntityTransformer;
import org.avp.tile.TileEntityTurret;
import org.avp.tile.TileEntityWorkstation;
@@ -452,6 +455,7 @@ private void registerBlockItemRenderers()
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.blastDoor), new RenderItemBlastDoor());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.lightPanel), new RenderItemLightPanel());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.ccflTube), new RenderItemCCFLTube());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.teslaCoil), new RenderItemTeslaCoil());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.powerline), new RenderItemPowerline());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.solarPanel), new RenderItemSolarPanel());
Renderers.registerBlockItemRenderer(BlockHandler.getItemFromBlock(BlockHandler.powercell), new RenderItemPowercell());
@@ -620,5 +624,6 @@ private void registerTileEntitySpecialRenderers()
bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderSkull());
bindTileEntitySpecialRenderer(TileEntityGroundFern.class, new RenderGroundFern());
bindTileEntitySpecialRenderer(TileEntityTreeFern.class, new RenderTreeFern());
bindTileEntitySpecialRenderer(TileEntityTeslaCoil.class, new RenderTeslaCoil());
}
}
@@ -79,6 +79,7 @@
import org.avp.client.model.tile.ModelSevastopolBlastdoor;
import org.avp.client.model.tile.ModelSolarPanel;
import org.avp.client.model.tile.ModelStasisMechanism;
import org.avp.client.model.tile.ModelTeslaCoil;
import org.avp.client.model.tile.ModelTransformer;
import org.avp.client.model.tile.ModelTurret;
import org.avp.client.model.tile.ModelWorkstation;
@@ -160,6 +161,7 @@ public Models models()
public final MapModelTexture<ModelM40> M40GRENADE_INCENDIARY = new MapModelTexture(new ModelM40(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/m40incendiary.png"));
public final MapModelTexture<ModelMotionTracker> MOTIONTRACKER = new MapModelTexture(new ModelMotionTracker(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/motiontracker.png"));
public final MapModelTexture<ModelTurret> TURRET = new MapModelTexture(new ModelTurret(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/turret.png"));
public final MapModelTexture<ModelTeslaCoil> TESLA_COIL = new MapModelTexture(new ModelTeslaCoil(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/teslacoil.png"));
public final MapModelTexture<ModelWorkstation> WORKSTATION = new MapModelTexture(new ModelWorkstation(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/workstation.png"));
public final MapModelTexture<ModelWorkstation> WORKSTATION_MASK = new MapModelTexture(new ModelWorkstation(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/workstation-on.png"));
public final MapModelTexture<ModelLightPanel> LIGHT_PANEL = new MapModelTexture(new ModelLightPanel(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/lightpanel.png"));

0 comments on commit d8d75b8

Please sign in to comment.
You can’t perform that action at this time.