Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -25,12 +26,13 @@ import net.minecraft.block.material.Material;
import appeng.block.AEDecorativeBlock;
import appeng.core.features.AEFeature;
public class BlockQuartz extends AEDecorativeBlock
{
public BlockQuartz() {
public BlockQuartz()
{
super( BlockQuartz.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
}
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -25,12 +26,13 @@ import net.minecraft.block.material.Material;
import appeng.block.AEDecorativeBlock;
import appeng.core.features.AEFeature;
public class BlockQuartzChiseled extends AEDecorativeBlock
{
public BlockQuartzChiseled() {
public BlockQuartzChiseled()
{
super( BlockQuartzChiseled.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
}
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -32,37 +33,39 @@ import appeng.client.render.blocks.RenderQuartzGlass;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
public class BlockQuartzGlass extends AEBaseBlock
{
public BlockQuartzGlass() {
public BlockQuartzGlass()
{
this( BlockQuartzGlass.class );
}
@Override
@SideOnly(Side.CLIENT)
public Class<? extends BaseBlockRender> getRenderer()
public BlockQuartzGlass( Class c )
{
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 );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
this.setLightOpacity( 0 );
this.isOpaque = false;
}
@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 );
}
}
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import java.util.Random;
@@ -32,10 +33,12 @@ import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.features.AEFeature;
public class BlockQuartzLamp extends BlockQuartzGlass
{
public BlockQuartzLamp() {
public BlockQuartzLamp()
{
super( BlockQuartzLamp.class );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
this.setLightLevel( 1.0f );
@@ -43,22 +46,21 @@ public class BlockQuartzLamp extends BlockQuartzGlass
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World w, int x, int y, int z, Random r)
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if ( !AEConfig.instance.enableEffects )
if( !AEConfig.instance.enableEffects )
return;
if ( CommonHelper.proxy.shouldAddParticles( r ) )
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
double d0 = (r.nextFloat() - 0.5F) * 0.96D;
double d1 = (r.nextFloat() - 0.5F) * 0.96D;
double d2 = (r.nextFloat() - 0.5F) * 0.96D;
double d0 = ( r.nextFloat() - 0.5F ) * 0.96D;
double d1 = ( r.nextFloat() - 0.5F ) * 0.96D;
double d2 = ( 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( fx );
}
}
}
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
@@ -29,24 +30,25 @@ import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature;
import appeng.helpers.MetaRotation;
public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
{
public BlockQuartzPillar() {
public BlockQuartzPillar()
{
super( BlockQuartzPillar.class, Material.rock );
this.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;
}
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
}
@@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import java.util.List;
@@ -54,36 +55,22 @@ import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IRB;
import appeng.util.Platform;
@RotatableBlockEnable
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
IIcon Block;
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
IIcon Brick;
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
IIcon SmallBrick;
@SubscribeEvent
public void breakFaster(PlayerEvent.BreakSpeed Ev)
public BlockSkyStone()
{
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 );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setHardness( 50 );
@@ -93,76 +80,28 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
MinecraftForge.EVENT_BUS.register( this );
}
@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;
}
}
@Override
public int damageDropped(int meta)
public int damageDropped( int meta )
{
return meta;
}
@Override
public String getUnlocalizedName(ItemStack is)
{
if ( is.getItemDamage() == 1 )
return this.getUnlocalizedName() + ".Block";
if ( is.getItemDamage() == 2 )
return this.getUnlocalizedName() + ".Brick";
if ( is.getItemDamage() == 3 )
return this.getUnlocalizedName() + ".SmallBrick";
return this.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 );
this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int direction, int metadata)
{
if ( metadata == 1 )
return this.Block;
if ( metadata == 2 )
return this.Brick;
if ( metadata == 3 )
return this.SmallBrick;
return super.getIcon( direction, metadata );
}
@Override
public void setRenderStateByMeta(int metadata)
{
this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) );
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
{
@@ -173,29 +112,10 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
@SideOnly(Side.CLIENT)
public void getCheckedSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemStacks)
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
itemStacks.add( new ItemStack( item, 1, 1 ) );
itemStacks.add( new ItemStack( item, 1, 2 ) );
itemStacks.add( new ItemStack( item, 1, 3 ) );
}
@Override
public void onBlockAdded(World w, int x, int y, int z)
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() )
if( Platform.isServer() )
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
}
@@ -211,4 +131,86 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
return false;
}
@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
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
return this.getUnlocalizedName() + ".Block";
if( is.getItemDamage() == 2 )
return this.getUnlocalizedName() + ".Brick";
if( is.getItemDamage() == 3 )
return this.getUnlocalizedName() + ".SmallBrick";
return this.getUnlocalizedName();
}
@Override
@SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister ir )
{
super.registerBlockIcons( ir );
this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
{
if( metadata == 1 )
return this.Block;
if( metadata == 2 )
return this.Brick;
if( metadata == 3 )
return this.SmallBrick;
return super.getIcon( direction, metadata );
}
@Override
public void setRenderStateByMeta( int metadata )
{
this.getRendererInstance().setTemporaryRenderIcon( this.getIcon( 0, metadata ) );
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
itemStacks.add( new ItemStack( item, 1, 1 ) );
itemStacks.add( new ItemStack( item, 1, 2 ) );
itemStacks.add( new ItemStack( item, 1, 3 ) );
}
@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 );
}
}
@@ -21,7 +21,6 @@ package appeng.block.solids;
import java.util.EnumSet;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
@@ -46,6 +45,11 @@ public class OreQuartz extends AEBaseBlock
private int boostBrightnessHigh;
private boolean enhanceBrightness;
public OreQuartz()
{
this( OreQuartz.class );
}
public OreQuartz( Class<? extends OreQuartz> self )
{
super( self, Material.rock );
@@ -57,27 +61,27 @@ public class OreQuartz extends AEBaseBlock
this.enhanceBrightness = false;
}
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderQuartzOre.class;
}
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
{
int j1 = super.getMixedBrightnessForBlock( par1iBlockAccess, par2, par3, par4 );
if ( this.enhanceBrightness )
if( this.enhanceBrightness )
{
j1 = Math.max( j1 >> 20, j1 >> 4 );
if ( j1 > 4 )
if( j1 > 4 )
{
j1 += this.boostBrightnessHigh;
}
@@ -86,55 +90,63 @@ public class OreQuartz extends AEBaseBlock
j1 += this.boostBrightnessLow;
}
if ( j1 > 15 )
if( j1 > 15 )
j1 = 15;
return j1 << 20 | j1 << 4;
}
return j1;
}
public OreQuartz()
{
this( OreQuartz.class );
}
@Nullable
@Override
public Item getItemDropped( int id, Random rand, int meta )
{
for ( Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() )
{
return crystalItem;
}
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
}
@Override
public int damageDropped( int id )
{
for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
}
@Override
public int quantityDropped( Random rand )
{
return 1 + rand.nextInt( 2 );
}
@Nullable
@Override
public Item getItemDropped( int id, Random rand, int meta )
{
for( Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() )
{
return crystalItem;
}
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
}
@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( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) )
{
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
this.dropXpOnBlockBreak( w, x, y, z, xp );
}
}
@Override
public int damageDropped( int id )
{
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
}
@Override
public int quantityDroppedWithBonus( int fortune, Random rand )
{
if ( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) )
if( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( 0, rand, fortune ) )
{
int j = rand.nextInt( fortune + 2 ) - 1;
if ( j < 0 )
if( j < 0 )
{
j = 0;
}
@@ -147,19 +159,6 @@ public class OreQuartz extends AEBaseBlock
}
}
@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 ( this.getItemDropped( blockID, w.rand, meta ) != Item.getItemFromBlock( this ) )
{
int xp = MathHelper.getRandomIntegerInRange( w.rand, 2, 5 );
this.dropXpOnBlockBreak( w, x, y, z, xp );
}
}
public void setBoostBrightnessLow( int boostBrightnessLow )
{
this.boostBrightnessLow = boostBrightnessLow;
@@ -52,7 +52,7 @@ public class OreQuartzCharged extends OreQuartz
@Override
public Item getItemDropped( int id, Random rand, int meta )
{
for ( Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() )
for( Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() )
{
return charged;
}
@@ -82,7 +82,7 @@ public class OreQuartzCharged extends OreQuartz
double yOff = ( r.nextFloat() );
double zOff = ( r.nextFloat() );
switch ( r.nextInt( 6 ) )
switch( r.nextInt( 6 ) )
{
case 0:
xOff = -0.01;
@@ -107,11 +107,10 @@ public class OreQuartzCharged extends OreQuartz
break;
}
if ( CommonHelper.proxy.shouldAddParticles( r ) )
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( fx );
}
}
}