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

@ -17,21 +17,25 @@ import net.minecraft.world.World;
import java.util.List;
import java.util.Set;
public class ItemBoundShovel extends ItemBoundTool {
public class ItemBoundShovel extends ItemBoundTool
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand);
public ItemBoundShovel() {
public ItemBoundShovel()
{
super("shovel", 5, EFFECTIVE_ON);
}
@Override
public boolean canHarvestBlock(Block blockIn) {
public boolean canHarvestBlock(Block blockIn)
{
return blockIn == Blocks.snow_layer || blockIn == Blocks.snow;
}
@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);
@ -40,20 +44,26 @@ public class ItemBoundShovel 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)
@ -73,7 +83,8 @@ public class ItemBoundShovel 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", 1, 0));
return multimap;