"today i will get shit done" and other jokes you can tell yourself

This commit is contained in:
Bob 2023-09-17 20:11:53 +02:00
parent 24ef4cb0ca
commit 8ce3e9837b
64 changed files with 2429 additions and 78 deletions

View File

@ -819,6 +819,9 @@ public class ModBlocks {
public static Block crane_boxer;
public static Block crane_unboxer;
public static Block crane_splitter;
public static Block drone_waypoint;
public static Block drone_crate;
public static Block fan;
@ -1990,6 +1993,9 @@ public class ModBlocks {
fan = new MachineFan().setBlockName("fan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
piston_inserter = new PistonInserter().setBlockName("piston_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
drone_waypoint = new DroneWaypoint().setBlockName("drone_waypoint").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_waypoint");
drone_crate = new DroneCrate().setBlockName("drone_crate").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain");
ladder_sturdy = new BlockNTMLadder().setBlockName("ladder_sturdy").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_sturdy");
@ -3249,6 +3255,8 @@ public class ModBlocks {
register(conveyor_chute);
register(conveyor_lift);
register(crane_splitter);
register(drone_waypoint);
register(drone_crate);
register(fan);
register(piston_inserter);

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.render.block.ct.CT;
@ -53,6 +54,6 @@ public class BlockHadronCoil extends Block implements IBlockCT, ITooltipProvider
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add(I18nUtil.resolveKey("info.coil") + ": " + String.format("%,d", factor));
list.add(I18nUtil.resolveKey("info.coil") + ": " + String.format(Locale.US, "%,d", factor));
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import com.hbm.blocks.IBlockMulti;
@ -265,7 +266,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
if(full) {
title = storage.type.getDisplayName();
text.add(String.format("%,d", storage.getStockpile()) + " / " + String.format("%,d", storage.getCapacity()));
text.add(String.format(Locale.US, "%,d", storage.getStockpile()) + " / " + String.format(Locale.US, "%,d", storage.getCapacity()));
double percent = (double) storage.getStockpile() / (double) storage.getCapacity();
int charge = (int) Math.floor(percent * 10_000D);
@ -286,7 +287,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
if(type != null) {
list.add(EnumChatFormatting.GOLD + type.getDisplayName());
list.add(String.format("%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format("%,d", getCapacity(stack.getItemDamage())));
list.add(String.format(Locale.US, "%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format(Locale.US, "%,d", getCapacity(stack.getItemDamage())));
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import api.hbm.block.IToolable;
import com.hbm.blocks.BlockDummyable;
@ -75,7 +76,7 @@ public class HeaterElectric extends BlockDummyable implements ILookOverlay, IToo
TileEntityHeaterElectric heater = (TileEntityHeaterElectric) te;
List<String> text = new ArrayList();
text.add(String.format("%,d", heater.heatEnergy) + " TU");
text.add(String.format(Locale.US, "%,d", heater.heatEnergy) + " TU");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + heater.getConsumption() + " HE/t");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + heater.getHeatGen() + " TU/t");

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
@ -63,7 +64,7 @@ public class HeaterHeatex extends BlockDummyable implements ILookOverlay, IToolt
TileEntityHeaterHeatex heater = (TileEntityHeaterHeatex) te;
List<String> text = new ArrayList();
text.add(String.format("%,d", heater.heatEnergy) + " TU");
text.add(String.format(Locale.US, "%,d", heater.heatEnergy) + " TU");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
@ -97,7 +98,7 @@ public class HeaterOilburner extends BlockDummyable implements ILookOverlay, ITo
FluidType type = heater.tank.getTankType();
if(type.hasTrait(FT_Flammable.class)) {
int heat = (int)(type.getTrait(FT_Flammable.class).getHeatEnergy() * heater.setting / 1000);
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + String.format("%,d", heat) + " TU/t");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", heat) + " TU/t");
}
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);

View File

@ -175,9 +175,9 @@ public class MachineHeatBoiler extends BlockDummyable implements ILookOverlay, I
if(boiler.hasExploded) return;
List<String> text = new ArrayList();
text.add(String.format("%,d", boiler.heat) + "TU");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[0].getFill()) + " / " + String.format("%,d", boiler.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[1].getFill()) + " / " + String.format("%,d", boiler.tanks[1].getMaxFill()) + "mB");
text.add(String.format(Locale.US, "%,d", boiler.heat) + "TU");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", boiler.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", boiler.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[1].getMaxFill()) + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -112,9 +112,9 @@ public class MachineHeatBoilerIndustrial extends BlockDummyable implements ILook
TileEntityHeatBoilerIndustrial boiler = (TileEntityHeatBoilerIndustrial) te;
List<String> text = new ArrayList();
text.add(String.format("%,d", boiler.heat) + "TU");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[0].getFill()) + " / " + String.format("%,d", boiler.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[1].getFill()) + " / " + String.format("%,d", boiler.tanks[1].getMaxFill()) + "mB");
text.add(String.format(Locale.US, "%,d", boiler.heat) + "TU");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", boiler.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", boiler.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[1].getMaxFill()) + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -107,7 +107,7 @@ public class MachineHephaestus extends BlockDummyable implements ILookOverlay {
TileEntityMachineHephaestus heatex = (TileEntityMachineHephaestus) te;
List<String> text = new ArrayList();
text.add(String.format("%,d", heatex.bufferedHeat) + " TU");
text.add(String.format(Locale.US, "%,d", heatex.bufferedHeat) + " TU");
for(int i = 0; i < heatex.getAllTanks().length; i++) {
FluidTank tank = heatex.getAllTanks()[i];

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
@ -83,15 +84,15 @@ public class MachinePump extends BlockDummyable implements ITooltipProvider, ILo
if(te instanceof TileEntityMachinePumpSteam) {
TileEntityMachinePumpSteam pump = (TileEntityMachinePumpSteam) te;
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.steam.getTankType().getUnlocalizedName()) + ": " + String.format("%,d", pump.steam.getFill()) + " / " + String.format("%,d", pump.steam.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.lps.getTankType().getUnlocalizedName()) + ": " + String.format("%,d", pump.lps.getFill()) + " / " + String.format("%,d", pump.lps.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.water.getTankType().getUnlocalizedName()) + ": " + String.format("%,d", pump.water.getFill()) + " / " + String.format("%,d", pump.water.getMaxFill()) + "mB");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.steam.getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", pump.steam.getFill()) + " / " + String.format(Locale.US, "%,d", pump.steam.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.lps.getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", pump.lps.getFill()) + " / " + String.format(Locale.US, "%,d", pump.lps.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.water.getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", pump.water.getFill()) + " / " + String.format(Locale.US, "%,d", pump.water.getMaxFill()) + "mB");
}
if(te instanceof TileEntityMachinePumpElectric) {
TileEntityMachinePumpElectric pump = (TileEntityMachinePumpElectric) te;
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + String.format("%,d", pump.power) + " / " + String.format("%,d", pump.maxPower) + "HE");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.water.getTankType().getUnlocalizedName()) + ": " + String.format("%,d", pump.water.getFill()) + " / " + String.format("%,d", pump.water.getMaxFill()) + "mB");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", pump.power) + " / " + String.format(Locale.US, "%,d", pump.maxPower) + "HE");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(pump.water.getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", pump.water.getFill()) + " / " + String.format(Locale.US, "%,d", pump.water.getMaxFill()) + "mB");
}
if(pos[1] > 70) {

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
@ -72,8 +73,8 @@ public class MachineSteamEngine extends BlockDummyable implements ILookOverlay,
TileEntitySteamEngine engine = (TileEntitySteamEngine) te;
List<String> text = new ArrayList();
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", engine.tanks[0].getFill()) + " / " + String.format("%,d", engine.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", engine.tanks[1].getFill()) + " / " + String.format("%,d", engine.tanks[1].getMaxFill()) + "mB");
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", engine.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", engine.tanks[0].getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", engine.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", engine.tanks[1].getMaxFill()) + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.ILookOverlay;
import com.hbm.lib.RefStrings;
@ -61,7 +62,7 @@ public class MachineTeleporter extends BlockContainer implements ILookOverlay {
if(tele.targetY == -1) {
text.add(EnumChatFormatting.RED + "No destination set!");
} else {
text.add((tele.power >= tele.consumption ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + String.format("%,d", tele.power) + " / " + String.format("%,d", tele.maxPower));
text.add((tele.power >= tele.consumption ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + String.format(Locale.US, "%,d", tele.power) + " / " + String.format(Locale.US, "%,d", tele.maxPower));
text.add("Destination: " + tele.targetX + " / " + tele.targetY + " / " + tele.targetZ + " (D: " + tele.targetDim + ")");
}

View File

@ -0,0 +1,41 @@
package com.hbm.blocks.network;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class DroneCrate extends BlockContainer {
@SideOnly(Side.CLIENT) private IIcon iconTop;
@SideOnly(Side.CLIENT) private IIcon iconBottom;
public DroneCrate() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
this.blockIcon = reg.registerIcon(RefStrings.MODID + ":drone_crate_side");
this.iconTop = reg.registerIcon(RefStrings.MODID + ":drone_crate_top");
this.iconBottom = reg.registerIcon(RefStrings.MODID + ":drone_crate_bottom");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
}
}

View File

@ -0,0 +1,141 @@
package com.hbm.blocks.network;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.items.ModItems;
import com.hbm.tileentity.network.TileEntityDroneWaypoint;
import com.hbm.util.I18nUtil;
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.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class DroneWaypoint extends BlockContainer implements ILookOverlay, ITooltipProvider {
public DroneWaypoint() {
super(Material.circuits);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityDroneWaypoint();
}
@Override
public int getRenderType() {
return RadioTorchBase.renderID;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
return true;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@Override
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 vec0, Vec3 vec1) {
int meta = world.getBlockMetadata(x, y, z) & 7;
ForgeDirection dir = ForgeDirection.getOrientation(meta);
this.setBlockBounds(
dir.offsetX == 1 ? 0F : 0.375F,
dir.offsetY == 1 ? 0F : 0.375F,
dir.offsetZ == 1 ? 0F : 0.375F,
dir.offsetX == -1 ? 1F : 0.625F,
dir.offsetY == -1 ? 1F : 0.625F,
dir.offsetZ == -1 ? 1F : 0.625F
);
return super.collisionRayTrace(world, x, y, z, vec0, vec1);
}
@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
return side;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
int meta = world.getBlockMetadata(x, y, z);
ForgeDirection dir = ForgeDirection.getOrientation(meta);
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
if(!b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) && (!b.renderAsNormalBlock() || b.isAir(world, x, y, z))) {
this.dropBlockAsItem(world, x, y, z, meta, 0);
world.setBlockToAir(x, y, z);
}
}
@Override
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side) {
if(!super.canPlaceBlockOnSide(world, x, y, z, side)) return false;
ForgeDirection dir = ForgeDirection.getOrientation(side);
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
return b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) || (b.renderAsNormalBlock() && !b.isAir(world, x, y, z));
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.drone_linker) return false;
if(world.isRemote) return true;
TileEntityDroneWaypoint tile = (TileEntityDroneWaypoint) world.getTileEntity(x, y, z);
tile.addHeight(player.isSneaking() ? - 1 : 1);
return true;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
addStandardInfo(stack, player, list, ext);
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
TileEntityDroneWaypoint tile = (TileEntityDroneWaypoint) world.getTileEntity(x, y, z);
List<String> text = new ArrayList();
text.add("Waypoint distance: " + tile.height);
if(tile.nextY != -1) {
text.add("Next waypoint: " + tile.nextX + " / " + tile.nextY + " / " + tile.nextZ);
}
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.network;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.IBlockMultiPass;
import com.hbm.blocks.ILookOverlay;
@ -96,8 +97,8 @@ public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, IL
List<String> text = new ArrayList();
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
text.add(String.format("%,d", duct.deltaTick) + " mB/t");
text.add(String.format("%,d", duct.deltaLastSecond) + " mB/s");
text.add(String.format(Locale.US, "%,d", duct.deltaTick) + " mB/t");
text.add(String.format(Locale.US, "%,d", duct.deltaLastSecond) + " mB/s");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -13,6 +13,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
public class CommandSatellites extends CommandBase {
@ -23,7 +24,7 @@ public class CommandSatellites extends CommandBase {
@Override
public String getCommandUsage(ICommandSender iCommandSender) {
return String.format(
return String.format(Locale.US,
"%s/%s orbit %s- Launch the held satellite\n" +
"%s/%s descend <frequency> %s- Deletes satellite by frequency.",
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE,

View File

@ -1,5 +1,7 @@
package com.hbm.config;
import java.util.Locale;
import com.hbm.main.MainRegistry;
import net.minecraftforge.common.config.Configuration;
@ -31,7 +33,7 @@ public class CommonConfig {
if(value < 0) {
MainRegistry.logger.error("Fatal error config: Randomizer value has been below zero, despite bound having to be positive integer!");
MainRegistry.logger.error(String.format("Errored value will default back to %d, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", def));
MainRegistry.logger.error(String.format(Locale.US, "Errored value will default back to %d, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", def));
return def;
}
@ -42,7 +44,7 @@ public class CommonConfig {
if(value <= 0) {
MainRegistry.logger.error("Fatal error config: Randomizer value has been set to zero, despite bound having to be positive integer!");
MainRegistry.logger.error(String.format("Errored value will default back to %d, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", def));
MainRegistry.logger.error(String.format(Locale.US, "Errored value will default back to %d, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", def));
return def;
}

View File

@ -1,5 +1,7 @@
package com.hbm.config;
import java.util.Locale;
import com.hbm.main.MainRegistry;
import net.minecraftforge.common.config.Configuration;
@ -28,7 +30,7 @@ public class StructureConfig {
if(structureMinChunks > structureMaxChunks) {
MainRegistry.logger.error("Fatal error config: Minimum value has been set higher than the maximum value!");
MainRegistry.logger.error(String.format("Errored values will default back to %1$d and %2$d respectively, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", 8, 24));
MainRegistry.logger.error(String.format(Locale.US, "Errored values will default back to %1$d and %2$d respectively, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", 8, 24));
structureMinChunks = 8;
structureMaxChunks = 24;
}

View File

@ -174,6 +174,7 @@ public class EntityMappings {
addEntity(EntitySoyuzCapsule.class, "entity_soyuz_capsule", 1000);
addEntity(EntityMovingItem.class, "entity_c_item", 1000);
addEntity(EntityMovingPackage.class, "entity_c_package", 1000);
addEntity(EntityDeliveryDrone.class, "entity_delivery_drone", 250, false);
addEntity(EntityCloudTom.class, "entity_moonstone_blast", 1000);
addEntity(EntityBeamVortex.class, "entity_vortex_beam", 1000);
addEntity(EntityFireworks.class, "entity_firework_ball", 1000);

View File

@ -0,0 +1,138 @@
package com.hbm.entity.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntityDeliveryDrone extends Entity {
protected int turnProgress;
protected double syncPosX;
protected double syncPosY;
protected double syncPosZ;
@SideOnly(Side.CLIENT) protected double velocityX;
@SideOnly(Side.CLIENT) protected double velocityY;
@SideOnly(Side.CLIENT) protected double velocityZ;
public double targetX = -1;
public double targetY = -1;
public double targetZ = -1;
public EntityDeliveryDrone(World world) {
super(world);
this.setSize(1.5F, 2.0F);
}
public void setTarget(double x, double y, double z) {
this.targetX = x;
this.targetY = y;
this.targetZ = z;
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@Override
public boolean canAttackWithItem() {
return true;
}
@Override
public boolean hitByEntity(Entity attacker) {
if(attacker instanceof EntityPlayer) {
this.setDead();
}
return false;
}
@Override
protected boolean canTriggerWalking() {
return true;
}
@Override
protected void entityInit() {
this.dataWatcher.addObject(10, new Integer(0));
}
@Override
public void onUpdate() {
if(worldObj.isRemote) {
if(this.turnProgress > 0) {
double interpX = this.posX + (this.syncPosX - this.posX) / (double) this.turnProgress;
double interpY = this.posY + (this.syncPosY - this.posY) / (double) this.turnProgress;
double interpZ = this.posZ + (this.syncPosZ - this.posZ) / (double) this.turnProgress;
--this.turnProgress;
this.setPosition(interpX, interpY, interpZ);
} else {
this.setPosition(this.posX, this.posY, this.posZ);
}
worldObj.spawnParticle("smoke", posX + 1.125, posY + 0.75, posZ, 0, -0.2, 0);
worldObj.spawnParticle("smoke", posX - 1.125, posY + 0.75, posZ, 0, -0.2, 0);
worldObj.spawnParticle("smoke", posX, posY + 0.75, posZ + 1.125, 0, -0.2, 0);
worldObj.spawnParticle("smoke", posX, posY + 0.75, posZ - 1.125, 0, -0.2, 0);
} else {
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
if(this.targetY != -1) {
Vec3 dist = Vec3.createVectorHelper(targetX - posX, targetY - posY, targetZ - posZ);
double speed = getSpeed();
if(dist.lengthVector() >= speed) {
dist = dist.normalize();
this.motionX = dist.xCoord * speed;
this.motionY = dist.yCoord * speed;
this.motionZ = dist.zCoord * speed;
}
}
this.moveEntity(motionX, motionY, motionZ);
}
}
public double getSpeed() {
return 0.125D;
}
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
}
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
}
@SideOnly(Side.CLIENT)
public void setVelocity(double motionX, double motionY, double motionZ) {
this.velocityX = this.motionX = motionX;
this.velocityY = this.motionY = motionY;
this.velocityZ = this.motionZ = motionZ;
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int theNumberThree) {
this.syncPosX = x;
this.syncPosY = y;
this.syncPosZ = z;
this.turnProgress = theNumberThree;
this.motionX = this.velocityX;
this.motionY = this.velocityY;
this.motionZ = this.velocityZ;
}
}

View File

@ -6,6 +6,7 @@ import java.awt.Rectangle;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import com.hbm.inventory.gui.GUIHadron;
import com.hbm.inventory.recipes.HadronRecipes;
@ -141,7 +142,7 @@ public class HadronRecipeHandler extends TemplateRecipeHandler {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String mom = String.format("%,d", rec.momentum);
String mom = String.format(Locale.US, "%,d", rec.momentum);
fontRenderer.drawString(mom, -fontRenderer.getStringWidth(mom) / 2 + 30, 42, 0x404040);
}

View File

@ -3,6 +3,7 @@ package com.hbm.interfaces;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.apache.logging.log4j.Level;
@ -198,7 +199,7 @@ public interface ICustomWarhead
{
for (Enum<?> f : combinedFuels)
if (data.getFloat(f.toString()) > 0)
tooltip.add(String.format("%s: %skg (%s)", I18nUtil.resolveKey("warheadFuel.".concat(f.toString())), df.format(data.getFloat(f.toString())), BobMathUtil.toPercentage(data.getFloat(f.toString()), data.getFloat(NBT_MASS))));
tooltip.add(String.format(Locale.US, "%s: %skg (%s)", I18nUtil.resolveKey("warheadFuel.".concat(f.toString())), df.format(data.getFloat(f.toString())), BobMathUtil.toPercentage(data.getFloat(f.toString()), data.getFloat(NBT_MASS))));
}
public default void addTooltip(ItemStack stack, List<String> tooltip)

View File

@ -3,6 +3,7 @@ package com.hbm.inventory.fluid.trait;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
@ -100,7 +101,7 @@ public class FT_Toxin extends FluidTrait {
@Override
public void addInfo(List<String> info) {
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" : "") + ": " + EnumChatFormatting.YELLOW + String.format("%,.1f", amount * 20 / delay) + " DPS");
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" : "") + ": " + EnumChatFormatting.YELLOW + String.format(Locale.US, "%,.1f", amount * 20 / delay) + " DPS");
}
}

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerCombustionEngine;
@ -59,7 +61,7 @@ public class GUICombustionEngine extends GuiInfoContainer {
power = setting * 0.2 * trait.getCombustionEnergy() / 1_000D * piston.eff[trait.getGrade().ordinal()];
}
String c = EnumChatFormatting.YELLOW + "";
drawCustomInfoStat(x, y, guiLeft + 79, guiTop + 50, 35, 14, x, y, c + String.format("%,d", (int)(power)) + " HE/t", c + String.format("%,d", (int)(power * 20)) + " HE/s");
drawCustomInfoStat(x, y, guiLeft + 79, guiTop + 50, 35, 14, x, y, c + String.format(Locale.US, "%,d", (int)(power)) + " HE/t", c + String.format(Locale.US, "%,d", (int)(power * 20)) + " HE/s");
}
drawCustomInfoStat(x, y, guiLeft + 79, guiTop + 13, 35, 15, x, y, "Ignition");

View File

@ -3,6 +3,7 @@ package com.hbm.inventory.gui;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -42,8 +43,8 @@ public class GUICrucible extends GuiInfoContainer {
drawStackInfo(crucible.wasteStack, x, y, 16, 17);
drawStackInfo(crucible.recipeStack, x, y, 61, 17);
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 81, 34, 7, x, y, new String[] { String.format("%,d", crucible.progress) + " / " + String.format("%,d", crucible.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 90, 34, 7, x, y, new String[] { String.format("%,d", crucible.heat) + " / " + String.format("%,d", crucible.maxHeat) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 81, 34, 7, x, y, new String[] { String.format(Locale.US, "%,d", crucible.progress) + " / " + String.format(Locale.US, "%,d", crucible.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 90, 34, 7, x, y, new String[] { String.format(Locale.US, "%,d", crucible.heat) + " / " + String.format(Locale.US, "%,d", crucible.maxHeat) + "TU" });
}
@Override

View File

@ -1,6 +1,7 @@
package com.hbm.inventory.gui;
import java.util.List;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
@ -48,7 +49,7 @@ public class GUIFirebox extends GuiInfoContainer {
}
}
this.drawCustomInfoStat(x, y, guiLeft + 80, guiTop + 27, 71, 7, x, y, new String[] { String.format("%,d", firebox.heatEnergy) + " / " + String.format("%,d", firebox.getMaxHeat()) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 80, guiTop + 27, 71, 7, x, y, new String[] { String.format(Locale.US, "%,d", firebox.heatEnergy) + " / " + String.format(Locale.US, "%,d", firebox.getMaxHeat()) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 80, guiTop + 36, 71, 7, x, y, new String[] { firebox.burnHeat + "TU/t", (firebox.burnTime / 20) + "s" });
}

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerFurnaceCombo;
@ -30,8 +32,8 @@ public class GUIFurnaceCombo extends GuiInfoContainer {
furnace.tank.renderTankInfo(this, x, y, guiLeft + 118, guiTop + 18, 16, 52);
this.drawCustomInfoStat(x, y, guiLeft + 44, guiTop + 36, 39, 7, x, y, new String[] { String.format("%,d", furnace.progress) + " / " + String.format("%,d", furnace.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 44, guiTop + 45, 39, 7, x, y, new String[] { String.format("%,d", furnace.heat) + " / " + String.format("%,d", furnace.maxHeat) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 44, guiTop + 36, 39, 7, x, y, new String[] { String.format(Locale.US, "%,d", furnace.progress) + " / " + String.format(Locale.US, "%,d", furnace.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 44, guiTop + 45, 39, 7, x, y, new String[] { String.format(Locale.US, "%,d", furnace.heat) + " / " + String.format(Locale.US, "%,d", furnace.maxHeat) + "TU" });
}
@Override

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerFurnaceSteel;
@ -29,11 +31,11 @@ public class GUIFurnaceSteel extends GuiInfoContainer {
super.drawScreen(x, y, interp);
for(int i = 0; i < 3; i++) {
this.drawCustomInfoStat(x, y, guiLeft + 53, guiTop + 17 + 18 * i, 70, 7, x, y, new String[] { String.format("%,d", furnace.progress[i]) + " / " + String.format("%,d", furnace.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 53, guiTop + 17 + 18 * i, 70, 7, x, y, new String[] { String.format(Locale.US, "%,d", furnace.progress[i]) + " / " + String.format(Locale.US, "%,d", furnace.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 53, guiTop + 26 + 18 * i, 70, 7, x, y, new String[] { "Bonus: " + furnace.bonus[i] + "%" });
}
this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 18, 9, 50, x, y, new String[] { String.format("%,d", furnace.heat) + " / " + String.format("%,d", furnace.maxHeat) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 18, 9, 50, x, y, new String[] { String.format(Locale.US, "%,d", furnace.heat) + " / " + String.format(Locale.US, "%,d", furnace.maxHeat) + "TU" });
}
@Override

View File

@ -54,7 +54,7 @@ public class GUIHadron extends GuiInfoContainer {
stats.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("hadron.stats"));
stats.add((hadron.stat_success ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + I18n.format("hadron." + this.hadron.stat_state.name().toLowerCase(Locale.US)));
if(this.hadron.state.showCoord) stats.add(EnumChatFormatting.RED + I18nUtil.resolveKey("hadron.stats_coord", hadron.stat_x, hadron.stat_y, hadron.stat_z));
stats.add(EnumChatFormatting.GRAY + I18nUtil.resolveKey("hadron.stats_momentum", String.format("%,d", hadron.stat_charge)));
stats.add(EnumChatFormatting.GRAY + I18nUtil.resolveKey("hadron.stats_momentum", String.format(Locale.US, "%,d", hadron.stat_charge)));
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 41, guiTop + 92, 25, 11, mouseX, mouseY, stats.toArray(new String[0]));
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 4, guiTop + 36, 16, 16, guiLeft + 4, guiTop + 36 + 16, new String[] {"Initial particle momentum: 750"});

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineCoker;
@ -31,8 +33,8 @@ public class GUIMachineCoker extends GuiInfoContainer {
refinery.tanks[0].renderTankInfo(this, x, y, guiLeft + 35, guiTop + 18, 16, 52);
refinery.tanks[1].renderTankInfo(this, x, y, guiLeft + 125, guiTop + 18, 16, 52);
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 45, 54, 7, x, y, new String[] { String.format("%,d", refinery.progress) + " / " + String.format("%,d", refinery.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 54, 54, 7, x, y, new String[] { String.format("%,d", refinery.heat) + " / " + String.format("%,d", refinery.maxHeat) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 45, 54, 7, x, y, new String[] { String.format(Locale.US, "%,d", refinery.progress) + " / " + String.format(Locale.US, "%,d", refinery.processTime) + "TU" });
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 54, 54, 7, x, y, new String[] { String.format(Locale.US, "%,d", refinery.heat) + " / " + String.format(Locale.US, "%,d", refinery.maxHeat) + "TU" });
}
@Override

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -35,7 +37,7 @@ public class GUIMassStorage extends GuiInfoContainer {
String percent = (((int) (storage.getStockpile() * 1000D / (double) storage.getCapacity())) / 10D) + "%";
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 96, guiTop + 16, 18, 90, mouseX, mouseY, new String[]
{ String.format("%,d", storage.getStockpile()) + " / " + String.format("%,d", storage.getCapacity()), percent });
{ String.format(Locale.US, "%,d", storage.getStockpile()) + " / " + String.format(Locale.US, "%,d", storage.getCapacity()), percent });
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 62, guiTop + 72, 14, 14, mouseX, mouseY, new String[] { "Click: Provide one", "Shift-click: Provide stack" });
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 80, guiTop + 72, 14, 14, mouseX, mouseY, new String[] { "Toggle output" });

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerOilburner;
@ -33,10 +35,10 @@ public class GUIOilburner extends GuiInfoContainer {
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
this.drawCustomInfoStat(x, y, guiLeft + 116, guiTop + 17, 16, 52, x, y, new String[] { String.format("%,d", Math.min(diFurnace.heatEnergy, diFurnace.maxHeatEnergy)) + " / " + String.format("%,d", diFurnace.maxHeatEnergy) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 116, guiTop + 17, 16, 52, x, y, new String[] { String.format(Locale.US, "%,d", Math.min(diFurnace.heatEnergy, diFurnace.maxHeatEnergy)) + " / " + String.format(Locale.US, "%,d", diFurnace.maxHeatEnergy) + " TU" });
if(diFurnace.tank.getTankType().hasTrait(FT_Flammable.class)) {
this.drawCustomInfoStat(x, y, guiLeft + 79, guiTop + 34, 18, 18, x, y, new String[] { diFurnace.setting + " mB/t", String.format("%,d", (int)(diFurnace.tank.getTankType().getTrait(FT_Flammable.class).getHeatEnergy() / 1000) * diFurnace.setting) + " TU/t" });
this.drawCustomInfoStat(x, y, guiLeft + 79, guiTop + 34, 18, 18, x, y, new String[] { diFurnace.setting + " mB/t", String.format(Locale.US, "%,d", (int)(diFurnace.tank.getTankType().getTrait(FT_Flammable.class).getHeatEnergy() / 1000) * diFurnace.setting) + " TU/t" });
}
diFurnace.tank.renderTankInfo(this, x, y, guiLeft + 44, guiTop + 17, 16, 52);

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.apache.commons.lang3.math.NumberUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -59,8 +61,8 @@ public class GUIPWR extends GuiInfoContainer {
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
this.drawCustomInfoStat(x, y, guiLeft + 115, guiTop + 31, 18, 18, x, y, new String[] { "Core: " + String.format("%,d", controller.coreHeat) + " / " + String.format("%,d", controller.coreHeatCapacity) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 31, 18, 18, x, y, new String[] { "Hull: " + String.format("%,d", controller.hullHeat) + " / " + String.format("%,d", controller.hullHeatCapacity) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 115, guiTop + 31, 18, 18, x, y, new String[] { "Core: " + String.format(Locale.US, "%,d", controller.coreHeat) + " / " + String.format(Locale.US, "%,d", controller.coreHeatCapacity) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 31, 18, 18, x, y, new String[] { "Hull: " + String.format(Locale.US, "%,d", controller.hullHeat) + " / " + String.format(Locale.US, "%,d", controller.hullHeatCapacity) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 52, guiTop + 31, 36, 18, x, y, new String[] { ((int) (controller.progress * 100 / controller.processTime)) + "%" });
this.drawCustomInfoStat(x, y, guiLeft + 52, guiTop + 53, 54, 4, x, y, "Control rod level: " + (100 - controller.rodLevel) + "%");
@ -96,7 +98,7 @@ public class GUIPWR extends GuiInfoContainer {
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
double scale = 1.25;
String flux = String.format("%,.1f", controller.flux);
String flux = String.format(Locale.US, "%,.1f", controller.flux);
GL11.glScaled(1 / scale, 1 / scale, 1);
this.fontRendererObj.drawString(flux, (int) (165 * scale - this.fontRendererObj.getStringWidth(flux)), (int)(64 * scale), 0x00ff00);
GL11.glScaled(scale, scale, 1);

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Locale;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerWatz;
@ -35,7 +37,7 @@ public class GUIWatz extends GuiInfoContainer {
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
this.drawCustomInfoStat(x, y, guiLeft + 13, guiTop + 100, 18, 18, x, y, new String[] { String.format("%,d", watz.heat) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 13, guiTop + 100, 18, 18, x, y, new String[] { String.format(Locale.US, "%,d", watz.heat) + " TU" });
this.drawCustomInfoStat(x, y, guiLeft + 143, guiTop + 71, 16, 16, x, y, new String[] { watz.isLocked ? "Unlock pellet IO configuration" : "Lock pellet IO configuration" });
watz.tanks[0].renderTankInfo(this, x, y, guiLeft + 142, guiTop + 23, 6, 45);
@ -48,7 +50,7 @@ public class GUIWatz extends GuiInfoContainer {
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 93, 4210752);
double scale = 1.25;
String flux = String.format("%,.1f", watz.fluxDisplay);
String flux = String.format(Locale.US, "%,.1f", watz.fluxDisplay);
GL11.glScaled(1 / scale, 1 / scale, 1);
this.fontRendererObj.drawString(flux, (int) (161 * scale - this.fontRendererObj.getStringWidth(flux)), (int)(107 * scale), 0x00ff00);
GL11.glScaled(scale, scale, 1);

View File

@ -1254,6 +1254,7 @@ public class ModItems {
public static Item power_net_tool;
public static Item analysis_tool;
public static Item coupling_tool;
public static Item drone_linker;
public static Item template_folder;
public static Item journal_pip;
@ -4581,6 +4582,7 @@ public class ModItems {
power_net_tool = new ItemPowerNetTool().setUnlocalizedName("power_net_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":power_net_tool");
analysis_tool = new ItemAnalysisTool().setUnlocalizedName("analysis_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":analysis_tool");
coupling_tool = new ItemCouplingTool().setUnlocalizedName("coupling_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coupling_tool");
drone_linker = new ItemDroneLinker().setUnlocalizedName("drone_linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":drone_linker");
key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key");
key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red");
@ -6747,6 +6749,7 @@ public class ModItems {
GameRegistry.registerItem(survey_scanner, survey_scanner.getUnlocalizedName());
GameRegistry.registerItem(mirror_tool, mirror_tool.getUnlocalizedName());
GameRegistry.registerItem(rbmk_tool, rbmk_tool.getUnlocalizedName());
GameRegistry.registerItem(drone_linker, drone_linker.getUnlocalizedName());
GameRegistry.registerItem(coltan_tool, coltan_tool.getUnlocalizedName());
GameRegistry.registerItem(power_net_tool, power_net_tool.getUnlocalizedName());
GameRegistry.registerItem(analysis_tool, analysis_tool.getUnlocalizedName());

View File

@ -1,6 +1,7 @@
package com.hbm.items.machine;
import java.util.List;
import java.util.Locale;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
@ -295,10 +296,10 @@ public class ItemRBMKRod extends Item {
String reactivity = EnumChatFormatting.YELLOW + "" + ((int)(this.reactivity * enrichment * 1000D) / 1000D) + EnumChatFormatting.WHITE;
String enrichmentPer = EnumChatFormatting.GOLD + " (" + ((int)(enrichment * 1000D) / 10D) + "%)";
return String.format(function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity).concat(enrichmentPer);
return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity).concat(enrichmentPer);
}
return String.format(function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity);
return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity);
}
public static enum EnumDepleteFunc {

View File

@ -3,6 +3,7 @@ package com.hbm.items.machine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import javax.annotation.CheckForNull;
@ -156,17 +157,17 @@ public class ItemRTGPellet extends Item {
list.add(BobMathUtil.toPercentage(instance.getLifespan(stack), instance.getMaxLifespan()));
if (bool) {
list.add("EXTENDED INFO:");
list.add(String.format("%s / %s ticks", instance.getLifespan(stack), instance.getMaxLifespan()));
list.add(String.format(Locale.US, "%s / %s ticks", instance.getLifespan(stack), instance.getMaxLifespan()));
final String[] timeLeft = BobMathUtil.ticksToDate(instance.getLifespan(stack));
final String[] maxLife = BobMathUtil.ticksToDate(instance.getMaxLifespan());
list.add(String.format("Time remaining: %s y, %s d, %s h", (Object[]) timeLeft));
list.add(String.format("Maximum life: %s y, %s d, %s h", (Object[]) maxLife));
list.add(String.format(Locale.US, "Time remaining: %s y, %s d, %s h", (Object[]) timeLeft));
list.add(String.format(Locale.US, "Maximum life: %s y, %s d, %s h", (Object[]) maxLife));
}
}
}
public String getData() {
return String.format("%s (%s HE/t) %s", I18nUtil.resolveKey(getUnlocalizedName().concat(".name")), getHeat(), (getDoesDecay() ? " (decays)" : ""));
return String.format(Locale.US, "%s (%s HE/t) %s", I18nUtil.resolveKey(getUnlocalizedName().concat(".name")), getHeat(), (getDoesDecay() ? " (decays)" : ""));
}
public static HashMap<ItemStack, ItemStack> getRecipeMap() {

View File

@ -1,6 +1,7 @@
package com.hbm.items.tool;
import java.util.List;
import java.util.Locale;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
@ -199,7 +200,7 @@ public class ItemBlowtorch extends Item implements IFillableItem {
@SideOnly(Side.CLIENT)
private String getFillGauge(ItemStack stack, FluidType type) {
return I18nUtil.resolveKey(type.getUnlocalizedName()) + ": " + String.format("%,d", this.getFill(stack, type)) + " / " + String.format("%,d", this.getMaxFill(type));
return I18nUtil.resolveKey(type.getUnlocalizedName()) + ": " + String.format(Locale.US, "%,d", this.getFill(stack, type)) + " / " + String.format(Locale.US, "%,d", this.getMaxFill(type));
}
@Override public boolean providesFluid(FluidType type, ItemStack stack) { return false; }

View File

@ -0,0 +1,101 @@
package com.hbm.items.tool;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.network.IDroneLinkable;
import com.hbm.util.ChatBuilder;
import com.hbm.util.fauxpointtwelve.BlockPos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class ItemDroneLinker extends Item {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof IDroneLinkable) {
if(!world.isRemote) {
if(!stack.hasTagCompound()) {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setInteger("x", x);
stack.stackTagCompound.setInteger("y", y);
stack.stackTagCompound.setInteger("z", z);
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
.next("] ").color(EnumChatFormatting.DARK_AQUA)
.next("Set initial position!").color(EnumChatFormatting.AQUA).flush());
} else {
int tx = stack.stackTagCompound.getInteger("x");
int ty = stack.stackTagCompound.getInteger("y");
int tz = stack.stackTagCompound.getInteger("z");
TileEntity prev = world.getTileEntity(tx, ty, tz);
if(prev instanceof IDroneLinkable) {
BlockPos dest = ((IDroneLinkable) tile).getPoint();
((IDroneLinkable) prev).setNextTarget(dest.getX(), dest.getY(), dest.getZ());
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
.next("] ").color(EnumChatFormatting.DARK_AQUA)
.next("Link set!").color(EnumChatFormatting.AQUA).flush());
} else {
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
.next("] ").color(EnumChatFormatting.DARK_AQUA)
.next("Previous link lost!").color(EnumChatFormatting.RED).flush());
}
stack.stackTagCompound.setInteger("x", x);
stack.stackTagCompound.setInteger("y", y);
stack.stackTagCompound.setInteger("z", z);
}
}
return true;
}
return false;
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean inhand) {
if(world.isRemote && inhand) {
if(stack.hasTagCompound()) {
int x = stack.stackTagCompound.getInteger("x");
int y = stack.stackTagCompound.getInteger("y");
int z = stack.stackTagCompound.getInteger("z");
MainRegistry.proxy.displayTooltip("Prev pos: " + x + " / " + y + " / " + z, MainRegistry.proxy.ID_DRONE);
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(!world.isRemote && stack.hasTagCompound()) {
stack.stackTagCompound = null;
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
.next("] ").color(EnumChatFormatting.DARK_AQUA)
.next("Position cleared!").color(EnumChatFormatting.GREEN).flush());
}
return stack;
}
}

View File

@ -24,7 +24,7 @@ import net.minecraft.world.World;
public class ItemMirrorTool extends Item {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
Block b = world.getBlock(x, y, z);

View File

@ -713,6 +713,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityMovingItem.class, new RenderMovingItem());
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
RenderingRegistry.registerEntityRenderingHandler(EntityDeliveryDrone.class, new RenderDeliveryDrone());
//mobs
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor.png").setSwellMod(5F));
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperTainted.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png"));

View File

@ -636,8 +636,11 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.fluid_tank_empty, 8), new Object[] { "121", "1G1", "121", '1', AL.plate(), '2', IRON.plate(), 'G', KEY_ANYPANE });
addRecipeAuto(new ItemStack(ModItems.fluid_tank_lead_empty, 4), new Object[] { "LUL", "LTL", "LUL", 'L', PB.plate(), 'U', U238.billet(), 'T', ModItems.fluid_tank_empty });
addRecipeAuto(new ItemStack(ModItems.fluid_barrel_empty, 2), new Object[] { "121", "1G1", "121", '1', STEEL.plate(), '2', AL.plate(), 'G', KEY_ANYPANE });
addRecipeAuto(new ItemStack(ModItems.inf_water, 1), new Object[] { "222", "131", "222", '1', Items.water_bucket, '2', AL.plate(), '3', DIAMOND.gem() });
addRecipeAuto(new ItemStack(ModItems.inf_water_mk2, 1), new Object[] { "BPB", "PTP", "BPB", 'B', ModItems.inf_water, 'P', ModBlocks.fluid_duct_neo, 'T', ModItems.tank_steel });
if(!GeneralConfig.enable528) {
addRecipeAuto(new ItemStack(ModItems.inf_water, 1), new Object[] { "222", "131", "222", '1', Items.water_bucket, '2', AL.plate(), '3', DIAMOND.gem() });
addRecipeAuto(new ItemStack(ModItems.inf_water_mk2, 1), new Object[] { "BPB", "PTP", "BPB", 'B', ModItems.inf_water, 'P', ModBlocks.fluid_duct_neo, 'T', ModItems.tank_steel });
}
//not so Temporary Crappy Recipes
addRecipeAuto(new ItemStack(ModItems.piston_selenium, 1), new Object[] { "SSS", "STS", " D ", 'S', STEEL.plate(), 'T', W.ingot(), 'D', ModItems.bolt_dura_steel });

View File

@ -1090,6 +1090,9 @@ public class ResourceManager {
public static final IModelCustom train_cargo_tram_trailer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/tram_trailer.obj"));
public static final IModelCustom tunnel_bore = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/vehicles/tunnel_bore.obj"));
//Drones
public static final IModelCustom delivery_drone = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/drone.obj"));
////Texture Entities
//Blast
@ -1366,6 +1369,9 @@ public class ResourceManager {
public static final ResourceLocation train_tram = new ResourceLocation(RefStrings.MODID, "textures/models/trains/tram.png");
public static final ResourceLocation tram_trailer = new ResourceLocation(RefStrings.MODID, "textures/models/trains/tram_trailer.png");
//Drone
public static final ResourceLocation delivery_drone_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/drone.png");
//ISBRHs
public static final IModelCustom scaffold = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/scaffold.obj"));
public static final IModelCustom taperecorder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/taperecorder.obj"));

View File

@ -20,13 +20,14 @@ public class ServerProxy {
public static final int ID_FILTER = 1;
public static final int ID_COMPASS = 2;
public static final int ID_CABLE = 3;
public static final int ID_JETPACK = 4;
public static final int ID_HUD = 5;
public static final int ID_DETONATOR = 6;
public static final int ID_FLUID_ID = 7;
public static final int ID_TOOLABILITY = 8;
public static final int ID_GUN_MODE = 9;
public static final int ID_GAS_HAZARD = 10;
public static final int ID_DRONE = 4;
public static final int ID_JETPACK = 5;
public static final int ID_HUD = 6;
public static final int ID_DETONATOR = 7;
public static final int ID_FLUID_ID = 8;
public static final int ID_TOOLABILITY = 9;
public static final int ID_GUN_MODE = 10;
public static final int ID_GAS_HAZARD = 11;
public void registerRenderInfo() { }
public void registerTileEntitySpecialRenderer() { }

View File

@ -0,0 +1,32 @@
package com.hbm.render.item;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderDeliveryDrone extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.delivery_drone_tex);
ResourceManager.delivery_drone.renderPart("Drone");
ResourceManager.delivery_drone.renderPart("Barrel");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity;
import java.util.List;
import java.util.Locale;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
@ -139,11 +140,11 @@ public interface IRadioisotopeFuel
if (showAdv)
{
tooltip.add("EXTENDED INFO:");
tooltip.add(String.format("%s / %s ticks", instance.getLifespan(stack), instance.getMaxLifespan()));
tooltip.add(String.format(Locale.US, "%s / %s ticks", instance.getLifespan(stack), instance.getMaxLifespan()));
final String[] timeLeft = BobMathUtil.ticksToDate(instance.getLifespan(stack));
final String[] maxLife = BobMathUtil.ticksToDate(instance.getMaxLifespan());
tooltip.add(String.format("Time remaining: %s y, %s d, %s h", (Object[]) timeLeft));
tooltip.add(String.format("Maximum life: %s y, %s d, %s h", (Object[]) maxLife));
tooltip.add(String.format(Locale.US, "Time remaining: %s y, %s d, %s h", (Object[]) timeLeft));
tooltip.add(String.format(Locale.US, "Maximum life: %s y, %s d, %s h", (Object[]) maxLife));
}
}
}

View File

@ -391,6 +391,8 @@ public class TileMappings {
put(TileEntityRadioTorchReceiver.class, "tileentity_rtty_rec");
put(TileEntityRadioTorchCounter.class, "tileentity_rtty_counter");
put(TileEntityRadioTelex.class, "tileentity_rtty_telex");
put(TileEntityDroneWaypoint.class, "tileentity_drone_waypoint");
}
private static void put(Class<? extends TileEntity> clazz, String... names) {

View File

@ -0,0 +1,9 @@
package com.hbm.tileentity.network;
import com.hbm.util.fauxpointtwelve.BlockPos;
public interface IDroneLinkable {
public BlockPos getPoint();
public void setNextTarget(int x, int y, int z);
}

View File

@ -0,0 +1,90 @@
package com.hbm.tileentity.network;
import java.util.List;
import com.hbm.entity.item.EntityDeliveryDrone;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.util.fauxpointtwelve.BlockPos;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityDroneWaypoint extends TileEntity implements INBTPacketReceiver, IDroneLinkable {
public int height = 5;
public int nextX = -1;
public int nextY = -1;
public int nextZ = -1;
public void updateEntity() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
if(!worldObj.isRemote) {
if(nextY != -1) {
List<EntityDeliveryDrone> drones = worldObj.getEntitiesWithinAABB(EntityDeliveryDrone.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).offset(dir.offsetX * height, dir.offsetY * height, dir.offsetZ * height));
for(EntityDeliveryDrone drone : drones) {
if(Vec3.createVectorHelper(drone.motionX, drone.motionY, drone.motionZ).lengthVector() < 0.05) {
drone.setTarget(nextX + 0.5, nextY + 0.5, nextZ + 0.5);
}
}
}
NBTTagCompound data = new NBTTagCompound();
data.setInteger("height", height);
data.setIntArray("pos", new int[] {nextX, nextY, nextZ});
INBTPacketReceiver.networkPack(this, data, 15);
} else {
if(nextY != -1 && worldObj.getTotalWorldTime() % 2 == 0) {
double x = xCoord + height * dir.offsetX + 0.5;
double y = yCoord + height * dir.offsetY + 0.5;
double z = zCoord + height * dir.offsetZ + 0.5;
worldObj.spawnParticle("reddust", x, y, z, 0, 0, 0);
/*Vec3 vec = Vec3.createVectorHelper(nextX + 0.5 - x, nextY + 0.5 - y, nextZ + 0.5 - z);
double speed = Math.min(vec.lengthVector(), 0.5);
double mX = vec.xCoord * speed;
double mY = vec.yCoord * speed;
double mZ = vec.zCoord * speed;
vec = vec.normalize();
worldObj.spawnParticle("crit", x, y, z, mX, mY, mZ);*/
}
}
}
@Override
public BlockPos getPoint() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
return new BlockPos(xCoord, yCoord, zCoord).offset(dir, height);
}
@Override
public void setNextTarget(int x, int y, int z) {
this.nextX = x;
this.nextY = y;
this.nextZ = z;
this.markDirty();
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.height = nbt.getInteger("height");
int[] pos = nbt.getIntArray("pos");
this.nextX = pos[0];
this.nextY = pos[1];
this.nextZ = pos[2];
}
public void addHeight(int h) {
height += h;
height = MathHelper.clamp_int(height, 1, 15);
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map.Entry;
import com.hbm.util.Tuple.Pair;
@ -44,11 +45,11 @@ public class TimeAnalyzer {
for(Entry<String, Long> entry : milliTime.entrySet()) {
total += entry.getValue();
String time = String.format("%,d", entry.getValue());
String time = String.format(Locale.US, "%,d", entry.getValue());
System.out.println(entry.getKey() + ": " + time + "ns");
}
System.out.println("Total time passed: " + String.format("%,d", total) + "ns (" + (total / 1_000_000_000) + "s)");
System.out.println("Total time passed: " + String.format(Locale.US, "%,d", total) + "ns (" + (total / 1_000_000_000) + "s)");
currentSection = "";
sectionStartTime = 0;

View File

@ -1,5 +1,7 @@
package com.hbm.util.function;
import java.util.Locale;
import com.hbm.util.BobMathUtil;
import net.minecraft.util.EnumChatFormatting;
@ -28,8 +30,8 @@ public abstract class Function {
public String getXName(boolean brackets) {
String x = "x";
boolean mod = false;
if(div != 1D) x += " / " + String.format("%,.1f", div);
if(off != 0D) x += " + " + String.format("%,.1f", off);
if(div != 1D) x += " / " + String.format(Locale.US, "%,.1f", div);
if(off != 0D) x += " + " + String.format(Locale.US, "%,.1f", off);
if(mod && brackets) x = "(" + x + ")";
return x;
}
@ -47,21 +49,21 @@ public abstract class Function {
public static class FunctionLogarithmic extends FunctionSingleArg {
public FunctionLogarithmic(double level) { super(level); this.withOff(1D); }
@Override public double effonix(double x) { return Math.log10(getX(x)) * level; }
@Override public String getLabelForFuel() { return "log10(" + getXName(false) + ") * " + String.format("%,.1f", this.level); }
@Override public String getLabelForFuel() { return "log10(" + getXName(false) + ") * " + String.format(Locale.US, "%,.1f", this.level); }
@Override public String getDangerFromFuel() { return EnumChatFormatting.YELLOW + "MEDIUM / LOGARITHMIC"; }
}
public static class FunctionPassive extends FunctionSingleArg {
public FunctionPassive(double level) { super(level); }
@Override public double effonix(double x) { return this.level; }
@Override public String getLabelForFuel() { return "" + String.format("%,.1f", this.level); }
@Override public String getLabelForFuel() { return "" + String.format(Locale.US, "%,.1f", this.level); }
@Override public String getDangerFromFuel() { return EnumChatFormatting.DARK_GREEN + "SAFE / PASSIVE"; }
}
public static class FunctionSqrt extends FunctionSingleArg {
public FunctionSqrt(double level) { super(level); }
@Override public double effonix(double x) { return BobMathUtil.squirt(getX(x)) * this.level; }
@Override public String getLabelForFuel() { return "sqrt(" + getXName(false) + ") * " + String.format("%,.3f", this.level); } //not entirely correct but good enough
@Override public String getLabelForFuel() { return "sqrt(" + getXName(false) + ") * " + String.format(Locale.US, "%,.3f", this.level); } //not entirely correct but good enough
@Override public String getDangerFromFuel() { return EnumChatFormatting.YELLOW + "MEDIUM / SQUARE ROOT"; }
}
@ -75,7 +77,7 @@ public abstract class Function {
public static class FunctionLinear extends FunctionSingleArg {
public FunctionLinear(double level) { super(level); }
@Override public double effonix(double x) { return getX(x) * this.level; }
@Override public String getLabelForFuel() { return getXName(true) + " * " + String.format("%,.1f", this.level); }
@Override public String getLabelForFuel() { return getXName(true) + " * " + String.format(Locale.US, "%,.1f", this.level); }
@Override public String getDangerFromFuel() { return EnumChatFormatting.RED + "DANGEROUS / LINEAR"; }
}
@ -83,7 +85,7 @@ public abstract class Function {
public FunctionQuadratic(double level) { super(level, 0D); }
public FunctionQuadratic(double level, double vOff) { super(level, vOff); }
@Override public double effonix(double x) { return getX(x) * getX(x) * this.level + this.vOff; }
@Override public String getLabelForFuel() { return getXName(true) + "² * " + String.format("%,.1f", this.level) + (vOff != 0 ? (" + " + String.format("%,.1f", vOff)) : ""); }
@Override public String getLabelForFuel() { return getXName(true) + "² * " + String.format(Locale.US, "%,.1f", this.level) + (vOff != 0 ? (" + " + String.format(Locale.US, "%,.1f", vOff)) : ""); }
@Override public String getDangerFromFuel() { return EnumChatFormatting.RED + "DANGEROUS / QUADRATIC"; }
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 10
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB