Relocate Source to proper directory.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockFluix extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockFluix() {
|
||||
super( BlockFluix.class, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartz extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartz() {
|
||||
super( BlockQuartz.class, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartzChiseled() {
|
||||
super( BlockQuartzChiseled.class, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQuartzGlass;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockQuartzGlass extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockQuartzGlass() {
|
||||
this( BlockQuartzGlass.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderQuartzGlass.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess w, int x, int y, int z, int side)
|
||||
{
|
||||
Material mat = w.getBlock( x, y, z ).getMaterial();
|
||||
if ( mat == Material.glass || mat == AEGlassMaterial.instance )
|
||||
{
|
||||
if ( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
|
||||
return false;
|
||||
}
|
||||
return super.shouldSideBeRendered( w, x, y, z, side );
|
||||
}
|
||||
|
||||
public BlockQuartzGlass(Class c) {
|
||||
super( c, Material.glass );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
setLightOpacity( 0 );
|
||||
isOpaque = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.client.render.effects.VibrantFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockQuartzLamp extends BlockQuartzGlass
|
||||
{
|
||||
|
||||
public BlockQuartzLamp() {
|
||||
super( BlockQuartzLamp.class );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
|
||||
setLightLevel( 1.0f );
|
||||
setBlockTextureName( "BlockQuartzGlass" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
if ( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
double d0 = (double) (r.nextFloat() - 0.5F) * 0.96D;
|
||||
double d1 = (double) (r.nextFloat() - 0.5F) * 0.96D;
|
||||
double d2 = (double) (r.nextFloat() - 0.5F) * 0.96D;
|
||||
|
||||
VibrantFX fx = new VibrantFX( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D );
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
public BlockQuartzPillar() {
|
||||
super( BlockQuartzPillar.class, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
return new MetaRotation( w, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMetadata()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import rblocks.api.RotatableBlockEnable;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
import appeng.helpers.NullRotation;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IRB;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@RotatableBlockEnable
|
||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon Block;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon Brick;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon SmallBrick;
|
||||
|
||||
@SubscribeEvent
|
||||
public void breakFaster(PlayerEvent.BreakSpeed Ev)
|
||||
{
|
||||
if ( Ev.block == this && Ev.entityPlayer != null )
|
||||
{
|
||||
ItemStack is = Ev.entityPlayer.inventory.getCurrentItem();
|
||||
int level = -1;
|
||||
|
||||
if ( is != null )
|
||||
level = is.getItem().getHarvestLevel( is, "pickaxe" );
|
||||
|
||||
if ( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
|
||||
Ev.newSpeed /= 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockSkyStone() {
|
||||
super( BlockSkyStone.class, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHardness( 50 );
|
||||
hasSubtypes = true;
|
||||
blockResistance = 150.0f;
|
||||
setHarvestLevel( "pickaxe", 3, 0 );
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return getUnlocalizedName() + ".Block";
|
||||
|
||||
if ( is.getItemDamage() == 2 )
|
||||
return getUnlocalizedName() + ".Brick";
|
||||
|
||||
if ( is.getItemDamage() == 3 )
|
||||
return getUnlocalizedName() + ".SmallBrick";
|
||||
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.RB ) )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if ( te != null )
|
||||
{
|
||||
IOrientable out = ((IRB) AppEng.instance.getIntegration( IntegrationType.RB )).getOrientable( te );
|
||||
if ( out != null )
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
if ( w.getBlockMetadata( x, y, z ) == 0 )
|
||||
return new LocationRotation( w, x, y, z );
|
||||
|
||||
return new NullRotation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir)
|
||||
{
|
||||
super.registerBlockIcons( ir );
|
||||
Block = ir.registerIcon( getTextureName() + ".Block" );
|
||||
Brick = ir.registerIcon( getTextureName() + ".Brick" );
|
||||
SmallBrick = ir.registerIcon( getTextureName() + ".SmallBrick" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
if ( metadata == 1 )
|
||||
return Block;
|
||||
if ( metadata == 2 )
|
||||
return Brick;
|
||||
if ( metadata == 3 )
|
||||
return SmallBrick;
|
||||
return super.getIcon( direction, metadata );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderStateByMeta(int metadata)
|
||||
{
|
||||
getRendererInstance().setTemporaryRenderIcon( getIcon( 0, metadata ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
ItemStack is = super.getPickBlock( target, world, x, y, z );
|
||||
is.setItemDamage( world.getBlockMetadata( x, y, z ) );
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item i, CreativeTabs ct, List l)
|
||||
{
|
||||
super.getSubBlocks( i, ct, l );
|
||||
l.add( new ItemStack( i, 1, 1 ) );
|
||||
l.add( new ItemStack( i, 1, 2 ) );
|
||||
l.add( new ItemStack( i, 1, 3 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World w, int x, int y, int z)
|
||||
{
|
||||
super.onBlockAdded( w, x, y, z );
|
||||
if ( Platform.isServer() )
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World w, int x, int y, int z, Block b, int WTF)
|
||||
{
|
||||
super.breakBlock( w, x, y, z, b, WTF );
|
||||
if ( Platform.isServer() )
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
}
|
||||
|
||||
// use AE2's renderer, no rotatable blocks.
|
||||
int getRealRenderType()
|
||||
{
|
||||
return getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMetadata()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQuartzOre;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class OreQuartz extends AEBaseBlock
|
||||
{
|
||||
|
||||
public int boostBrightnessLow;
|
||||
public int boostBrightnessHigh;
|
||||
public boolean enhanceBrightness;
|
||||
|
||||
public OreQuartz(Class self) {
|
||||
super( self, Material.rock );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHardness( 3.0F );
|
||||
setResistance( 5.0F );
|
||||
boostBrightnessLow = 0;
|
||||
boostBrightnessHigh = 1;
|
||||
enhanceBrightness = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderQuartzOre.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMixedBrightnessForBlock(IBlockAccess par1iBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
|
||||
if ( enhanceBrightness )
|
||||
{
|
||||
j1 = Math.max( j1 >> 20, j1 >> 4 );
|
||||
|
||||
if ( j1 > 4 )
|
||||
j1 += boostBrightnessHigh;
|
||||
else
|
||||
j1 += boostBrightnessLow;
|
||||
|
||||
if ( j1 > 15 )
|
||||
j1 = 15;
|
||||
return j1 << 20 | j1 << 4;
|
||||
}
|
||||
return j1;
|
||||
}
|
||||
|
||||
public OreQuartz() {
|
||||
this( OreQuartz.class );
|
||||
}
|
||||
|
||||
ItemStack getItemDropped()
|
||||
{
|
||||
return AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int id, Random rand, int meta)
|
||||
{
|
||||
return getItemDropped().getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int id)
|
||||
{
|
||||
return getItemDropped().getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand)
|
||||
{
|
||||
return 1 + rand.nextInt( 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int fortune, Random rand)
|
||||
{
|
||||
if ( fortune > 0 && Item.getItemFromBlock( this ) != getItemDropped( 0, rand, fortune ) )
|
||||
{
|
||||
int j = rand.nextInt( fortune + 2 ) - 1;
|
||||
|
||||
if ( j < 0 )
|
||||
{
|
||||
j = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped( rand ) * (j + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.quantityDropped( rand );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World w, int x, int y, int z, int blockid, float something, int meta)
|
||||
{
|
||||
super.dropBlockAsItemWithChance( w, x, y, z, blockid, something, meta );
|
||||
|
||||
if ( getItemDropped( blockid, w.rand, meta ) != Item.getItemFromBlock( this ) )
|
||||
{
|
||||
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
|
||||
|
||||
this.dropXpOnBlockBreak( w, x, y, z, xp );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.client.render.effects.ChargedOreFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OreQuartzCharged extends OreQuartz
|
||||
{
|
||||
|
||||
public OreQuartzCharged() {
|
||||
super( OreQuartzCharged.class );
|
||||
boostBrightnessLow = 2;
|
||||
boostBrightnessHigh = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
ItemStack getItemDropped()
|
||||
{
|
||||
return AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
double xOff = (double) (r.nextFloat());
|
||||
double yOff = (double) (r.nextFloat());
|
||||
double zOff = (double) (r.nextFloat());
|
||||
|
||||
switch (r.nextInt( 6 ))
|
||||
{
|
||||
case 0:
|
||||
xOff = -0.01;
|
||||
break;
|
||||
case 1:
|
||||
yOff = -0.01;
|
||||
break;
|
||||
case 2:
|
||||
xOff = -0.01;
|
||||
break;
|
||||
case 3:
|
||||
zOff = -0.01;
|
||||
break;
|
||||
case 4:
|
||||
xOff = 1.01;
|
||||
break;
|
||||
case 5:
|
||||
yOff = 1.01;
|
||||
break;
|
||||
case 6:
|
||||
zOff = 1.01;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
ChargedOreFX fx = new ChargedOreFX( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f );
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user