Permalink
Browse files

Added CCFL tube lights.

  • Loading branch information...
Ri5ux committed Nov 5, 2017
1 parent 6eb85f5 commit d7cd2e9c112f54726943f9ac291c1d3283ca29c4
@@ -7,6 +7,7 @@
import org.avp.block.BlockAssembler;
import org.avp.block.BlockBlackGoo;
import org.avp.block.BlockBlastdoor;
import org.avp.block.BlockCCFLTube;
import org.avp.block.BlockCryostasisTube;
import org.avp.block.BlockCustomSlab;
import org.avp.block.BlockCustomStairs;
@@ -160,6 +161,7 @@
public Block sevastopolBlastDoor = new BlockSevastopolBlastDoor().setHardness(10F).setResistance(15.0F).setLightOpacity(0);
public Block cryoTube = new BlockCryostasisTube(Material.IRON).setHardness(10F).setResistance(15.0F).setLightOpacity(4);
public Block lightPanel = new BlockLightPanel(Material.IRON).setHardness(1.5F).setResistance(2.0F);
public Block ccflTube = new BlockCCFLTube(Material.IRON).setHardness(0.5F).setResistance(1.0F);
public Block satelliteModem = new BlockSatelliteModem(Material.IRON).setHardness(3.2F).setResistance(2.6F);
public Block powercell = new BlockPowercell(Material.IRON).setHardness(3.2F).setResistance(2.6F);
public Block redstoneSensor = new BlockRedstoneSensor(Material.IRON).setHardness(3.2F).setResistance(2.6F);
@@ -251,6 +253,7 @@ private void register()
register("supplychuteblock.seegson", crateSeegson).setCreativeTab(AliensVsPredator.tabMain());
register("cryostasistube", cryoTube).setCreativeTab(AliensVsPredator.tabMain());
register("lightpanel", lightPanel).setCreativeTab(AliensVsPredator.tabMain());
register("ccfltube", ccflTube).setCreativeTab(AliensVsPredator.tabMain());
register("mainframepanel.shimmer", muthurPanel1).setCreativeTab(AliensVsPredator.tabMain());
register("mainframepanel.flicker", muthurPanel2).setCreativeTab(AliensVsPredator.tabMain());
register("engineership.ampule", ampule).setCreativeTab(AliensVsPredator.tabMain());
@@ -364,7 +367,7 @@ public Block register(String identifier, Block block)
public static final BlockFluidClassic blackgoo = null;
public static final BlockFluidClassic mist = null;
public static final Block lv426rock = null;
public static ArrayList<BlockRegistration> getRegistrations()
{
return registrations;
@@ -375,7 +378,7 @@ public static void registerBlocks(RegistryEvent.Register<Block> event)
{
registrations.add(new BlockFluidRegistration("blackgoo", BlockBlackGoo.class, BlockBlackGoo.fluid));
registrations.add(new BlockFluidRegistration("mist", BlockMist.class, BlockMist.fluid));
registrations.add(new BlockRegistrationAVP("paddingpanel_orange", new BlockMaterial(Material.CLOTH)) {
@Override
public Block applyModifiers(Block block)
@@ -0,0 +1,112 @@
package org.avp.block;
import org.avp.tile.TileEntityCCFLTube;
import org.avp.tile.TileEntityElectrical;
import com.arisux.mdx.lib.world.entity.Entities;
import com.arisux.mdx.lib.world.tile.IRotatableYAxis;
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.IBlockAccess;
import net.minecraft.world.World;
public class BlockCCFLTube extends Block
{
public BlockCCFLTube(Material material)
{
super(material);
this.setLightOpacity(0);
}
@Override
public boolean isTranslucent(IBlockState state)
{
return true;
}
@Override
public boolean isBlockNormalCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityElectrical)
{
TileEntityElectrical e = (TileEntityElectrical) tile;
if (e.isOperational())
{
return 15;
}
}
return 0;
}
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, 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);
TileEntityCCFLTube ccfl = (TileEntityCCFLTube) world.getTileEntity(pos);
if (ccfl != null)
{
ccfl.setRotationYAxis(Entities.getEntityFacingRotY(placer));
ccfl.setRotationXAxis(Entities.getEntityFacingRotX(placer));
System.out.println(ccfl.getRotationXAxis());
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 TileEntityCCFLTube();
}
@Override
public boolean hasTileEntity(IBlockState state)
{
return true;
}
}
@@ -78,6 +78,7 @@
import org.avp.client.render.items.RenderItemAPC;
import org.avp.client.render.items.RenderItemAmpule;
import org.avp.client.render.items.RenderItemBlastDoor;
import org.avp.client.render.items.RenderItemCCFLTube;
import org.avp.client.render.items.RenderItemCryostasisTube;
import org.avp.client.render.items.RenderItemGunLocker;
import org.avp.client.render.items.RenderItemLightPanel;
@@ -137,6 +138,7 @@
import org.avp.client.render.tile.RenderAmpule;
import org.avp.client.render.tile.RenderAssembler;
import org.avp.client.render.tile.RenderBlastdoor;
import org.avp.client.render.tile.RenderCCFLTube;
import org.avp.client.render.tile.RenderCryostasisTube;
import org.avp.client.render.tile.RenderGunLocker;
import org.avp.client.render.tile.RenderHiveResin;
@@ -230,6 +232,7 @@
import org.avp.tile.TileEntityAmpule;
import org.avp.tile.TileEntityAssembler;
import org.avp.tile.TileEntityBlastdoor;
import org.avp.tile.TileEntityCCFLTube;
import org.avp.tile.TileEntityCryostasisTube;
import org.avp.tile.TileEntityGunLocker;
import org.avp.tile.TileEntityHiveResin;
@@ -431,6 +434,7 @@ private void registerItemRenderers(ItemHandler items)
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().repulsionGenerator), new RenderItemRepulsionGenerator());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().blastDoor), new RenderItemBlastDoor());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().lightPanel), new RenderItemLightPanel());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().ccflTube), new RenderItemCCFLTube());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().powerline), new RenderItemPowerline());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().solarPanel), new RenderItemSolarPanel());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().powercell), new RenderItemPowercell());
@@ -562,6 +566,7 @@ private void registerTileEntitySpecialRenderers()
bindTileEntitySpecialRenderer(TileEntityRepulsionGenerator.class, new RenderRepulsionGenerator());
bindTileEntitySpecialRenderer(TileEntityAssembler.class, new RenderAssembler());
bindTileEntitySpecialRenderer(TileEntityLightPanel.class, new RenderLightPanel());
bindTileEntitySpecialRenderer(TileEntityCCFLTube.class, new RenderCCFLTube());
bindTileEntitySpecialRenderer(TileEntitySolarPanel.class, new RenderSolarPanel());
bindTileEntitySpecialRenderer(TileEntitySatelliteModem.class, new RenderSatelliteModem());
bindTileEntitySpecialRenderer(TileEntityTransformer.class, new RenderTransformer());
Oops, something went wrong.

0 comments on commit d7cd2e9

Please sign in to comment.