Changed formatting to have bracing on a new line
This commit is contained in:
parent
e5eddd6c45
commit
e48eedb874
189 changed files with 6092 additions and 4041 deletions
|
@ -20,26 +20,31 @@ import net.minecraft.world.World;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ItemBoundPickaxe extends ItemBoundTool {
|
||||
public class ItemBoundPickaxe extends ItemBoundTool
|
||||
{
|
||||
|
||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.activator_rail, Blocks.coal_ore, Blocks.cobblestone, Blocks.detector_rail, Blocks.diamond_block, Blocks.diamond_ore, Blocks.double_stone_slab, Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab);
|
||||
|
||||
public ItemBoundPickaxe() {
|
||||
public ItemBoundPickaxe()
|
||||
{
|
||||
super("pickaxe", 5, EFFECTIVE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block blockIn) {
|
||||
public boolean canHarvestBlock(Block blockIn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, Block block) {
|
||||
public float getStrVsBlock(ItemStack stack, Block block)
|
||||
{
|
||||
return block.getMaterial() != Material.iron && block.getMaterial() != Material.anvil && block.getMaterial() != Material.rock ? super.getStrVsBlock(stack, block) : 12F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBoundRelease(ItemStack stack, World world, EntityPlayer player, int charge) {
|
||||
protected void onBoundRelease(ItemStack stack, World world, EntityPlayer player, int charge)
|
||||
{
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(player);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(player);
|
||||
int range = (int) (charge * 0.25);
|
||||
|
@ -48,20 +53,26 @@ public class ItemBoundPickaxe extends ItemBoundTool {
|
|||
|
||||
BlockPos playerPos = player.getPosition().add(0, -1, 0);
|
||||
|
||||
for (int i = -range; i <= range; i++) {
|
||||
for (int j = -range; j <= range; j++) {
|
||||
for (int k = -range; k <= range; k++) {
|
||||
for (int i = -range; i <= range; i++)
|
||||
{
|
||||
for (int j = -range; j <= range; j++)
|
||||
{
|
||||
for (int k = -range; k <= range; k++)
|
||||
{
|
||||
BlockPos blockPos = playerPos.add(i, j, k);
|
||||
Block block = world.getBlockState(blockPos).getBlock();
|
||||
int blockMeta = block.getMetaFromState(world.getBlockState(blockPos));
|
||||
|
||||
if (block != null && block.getBlockHardness(world, blockPos) != -1) {
|
||||
if (block != null && block.getBlockHardness(world, blockPos) != -1)
|
||||
{
|
||||
float strengthVsBlock = getStrVsBlock(stack, block);
|
||||
|
||||
if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) {
|
||||
if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player))
|
||||
drops.add(new ItemStackWrapper(block, 1, blockMeta));
|
||||
else {
|
||||
else
|
||||
{
|
||||
List<ItemStack> itemDrops = block.getDrops(world, blockPos, world.getBlockState(blockPos), fortuneLvl);
|
||||
|
||||
if (itemDrops != null)
|
||||
|
@ -81,7 +92,8 @@ public class ItemBoundPickaxe extends ItemBoundTool {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getAttributeModifiers(ItemStack stack) {
|
||||
public Multimap<String, AttributeModifier> getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(stack);
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", 5, 0));
|
||||
return multimap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue