Close #477 Auto-Format code with new formatting settings

This commit is contained in:
mezz committed 2015-01-26 22:26:21 -08:00
1 parent 8e92d16320
commit 5b8b0c78b0
763 files changed
+13174 -8868

No files matched your search

@@ -1,33 +1,38 @@
/*******************************************************************************
* Copyright 2011-2014 by SirSengir
*
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
*
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/.
******************************************************************************/
package forestry.pipes;
import buildcraft.transport.Pipe;
import buildcraft.transport.TileGenericPipe;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import forestry.core.network.GuiId;
import forestry.pipes.gui.ContainerPropolisPipe;
import forestry.pipes.gui.GuiPropolisPipe;
import forestry.plugins.PluginApiculture;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import buildcraft.transport.Pipe;
import buildcraft.transport.TileGenericPipe;
public class GuiHandlerPipes implements IGuiHandler {
@SuppressWarnings("rawtypes")
private Pipe getPipe(World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile == null)
if (tile == null) {
return null;
}
if (!(tile instanceof TileGenericPipe))
if (!(tile instanceof TileGenericPipe)) {
return null;
}
return ((TileGenericPipe) tile).pipe;
}
@@ -36,14 +41,15 @@ public class GuiHandlerPipes implements IGuiHandler {
@SuppressWarnings("rawtypes")
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id >= GuiId.values().length)
if (id >= GuiId.values().length) {
return null;
}
switch (GuiId.values()[id]) {
case PropolisPipeGUI:
return new GuiPropolisPipe(player, (PipeItemsPropolis)getPipe(world, x, y, z));
default:
return null;
case PropolisPipeGUI:
return new GuiPropolisPipe(player, (PipeItemsPropolis) getPipe(world, x, y, z));
default:
return null;
}
}
@@ -51,15 +57,16 @@ public class GuiHandlerPipes implements IGuiHandler {
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id >= GuiId.values().length)
if (id >= GuiId.values().length) {
return null;
}
switch (GuiId.values()[id]) {
case PropolisPipeGUI:
PluginApiculture.beeInterface.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
return new ContainerPropolisPipe(player.inventory, (PipeItemsPropolis)getPipe(world, x, y, z));
default:
return null;
case PropolisPipeGUI:
PluginApiculture.beeInterface.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
return new ContainerPropolisPipe(player.inventory, (PipeItemsPropolis) getPipe(world, x, y, z));
default:
return null;
}
}