autocleanup

dev
Arona Jones 2016-02-05 15:19:42 +00:00
parent ce519eecbc
commit ab47723b88
33 changed files with 239 additions and 160 deletions

View File

@ -21,7 +21,8 @@ public interface IFistModule extends IModule
enum EnumModuleEffectType
{
/** The rightclick. */
RIGHTCLICK, /** The attack. */
RIGHTCLICK,
/** The attack. */
ATTACK
}
}

View File

@ -10,7 +10,10 @@ import net.minecraftforge.common.util.ForgeDirection;
public interface ISpannerTile
{
public void changeExtraction();
public void changeExtraction(int dirIndex);
public ForgeDirection[] getExtractableConnections();
public ForgeDirection[] getExtractions();
}

View File

@ -11,12 +11,19 @@ public enum EnumVanityType
{
/** The hat. */
HAT, /** The tunic. */
TUNIC, /** The leggings. */
LEGGINGS, /** The boots. */
BOOTS, /** The HA t1. */
HAT1, /** The TUNI c1. */
TUNIC1, /** The LEGGING s1. */
LEGGINGS1, /** The BOOT s1. */
HAT,
/** The tunic. */
TUNIC,
/** The leggings. */
LEGGINGS,
/** The boots. */
BOOTS,
/** The HA t1. */
HAT1,
/** The TUNI c1. */
TUNIC1,
/** The LEGGING s1. */
LEGGINGS1,
/** The BOOT s1. */
BOOTS1
}

View File

@ -42,6 +42,6 @@ public class GuiArmorEditor extends BaseEntityRenderGUI
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
renderEntity(x + 33, y + 75, 30, x + 33 - this.xSizeFloat, (y + 75) - 50 - this.ySizeFloat, this.mc.thePlayer);
renderEntity(x + 33, y + 75, 30, (x + 33) - this.xSizeFloat, (y + 75) - 50 - this.ySizeFloat, this.mc.thePlayer);
}
}

View File

