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:
@@ -23,16 +23,16 @@ import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -483,11 +483,11 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*/
|
||||
private boolean canHandleBlock( final WorldServer w, final BlockPos pos )
|
||||
{
|
||||
final Block block = w.getBlockState( pos ).getBlock();
|
||||
final Material material = block.getMaterial();
|
||||
final float hardness = block.getBlockHardness( w, pos );
|
||||
final boolean ignoreMaterials = material == Material.air || material == Material.lava || material == Material.water || material.isLiquid();
|
||||
final boolean ignoreBlocks = block == Blocks.bedrock || block == Blocks.end_portal || block == Blocks.end_portal_frame || block == Blocks.command_block;
|
||||
final IBlockState state = w.getBlockState( pos );
|
||||
final Material material = state.getMaterial();
|
||||
final float hardness = state.getBlockHardness( w, pos );
|
||||
final boolean ignoreMaterials = material == Material.AIR || material == Material.LAVA || material == Material.WATER || material.isLiquid();
|
||||
final boolean ignoreBlocks = state.getBlock() == Blocks.BEDROCK || state.getBlock() == Blocks.END_PORTAL || state.getBlock() == Blocks.END_PORTAL_FRAME || state.getBlock() == Blocks.COMMAND_BLOCK;
|
||||
|
||||
return !ignoreMaterials && !ignoreBlocks && !w.isAirBlock( pos ) && w.isBlockLoaded( pos ) && w.canMineBlockBody( Platform.getPlayer( w ), pos ) && hardness >= 0f;
|
||||
}
|
||||
@@ -503,8 +503,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*/
|
||||
protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
final Block block = w.getBlockState( pos ).getBlock();
|
||||
final float hardness = block.getBlockHardness( w, pos );
|
||||
final IBlockState state = w.getBlockState( pos );
|
||||
final float hardness = state.getBlockHardness( w, pos );
|
||||
|
||||
float requiredEnergy = 1 + hardness;
|
||||
for( final ItemStack is : items )
|
||||
@@ -555,7 +555,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
w.setBlockToAir( pos );
|
||||
|
||||
final AxisAlignedBB box = AxisAlignedBB.fromBounds( pos.getX() - 0.2, pos.getY() - 0.2, pos.getZ() - 0.2, pos.getX() + 1.2, pos.getY() + 1.2, pos.getZ() + 1.2 );
|
||||
final AxisAlignedBB box = new AxisAlignedBB( pos.getX() - 0.2, pos.getY() - 0.2, pos.getZ() - 0.2, pos.getX() + 1.2, pos.getY() + 1.2, pos.getZ() + 1.2 );
|
||||
for( final Object ei : w.getEntitiesWithinAABB( EntityItem.class, box ) )
|
||||
{
|
||||
if( ei instanceof EntityItem )
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -234,7 +234,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
|
||||
@@ -25,18 +25,20 @@ import java.util.List;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemFirework;
|
||||
import net.minecraft.item.ItemReed;
|
||||
import net.minecraft.item.ItemSkull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
@@ -347,7 +349,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -408,6 +410,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@Override
|
||||
public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src )
|
||||
{
|
||||
//TODO 1.9.4 - 2 hands! Just do something!
|
||||
final EnumHand hand = EnumHand.MAIN_HAND;
|
||||
|
||||
if( this.blocked || input == null || input.getStackSize() <= 0 )
|
||||
{
|
||||
return input;
|
||||
@@ -429,7 +434,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
if( w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ) )
|
||||
{
|
||||
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i instanceof ItemReed ) )
|
||||
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i == Item.getItemFromBlock( Blocks.REEDS ) ) )
|
||||
{
|
||||
final EntityPlayer player = Platform.getPlayer( (WorldServer) w );
|
||||
Platform.configurePlayer( player, side, this.getTile() );
|
||||
@@ -455,35 +460,35 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
worked = true;
|
||||
if( type == Actionable.MODULATE )
|
||||
{
|
||||
if( i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemReed )
|
||||
if( i instanceof IPlantable || i instanceof ItemSkull || i == Item.getItemFromBlock( Blocks.REEDS ) )
|
||||
{
|
||||
boolean Worked = false;
|
||||
|
||||
if( side.xOffset == 0 && side.zOffset == 0 )
|
||||
{
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing() ), side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing() ), hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if( !Worked && side.xOffset == 0 && side.zOffset == 0 )
|
||||
{
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing().getOpposite() ), side.getFacing(), side.xOffset, side.yOffset, side.zOffset );
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing().getOpposite() ), hand, side.getFacing(), side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if( !Worked && side.yOffset == 0 )
|
||||
{
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( EnumFacing.DOWN ), EnumFacing.UP, side.xOffset, side.yOffset, side.zOffset );
|
||||
Worked = i.onItemUse( is, player, w, tePos.offset( EnumFacing.DOWN ), hand, EnumFacing.UP, side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if( !Worked )
|
||||
{
|
||||
i.onItemUse( is, player, w, tePos, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
|
||||
i.onItemUse( is, player, w, tePos, hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
|
||||
}
|
||||
|
||||
maxStorage -= is.stackSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
i.onItemUse( is, player, w, tePos, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
|
||||
i.onItemUse( is, player, w, tePos, hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
|
||||
maxStorage -= is.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.parts.automation;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
|
||||
@@ -29,10 +29,10 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -595,6 +595,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
renderer.setRenderAllFaces( true );
|
||||
|
||||
//TODO 1.9.4 - getMixedBrightnessForBlock => ?
|
||||
renderer.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorld(), pos ) );
|
||||
renderer.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||
|
||||
@@ -642,7 +643,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.parts.automation;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
@@ -115,7 +115,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
{
|
||||
final World w = self.getWorld();
|
||||
|
||||
if( w.getChunkProvider().chunkExists( pos.getX() >> 4, pos.getZ() >> 4 ) )
|
||||
if( w.getChunkProvider().getLoadedChunk( pos.getX() >> 4, pos.getZ() >> 4 ) != null )
|
||||
{
|
||||
return w.getTileEntity( pos );
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
final int zCoordinate = selfPos.getZ();
|
||||
final World world = self.getWorld();
|
||||
|
||||
return world != null && world.getChunkProvider().chunkExists( xCoordinate >> 4, zCoordinate >> 4 );
|
||||
return world != null && world.getChunkProvider().getLoadedChunk( xCoordinate >> 4, zCoordinate >> 4 ) != null;
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
|
||||
Reference in New Issue
Block a user