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

@ -10,15 +10,19 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public class ItemSigilGreenGrove extends ItemSigilToggleable {
public class ItemSigilGreenGrove extends ItemSigilToggleable
{
public ItemSigilGreenGrove() {
public ItemSigilGreenGrove()
{
super("greenGrove", 150);
}
@Override
public boolean onSigilUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ) {
if (applyBonemeal(stack, world, blockPos)) {
public boolean onSigilUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
{
if (applyBonemeal(stack, world, blockPos))
{
world.playAuxSFX(2005, blockPos, 0);
return true;
}
@ -27,21 +31,27 @@ public class ItemSigilGreenGrove extends ItemSigilToggleable {
}
@Override
public void onSigilUpdate(ItemStack stack, World worldIn, EntityPlayer player, int itemSlot, boolean isSelected) {
public void onSigilUpdate(ItemStack stack, World worldIn, EntityPlayer player, int itemSlot, boolean isSelected)
{
int range = 3;
int verticalRange = 2;
int posX = (int) Math.round(player.posX - 0.5f);
int posY = (int) player.posY;
int posZ = (int) Math.round(player.posZ - 0.5f);
for (int ix = posX - range; ix <= posX + range; ix++) {
for (int iz = posZ - range; iz <= posZ + range; iz++) {
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) {
for (int ix = posX - range; ix <= posX + range; ix++)
{
for (int iz = posZ - range; iz <= posZ + range; iz++)
{
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
{
BlockPos blockPos = new BlockPos(ix, iy, iz);
Block block = worldIn.getBlockState(blockPos).getBlock();
if (block instanceof IPlantable || block instanceof IGrowable) {
if (worldIn.rand.nextInt(50) == 0) {
if (block instanceof IPlantable || block instanceof IGrowable)
{
if (worldIn.rand.nextInt(50) == 0)
{
IBlockState preBlockState = worldIn.getBlockState(blockPos);
block.updateTick(worldIn, blockPos, worldIn.getBlockState(blockPos), worldIn.rand);
@ -54,21 +64,27 @@ public class ItemSigilGreenGrove extends ItemSigilToggleable {
}
}
private boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target) {
private boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target)
{
return worldIn instanceof net.minecraft.world.WorldServer && applyBonemeal(stack, worldIn, target, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.WorldServer) worldIn));
}
private boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target, EntityPlayer player) {
private boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target, EntityPlayer player)
{
IBlockState iblockstate = worldIn.getBlockState(target);
int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, worldIn, target, iblockstate, stack);
if (hook != 0) return hook > 0;
if (hook != 0)
return hook > 0;
if (iblockstate.getBlock() instanceof IGrowable) {
if (iblockstate.getBlock() instanceof IGrowable)
{
IGrowable igrowable = (IGrowable) iblockstate.getBlock();
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote)) {
if (!worldIn.isRemote) {
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote))
{
if (!worldIn.isRemote)
{
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
igrowable.grow(worldIn, worldIn.rand, target, iblockstate);
}