mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
minor cleanup
This commit is contained in:
parent
2c081af511
commit
6b873b0c81
@ -1153,8 +1153,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block volcano_core;
|
||||
|
||||
public static Block dummy_block_igenerator;
|
||||
public static Block dummy_port_igenerator;
|
||||
public static Block dummy_block_cyclotron;
|
||||
public static Block dummy_port_cyclotron;
|
||||
public static Block dummy_block_well;
|
||||
@ -2152,8 +2150,6 @@ public class ModBlocks {
|
||||
FluidRegistry.registerFluid(volcanic_lava_fluid);
|
||||
volcanic_lava_block = new VolcanicBlock(volcanic_lava_fluid, Material.lava).setBlockName("volcanic_lava_block").setResistance(500F);
|
||||
|
||||
dummy_block_igenerator = new DummyBlockIGenerator(Material.iron, false).setBlockName("dummy_block_igenerator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_igenerator = new DummyBlockIGenerator(Material.iron, true).setBlockName("dummy_port_igenerator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_cyclotron = new DummyBlockCyclotron(Material.iron, false).setBlockName("dummy_block_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_cyclotron = new DummyBlockCyclotron(Material.iron, true).setBlockName("dummy_port_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_well = new BlockGeneric(Material.iron).setBlockName("dummy_block_well").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -3114,8 +3110,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(volcanic_lava_block, volcanic_lava_block.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_igenerator, dummy_block_igenerator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_igenerator, dummy_port_igenerator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_cyclotron, dummy_block_cyclotron.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_cyclotron, dummy_port_cyclotron.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_well, dummy_block_well.getUnlocalizedName());
|
||||
|
||||
@ -1,94 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IDummy;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockIGenerator extends DummyOldBase {
|
||||
|
||||
public DummyBlockIGenerator(Material mat, boolean port) {
|
||||
super(mat, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i)
|
||||
{
|
||||
if(!safeBreak) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
//world.getBlock(a, b, c).breakBlock(world, a, b, c, block, i);
|
||||
if(!world.isRemote)
|
||||
world.func_147480_a(a, b, c, true);
|
||||
}
|
||||
}
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_industrial_generator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentText("The IGen has been retired, you may break it for recycling."));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,9 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyInventory;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
|
||||
@ -14,7 +12,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineReactorBreeding extends BlockDummyable implements IMultiblock {
|
||||
public class MachineReactorBreeding extends BlockDummyable {
|
||||
|
||||
public MachineReactorBreeding(Material mat) {
|
||||
super(mat);
|
||||
|
||||
@ -36,7 +36,6 @@ public class MachineReactorControl extends BlockContainer {
|
||||
private IIcon iconBack;
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private Random rand;
|
||||
private static boolean keepInventory;
|
||||
|
||||
public MachineReactorControl(Material p_i45386_1_) {
|
||||
|
||||
@ -5,7 +5,6 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.BossSpawnHandler;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
|
||||
@ -18,7 +17,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ReactorZirnox extends BlockDummyable implements IMultiblock {
|
||||
public class ReactorZirnox extends BlockDummyable {
|
||||
|
||||
public ReactorZirnox(Material mat) {
|
||||
super(mat);
|
||||
|
||||
@ -100,7 +100,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_ks23, 1), new Object[] { "PPM", "SWL", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'W', ModItems.wire_tungsten, 'L', KEY_LOG });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.gun_sauer, 1), new Object[] { ModItems.ducttape, ModItems.gun_ks23, Blocks.lever, ModItems.gun_ks23 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456, 1), new Object[] { "PBB", "ACC", "PRY", 'P', STEEL.plate(), 'R', ModItems.redcoil_capacitor, 'A', ModItems.coil_advanced_alloy, 'B', ModItems.battery_generic, 'C', ModItems.coil_advanced_torus, 'Y', ModItems.mechanism_special });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", " SRS ", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_natural_uranium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", "SRS", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_natural_uranium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", "SRS", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_uranium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 20), new Object[] { " S ", " R ", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_plate_u235 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { "SRS", 'S', STEEL.plate(), 'R', ModItems.waste_u235 });
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.interfaces.ICustomWarhead.EnumCustomWarhead.EnumBioType;
|
||||
import com.hbm.interfaces.ICustomWarhead.EnumCustomWarhead.EnumChemicalType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemHazard;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
@ -251,12 +250,12 @@ public interface ICustomWarhead
|
||||
case HE:
|
||||
case NUCLEAR:
|
||||
case TX:
|
||||
tooltip.add("Yield: " + Library.getShortNumber(data.getInteger(NBT_YIELD)) + "T");
|
||||
tooltip.add("Yield: " + BobMathUtil.getShortNumber(data.getInteger(NBT_YIELD)) + "T");
|
||||
break;
|
||||
case BIO:
|
||||
case CHEM:
|
||||
case SCHRAB:
|
||||
tooltip.add("Radius: " + Library.getShortNumber(data.getInteger(NBT_YIELD)) + "M");
|
||||
tooltip.add("Radius: " + BobMathUtil.getShortNumber(data.getInteger(NBT_YIELD)) + "M");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
@Deprecated //for the love of god stop leaving this behind
|
||||
public interface IMultiblock {
|
||||
|
||||
}
|
||||
|
||||
@ -6,11 +6,11 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerCoreEmitter;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityCoreEmitter;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
@ -81,7 +81,7 @@ public class GUICoreEmitter extends GuiInfoContainer {
|
||||
String name = I18n.format(this.emitter.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString("Output: " + Library.getShortNumber(emitter.prev) + "Spk", 50, 30, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString("Output: " + BobMathUtil.getShortNumber(emitter.prev) + "Spk", 50, 30, 0xFF7F7F);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@ -4,9 +4,9 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerCoreReceiver;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCoreReceiver;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@ -39,9 +39,9 @@ public class GUICoreReceiver extends GuiInfoContainer {
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString("Input:", 40, 25, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString(Library.getShortNumber(receiver.joules) + "Spk", 50, 35, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString(BobMathUtil.getShortNumber(receiver.joules) + "Spk", 50, 35, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString("Output:", 40, 45, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString(Library.getShortNumber(receiver.joules * 5000) + "HE", 50, 55, 0xFF7F7F);
|
||||
this.fontRendererObj.drawString(BobMathUtil.getShortNumber(receiver.joules * 5000) + "HE", 50, 55, 0xFF7F7F);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerIGenerator;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
|
||||
|
||||
|
||||
@ -10,11 +10,11 @@ import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
public class GUIMachineBattery extends GuiInfoContainer {
|
||||
|
||||
@ -36,7 +36,7 @@ public class GUIMachineBattery extends GuiInfoContainer {
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, battery.power, battery.maxPower);
|
||||
|
||||
long delta = battery.log[19] - battery.log[0];
|
||||
String deltaText = Library.getShortNumber(Math.abs(delta)) + "HE/s";
|
||||
String deltaText = BobMathUtil.getShortNumber(Math.abs(delta)) + "HE/s";
|
||||
|
||||
if(delta > 0)
|
||||
deltaText = EnumChatFormatting.GREEN + "+" + deltaText;
|
||||
@ -46,7 +46,7 @@ public class GUIMachineBattery extends GuiInfoContainer {
|
||||
deltaText = EnumChatFormatting.YELLOW + "+" + deltaText;
|
||||
|
||||
String[] info = {
|
||||
Library.getShortNumber(battery.power) + "/" + Library.getShortNumber(battery.maxPower) + "HE",
|
||||
BobMathUtil.getShortNumber(battery.power) + "/" + BobMathUtil.getShortNumber(battery.maxPower) + "HE",
|
||||
deltaText
|
||||
};
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
@ -10,8 +9,8 @@ import javax.annotation.Nonnegative;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@ -35,7 +34,7 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
|
||||
public void drawElectricityInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height, long power, long maxPower) {
|
||||
if(x <= mouseX && x + width > mouseX && y < mouseY && y + height >= mouseY)
|
||||
gui.drawFluidInfo(new String[] { Library.getShortNumber(power) + "/" + Library.getShortNumber(maxPower) + "HE" }, mouseX, mouseY);
|
||||
gui.drawFluidInfo(new String[] { BobMathUtil.getShortNumber(power) + "/" + BobMathUtil.getShortNumber(maxPower) + "HE" }, mouseX, mouseY);
|
||||
}
|
||||
|
||||
public void drawCustomInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height, String[] text) {
|
||||
@ -168,12 +167,9 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
* @param c Color to use
|
||||
* @return
|
||||
*/
|
||||
private int enumToColor(EnumChatFormatting c)
|
||||
{
|
||||
int hex;
|
||||
if(c.isColor())
|
||||
switch(c)
|
||||
{
|
||||
private int enumToColor(EnumChatFormatting c) {
|
||||
if(c.isColor()) {
|
||||
switch(c) {
|
||||
case AQUA:
|
||||
return 0x55FFFF;
|
||||
case BLACK:
|
||||
@ -208,6 +204,7 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
return 0xFFFF55;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return 0xFFFF55;
|
||||
}
|
||||
@ -224,7 +221,7 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
*/
|
||||
public void drawNumber(char[] num)
|
||||
{
|
||||
if (blink && !Library.getBlink())
|
||||
if (blink && !BobMathUtil.getBlink())
|
||||
return;
|
||||
|
||||
short gap = (short) (digitLength - num.length);
|
||||
@ -472,7 +469,7 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
|
||||
// char[] proc = new Double(bd.doubleValue()).toString().toCharArray();
|
||||
char[] proc = bd.toString().toCharArray();
|
||||
proc = Double.valueOf(Library.roundDecimal(numIn.doubleValue(), floatPad)).toString().toCharArray();
|
||||
proc = Double.valueOf(BobMathUtil.roundDecimal(numIn.doubleValue(), floatPad)).toString().toCharArray();
|
||||
|
||||
if (proc.length == digitLength)
|
||||
toDisp = proc;
|
||||
|
||||
@ -12,7 +12,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemEnumMulti extends Item {
|
||||
|
||||
@ -65,7 +64,6 @@ public class ItemEnumMulti extends Item {
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
|
||||
if(multiTexture) {
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
Enum num = EnumUtil.grabEnumSafely(theEnum, meta);
|
||||
return this.icons[num.ordinal()];
|
||||
} else {
|
||||
|
||||
@ -6,11 +6,11 @@ import java.util.UUID;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.render.model.ModelArmorDNT;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -171,7 +171,7 @@ public class ArmorDNT extends ArmorFSBPowered {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add("Charge: " + Library.getShortNumber(getCharge(stack)) + " / " + Library.getShortNumber(maxPower));
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
list.add(EnumChatFormatting.GOLD + I18nUtil.resolveKey("armor.fullSetBonus"));
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -31,7 +31,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + Library.getShortNumber(getCharge(stack)) + " / " + Library.getShortNumber(maxPower));
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.items.machine;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -34,14 +34,14 @@ public class ItemBattery extends Item implements IBatteryItem {
|
||||
charge = getCharge(itemstack);
|
||||
|
||||
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced && itemstack.getItem() != ModItems.energy_core && itemstack.getItem() != ModItems.dynosphere_desh && itemstack.getItem() != ModItems.dynosphere_schrabidium && itemstack.getItem() != ModItems.dynosphere_euphemium && itemstack.getItem() != ModItems.dynosphere_dineutronium) {
|
||||
list.add("Energy stored: " + Library.getShortNumber(charge) + "/" + Library.getShortNumber(maxCharge) + "HE");
|
||||
list.add("Energy stored: " + BobMathUtil.getShortNumber(charge) + "/" + BobMathUtil.getShortNumber(maxCharge) + "HE");
|
||||
} else {
|
||||
String charge1 = Library.getShortNumber((charge * 100) / this.maxCharge);
|
||||
String charge1 = BobMathUtil.getShortNumber((charge * 100) / this.maxCharge);
|
||||
list.add("Charge: " + charge1 + "%");
|
||||
list.add("(" + Library.getShortNumber(charge) + "/" + Library.getShortNumber(maxCharge) + "HE)");
|
||||
list.add("(" + BobMathUtil.getShortNumber(charge) + "/" + BobMathUtil.getShortNumber(maxCharge) + "HE)");
|
||||
}
|
||||
list.add("Charge rate: " + Library.getShortNumber(chargeRate) + "HE/t");
|
||||
list.add("Discharge rate: " + Library.getShortNumber(dischargeRate) + "HE/t");
|
||||
list.add("Charge rate: " + BobMathUtil.getShortNumber(chargeRate) + "HE/t");
|
||||
list.add("Discharge rate: " + BobMathUtil.getShortNumber(dischargeRate) + "HE/t");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@ -32,7 +32,7 @@ public class ItemPlateFuel extends ItemFuelRod {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "[Reactor Plate Fuel]");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " " + getFunctionDesc());
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Yield of " + Library.getShortNumber(lifeTime) + " events");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Yield of " + BobMathUtil.getShortNumber(lifeTime) + " events");
|
||||
|
||||
super.addInformation(itemstack, player, list, bool);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -20,7 +20,7 @@ public class ItemSelfcharger extends Item implements IBatteryItem {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add(EnumChatFormatting.YELLOW + "" + Library.getShortNumber(charge) + "HE/t");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(charge) + "HE/t");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -19,6 +19,6 @@ public class ItemZirnoxBreedingRod extends ItemZirnoxRod {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "[ZIRNOX Breeding Rod]");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Place next to fuel rods to breed");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Lasts " + Library.getShortNumber(lifeTime) + " ticks");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Lasts " + BobMathUtil.getShortNumber(lifeTime) + " ticks");
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -22,6 +22,6 @@ public class ItemZirnoxRod extends ItemFuelRod {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "[ZIRNOX Fuel Rod]");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Generates " + heat + " heat per tick");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Lasts " + Library.getShortNumber(lifeTime) + " ticks");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + " Lasts " + BobMathUtil.getShortNumber(lifeTime) + " ticks");
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
import com.hbm.items.armor.ArmorFSBPowered;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -52,7 +52,7 @@ public class ItemFusionCore extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "Charges all worn armor pieces by " + Library.getShortNumber(charge) + "HE");
|
||||
list.add(EnumChatFormatting.YELLOW + "Charges all worn armor pieces by " + BobMathUtil.getShortNumber(charge) + "HE");
|
||||
list.add("[Requires full electric set to be worn]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -82,7 +82,7 @@ public class ItemSwordAbilityPower extends ItemSwordAbility implements IBatteryI
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + Library.getShortNumber(getCharge(stack)) + " / " + Library.getShortNumber(maxPower));
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -82,7 +82,7 @@ public class ItemToolAbilityPower extends ItemToolAbility implements IBatteryIte
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + Library.getShortNumber(getCharge(stack)) + " / " + Library.getShortNumber(maxPower));
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.machine.ItemBreedingRod.*;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
@ -309,7 +308,7 @@ public class HbmChestContents {
|
||||
* case 8: spaceship loot (reactor elements, super conductors)
|
||||
* case 9: powder loot (secret chest with the five powders for NITAN)
|
||||
**/
|
||||
|
||||
//what kind of drugs did i take that made me thing this was supposed to be an acceptable way of doing things? what the hell?
|
||||
public static WeightedRandomChestContent[] getLoot(int i) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
package com.hbm.lib;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids;
|
||||
@ -28,9 +24,6 @@ import com.hbm.tileentity.conductor.TileEntityGasDuctSolid;
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuct;
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuctSolid;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTransformer;
|
||||
import com.hbm.tileentity.network.TileEntityPylon;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
@ -87,26 +80,6 @@ public class Library {
|
||||
"5bf069bc-5b46-4179-aafe-35c0a07dee8b", //JMF781
|
||||
});
|
||||
|
||||
/**
|
||||
* Rounds a number to so many significant digits
|
||||
* @param num The number to round
|
||||
* @param digits Amount of digits
|
||||
* @return The rounded double
|
||||
*/
|
||||
public static double roundDecimal(double num, @Nonnegative int digits)
|
||||
{
|
||||
if (digits < 0)
|
||||
throw new IllegalArgumentException("Attempted negative number in non-negative field! Attempted value: " + digits);
|
||||
|
||||
return new BigDecimal(num).setScale(digits, RoundingMode.HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
|
||||
public static boolean getBlink()
|
||||
{
|
||||
return System.currentTimeMillis() % 1000 < 500;
|
||||
}
|
||||
|
||||
//the old list that allowed superuser mode for the ZOMG
|
||||
//currently unused
|
||||
public static List<String> superuser = new ArrayList<String>();
|
||||
@ -331,42 +304,6 @@ public class Library {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static String getShortNumber(long l) {
|
||||
|
||||
if(l >= Math.pow(10, 18)) {
|
||||
double res = l / Math.pow(10, 18);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "E";
|
||||
}
|
||||
if(l >= Math.pow(10, 15)) {
|
||||
double res = l / Math.pow(10, 15);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "P";
|
||||
}
|
||||
if(l >= Math.pow(10, 12)) {
|
||||
double res = l / Math.pow(10, 12);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "T";
|
||||
}
|
||||
if(l >= Math.pow(10, 9)) {
|
||||
double res = l / Math.pow(10, 9);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "G";
|
||||
}
|
||||
if(l >= Math.pow(10, 6)) {
|
||||
double res = l / Math.pow(10, 6);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "M";
|
||||
}
|
||||
if(l >= Math.pow(10, 3)) {
|
||||
double res = l / Math.pow(10, 3);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "k";
|
||||
}
|
||||
|
||||
return Long.toString(l);
|
||||
}
|
||||
|
||||
//not great either but certainly better
|
||||
public static long chargeItemsFromTE(ItemStack[] slots, int index, long power, long maxPower) {
|
||||
|
||||
|
||||
@ -87,7 +87,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_flare));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_fluidtank));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_igenerator));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_pumpjack));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_refinery));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_turbofan));
|
||||
@ -106,7 +105,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_flare));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_fluidtank));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_igenerator));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_pumpjack));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_refinery));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_turbofan));
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package com.hbm.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
public class BobMathUtil {
|
||||
|
||||
@ -90,4 +93,57 @@ public class BobMathUtil {
|
||||
double newRange = newMax - newMin;
|
||||
return (((toScale - oldMin) * newRange) / prevRange) + newMin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rounds a number to so many significant digits
|
||||
* @param num The number to round
|
||||
* @param digits Amount of digits
|
||||
* @return The rounded double
|
||||
*/
|
||||
public static double roundDecimal(double num, @Nonnegative int digits) {
|
||||
if(digits < 0)
|
||||
throw new IllegalArgumentException("Attempted negative number in non-negative field! Attempted value: " + digits);
|
||||
|
||||
return new BigDecimal(num).setScale(digits, RoundingMode.HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
public static boolean getBlink() {
|
||||
return System.currentTimeMillis() % 1000 < 500;
|
||||
}
|
||||
|
||||
public static String getShortNumber(long l) {
|
||||
|
||||
if(l >= Math.pow(10, 18)) {
|
||||
double res = l / Math.pow(10, 18);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "E";
|
||||
}
|
||||
if(l >= Math.pow(10, 15)) {
|
||||
double res = l / Math.pow(10, 15);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "P";
|
||||
}
|
||||
if(l >= Math.pow(10, 12)) {
|
||||
double res = l / Math.pow(10, 12);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "T";
|
||||
}
|
||||
if(l >= Math.pow(10, 9)) {
|
||||
double res = l / Math.pow(10, 9);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "G";
|
||||
}
|
||||
if(l >= Math.pow(10, 6)) {
|
||||
double res = l / Math.pow(10, 6);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "M";
|
||||
}
|
||||
if(l >= Math.pow(10, 3)) {
|
||||
double res = l / Math.pow(10, 3);
|
||||
res = Math.round(res * 100.0) / 100.0;
|
||||
return res + "k";
|
||||
}
|
||||
|
||||
return Long.toString(l);
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,6 +283,7 @@ public class ContaminationUtil {
|
||||
* This system is nice but the cont types are a bit confusing. Cont types should have much better names and multiple cont types should be applicable.
|
||||
*/
|
||||
@SuppressWarnings("incomplete-switch") //just shut up
|
||||
@Deprecated // instead of this does-everything-but-nothing-well solution, please use the ArmorRegistry to check for protection and the HBM Props for applying contamination
|
||||
public static boolean contaminate(EntityLivingBase entity, HazardType hazard, ContaminationType cont, float amount) {
|
||||
|
||||
if(hazard == HazardType.RADIATION) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Loading…
x
Reference in New Issue
Block a user