Changed formatting to have bracing on a new line

This commit is contained in:
WayofTime 2015-12-30 15:34:40 -05:00
parent e5eddd6c45
commit e48eedb874
189 changed files with 6092 additions and 4041 deletions

View file

@ -19,21 +19,25 @@ import net.minecraft.world.World;
import java.util.List;
import java.util.Set;
public class ItemBoundAxe extends ItemBoundTool {
public class ItemBoundAxe extends ItemBoundTool
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder);
public ItemBoundAxe() {
public ItemBoundAxe()
{
super("axe", 5, EFFECTIVE_ON);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block) {
public float getStrVsBlock(ItemStack stack, Block block)
{
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? 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);
@ -42,20 +46,26 @@ public class ItemBoundAxe 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 || block instanceof BlockLeavesBase && world.canMineBlockBody(player, blockPos)) {
if (strengthVsBlock > 1.1F || block instanceof BlockLeavesBase && 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)
@ -75,7 +85,8 @@ public class ItemBoundAxe 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", 7, 0));
return multimap;