First update pass (1/3) - ~1400 -> 82 errors

This is first update pass, which is mainly import reorganization, name
fixes, etc... Although some parts of second were done where changes
aren't important.
Errors: ~1400 -> 82.
This commit is contained in:
elix-x
2016-06-19 14:43:27 +02:00
parent d9725a7d9b
commit 5498eb6d7c
288 changed files with 1637 additions and 1420 deletions
@@ -24,7 +24,7 @@ import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;
@@ -22,13 +22,14 @@ package appeng.entity;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import appeng.api.AEApi;
@@ -79,7 +80,8 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
final int i = MathHelper.floor_double( this.posY );
final int k = MathHelper.floor_double( this.posZ );
final Material mat = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock().getMaterial();
IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
final Material mat = state.getBlock().getMaterial( state );
if( Platform.isServer() && mat.isLiquid() )
{
this.transformTime++;
@@ -104,7 +106,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
if( materials.certusQuartzCrystalCharged().isSameAs( item ) )
{
final AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 );
final AxisAlignedBB region = new AxisAlignedBB( this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1 );
final List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
EntityItem redstone = null;
@@ -117,12 +119,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
final ItemStack other = ( (EntityItem) e ).getEntityItem();
if( other != null && other.stackSize > 0 )
{
if( Platform.isSameItem( other, new ItemStack( Items.redstone ) ) )
if( Platform.isSameItem( other, new ItemStack( Items.REDSTONE ) ) )
{
redstone = (EntityItem) e;
}
if( Platform.isSameItem( other, new ItemStack( Items.quartz ) ) )
if( Platform.isSameItem( other, new ItemStack( Items.QUARTZ ) ) )
{
netherQuartz = (EntityItem) e;
}
@@ -19,14 +19,14 @@
package appeng.entity;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import appeng.api.implementations.items.IGrowableCrystal;
@@ -73,11 +73,11 @@ public final class EntityGrowingCrystal extends EntityItem
final int i = MathHelper.floor_double( this.posY );
final int k = MathHelper.floor_double( this.posZ );
final Block blk = this.worldObj.getBlockState( new BlockPos( j, i, k ) ).getBlock();
final Material mat = blk.getMaterial();
final IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
final Material mat = state.getMaterial();
final IGrowableCrystal cry = (IGrowableCrystal) is.getItem();
final float multiplier = cry.getMultiplier( blk, mat );
final float multiplier = cry.getMultiplier( state.getBlock(), mat );
final int speed = (int) Math.max( 1, this.getSpeed( j, i, k ) * multiplier );
final boolean isClient = Platform.isClient();
@@ -26,8 +26,8 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
@@ -85,7 +85,7 @@ public final class EntitySingularity extends AEBaseEntityItem
if( materials.singularity().isSameAs( item ) )
{
final AxisAlignedBB region = AxisAlignedBB.fromBounds( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
final AxisAlignedBB region = new AxisAlignedBB( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
final List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
for( final Entity e : l )
@@ -28,11 +28,13 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
@@ -104,7 +106,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
}
}
if( this.fuse <= 0 )
if( this.getFuse() <= 0 )
{
this.setDead();
@@ -117,24 +119,24 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
{
this.worldObj.spawnParticle( EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D );
}
this.fuse--;
this.setFuse( getFuse() - 1 );
}
// override :P
void explode()
{
this.worldObj.playSoundEffect( this.posX, this.posY, this.posZ, "random.explode", 4.0F, ( 1.0F + ( this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat() ) * 0.2F ) * 32.9F );
this.worldObj.playSound( null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F, ( 1.0F + ( this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat() ) * 0.2F ) * 32.9F );
if( this.isInWater() )
{
return;
}
for( final Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, AxisAlignedBB.fromBounds( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) )
for( final Object e : this.worldObj.getEntitiesWithinAABBExcludingEntity( this, new AxisAlignedBB( this.posX - 1.5, this.posY - 1.5f, this.posZ - 1.5, this.posX + 1.5, this.posY + 1.5, this.posZ + 1.5 ) ) )
{
if( e instanceof Entity )
{
( (Entity) e ).attackEntityFrom( DamageSource.setExplosionSource( null ), 6 );
( (Entity) e ).attackEntityFrom( DamageSource.causeExplosionDamage( (Explosion) null ), 6 );
}
}
@@ -152,7 +154,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
final BlockPos point = new BlockPos( x, y, z );
final IBlockState state = this.worldObj.getBlockState( point );
final Block block = state.getBlock();
if( block != null && !block.isAir( this.worldObj, point ) )
if( block != null && !block.isAir( state, this.worldObj, point ) )
{
float strength = (float) ( 2.3f - ( ( ( x + 0.5f ) - this.posX ) * ( ( x + 0.5f ) - this.posX ) + ( ( y + 0.5f ) - this.posY ) * ( ( y + 0.5f ) - this.posY ) + ( ( z + 0.5f ) - this.posZ ) * ( ( z + 0.5f ) - this.posZ ) ) );
@@ -161,7 +163,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
if( strength > 0.01 )
{
if( block.getMaterial() != Material.air )
if( block.getMaterial(state) != Material.AIR )
{
if( block.canDropFromExplosion( ex ) )
{
@@ -183,12 +185,12 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
@Override
public void writeSpawnData( final ByteBuf data )
{
data.writeByte( this.fuse );
data.writeByte( this.getFuse() );
}
@Override
public void readSpawnData( final ByteBuf data )
{
this.fuse = data.readByte();
this.setFuse( data.readByte() );;
}
}
@@ -62,9 +62,9 @@ public class RenderTinyTNTPrimed extends Render
GlStateManager.translate( (float) x, (float) y + 0.5F, (float) z );
float f2;
if( tnt.fuse - life + 1.0F < 10.0F )
if( tnt.getFuse() - life + 1.0F < 10.0F )
{
f2 = 1.0F - ( tnt.fuse - life + 1.0F ) / 10.0F;
f2 = 1.0F - ( tnt.getFuse() - life + 1.0F ) / 10.0F;
if( f2 < 0.0F )
{
@@ -83,13 +83,13 @@ public class RenderTinyTNTPrimed extends Render
}
GL11.glScalef( 0.5f, 0.5f, 0.5f );
f2 = ( 1.0F - ( tnt.fuse - life + 1.0F ) / 100.0F ) * 0.8F;
f2 = ( 1.0F - ( tnt.getFuse() - life + 1.0F ) / 100.0F ) * 0.8F;
this.bindEntityTexture( tnt );
GlStateManager.translate( -0.5F, -0.5F, 0.5F );
blockrendererdispatcher.renderBlockBrightness( Blocks.tnt.getDefaultState(), tnt.getBrightness( life ) );
blockrendererdispatcher.renderBlockBrightness( Blocks.TNT.getDefaultState(), tnt.getBrightness( life ) );
GlStateManager.translate( 0.0F, 0.0F, 1.0F );
if( tnt.fuse / 5 % 2 == 0 )
if( tnt.getFuse() / 5 % 2 == 0 )
{
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
@@ -98,7 +98,7 @@ public class RenderTinyTNTPrimed extends Render
GlStateManager.color( 1.0F, 1.0F, 1.0F, f2 );
GlStateManager.doPolygonOffset( -3.0F, -3.0F );
GlStateManager.enablePolygonOffset();
blockrendererdispatcher.renderBlockBrightness( Blocks.tnt.getDefaultState(), 1.0F );
blockrendererdispatcher.renderBlockBrightness( Blocks.TNT.getDefaultState(), 1.0F );
GlStateManager.doPolygonOffset( 0.0F, 0.0F );
GlStateManager.disablePolygonOffset();
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
@@ -114,6 +114,6 @@ public class RenderTinyTNTPrimed extends Render
@Override
protected ResourceLocation getEntityTexture( final Entity entity )
{
return TextureMap.locationBlocksTexture;
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
}