Skip to content

Commit

Permalink
run repo through formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Feb 5, 2014
1 parent 5585d68 commit ffaea7d
Show file tree
Hide file tree
Showing 140 changed files with 1,104 additions and 946 deletions.
16 changes: 8 additions & 8 deletions src/main/java/tconstruct/TConstruct.java
Expand Up @@ -59,10 +59,10 @@ public class TConstruct

//The name of the enum is accompanied by numbers because I have no idea what will happen if another mod will try to add the same enum, just to be safe
//public static EnumCreatureType creatureTypePlayer = EnumHelper.addCreatureType("PLAYER_5821443", EntityPlayer.class, 0, Material.air, true);

//The packet pipeline
public static final PacketPipeline packetPipeline = new PacketPipeline();

public TConstruct()
{
LoggerConfig fml = new LoggerConfig(FMLCommonHandler.instance().getFMLLogger().getName(), Level.ALL, true);
Expand All @@ -88,7 +88,7 @@ public TConstruct()
@EventHandler
public void preInit (FMLPreInitializationEvent event)
{

PHConstruct.initProps(event.getSuggestedConfigurationFile());
TConstructRegistry.materialTab = new TabTools("TConstructMaterials");
TConstructRegistry.toolTab = new TabTools("TConstructTools");
Expand All @@ -99,7 +99,7 @@ public void preInit (FMLPreInitializationEvent event)
chiselDetailing = new Detailing();

content = new TContent();

recipes = new TRecipes();

events = new TEventHandler();
Expand Down Expand Up @@ -141,10 +141,10 @@ public void preInit (FMLPreInitializationEvent event)
playerTracker = new TPlayerHandler();
//GameRegistry.registerPlayerTracker(playerTracker);
FMLCommonHandler.instance().bus().register(playerTracker);

if (event.getSide() == Side.CLIENT)
{
FMLCommonHandler.instance().bus().register(new TControls());
FMLCommonHandler.instance().bus().register(new TControls());
}

PluginController.getController().preInit();
Expand All @@ -153,14 +153,14 @@ public void preInit (FMLPreInitializationEvent event)
@EventHandler
public void init (FMLInitializationEvent event)
{
packetPipeline.initalise();
packetPipeline.initalise();
if (event.getSide() == Side.CLIENT)
{
//MinecraftForge.EVENT_BUS.register(new EventCloakRender());
}

DimensionBlacklist.getBadBimensions();
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool,2), 2);
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool, 2), 2);

PluginController.getController().init();

Expand Down
43 changes: 23 additions & 20 deletions src/main/java/tconstruct/achievements/TAchievements.java
Expand Up @@ -5,24 +5,27 @@
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.AchievementPage;

public class TAchievements {

//Add achievements in here before the load executes(end of TC's init event)
public static HashMap<String, Achievement> achievements = new HashMap<String, Achievement>();

//Warning: Will be null until after the init stage
public static AchievementPage achievementPage = null;

public static void init(){
Achievement[] achs = new Achievement[achievements.values().size()];

for(int i = 0; i < achs.length; i++){
achs[i] = (Achievement)achievements.values().toArray()[i];
}

achievementPage = new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achs);

AchievementPage.registerAchievementPage(achievementPage);
}

public class TAchievements
{

//Add achievements in here before the load executes(end of TC's init event)
public static HashMap<String, Achievement> achievements = new HashMap<String, Achievement>();

//Warning: Will be null until after the init stage
public static AchievementPage achievementPage = null;

public static void init ()
{
Achievement[] achs = new Achievement[achievements.values().size()];

for (int i = 0; i < achs.length; i++)
{
achs[i] = (Achievement) achievements.values().toArray()[i];
}

achievementPage = new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achs);

AchievementPage.registerAchievementPage(achievementPage);
}

}
22 changes: 13 additions & 9 deletions src/main/java/tconstruct/blocks/BlockFalling.java
Expand Up @@ -24,25 +24,25 @@ public BlockFalling(Material p_i45405_1_)
super(p_i45405_1_);
}

public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
public void onBlockAdded (World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
{
p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.tickRate(p_149726_1_));
}

public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
public void onNeighborBlockChange (World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
{
p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.tickRate(p_149695_1_));
}

public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
public void updateTick (World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
if (!p_149674_1_.isRemote)
{
this.func_149830_m(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
}
}

private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_)
private void func_149830_m (World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_)
{
if (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ >= 0)
{
Expand Down Expand Up @@ -74,14 +74,16 @@ private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_,
}
}

protected void func_149829_a(EntityFallingBlock p_149829_1_) {}
protected void func_149829_a (EntityFallingBlock p_149829_1_)
{
}

public int tickRate(World p_149738_1_)
public int tickRate (World p_149738_1_)
{
return 2;
}

public static boolean func_149831_e(World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_)
public static boolean func_149831_e (World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_)
{
Block block = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_);

Expand All @@ -98,9 +100,11 @@ else if (block == Blocks.fire)
//TODO: King, take a look here when doing liquids!
//Material material = block.blockMaterial;
//return material == Material.water ? true : material == Material.lava;
return false;
return false;
}
}

public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) {}
public void func_149828_a (World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_)
{
}
}
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/BlockLandmine.java
Expand Up @@ -458,10 +458,10 @@ private boolean hasItems (World par1World, int par2, int par3, int par4)
return false;
}
}

public static enum Sensitivity
{
everything, mobs, players;
everything, mobs, players;
}

protected int getMineState (World par1World, int par2, int par3, int par4)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/blocks/BloodBlock.java
Expand Up @@ -15,13 +15,13 @@ public BloodBlock(Fluid fluid, Material material, String texture)
{
super(fluid, material, texture);
}

public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity)
{
if (entity instanceof EntityLivingBase)
{
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20*15, 0));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20*5, 1));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20 * 15, 0));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20 * 5, 1));
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/ConveyorBase.java
Expand Up @@ -101,11 +101,11 @@ public void onBlockPlacedBy (World world, int x, int y, int z, EntityLivingBase
world.setBlockMetadataWithNotify(x, y, z, face | meta, 2);
}

public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
{
if (side == 1)
return false;
return super. shouldSideBeRendered(world, x, y, z, side);
return super.shouldSideBeRendered(world, x, y, z, side);
}

public IIcon[] icons;
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/tconstruct/blocks/CraftingStationBlock.java
Expand Up @@ -101,10 +101,11 @@ public void getSubBlocks (Item id, CreativeTabs tab, List list)
}
}

@Override
public TileEntity createNewTileEntity(World arg0, int arg1) {
return new CraftingStationLogic();
}
@Override
public TileEntity createNewTileEntity (World arg0, int arg1)
{
return new CraftingStationLogic();
}

@Override
public TileEntity func_149915_a (World arg0, int arg1)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/GlassBlockConnected.java
Expand Up @@ -585,10 +585,10 @@ else if (isOpenRight)
}

@Override
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
Block b = par1IBlockAccess.getBlock(par2, par3, par4);
return b == (Block) this ? false : super. shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
return b == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/GlassBlockStained.java
Expand Up @@ -31,10 +31,10 @@ public boolean isOpaqueCube ()
}

@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
{
Block block = world.getBlock(x, y, z);
return block == this ? false : super. shouldSideBeRendered(world, x, y, z, side);
return block == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/GlassPaneConnected.java
Expand Up @@ -37,8 +37,8 @@ public IIcon getIcon (IBlockAccess par1IBlockAccess, int par2, int par3, int par
{
if (par5 == 0 || par5 == 1)
{
return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15]
: par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15] : getSideTextureIndex();
return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15] : par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15]
: getSideTextureIndex();
}
else
{
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/tconstruct/blocks/GlueBlock.java
Expand Up @@ -10,11 +10,12 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;

public class GlueBlock extends TConstructBlock {
public class GlueBlock extends TConstructBlock
{

public GlueBlock()
{
super(Material.ground, 4.0f, new String[]{"glue"});
super(Material.ground, 4.0f, new String[] { "glue" });
}

@Override
Expand All @@ -23,19 +24,26 @@ public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity
entity.motionX *= 0.1;
entity.motionZ *= 0.1;

if (entity instanceof EntityLivingBase) {
EntityLivingBase lvb = (EntityLivingBase)entity;
if (entity instanceof EntityLivingBase)
{
EntityLivingBase lvb = (EntityLivingBase) entity;
// Well you'd feel ill too standing on glue...
if (lvb.isPotionActive(Potion.hunger)) {
if (lvb.isPotionActive(Potion.hunger))
{
lvb.getActivePotionEffect(Potion.hunger).duration = 20;
} else {
}
else
{
lvb.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 20, 4));
}

// Glue is sticky stuff
if (lvb.isPotionActive(Potion.moveSlowdown)) {
if (lvb.isPotionActive(Potion.moveSlowdown))
{
lvb.getActivePotionEffect(Potion.moveSlowdown).duration = 30;
} else {
}
else
{
lvb.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 30, 4));
}
}
Expand Down
25 changes: 17 additions & 8 deletions src/main/java/tconstruct/blocks/GlueFluid.java
Expand Up @@ -13,7 +13,8 @@
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;

public class GlueFluid extends BlockFluidFinite {
public class GlueFluid extends BlockFluidFinite
{

IIcon stillIcon;
IIcon flowIcon;
Expand Down Expand Up @@ -41,23 +42,31 @@ public IIcon getIcon (int side, int meta)
}

@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity)
{
entity.motionX *= 0.1;
entity.motionZ *= 0.1;

if (entity instanceof EntityLivingBase) {
EntityLivingBase lvb = (EntityLivingBase)entity;
if (entity instanceof EntityLivingBase)
{
EntityLivingBase lvb = (EntityLivingBase) entity;
// Well you'd feel ill too standing in glue...
if (lvb.isPotionActive(Potion.hunger)) {
if (lvb.isPotionActive(Potion.hunger))
{
lvb.getActivePotionEffect(Potion.hunger).duration = 20;
} else {
}
else
{
lvb.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 20, 4));
}

// Glue is sticky stuff
if (lvb.isPotionActive(Potion.moveSlowdown)) {
if (lvb.isPotionActive(Potion.moveSlowdown))
{
lvb.getActivePotionEffect(Potion.moveSlowdown).duration = 30;
} else {
}
else
{
lvb.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 30, 4));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/LavaTankBlock.java
Expand Up @@ -95,7 +95,7 @@ public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, in
//if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
//return super. shouldSideBeRendered(world, x, y, z, side);
Block b = world.getBlock(x, y, z);
return b == (Block)this ? false : super. shouldSideBeRendered(world, x, y, z, side);
return b == (Block) this ? false : super.shouldSideBeRendered(world, x, y, z, side);
//return true;
}

Expand Down

0 comments on commit ffaea7d

Please sign in to comment.