Code formatter take 2

This commit is contained in:
modmuss50 2016-03-25 09:47:34 +00:00
parent 33985f1a31
commit 5eed5b161d
450 changed files with 32768 additions and 26684 deletions

View file

@ -1,5 +1,7 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -17,70 +19,75 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileAesu;
import java.util.List;
public class ItemBlockAesu extends ItemBlock
{
public class ItemBlockAesu extends ItemBlock {
public ItemBlockAesu(Block p_i45328_1_)
{
super(p_i45328_1_);
}
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())
{
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(PowerSystem
.getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("energy")));
}
}
@SuppressWarnings(
{"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
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")));
}
}
@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))
{
return false;
}
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())
{
((TileAesu) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}
@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)) {
return false;
}
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()) {
((TileAesu) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound()
.getCompoundTag("tileEntity"));
}
return true;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
itemList.add(getDropWithNBT(0));
itemList.add(getDropWithNBT(1000000000));
}
public ItemStack getDropWithNBT(double energy)
{
NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1);
writeToNBTWithoutCoords(tileEntity, energy);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
return dropStack;
}
@SuppressWarnings(
{"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
itemList.add(getDropWithNBT(0));
itemList.add(getDropWithNBT(1000000000));
}
public ItemStack getDropWithNBT(double energy) {
NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1);
writeToNBTWithoutCoords(tileEntity, energy);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
return dropStack;
}
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy) {
NBTTagCompound data = new NBTTagCompound();
data.setDouble("energy", energy);
tagCompound.setTag("TilePowerAcceptor", data);
tagCompound.setDouble("energy", energy);
tagCompound.setDouble("euChange", 0);
tagCompound.setDouble("euLastTick", 0);
tagCompound.setBoolean("active", false);
}
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy)
{
NBTTagCompound data = new NBTTagCompound();
data.setDouble("energy", energy);
tagCompound.setTag("TilePowerAcceptor", data);
tagCompound.setDouble("energy", energy);
tagCompound.setDouble("euChange", 0);
tagCompound.setDouble("euLastTick", 0);
tagCompound.setBoolean("active", false);
}
}

View file

@ -1,5 +1,7 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
@ -12,43 +14,45 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.tiles.TileDigitalChest;
import java.util.List;
public class ItemBlockDigitalChest extends ItemBlock
{
public class ItemBlockDigitalChest extends ItemBlock {
public ItemBlockDigitalChest(Block p_i45328_1_)
{
super(p_i45328_1_);
}
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())
{
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");
}
}
@SuppressWarnings(
{"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
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");
}
}
@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)) {
return false;
}
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()) {
((TileDigitalChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound()
.getCompoundTag("tileEntity"));
}
return true;
}
@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))
{
return false;
}
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())
{
((TileDigitalChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}
}

View file

@ -5,11 +5,12 @@ 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) {
super(ModBlocks.MachineCasing, ModBlocks.MachineCasing,
BlockMachineCasing.types);
}
public ItemBlockMachineCasing(Block block)
{
super(ModBlocks.MachineCasing, ModBlocks.MachineCasing, BlockMachineCasing.types);
}
}

View file

@ -5,10 +5,12 @@ 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) {
super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types);
}
public ItemBlockMachineFrame(Block block)
{
super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types);
}
}

View file

@ -5,10 +5,12 @@ 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) {
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
}
public ItemBlockOre(Block block)
{
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
}
}

View file

@ -5,10 +5,12 @@ 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) {
super(ModBlocks.ore2, ModBlocks.ore2, BlockOre2.types);
}
public ItemBlockOre2(Block block)
{
super(ModBlocks.ore2, ModBlocks.ore2, BlockOre2.types);
}
}

View file

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

View file

@ -1,5 +1,7 @@
package techreborn.itemblocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
@ -12,43 +14,45 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.tiles.TileQuantumChest;
import java.util.List;
public class ItemBlockQuantumChest extends ItemBlock
{
public class ItemBlockQuantumChest extends ItemBlock {
public ItemBlockQuantumChest(Block p_i45328_1_)
{
super(p_i45328_1_);
}
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())
{
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");
}
}
@SuppressWarnings(
{"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
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");
}
}
@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)) {
return false;
}
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()) {
((TileQuantumChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound()
.getCompoundTag("tileEntity"));
}
return true;
}
@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))
{
return false;
}
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())
{
((TileQuantumChest) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}
}

View file

@ -10,27 +10,33 @@ 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) {
super(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)) {
return false;
}
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()) {
((TileQuantumTank) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound()
.getCompoundTag("tileEntity"));
}
return true;
}
@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))
{
return false;
}
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())
{
((TileQuantumTank) world.getTileEntity(pos))
.readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
}
return true;
}
}

View file

@ -15,28 +15,33 @@ 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) {
super(block);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.rubberSapling");
RebornCore.jsonDestroyer.registerObject(this);
}
public ItemBlockRubberSapling(Block block)
{
super(block);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.rubberSapling");
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/rubber_sapling";
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/rubber_sapling";
}
@Override
public int getMaxMeta() {
return 1;
}
@Override
public int getMaxMeta()
{
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining)
{
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -5,10 +5,12 @@ 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) {
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
}
public ItemBlockStorage(Block block)
{
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
}
}

View file

@ -5,11 +5,12 @@ 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) {
super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types);
}
public ItemBlockStorage2(Block block)
{
super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types);
}
}