Normalized code formatting.

This commit is contained in:
WayofTime 2016-03-16 18:41:06 -04:00
parent b1db7c5152
commit 134b11f177
122 changed files with 944 additions and 697 deletions

View file

@ -80,39 +80,39 @@ public class RitualAltarBuilder extends Ritual
{
switch (currentComponent.getComponent())
{
case NOTAIR:
case NOTAIR:
{
BlockStack blockStack = getMundaneBlock(tileEntity);
if (blockStack != null)
{
BlockStack blockStack = getMundaneBlock(tileEntity);
if (blockStack != null)
{
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
break;
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
case BLOODRUNE:
break;
}
case BLOODRUNE:
{
BlockStack blockStack = getBloodRune(tileEntity);
if (blockStack != null)
{
BlockStack blockStack = getBloodRune(tileEntity);
if (blockStack != null)
{
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
break;
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
default:
break;
}
default:
{
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(currentComponent.getComponent()), 0);
if (hasItem(tileEntity, Item.getItemFromBlock(blockStack.getBlock()), blockStack.getMeta(), true))
{
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(currentComponent.getComponent()), 0);
if (hasItem(tileEntity, Item.getItemFromBlock(blockStack.getBlock()), blockStack.getMeta(), true))
{
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
break;
world.setBlockState(currentPos, blockStack.getState(), 3);
lightning(world, currentPos);
network.syphon(getRefreshCost());
}
break;
}
}
}
} else
@ -193,10 +193,9 @@ public class RitualAltarBuilder extends Ritual
}
/*
*
* These methods are utilities for this ritual.
* They support both the old forge inventory system, and the new one.
*
*
* These methods are utilities for this ritual. They support both the old
* forge inventory system, and the new one.
*/
public boolean hasItem(TileEntity tileEntity, Item item, int damage, boolean consumeItem)
{

View file

@ -56,25 +56,23 @@ public class RitualCobblestone extends Ritual
{
switch (alchemyArray.getStackInSlot(0).getItemDamage())
{
case 0:
block = Blocks.obsidian;
alchemyArray.decrStackSize(0, 1);
world.setBlockToAir(alchemyArray.getPos());
break;
case 1:
block = Blocks.netherrack;
alchemyArray.decrStackSize(0, 1);
world.setBlockToAir(alchemyArray.getPos());
break;
/*
case 4:
block = Blocks.end_stone;
alchemyArray.decrStackSize(0, 1);
world.setBlockToAir(alchemyArray.getPos());
break;
*/
default:
break;
case 0:
block = Blocks.obsidian;
alchemyArray.decrStackSize(0, 1);
world.setBlockToAir(alchemyArray.getPos());
break;
case 1:
block = Blocks.netherrack;
alchemyArray.decrStackSize(0, 1);
world.setBlockToAir(alchemyArray.getPos());
break;
/*
* case 4: block = Blocks.end_stone;
* alchemyArray.decrStackSize(0, 1);
* world.setBlockToAir(alchemyArray.getPos()); break;
*/
default:
break;
}
}
}

View file

@ -144,8 +144,7 @@ public class RitualExpulsion extends Ritual
if (block != null && block.getMaterial().blocksMovement())
{
flag1 = true;
}
else
} else
{
--entityLiving.posY;
--j;
@ -167,8 +166,7 @@ public class RitualExpulsion extends Ritual
{
moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ);
return false;
}
else
} else
{
for (l = 0; l < 128; ++l)
{
@ -208,8 +206,7 @@ public class RitualExpulsion extends Ritual
}
}
}
}
else if (entityLiving != null)
} else if (entityLiving != null)
{
entityLiving.setPosition(x, y, z);
}

View file

@ -17,16 +17,15 @@ import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
/**
* This ritual uses registered {@link IHarvestHandler}'s to
* harvest blocks.
*
* This ritual uses registered {@link IHarvestHandler}'s to harvest blocks.
*
* To register a new Handler for this ritual use
* {@link HarvestRegistry#registerHandler(IHarvestHandler)}
*
* This ritual includes a way to change the range based on what block
* is above the MasterRitualStone. You can use
* {@link HarvestRegistry#registerRangeAmplifier(BlockStack, int)}
* to register a new amplifier.
*
* This ritual includes a way to change the range based on what block is above
* the MasterRitualStone. You can use
* {@link HarvestRegistry#registerRangeAmplifier(BlockStack, int)} to register a
* new amplifier.
*/
public class RitualHarvest extends Ritual
{
@ -118,7 +117,8 @@ public class RitualHarvest extends Ritual
return new RitualHarvest();
}
public static boolean harvestBlock(World world, BlockPos pos) {
public static boolean harvestBlock(World world, BlockPos pos)
{
BlockStack harvestStack = BlockStack.getStackFromPos(world, pos);
for (IHarvestHandler handler : HarvestRegistry.getHandlerList())

View file

@ -79,7 +79,7 @@ public class RitualPlacer extends Ritual
}
}
}
//Compatibility with the old system, as it still exists
//Compatibility with the old system, as it still exists
} else if (tileEntity instanceof IInventory)
{
iInventory = (IInventory) tileEntity;

View file

@ -42,7 +42,8 @@ public class RitualSpeed extends Ritual
for (EntityLivingBase entity : world.getEntitiesWithinAABB(EntityLivingBase.class, speedRange.getAABB(masterRitualStone.getBlockPos())))
{
if (entity.isSneaking()) continue;
if (entity.isSneaking())
continue;
double motionY = 1.2;
double speed = 3;
@ -53,21 +54,21 @@ public class RitualSpeed extends Ritual
switch (direction)
{
case NORTH:
entity.setVelocity(0, motionY, -speed);
break;
case NORTH:
entity.setVelocity(0, motionY, -speed);
break;
case SOUTH:
entity.setVelocity(0, motionY, speed);
break;
case SOUTH:
entity.setVelocity(0, motionY, speed);
break;
case WEST:
entity.setVelocity(-speed, motionY, 0);
break;
case WEST:
entity.setVelocity(-speed, motionY, 0);
break;
case EAST:
entity.setVelocity(speed, motionY, 0);
break;
case EAST:
entity.setVelocity(speed, motionY, 0);
break;
}
}

View file

@ -14,9 +14,8 @@ import WayofTime.bloodmagic.api.iface.IHarvestHandler;
import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/**
* Harvest handler for standard plantable crops such as
* Wheat, Potatoes, and Netherwart.
* <br>
* Harvest handler for standard plantable crops such as Wheat, Potatoes, and
* Netherwart. <br>
* Register a new crop for this handler with
* {@link HarvestRegistry#registerStandardCrop(Block, int)}
*/
@ -38,13 +37,14 @@ public class HarvestHandlerPlantable implements IHarvestHandler
int matureMeta = HarvestRegistry.getStandardCrops().get(blockStack.getBlock());
if(blockStack.getMeta() < matureMeta)
if (blockStack.getMeta() < matureMeta)
return false;
List<ItemStack> drops = blockStack.getBlock().getDrops(world, pos, blockStack.getState(), 0);
boolean foundSeed = false;
for (ItemStack stack : drops) {
for (ItemStack stack : drops)
{
if (stack == null)
continue;
@ -53,7 +53,7 @@ public class HarvestHandlerPlantable implements IHarvestHandler
if (stack.stackSize > 1)
stack.stackSize--;
else
drops.remove(stack);
drops.remove(stack);
foundSeed = true;
break;

View file

@ -17,10 +17,9 @@ import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/**
* Harvest handler for crops with stems such as Pumpkins and Melons.
* {@link OreDictionary#WILDCARD_VALUE} is used as a wildcard to allow
* the crop to be harvested at any metadata. Rotation based crop blocks
* are a good reason to use this (see pumpkins).
* <br>
* {@link OreDictionary#WILDCARD_VALUE} is used as a wildcard to allow the crop
* to be harvested at any metadata. Rotation based crop blocks are a good reason
* to use this (see pumpkins). <br>
* Register a new crop for this handler with
* {@link HarvestRegistry#registerStemCrop(BlockStack, BlockStack)}
*/

View file

@ -13,9 +13,7 @@ import WayofTime.bloodmagic.api.iface.IHarvestHandler;
import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/**
* Harvest handler for crops that grow vertically such as
* Sugar Cane and Cactus.
* <br>
* Harvest handler for crops that grow vertically such as Sugar Cane and Cactus. <br>
* Register a new crop for this handler with
* {@link HarvestRegistry#registerTallCrop(BlockStack)}
*/