Auto Format code

This commit is contained in:
modmuss50 2016-10-08 20:46:16 +01:00
parent 112b1657cf
commit 796df6c055
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
503 changed files with 12260 additions and 16291 deletions

View file

@ -1,7 +1,5 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -19,59 +17,51 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileAesu;
public class ItemBlockAesu extends ItemBlock
{
import java.util.List;
public ItemBlockAesu(Block p_i45328_1_)
{
public class ItemBlockAesu extends ItemBlock {
public ItemBlockAesu(Block p_i45328_1_) {
super(p_i45328_1_);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (stack != null && stack.hasTagCompound())
{
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
if (stack != null && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(PowerSystem
.getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("energy")));
.getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("energy")));
}
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side,
float hitX, float hitY, float hitZ, IBlockState newState)
{
if (!world.setBlockState(pos, newState))
{
float hitX, float hitY, float hitZ, IBlockState newState) {
if (!world.setBlockState(pos, newState)) {
return false;
}
if (world.getBlockState(pos).getBlock() == block)
{
if (world.getBlockState(pos).getBlock() == block) {
world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack);
// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x,
// y, z, metadata);
}
if (stack != null && stack.hasTagCompound())
{
if (stack != null && stack.hasTagCompound()) {
((TileAesu) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
itemList.add(getDropWithNBT(0));
itemList.add(getDropWithNBT(1000000000));
}
public ItemStack getDropWithNBT(double energy)
{
public ItemStack getDropWithNBT(double energy) {
NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1);
writeToNBTWithoutCoords(tileEntity, energy);
@ -80,8 +70,7 @@ public class ItemBlockAesu extends ItemBlock
return dropStack;
}
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy)
{
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy) {
NBTTagCompound data = new NBTTagCompound();
data.setDouble("energy", energy);
tagCompound.setTag("TilePowerAcceptor", data);

View file

@ -1,7 +1,5 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
@ -14,21 +12,19 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.tiles.TileDigitalChest;
public class ItemBlockDigitalChest extends ItemBlock
{
import java.util.List;
public ItemBlockDigitalChest(Block p_i45328_1_)
{
public class ItemBlockDigitalChest extends ItemBlock {
public ItemBlockDigitalChest(Block p_i45328_1_) {
super(p_i45328_1_);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (stack != null && stack.hasTagCompound())
{
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
if (stack != null && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");
}
@ -36,22 +32,18 @@ public class ItemBlockDigitalChest extends ItemBlock
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side,
float hitX, float hitY, float hitZ, IBlockState newState)
{
if (!world.setBlockState(pos, newState))
{
float hitX, float hitY, float hitZ, IBlockState newState) {
if (!world.setBlockState(pos, newState)) {
return false;
}
if (world.getBlockState(pos).getBlock() == block)
{
if (world.getBlockState(pos).getBlock() == block) {
world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack);
// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x,
// y, z, metadata);
}
if (stack != null && stack.hasTagCompound())
{
if (stack != null && stack.hasTagCompound()) {
((TileDigitalChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}

View file

@ -5,11 +5,9 @@ import net.minecraft.item.ItemMultiTexture;
import techreborn.blocks.BlockMachineCasing;
import techreborn.init.ModBlocks;
public class ItemBlockMachineCasing extends ItemMultiTexture
{
public class ItemBlockMachineCasing extends ItemMultiTexture {
public ItemBlockMachineCasing(Block block)
{
public ItemBlockMachineCasing(Block block) {
super(ModBlocks.MachineCasing, ModBlocks.MachineCasing, BlockMachineCasing.types);
}

View file

@ -5,11 +5,9 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockMachineFrame;
import techreborn.init.ModBlocks;
public class ItemBlockMachineFrame extends ItemBlockBase
{
public class ItemBlockMachineFrame extends ItemBlockBase {
public ItemBlockMachineFrame(Block block)
{
public ItemBlockMachineFrame(Block block) {
super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types);
}

View file

@ -5,11 +5,9 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockOre;
import techreborn.init.ModBlocks;
public class ItemBlockOre extends ItemBlockBase
{
public class ItemBlockOre extends ItemBlockBase {
public ItemBlockOre(Block block)
{
public ItemBlockOre(Block block) {
super(ModBlocks.ore, ModBlocks.ore, BlockOre.ores);
}

View file

@ -5,11 +5,9 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockOre2;
import techreborn.init.ModBlocks;
public class ItemBlockOre2 extends ItemBlockBase
{
public class ItemBlockOre2 extends ItemBlockBase {
public ItemBlockOre2(Block block)
{
public ItemBlockOre2(Block block) {
super(ModBlocks.ore2, ModBlocks.ore2, BlockOre2.ores);
}

View file

@ -5,10 +5,8 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockPlayerDetector;
import techreborn.init.ModBlocks;
public class ItemBlockPlayerDetector extends ItemBlockBase
{
public ItemBlockPlayerDetector(Block block)
{
public class ItemBlockPlayerDetector extends ItemBlockBase {
public ItemBlockPlayerDetector(Block block) {
super(ModBlocks.playerDetector, ModBlocks.playerDetector, BlockPlayerDetector.types);
}
}

View file

@ -1,7 +1,5 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
@ -14,21 +12,19 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.tiles.TileQuantumChest;
public class ItemBlockQuantumChest extends ItemBlock
{
import java.util.List;
public ItemBlockQuantumChest(Block p_i45328_1_)
{
public class ItemBlockQuantumChest extends ItemBlock {
public ItemBlockQuantumChest(Block p_i45328_1_) {
super(p_i45328_1_);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (stack != null && stack.hasTagCompound())
{
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
if (stack != null && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");
}
@ -36,22 +32,18 @@ public class ItemBlockQuantumChest extends ItemBlock
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side,
float hitX, float hitY, float hitZ, IBlockState newState)
{
if (!world.setBlockState(pos, newState))
{
float hitX, float hitY, float hitZ, IBlockState newState) {
if (!world.setBlockState(pos, newState)) {
return false;
}
if (world.getBlockState(pos).getBlock() == block)
{
if (world.getBlockState(pos).getBlock() == block) {
world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack);
// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x,
// y, z, metadata);
}
if (stack != null && stack.hasTagCompound())
{
if (stack != null && stack.hasTagCompound()) {
((TileQuantumChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}

View file

@ -10,32 +10,26 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.tiles.TileQuantumTank;
public class ItemBlockQuantumTank extends ItemBlock
{
public class ItemBlockQuantumTank extends ItemBlock {
public ItemBlockQuantumTank(Block block)
{
public ItemBlockQuantumTank(Block block) {
super(block);
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side,
float hitX, float hitY, float hitZ, IBlockState newState)
{
if (!world.setBlockState(pos, newState))
{
float hitX, float hitY, float hitZ, IBlockState newState) {
if (!world.setBlockState(pos, newState)) {
return false;
}
if (world.getBlockState(pos).getBlock() == block)
{
if (world.getBlockState(pos).getBlock() == block) {
world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack);
// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x,
// y, z, metadata);
}
if (stack != null && stack.hasTagCompound())
{
if (stack != null && stack.hasTagCompound()) {
((TileQuantumTank) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}

View file

@ -15,11 +15,9 @@ import techreborn.lib.ModInfo;
/**
* Created by modmuss50 on 20/02/2016.
*/
public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem
{
public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem {
public ItemBlockRubberSapling(Block block)
{
public ItemBlockRubberSapling(Block block) {
super(block);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.rubberSapling");
@ -27,21 +25,18 @@ public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem
}
@Override
public String getTextureName(int damage)
{
public String getTextureName(int damage) {
return "techreborn:items/misc/rubber_sapling";
}
@Override
public int getMaxMeta()
{
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining)
{
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -5,11 +5,9 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockStorage;
import techreborn.init.ModBlocks;
public class ItemBlockStorage extends ItemBlockBase
{
public class ItemBlockStorage extends ItemBlockBase {
public ItemBlockStorage(Block block)
{
public ItemBlockStorage(Block block) {
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
}

View file

@ -5,11 +5,9 @@ import reborncore.common.itemblock.ItemBlockBase;
import techreborn.blocks.BlockStorage2;
import techreborn.init.ModBlocks;
public class ItemBlockStorage2 extends ItemBlockBase
{
public class ItemBlockStorage2 extends ItemBlockBase {
public ItemBlockStorage2(Block block)
{
public ItemBlockStorage2(Block block) {
super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types);
}