Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -12,27 +12,23 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
public class TileSpectralBlock extends TileTicking
{
public class TileSpectralBlock extends TileTicking {
private int ticksRemaining;
private String containedBlockName;
private int containedBlockMeta;
public TileSpectralBlock()
{
public TileSpectralBlock() {
}
@Override
public void deserialize(NBTTagCompound tagCompound)
{
public void deserialize(NBTTagCompound tagCompound) {
ticksRemaining = tagCompound.getInteger(Constants.NBT.TICKS_REMAINING);
containedBlockName = tagCompound.getString(Constants.NBT.CONTAINED_BLOCK_NAME);
containedBlockMeta = tagCompound.getInteger(Constants.NBT.CONTAINED_BLOCK_META);
}
@Override
public NBTTagCompound serialize(NBTTagCompound tagCompound)
{
public NBTTagCompound serialize(NBTTagCompound tagCompound) {
tagCompound.setInteger(Constants.NBT.TICKS_REMAINING, ticksRemaining);
tagCompound.setString(Constants.NBT.CONTAINED_BLOCK_NAME, Strings.isNullOrEmpty(containedBlockName) ? "" : containedBlockName);
tagCompound.setInteger(Constants.NBT.CONTAINED_BLOCK_META, containedBlockMeta);
@ -40,40 +36,33 @@ public class TileSpectralBlock extends TileTicking
}
@Override
public void onUpdate()
{
if (getWorld().isRemote)
{
public void onUpdate() {
if (getWorld().isRemote) {
return;
}
ticksRemaining--;
if (ticksRemaining <= 0)
{
if (ticksRemaining <= 0) {
returnContainedBlock();
}
}
private void setContainedBlockInfo(IBlockState blockState)
{
private void setContainedBlockInfo(IBlockState blockState) {
containedBlockName = blockState.getBlock().getRegistryName().toString();
containedBlockMeta = blockState.getBlock().getMetaFromState(blockState);
}
private void setDuration(int duration)
{
private void setDuration(int duration) {
ticksRemaining = duration;
}
public void resetDuration(int reset)
{
public void resetDuration(int reset) {
if (ticksRemaining < reset)
ticksRemaining = reset;
}
public void returnContainedBlock()
{
public void returnContainedBlock() {
Block block = null;
if (!Strings.isNullOrEmpty(containedBlockName))
@ -83,8 +72,7 @@ public class TileSpectralBlock extends TileTicking
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3);
}
public static void createSpectralBlock(World world, BlockPos blockPos, int duration)
{
public static void createSpectralBlock(World world, BlockPos blockPos, int duration) {
if (world.isAirBlock(blockPos))
return;
IBlockState cachedState = world.getBlockState(blockPos);