mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
Made the drill's 5x5 upgrade mine out a five by five one block higher so that people stop bitching about it
This commit is contained in:
parent
bfac50b2cd
commit
b26c74c23a
1 changed files with 19 additions and 20 deletions
|
@ -255,23 +255,29 @@ public class ItemDrill extends ItemEnergy{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Block hit
|
||||||
|
RayTraceResult ray = WorldUtil.getNearestBlockWithDefaultReachDistance(player.worldObj, player);
|
||||||
|
if(ray != null){
|
||||||
|
int side = ray.sideHit.ordinal();
|
||||||
|
|
||||||
//Breaks the Blocks
|
//Breaks the Blocks
|
||||||
if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
|
if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
|
||||||
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
|
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
|
||||||
toReturn = this.breakBlocks(stack, 2, player.worldObj, pos, player);
|
toReturn = this.breakBlocks(stack, 2, player.worldObj, side != 0 && side != 1 ? pos.up() : pos, side, player);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
toReturn = this.breakBlocks(stack, 1, player.worldObj, pos, player);
|
toReturn = this.breakBlocks(stack, 1, player.worldObj, pos, side, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
toReturn = this.breakBlocks(stack, 0, player.worldObj, pos, player);
|
toReturn = this.breakBlocks(stack, 0, player.worldObj, pos, side, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Removes Enchantments added above
|
//Removes Enchantments added above
|
||||||
ItemUtil.removeEnchantment(stack, Enchantments.SILK_TOUCH);
|
ItemUtil.removeEnchantment(stack, Enchantments.SILK_TOUCH);
|
||||||
ItemUtil.removeEnchantment(stack, Enchantments.FORTUNE);
|
ItemUtil.removeEnchantment(stack, Enchantments.FORTUNE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,19 +420,12 @@ public class ItemDrill extends ItemEnergy{
|
||||||
* @param world The World
|
* @param world The World
|
||||||
* @param player The Player who breaks the Blocks
|
* @param player The Player who breaks the Blocks
|
||||||
*/
|
*/
|
||||||
public boolean breakBlocks(ItemStack stack, int radius, World world, BlockPos aPos, EntityPlayer player){
|
public boolean breakBlocks(ItemStack stack, int radius, World world, BlockPos aPos, int side, EntityPlayer player){
|
||||||
int xRange = radius;
|
int xRange = radius;
|
||||||
int yRange = radius;
|
int yRange = radius;
|
||||||
int zRange = 0;
|
int zRange = 0;
|
||||||
|
|
||||||
//Block hit
|
|
||||||
RayTraceResult pos = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player);
|
|
||||||
if(pos == null){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Corrects Blocks to hit depending on Side of original Block hit
|
//Corrects Blocks to hit depending on Side of original Block hit
|
||||||
int side = pos.sideHit.ordinal();
|
|
||||||
if(side == 0 || side == 1){
|
if(side == 0 || side == 1){
|
||||||
zRange = radius;
|
zRange = radius;
|
||||||
yRange = 0;
|
yRange = 0;
|
||||||
|
|
Loading…
Reference in a new issue