@ -1,13 +1,14 @@
package steamcraft.client.gui;
import org.lwjgl.opengl.GL11;
import boilerplate.client.BaseContainerGui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import boilerplate.client.BaseContainerGui;
import org.lwjgl.opengl.GL11;
import steamcraft.api.tile.ISpannerTile;
import steamcraft.common.init.InitPackets;
import steamcraft.common.lib.ModInfo;
@ -21,12 +22,11 @@ import steamcraft.common.tiles.container.ContainerChangeExtractions;
public class GuiChangeExtractions extends BaseContainerGui
{
private static ResourceLocation guitexture = new ResourceLocation(ModInfo.PREFIX + "textures/gui/changeextractions.png");
private static String[] buttonNames = new String[]{"Insert", "Extract"};
private static String[] buttonNames = new String[] { "Insert", "Extract" };
private TileEntity tile;
private int worldId;
public GuiChangeExtractions(TileEntity tile, int worldId)
{
super(new ContainerChangeExtractions());
@ -63,28 +63,28 @@ public class GuiChangeExtractions extends BaseContainerGui
public void initGui()
{
super.initGui();
buttonList.clear();
this.buttonList.clear();
ISpannerTile spannerTile = (ISpannerTile) this.tile;
ForgeDirection[] connections = spannerTile.getExtractableConnections();
ForgeDirection[] extractions = spannerTile.getExtractions();
GuiButton up = this.createGuiButton(0, guiLeft + 55, guiTop + 20, 44, 20, connections, extractions);
GuiButton down = this.createGuiButton(1, guiLeft + 150, guiTop + 20, 44, 20, connections, extractions);
GuiButton up = this.createGuiButton(0, this.guiLeft + 55, this.guiTop + 20, 44, 20, connections, extractions);
GuiButton down = this.createGuiButton(1, this.guiLeft + 150, this.guiTop + 20, 44, 20, connections, extractions);
GuiButton north = this.createGuiButton(2, guiLeft + 55, guiTop + 50, 44, 20, connections, extractions);
GuiButton south = this.createGuiButton(3, guiLeft + 150, guiTop + 50, 44, 20, connections, extractions);
GuiButton north = this.createGuiButton(2, this.guiLeft + 55, this.guiTop + 50, 44, 20, connections, extractions);
GuiButton south = this.createGuiButton(3, this.guiLeft + 150, this.guiTop + 50, 44, 20, connections, extractions);
GuiButton west = this.createGuiButton(4, guiLeft + 55, guiTop + 80, 44, 20, connections, extractions);
GuiButton east = this.createGuiButton(5, guiLeft + 150, guiTop + 80, 44, 20, connections, extractions);
GuiButton west = this.createGuiButton(4, this.guiLeft + 55, this.guiTop + 80, 44, 20, connections, extractions);
GuiButton east = this.createGuiButton(5, this.guiLeft + 150, this.guiTop + 80, 44, 20, connections, extractions);
buttonList.add(north);
buttonList.add(south);
buttonList.add(west);
buttonList.add(east);
buttonList.add(up);
buttonList.add(down);
this.buttonList.add(north);
this.buttonList.add(south);
this.buttonList.add(west);
this.buttonList.add(east);
this.buttonList.add(up);
this.buttonList.add(down);
}
private GuiButton createGuiButton(int index, int x, int y, int xx, int yy, ForgeDirection[] connections, ForgeDirection[] extractions)
@ -102,7 +102,8 @@ public class GuiChangeExtractions extends BaseContainerGui
{
if (button.enabled)
{
InitPackets.network.sendToServer(new UpdateExtractionPacket(worldId, this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, button.id));
InitPackets.network
.sendToServer(new UpdateExtractionPacket(this.worldId, this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, button.id));
button.displayString = button.displayString.equals(buttonNames[0]) ? buttonNames[1] : buttonNames[0];
}
}

View File

@ -1,14 +1,15 @@
package steamcraft.client.gui;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import steamcraft.common.container.ContainerVanity;
import steamcraft.common.container.InventoryVanity;
import steamcraft.common.lib.ModInfo;
@ -18,7 +19,8 @@ import steamcraft.common.lib.ModInfo;
*
*/
@SideOnly(Side.CLIENT)
public class GuiVanity extends GuiContainer {
public class GuiVanity extends GuiContainer
{
private float xSize_lo;
private float ySize_lo;
@ -27,20 +29,23 @@ public class GuiVanity extends GuiContainer {
private final InventoryVanity inventory;
public GuiVanity(final EntityPlayer player, final InventoryPlayer inventoryPlayer, final InventoryVanity inventoryCustom) {
public GuiVanity(final EntityPlayer player, final InventoryPlayer inventoryPlayer, final InventoryVanity inventoryCustom)
{
super(new ContainerVanity(player, inventoryPlayer, inventoryCustom));
this.inventory = inventoryCustom;
}
@Override
public void drawScreen(final int x, final int y, final float scale) {
public void drawScreen(final int x, final int y, final float scale)
{
super.drawScreen(x, y, scale);
this.xSize_lo = x;
this.ySize_lo = y;
}
@Override
protected void drawGuiContainerForegroundLayer(final int x, final int y) {
protected void drawGuiContainerForegroundLayer(final int x, final int y)
{
final String s = this.inventory.getInventoryName();
this.fontRendererObj.drawString(s, this.xSize - this.fontRendererObj.getStringWidth(s) - 8, 5, 4210752);
this.fontRendererObj.drawString("container.inventory", 120, this.ySize - 92, 4210752); // TODO
@ -49,7 +54,8 @@ public class GuiVanity extends GuiContainer {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float scale, final int par2, final int par3) {
protected void drawGuiContainerBackgroundLayer(final float scale, final int par2, final int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(iconLocation);
final int x = (this.width - this.xSize) / 2;

View File

@ -55,7 +55,7 @@ public class BlockTransparentWithInsideRenderer implements ISimpleBlockRendering
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer)
{
drawBlock(block, meta, renderer);
this.drawBlock(block, meta, renderer);
}
@Override

View File

@ -1,16 +1,19 @@
package steamcraft.client.renderers.models;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import steamcraft.common.entities.living.EntityVampireBat;
@SideOnly(Side.CLIENT)
public class ModelVampireBat extends ModelBase {
public class ModelVampireBat extends ModelBase
{
private final ModelRenderer batHead;
/** The body box of the bat model. */
private final ModelRenderer batBody;
@ -23,7 +26,8 @@ public class ModelVampireBat extends ModelBase {
/** The outer left wing box of the bat model. */
private final ModelRenderer batOuterLeftWing;
public ModelVampireBat() {
public ModelVampireBat()
{
this.textureWidth = 64;
this.textureHeight = 64;
this.batHead = new ModelRenderer(this, 0, 0);
@ -61,7 +65,8 @@ public class ModelVampireBat extends ModelBase {
* would be recreated if the value changed and it seems a good match for a
* bats size
*/
public int getBatSize() {
public int getBatSize()
{
return 36;
}
@ -69,11 +74,13 @@ public class ModelVampireBat extends ModelBase {
* Sets the models various rotation angles then renders the model.
*/
@Override
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
{
EntityVampireBat EntityVampireBat = (EntityVampireBat) p_78088_1_;
float f6;
if (EntityVampireBat.getIsBatHanging()) {
if (EntityVampireBat.getIsBatHanging())
{
f6 = (180F / (float) Math.PI);
this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
this.batHead.rotateAngleY = (float) Math.PI - (p_78088_5_ / (180F / (float) Math.PI));
@ -88,7 +95,9 @@ public class ModelVampireBat extends ModelBase {
this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY;
} else {
}
else
{
f6 = (180F / (float) Math.PI);
this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
this.batHead.rotateAngleY = p_78088_5_ / (180F / (float) Math.PI);

View File

@ -55,7 +55,7 @@ public class TileCopperPipeRenderer extends TileEntitySpecialRenderer
{
this.drawCore(pipe);
for (int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = pipe.connections[i];
if (dir != null)

View File

@ -41,7 +41,7 @@ public class TileCopperWireRenderer extends TileEntitySpecialRenderer
this.bindTexture(this.texture1);
this.drawCore(wire);
for (int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = wire.connections[i];

View File

@ -56,9 +56,9 @@ public class BlockMetalLattice extends BaseMetadataBlock
public void registerBlockIcons(final IIconRegister ir)
{
for (int i = 0; i < 8; i++)
this.icon[i] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "block" + LibInfo.metals[i] + "Lattice" + textureSuffix);
this.icon[i] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "block" + LibInfo.metals[i] + "Lattice" + this.textureSuffix);
for (int i2 = 8; i2 < 16; i2++)
this.icon[i2] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "block" + LibInfo.metals[i2 - 8] + "LatticeThin" + textureSuffix);
this.icon[i2] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "block" + LibInfo.metals[i2 - 8] + "LatticeThin" + this.textureSuffix);
}
@SuppressWarnings({ "rawtypes", "unchecked" })

View File

@ -36,17 +36,17 @@ public class BlockPlating extends BaseMetadataBlock
@SideOnly(Side.CLIENT)
public void getSubBlocks(final Item item, final CreativeTabs tab, final List l)
{
if (block == InitBlocks.blockMetal)
if (this.block == InitBlocks.blockMetal)
{
for (int var4 = 0; var4 < 8; ++var4)
l.add(new ItemStack(InitBlocks.blockMetalPlate, 1, var4));
}
else if (block == InitBlocks.blockMossyMetal)
else if (this.block == InitBlocks.blockMossyMetal)
{
for (int var4 = 0; var4 < 8; ++var4)
l.add(new ItemStack(InitBlocks.blockMossyMetalPlate, 1, var4));
}
if (block == InitBlocks.blockRustyMetal)
if (this.block == InitBlocks.blockRustyMetal)
{
for (int var4 = 0; var4 < 8; ++var4)
l.add(new ItemStack(InitBlocks.blockRustyMetalPlate, 1, var4));
@ -60,7 +60,7 @@ public class BlockPlating extends BaseMetadataBlock
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
return block.getIcon(side, meta);
return this.block.getIcon(side, meta);
}
/**

View File

@ -34,7 +34,7 @@ public class BlockScaffold extends BaseMetadataBlock
{
super(Material.wood);
this.textureSuffixs = suffixs;
this.icon = new IIcon[textureSuffixs.length];
this.icon = new IIcon[this.textureSuffixs.length];
this.setHardness(1.0F);
this.setResistance(1.0F);
this.setStepSound(Block.soundTypeWood);
@ -55,8 +55,8 @@ public class BlockScaffold extends BaseMetadataBlock
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister ir)
{
for (int i = 0; i < textureSuffixs.length; i++)
this.icon[i] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "blockScaffold" + textureSuffixs[i]);
for (int i = 0; i < this.textureSuffixs.length; i++)
this.icon[i] = ir.registerIcon(ModInfo.PREFIX + "frame/" + "blockScaffold" + this.textureSuffixs[i]);
}
@SuppressWarnings({ "rawtypes", "unchecked" })

View File

@ -4,9 +4,11 @@ package steamcraft.common.config;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
import steamcraft.common.lib.LoggerSteamcraft;
public class ConfigGeneral {
public class ConfigGeneral
{
public static Configuration config;
public static final String CATEGORY_GENERAL = "general";
@ -22,21 +24,26 @@ public class ConfigGeneral {
public static boolean unnaturalLightningStrikes, naturalLightningStrikes, weather2LightningStrikes;
public static int depthsBiomeID, depthsFBiomeID, depthsMBiomeID, depthsSBiomeID, depthsIBiomeID, depthsSCBiomeID, depthsSCHBiomeID, depthsSWBiomeID, depthsTFBiomeID, depthsJBiomeID;// ,
// depthsOBiomeID,
// depthsBBiomeID;
public static int depthsBiomeID, depthsFBiomeID, depthsMBiomeID, depthsSBiomeID, depthsIBiomeID, depthsSCBiomeID, depthsSCHBiomeID,
depthsSWBiomeID, depthsTFBiomeID, depthsJBiomeID;// ,
// depthsOBiomeID,
// depthsBBiomeID;
public static double spyglassZoom;
public static String[] oredictMetals;
public static void initialize(File configFile) {
public static void initialize(File configFile)
{
config = new Configuration(configFile);
try {
try
{
config.load();
partyPooper = config.get(CATEGORY_GENERAL, "Remove all little fun things from mod :(", false).getBoolean();
golemFireDrop = config.get(CATEGORY_GENERAL, "Iron Golems drop cast iron when dying from fire (Kinda breaks iron farms that use fire drop)", true).getBoolean();
golemFireDrop = config
.get(CATEGORY_GENERAL, "Iron Golems drop cast iron when dying from fire (Kinda breaks iron farms that use fire drop)", true)
.getBoolean();
armorSpawnChance = config.get(CATEGORY_GENERAL, "Spawn Chance of our Armor on Zombies/Skeletons (0.0-1.0)", 0.2D).getDouble();
drawFluid = config.get(CATEGORY_CLIENT, "Render fluid inside blocks", true).getBoolean();
@ -63,10 +70,14 @@ public class ConfigGeneral {
depthsTFBiomeID = config.get(CATEGORY_GENERAL, "Biome ID for Depths Tall Forest Biome", biomeID++).getInt();
depthsJBiomeID = config.get(CATEGORY_GENERAL, "Biome ID for Depths Jungle Biome", biomeID++).getInt();
oredictMetals = config.getStringList(CATEGORY_GENERAL, "List of oredictionary names of ingots/plates that the grindstone will be able to convert to dust", new String[] { "Platinum", "Nickel", "Lead", "Silver", "" }, "");
} catch (Exception e) {
oredictMetals = config.getStringList(CATEGORY_GENERAL,
"List of oredictionary names of ingots/plates that the grindstone will be able to convert to dust",
new String[] { "Platinum", "Nickel", "Lead", "Silver", "" }, "");
} catch (Exception e)
{
LoggerSteamcraft.error("Failed to load configuration file:" + e);
} finally {
} finally
{
if (config.hasChanged())
config.save();
}

View File

@ -5,17 +5,21 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import steamcraft.common.tiles.container.slot.SlotVanity;
/**
* @author warlordjones
*
*/
public class ContainerVanity extends Container {
public class ContainerVanity extends Container
{
private static final int ARMOR_START = InventoryVanity.INV_SIZE, ARMOR_END = ARMOR_START + 3, INV_START = ARMOR_END + 1, INV_END = INV_START + 26, HOTBAR_START = INV_END + 1, HOTBAR_END = HOTBAR_START + 8;
private static final int ARMOR_START = InventoryVanity.INV_SIZE, ARMOR_END = ARMOR_START + 3, INV_START = ARMOR_END + 1, INV_END = INV_START + 26,
HOTBAR_START = INV_END + 1, HOTBAR_END = HOTBAR_START + 8;
public ContainerVanity(final EntityPlayer player, final InventoryPlayer inventoryPlayer, final InventoryVanity inventoryCustom) {
public ContainerVanity(final EntityPlayer player, final InventoryPlayer inventoryPlayer, final InventoryVanity inventoryCustom)
{
// Custom Slots
this.addSlotToContainer(new SlotVanity(inventoryCustom, 0, 25, 8));
this.addSlotToContainer(new SlotVanity(inventoryCustom, 1, 25, 26));
@ -37,7 +41,8 @@ public class ContainerVanity extends Container {
}
@Override
public boolean canInteractWith(final EntityPlayer player) {
public boolean canInteractWith(final EntityPlayer player)
{
return true;
}

View File

@ -5,7 +5,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
import steamcraft.common.container.InventoryVanity;
/**
@ -13,44 +15,52 @@ import steamcraft.common.container.InventoryVanity;
*
*/
// TODO: Add packets
public class EntityPlayerExtended implements IExtendedEntityProperties {
public class EntityPlayerExtended implements IExtendedEntityProperties
{
public final static String EXT_PROP_NAME = "SteamcraftPlayerExtended";
private final InventoryVanity inventory = new InventoryVanity();
private final EntityPlayer player;
public EntityPlayerExtended(final EntityPlayer player) {
public EntityPlayerExtended(final EntityPlayer player)
{
this.player = player;
}
public static void register(final EntityPlayer player) {
public static void register(final EntityPlayer player)
{
player.registerExtendedProperties(EntityPlayerExtended.EXT_PROP_NAME, new EntityPlayerExtended(player));
}
public static EntityPlayerExtended get(final EntityPlayer player) {
public static EntityPlayerExtended get(final EntityPlayer player)
{
return (EntityPlayerExtended) player.getExtendedProperties(EXT_PROP_NAME);
}
@Override
public void saveNBTData(final NBTTagCompound tagCompound) {
public void saveNBTData(final NBTTagCompound tagCompound)
{
final NBTTagCompound properties = new NBTTagCompound();
tagCompound.setTag(EXT_PROP_NAME, properties);
this.inventory.writeToNBT(properties);
}
@Override
public void loadNBTData(final NBTTagCompound tagCompound) {
public void loadNBTData(final NBTTagCompound tagCompound)
{
final NBTTagCompound properties = (NBTTagCompound) tagCompound.getTag(EXT_PROP_NAME);
if (properties != null)
this.inventory.readFromNBT(properties);
}
@Override
public void init(final Entity entity, final World world) {
public void init(final Entity entity, final World world)
{
}
public InventoryVanity getInventory() {
public InventoryVanity getInventory()
{
return this.inventory;
}
}

View File

@ -387,7 +387,7 @@ public class InitItems
registerItem(itemMatch, "ItemMatch");
itemTopHat = new ItemTopHat().setUnlocalizedName("itemTopHat");
// registerItem(itemTopHat, "ItemTopHat");
registerItem(itemTopHat, "ItemTopHat");
itemAqualung = new ItemAqualung().setUnlocalizedName("itemAqualung");
registerItem(itemAqualung, "ItemAqualung");

View File

@ -4,6 +4,7 @@ package steamcraft.common.init;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
import steamcraft.common.packets.CopperPipeFluidPacket;
import steamcraft.common.packets.CopperPipeFluidPacket.FluidNetworkPacketHandler;
import steamcraft.common.packets.CopperPipePacket;

View File

@ -1,23 +1,28 @@
package steamcraft.common.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import steamcraft.common.lib.ModInfo;
/**
* @author warlordjones
*
*/
public class ItemNuggetIron extends BaseItem {
public ItemNuggetIron() {
public class ItemNuggetIron extends BaseItem
{
public ItemNuggetIron()
{
super();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister par1IconRegister) {
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + "metals/itemNuggetIron");
}
}

View File

@ -1,10 +1,6 @@
package steamcraft.common.items;
import boilerplate.api.IOpenableGUI;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityMinecart;
@ -12,6 +8,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import boilerplate.api.IOpenableGUI;
import steamcraft.api.item.IUniversalWrench;
import steamcraft.api.tile.ISpannerTile;
import steamcraft.client.lib.GuiIDs;
@ -41,7 +43,7 @@ public class ItemSpanner extends BaseItem implements IUniversalWrench
{
ISpannerTile spannerTile = (ISpannerTile) tile;
if (player.isSneaking() && tile instanceof IOpenableGUI)
if (player.isSneaking() && (tile instanceof IOpenableGUI))
player.openGui(Steamcraft.instance, GuiIDs.PIPES, world, x, y, z);
else
spannerTile.changeExtraction();

View File

@ -79,7 +79,7 @@ public class ElectricItem extends BaseElectricItem
{
NBTTagCompound tag = stack.getTagCompound();
if (tag != null && tag.getBoolean("canCharge"))
if ((tag != null) && tag.getBoolean("canCharge"))
{
EntityPlayer player = (EntityPlayer) entity;
if (this.maxSend > 0)

View File

@ -4,7 +4,6 @@ package steamcraft.common.items.electric;
import java.awt.Color;
import java.util.HashMap;
import boilerplate.common.utils.PlayerUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -16,6 +15,8 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import boilerplate.common.utils.PlayerUtils;
import steamcraft.common.Steamcraft;
import steamcraft.common.lib.ModInfo;
@ -24,14 +25,16 @@ import steamcraft.common.lib.ModInfo;
*
*/
public class ItemRayGun extends ElectricItem {
public class ItemRayGun extends ElectricItem
{
public static short energyPerUse = 100;
static HashMap<String, Object> ray = new HashMap<String, Object>();
static HashMap<String, Long> soundDelay = new HashMap<String, Long>();
static final HashMap<Block, Block> meltables = new HashMap<Block, Block>();
public ItemRayGun(String raySound, int maxEnergy, int maxReceive) {
public ItemRayGun(String raySound, int maxEnergy, int maxReceive)
{
super(maxEnergy, maxReceive, 0);
this.setMaxStackSize(1);
this.setFull3D();
@ -45,8 +48,10 @@ public class ItemRayGun extends ElectricItem {
@SuppressWarnings("all")
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (this.getEnergyStored(stack) >= ItemRayGun.energyPerUse || player.capabilities.isCreativeMode) {
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
if ((this.getEnergyStored(stack) >= ItemRayGun.energyPerUse) || player.capabilities.isCreativeMode)
{
MovingObjectPosition mop = PlayerUtils.getTargetBlock(world, player, true, 50);
Vec3 vec3 = player.getLookVec();
@ -66,15 +71,19 @@ public class ItemRayGun extends ElectricItem {
if (soundDelay.get(player) == null)
soundDelay.put(player.getCommandSenderName(), Long.valueOf(0L));
if (!world.isRemote && (soundDelay.get(player.getCommandSenderName()).longValue() < System.currentTimeMillis())) {
if (!world.isRemote && (soundDelay.get(player.getCommandSenderName()).longValue() < System.currentTimeMillis()))
{
world.playSoundEffect(tx, ty, tz, ModInfo.PREFIX + "raygun", 0.35F, 1.0F);
soundDelay.put(player.getCommandSenderName(), Long.valueOf(System.currentTimeMillis() + 1200L));
} else
}
else
soundDelay.put(player.getCommandSenderName(), Long.valueOf(0L));
if (world.isRemote)
ray.put(player.getCommandSenderName(), Steamcraft.proxy.rayFX(world, player, tx, ty, tz, 2, false, impact > 0 ? 2.0F : 0.0F, ray.get(player), impact, Color.GREEN));
ray.put(player.getCommandSenderName(),
Steamcraft.proxy.rayFX(world, player, tx, ty, tz, 2, false, impact > 0 ? 2.0F : 0.0F, ray.get(player), impact, Color.GREEN));
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK))
{
int x = mop.blockX;
int y = mop.blockY;
int z = mop.blockZ;
@ -82,13 +91,15 @@ public class ItemRayGun extends ElectricItem {
if (!world.isRemote && !world.isAirBlock(x, y, z))
for (int i = x - Item.itemRand.nextInt(4); i < (x + Item.itemRand.nextInt(4)); i++)
for (int j = y - Item.itemRand.nextInt(4); j < (y + Item.itemRand.nextInt(4)); j++)
for (int k = z - Item.itemRand.nextInt(4); k < (z + Item.itemRand.nextInt(4)); k++) {
for (int k = z - Item.itemRand.nextInt(4); k < (z + Item.itemRand.nextInt(4)); k++)
{
if (world.isAirBlock(i, j, k))
world.setBlock(i, j, k, Blocks.fire);
else if (meltables.containsKey(world.getBlock(i, j, k)))
world.setBlock(i, j, k, meltables.get(world.getBlock(i, j, k)));
if (!player.capabilities.isCreativeMode) {
if (!player.capabilities.isCreativeMode)
{
this.setEnergy(stack, this.getEnergyStored(stack) - energyPerUse);
}
@ -110,7 +121,8 @@ public class ItemRayGun extends ElectricItem {
py += vec3d.yCoord * 0.5D;
pz += vec3d.zCoord * 0.5D;
if ((pointedEntity != null) && ((pointedEntity instanceof EntityLivingBase))) {
if ((pointedEntity != null) && ((pointedEntity instanceof EntityLivingBase)))
{
if (!world.isRemote)
pointedEntity.setFire(100);
}

View File

@ -153,22 +153,22 @@ public class EventHandlerFML
ItemStack armorPiece = player.getCurrentArmor(0);
if (!armorWearing && armorPiece != null && armorPiece.getItem() instanceof ItemBrassArmor)
if (!armorWearing && (armorPiece != null) && (armorPiece.getItem() instanceof ItemBrassArmor))
{
armorWearingPlayers.add(player.getGameProfile().getName());
FMLLog.warning("E", "E");
ItemBrassArmor brassArmor = (ItemBrassArmor) armorPiece.getItem();
brassArmor.onArmorEquipped(player.getEntityWorld(), player, armorPiece);
prevArmor = brassArmor;
this.prevArmor = brassArmor;
}
if (armorWearing && (armorPiece == null || !(armorPiece.getItem() instanceof ItemBrassArmor)))
if (armorWearing && ((armorPiece == null) || !(armorPiece.getItem() instanceof ItemBrassArmor)))
{
armorWearingPlayers.remove(player.getGameProfile().getName());
FMLLog.warning("U", "U");
if (prevArmor != null)
if (this.prevArmor != null)
{
prevArmor.onArmorUnequipped(player.getEntityWorld(), player, /* TODO */ new ItemStack(prevArmor));
prevArmor = null;
this.prevArmor.onArmorUnequipped(player.getEntityWorld(), player, /* TODO */ new ItemStack(this.prevArmor));
this.prevArmor = null;
}
}
}

View File

@ -66,7 +66,7 @@ public class EventHandlerForge
@SubscribeEvent
public void onMobDrops(LivingDropsEvent event)
{
if (event.entity instanceof EntityIronGolem && event.entity.isBurning() && ConfigGeneral.golemFireDrop)
if ((event.entity instanceof EntityIronGolem) && event.entity.isBurning() && ConfigGeneral.golemFireDrop)
{
event.drops.clear();
ItemStack ingot = new ItemStack(InitItems.itemIngot, 3 + this.rand.nextInt(3), 7);

View File

@ -1,12 +1,15 @@
package steamcraft.common.packets;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import io.netty.buffer.ByteBuf;
import steamcraft.api.tile.ISpannerTile;
/**
@ -44,7 +47,7 @@ public class UpdateExtractionPacket implements IMessage
@Override
public void toBytes(ByteBuf buf)
{
buf.writeInt(worldId);
buf.writeInt(this.worldId);
buf.writeInt(this.x);
buf.writeInt(this.y);
buf.writeInt(this.z);

View File

@ -3,10 +3,6 @@ package steamcraft.common.tiles;
import java.util.ArrayList;
import boilerplate.api.IOpenableGUI;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -15,6 +11,11 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
@ -22,6 +23,8 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import boilerplate.api.IOpenableGUI;
import steamcraft.api.tile.ISpannerTile;
import steamcraft.client.gui.GuiChangeExtractions;
import steamcraft.common.init.InitBlocks;
@ -36,7 +39,8 @@ import steamcraft.common.tiles.container.ContainerChangeExtractions;
*/
public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpannerTile, IOpenableGUI
{
private static int ticksTillFluidUpdate = 200; // update the fluid in pipe every 10 seconds
private static int ticksTillFluidUpdate = 200; // update the fluid in pipe
// every 10 seconds
private static int copperPipeCapacity = 500;
private static int copperPipeExtract = 50;
@ -51,7 +55,8 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
public Fluid fluidInPipe;
public float fluidScaled = 0;
private int ticksSinceUpdate = ticksTillFluidUpdate / 2; // first time update faster
private int ticksSinceUpdate = ticksTillFluidUpdate / 2; // first time
// update faster
public ForgeDirection[] connections = new ForgeDirection[6];
public ForgeDirection[] extractions = new ForgeDirection[6];
@ -274,8 +279,7 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
if ((dir != null) && this.isFluidHandler(dir))
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY,
this.zCoord + dir.offsetZ, dir.getOpposite());
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
if (this.extractions[i] == null)
{
@ -312,8 +316,7 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
if (dir != null)
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY,
this.zCoord + dir.offsetZ, dir.getOpposite());
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
if (this.extractions[dirIndex] == null)
{
@ -344,10 +347,10 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
{
ForgeDirection[] extractableConnections = new ForgeDirection[6];
for(int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = this.connections[i];
if (dir != null && this.isFluidHandler(dir))
if ((dir != null) && this.isFluidHandler(dir))
extractableConnections[i] = dir;
}
@ -453,10 +456,10 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
this.setMaster(this);
}
for (int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = this.connections[i];
if (dir != null && this.isFluidHandler(dir))
if ((dir != null) && this.isFluidHandler(dir))
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
@ -714,8 +717,7 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
if (dir == from)
return false;
return (this.network != null)
&& ((this.network.tank.getFluid() == null) || (this.network.tank.getFluid().getFluid() == fluid));
return (this.network != null) && ((this.network.tank.getFluid() == null) || (this.network.tank.getFluid().getFluid() == fluid));
}
@Override
@ -725,8 +727,7 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
if (dir == from)
return false;
return (this.network != null)
&& ((this.network.tank.getFluid() == null) || (this.network.tank.getFluid().getFluid() == fluid));
return (this.network != null) && ((this.network.tank.getFluid() == null) || (this.network.tank.getFluid().getFluid() == fluid));
}
@Override
@ -736,9 +737,7 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
if (dir == from)
return null;
if ((this.network != null) && (this.network.tank.getFluid() != null)
&& this.network.tank.getFluid().isFluidEqual(resource))
if ((this.network != null) && (this.network.tank.getFluid() != null) && this.network.tank.getFluid().isFluidEqual(resource))
{
int amount = Math.min(resource.amount, this.pipeTransfer);

View File

@ -59,7 +59,7 @@ public class TileInjector extends BaseTileWithInventory implements IOpenableGUI,
{
if (this.inventory[0] != null)
{
ItemStack stack = FluidUtils.drainFluidContainer(buffer, this.inventory[0]);
ItemStack stack = FluidUtils.drainFluidContainer(this.buffer, this.inventory[0]);
if ((this.inventory[0] != null) && OreDictionary.itemMatches(this.inventory[0], stack, true))
this.inventory[0].stackSize += stack.stackSize;
else if (this.inventory[0] == null)
@ -68,7 +68,7 @@ public class TileInjector extends BaseTileWithInventory implements IOpenableGUI,
}
if (this.inventory[1] != null)
{
ItemStack stack = FluidUtils.fillFluidContainer(buffer, this.inventory[1]);
ItemStack stack = FluidUtils.fillFluidContainer(this.buffer, this.inventory[1]);
if (stack != null)
{
if ((this.inventory[1] != null) && OreDictionary.itemMatches(this.inventory[1], stack, true))

View File

@ -150,12 +150,12 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
}
}
// Burn fuel
if ((this.furnaceBurnTime == 0) && this.fuelTank.getFluid() != null)
if ((this.furnaceBurnTime == 0) && (this.fuelTank.getFluid() != null))
{
this.furnaceBurnTime = this.getFuelBurnTime(this.fuelTank.getFluid().getFluid());
}
if (this.furnaceBurnTime != 0 && (this.waterTank.getFluidAmount() >= waterPerTick)
if ((this.furnaceBurnTime != 0) && (this.waterTank.getFluidAmount() >= waterPerTick)
&& (this.steamTank.fill(new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), false) > 0)
&& (this.fuelTank.getFluidAmount() >= fuelPerTick))
this.fuelTank.drain(fuelPerTick, true);

View File

@ -116,7 +116,7 @@ public class TileRefinery extends BaseTileWithInventory implements IFluidHandler
{
if (this.inventory[1].getItem() == InitItems.itemWhaleBlubber)
{
if (this.cookTime < totalCookTime)
if (this.cookTime < this.totalCookTime)
this.cookTime++;
else
{

View File

@ -1,9 +1,10 @@
package steamcraft.common.tiles.container;
import boilerplate.common.baseclasses.blocks.BaseContainer;
import net.minecraft.entity.player.EntityPlayer;
import boilerplate.common.baseclasses.blocks.BaseContainer;
/**
* @author decebaldecebal
*

View File

@ -73,7 +73,7 @@ public class ContainerInjector extends BaseContainer
@SideOnly(Side.CLIENT)
public void updateProgressBar(int par1, int par2)
{
if (par1 == 0 && tileent.buffer.getFluid() != null)
if ((par1 == 0) && (this.tileent.buffer.getFluid() != null))
this.tileent.buffer.getFluid().amount = par2;
}

View File

@ -3,13 +3,6 @@ package steamcraft.common.tiles.energy;
import java.util.ArrayList;
import boilerplate.api.IOpenableGUI;
import cofh.api.energy.EnergyStorage;
import cofh.api.energy.IEnergyConnection;
import cofh.api.energy.IEnergyHandler;
import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -18,8 +11,18 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import boilerplate.api.IOpenableGUI;
import cofh.api.energy.EnergyStorage;
import cofh.api.energy.IEnergyConnection;
import cofh.api.energy.IEnergyHandler;
import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver;
import steamcraft.api.tile.ISpannerTile;
import steamcraft.client.gui.GuiChangeExtractions;
import steamcraft.common.init.InitBlocks;
@ -231,8 +234,7 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
if ((dir != null) && this.isEnergyHandler(dir))
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY,
this.zCoord + dir.offsetZ, dir.getOpposite());
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
if (this.extractions[i] == null)
{
@ -259,6 +261,7 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
this.updateClientConnections();
}
}
@Override
public void changeExtraction(int dirIndex)
{
@ -268,8 +271,7 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
if (dir != null)
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY,
this.zCoord + dir.offsetZ, dir.getOpposite());
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
if (this.extractions[dirIndex] == null)
{
@ -300,10 +302,10 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
{
ForgeDirection[] extractableConnections = new ForgeDirection[6];
for(int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = this.connections[i];
if (dir != null && this.isEnergyHandler(dir))
if ((dir != null) && this.isEnergyHandler(dir))
extractableConnections[i] = dir;
}
@ -318,7 +320,7 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
private void removeConnections(int i)
{
if (this.connections[i] != null && !this.worldObj.isRemote)
if ((this.connections[i] != null) && !this.worldObj.isRemote)
{
ForgeDirection dir = this.connections[i];
@ -396,14 +398,14 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
this.setMaster(this);
}
for (int i = 0;i < 6;i++)
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = this.connections[i];
if (dir != null && this.isEnergyHandler(dir))
if ((dir != null) && this.isEnergyHandler(dir))
{
Coords temp = new Coords(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, dir.getOpposite());
if (this.extractions[i] == null && (this.worldObj.getTileEntity(temp.x, temp.y, temp.z) instanceof IEnergyReceiver))
if ((this.extractions[i] == null) && (this.worldObj.getTileEntity(temp.x, temp.y, temp.z) instanceof IEnergyReceiver))
{
if (!this.network.outputs.contains(temp))
this.network.outputs.add(temp);
@ -419,7 +421,7 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
private void updateClientConnections()
{
if (this.network != null && !this.worldObj.isRemote)
if ((this.network != null) && !this.worldObj.isRemote)
{
InitPackets.network.sendToAllAround(new WirePacket(this.xCoord, this.yCoord, this.zCoord, this.connections, this.extractions),
new TargetPoint(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 100));
@ -616,7 +618,8 @@ public class TileCopperWire extends TileEntity implements IEnergyHandler, ISpann
if (dir == from)
return 0;
if ((this.network != null)) // should actively receive energy from where it is not actively pulling
if ((this.network != null)) // should actively receive energy from where
// it is not actively pulling
{
int amount = Math.min(maxReceive, this.wireTransfer);

View File

@ -97,7 +97,7 @@ public class WorldGenSteamcraft implements IWorldGenerator
}
}
if (random.nextInt(30) == 0 && ConfigWorldGen.deepsPortalGenEnabled)
if ((random.nextInt(30) == 0) && ConfigWorldGen.deepsPortalGenEnabled)
{
int X = chunkX + random.nextInt(16);
int Z = chunkZ + random.nextInt(16);