mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 03:59:37 +00:00
Merge pull request #2805 from halvors/fix/get-pick-block
Update getPickBlock() to use the new non-deprecated version.
This commit is contained in:
commit
b743618186
5 files changed
+14
-15
No files matched your search
@@ -51,11 +51,11 @@ public class BlockBounding extends Block implements IPeripheralProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getPickBlock(target, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getPickBlock(target, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, player);
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
{
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z);
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z, null);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
@@ -149,7 +149,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
TileEntityCardboardBox tileEntity = (TileEntityCardboardBox)world.getTileEntity(x, y, z);
|
||||
|
||||
@@ -176,7 +176,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z));
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
|
||||
@@ -204,8 +204,7 @@ public class BlockEnergyCube extends BlockContainer implements IPeripheralProvid
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z));
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player));
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
|
||||
@@ -238,7 +237,7 @@ public class BlockEnergyCube extends BlockContainer implements IPeripheralProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(x, y, z);
|
||||
ItemStack itemStack = new ItemStack(MekanismBlocks.EnergyCube);
|
||||
@@ -257,7 +256,7 @@ public class BlockEnergyCube extends BlockContainer implements IPeripheralProvid
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
{
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z);
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z, null);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public class BlockGasTank extends BlockContainer
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z));
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class BlockGasTank extends BlockContainer
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
{
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z);
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z, null);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
@@ -208,7 +208,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
TileEntityGasTank tileEntity = (TileEntityGasTank)world.getTileEntity(x, y, z);
|
||||
ItemStack itemStack = new ItemStack(MekanismBlocks.GasTank);
|
||||
|
||||
@@ -447,7 +447,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IP
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z));
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
@@ -456,7 +456,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IP
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
|
||||
ItemStack itemStack = new ItemStack(GeneratorsBlocks.Generator, 1, world.getBlockMetadata(x, y, z));
|
||||
@@ -493,7 +493,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IP
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
{
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z);
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z, null);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
|
||||
Reference in new issue
Block a user