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:
Ellpeck 2016-07-28 18:09:48 +02:00
parent bfac50b2cd
commit b26c74c23a

View file

@ -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
if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
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{
toReturn = this.breakBlocks(stack, 1, player.worldObj, pos, player);
toReturn = this.breakBlocks(stack, 1, player.worldObj, pos, side, player);
}
}
else{
toReturn = this.breakBlocks(stack, 0, player.worldObj, pos, player);
toReturn = this.breakBlocks(stack, 0, player.worldObj, pos, side, player);
}
//Removes Enchantments added above
ItemUtil.removeEnchantment(stack, Enchantments.SILK_TOUCH);
ItemUtil.removeEnchantment(stack, Enchantments.FORTUNE);
}
}
return toReturn;
}
@ -414,19 +420,12 @@ public class ItemDrill extends ItemEnergy{
* @param world The World
* @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 yRange = radius;
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
int side = pos.sideHit.ordinal();
if(side == 0 || side == 1){
zRange = radius;
yRange = 0;