mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2106 from archiecarrot123/master
Reduce calls to System.currentTimeMillis
This commit is contained in:
commit
c1d3aad937
@ -133,7 +133,7 @@ public class ModEventHandlerClient {
|
|||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
|
|
||||||
/// NUKE FLASH ///
|
/// NUKE FLASH ///
|
||||||
if(event.type == ElementType.CROSSHAIRS && (flashTimestamp + flashDuration - System.currentTimeMillis()) > 0 && ClientConfig.NUKE_HUD_FLASH.get()) {
|
if(event.type == ElementType.CROSSHAIRS && (flashTimestamp + flashDuration - Clock.get_ms()) > 0 && ClientConfig.NUKE_HUD_FLASH.get()) {
|
||||||
int width = event.resolution.getScaledWidth();
|
int width = event.resolution.getScaledWidth();
|
||||||
int height = event.resolution.getScaledHeight();
|
int height = event.resolution.getScaledHeight();
|
||||||
Tessellator tess = Tessellator.instance;
|
Tessellator tess = Tessellator.instance;
|
||||||
@ -143,7 +143,7 @@ public class ModEventHandlerClient {
|
|||||||
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.0F);
|
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.0F);
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
tess.startDrawingQuads();
|
tess.startDrawingQuads();
|
||||||
float brightness = (flashTimestamp + flashDuration - System.currentTimeMillis()) / (float) flashDuration;
|
float brightness = (flashTimestamp + flashDuration - Clock.get_ms()) / (float) flashDuration;
|
||||||
tess.setColorRGBA_F(1F, 1F, 1F, brightness * 1F);
|
tess.setColorRGBA_F(1F, 1F, 1F, brightness * 1F);
|
||||||
tess.addVertex(width, 0, 0);
|
tess.addVertex(width, 0, 0);
|
||||||
tess.addVertex(0, 0, 0);
|
tess.addVertex(0, 0, 0);
|
||||||
@ -333,7 +333,7 @@ public class ModEventHandlerClient {
|
|||||||
if(animation.holdLastFrame)
|
if(animation.holdLastFrame)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
long time = System.currentTimeMillis() - animation.startMillis;
|
long time = Clock.get_ms() - animation.startMillis;
|
||||||
|
|
||||||
if(time > animation.animation.getDuration())
|
if(time > animation.animation.getDuration())
|
||||||
HbmAnimations.hotbar[i][j] = null;
|
HbmAnimations.hotbar[i][j] = null;
|
||||||
@ -804,7 +804,7 @@ public class ModEventHandlerClient {
|
|||||||
if(cannery != null) {
|
if(cannery != null) {
|
||||||
list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("cannery.f1"));
|
list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("cannery.f1"));
|
||||||
lastCannery = comp;
|
lastCannery = comp;
|
||||||
canneryTimestamp = System.currentTimeMillis();
|
canneryTimestamp = Clock.get_ms();
|
||||||
}
|
}
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
list.add(EnumChatFormatting.RED + "Error loading cannery: " + ex.getLocalizedMessage());
|
list.add(EnumChatFormatting.RED + "Error loading cannery: " + ex.getLocalizedMessage());
|
||||||
@ -849,7 +849,7 @@ public class ModEventHandlerClient {
|
|||||||
|
|
||||||
int w = resolution.getScaledWidth();
|
int w = resolution.getScaledWidth();
|
||||||
int h = resolution.getScaledHeight();
|
int h = resolution.getScaledHeight();
|
||||||
double off = System.currentTimeMillis() / -10000D % 10000D;
|
double off = Clock.get_ms() / -10000D % 10000D;
|
||||||
double aw = 25;
|
double aw = 25;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
@ -938,7 +938,7 @@ public class ModEventHandlerClient {
|
|||||||
|
|
||||||
if(Keyboard.isKeyDown(Keyboard.KEY_F1) && Minecraft.getMinecraft().currentScreen != null) {
|
if(Keyboard.isKeyDown(Keyboard.KEY_F1) && Minecraft.getMinecraft().currentScreen != null) {
|
||||||
|
|
||||||
ComparableStack comp = canneryTimestamp > System.currentTimeMillis() - 100 ? lastCannery : null;
|
ComparableStack comp = canneryTimestamp > Clock.get_ms() - 100 ? lastCannery : null;
|
||||||
|
|
||||||
if(comp == null) {
|
if(comp == null) {
|
||||||
ItemStack stack = getMouseOverStack();
|
ItemStack stack = getMouseOverStack();
|
||||||
@ -1114,7 +1114,7 @@ public class ModEventHandlerClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
long millis = System.currentTimeMillis();
|
long millis = Clock.get_ms();
|
||||||
|
|
||||||
if(lastStarCheck + 200 < millis) {
|
if(lastStarCheck + 200 < millis) {
|
||||||
renderLodeStar = false; // GENUINELY shut the fuck up i'm not kidding
|
renderLodeStar = false; // GENUINELY shut the fuck up i'm not kidding
|
||||||
@ -1222,6 +1222,8 @@ public class ModEventHandlerClient {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderWorldLastEvent(RenderWorldLastEvent event) {
|
public void onRenderWorldLastEvent(RenderWorldLastEvent event) {
|
||||||
|
|
||||||
|
Clock.update();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
@ -1248,8 +1250,8 @@ public class ModEventHandlerClient {
|
|||||||
GL11.glRotated(80, 0, 0, 1);
|
GL11.glRotated(80, 0, 0, 1);
|
||||||
GL11.glRotated(30, 0, 1, 0);
|
GL11.glRotated(30, 0, 1, 0);
|
||||||
|
|
||||||
double sine = Math.sin(System.currentTimeMillis() * 0.0005) * 5;
|
double sine = Math.sin(Clock.get_ms() * 0.0005) * 5;
|
||||||
double sin3 = Math.sin(System.currentTimeMillis() * 0.0005 + Math.PI * 0.5) * 5;
|
double sin3 = Math.sin(Clock.get_ms() * 0.0005 + Math.PI * 0.5) * 5;
|
||||||
GL11.glRotated(sine, 0, 0, 1);
|
GL11.glRotated(sine, 0, 0, 1);
|
||||||
GL11.glRotated(sin3, 1, 0, 0);
|
GL11.glRotated(sin3, 1, 0, 0);
|
||||||
|
|
||||||
@ -1257,7 +1259,7 @@ public class ModEventHandlerClient {
|
|||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 6500F, 30F);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 6500F, 30F);
|
||||||
SoyuzPronter.prontCapsule();
|
SoyuzPronter.prontCapsule();
|
||||||
|
|
||||||
GL11.glRotated(System.currentTimeMillis() * 0.025 % 360, 0, -1, 0);
|
GL11.glRotated(Clock.get_ms() * 0.025 % 360, 0, -1, 0);
|
||||||
|
|
||||||
int rand = new Random(MainRegistry.startupTime).nextInt(HTTPHandler.capsule.size());
|
int rand = new Random(MainRegistry.startupTime).nextInt(HTTPHandler.capsule.size());
|
||||||
String msg = HTTPHandler.capsule.get(rand);
|
String msg = HTTPHandler.capsule.get(rand);
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
|||||||
import com.hbm.packet.PermaSyncHandler;
|
import com.hbm.packet.PermaSyncHandler;
|
||||||
import com.hbm.render.item.weapon.sedna.ItemRenderWeaponBase;
|
import com.hbm.render.item.weapon.sedna.ItemRenderWeaponBase;
|
||||||
import com.hbm.render.model.ModelMan;
|
import com.hbm.render.model.ModelMan;
|
||||||
|
import com.hbm.util.Clock;
|
||||||
import com.hbm.world.biome.BiomeGenCraterBase;
|
import com.hbm.world.biome.BiomeGenCraterBase;
|
||||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
@ -544,11 +545,11 @@ public class ModEventHandlerRenderer {
|
|||||||
/** Same procedure as getting the blended sky color but for fog */
|
/** Same procedure as getting the blended sky color but for fog */
|
||||||
public static Vec3 getFogBlendColor(World world, int playerX, int playerZ, float red, float green, float blue, double partialTicks) {
|
public static Vec3 getFogBlendColor(World world, int playerX, int playerZ, float red, float green, float blue, double partialTicks) {
|
||||||
|
|
||||||
long millis = System.currentTimeMillis() - fogTimer;
|
long millis = Clock.get_ms() - fogTimer;
|
||||||
if(playerX == fogX && playerZ == fogZ && fogInit && millis < 3000) return fogRGBMultiplier;
|
if(playerX == fogX && playerZ == fogZ && fogInit && millis < 3000) return fogRGBMultiplier;
|
||||||
|
|
||||||
fogInit = true;
|
fogInit = true;
|
||||||
fogTimer = System.currentTimeMillis();
|
fogTimer = Clock.get_ms();
|
||||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
||||||
int[] ranges = ForgeModContainer.blendRanges;
|
int[] ranges = ForgeModContainer.blendRanges;
|
||||||
int distance = 0;
|
int distance = 0;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.render.anim;
|
package com.hbm.render.anim;
|
||||||
|
|
||||||
|
import com.hbm.util.Clock;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -98,7 +99,7 @@ public class HbmAnimations {
|
|||||||
if(anim != null) {
|
if(anim != null) {
|
||||||
|
|
||||||
BusAnimation buses = anim.animation;
|
BusAnimation buses = anim.animation;
|
||||||
int millis = (int)(System.currentTimeMillis() - anim.startMillis);
|
int millis = (int)(Clock.get_ms() - anim.startMillis);
|
||||||
|
|
||||||
BusAnimationSequence seq = buses.getBus(bus);
|
BusAnimationSequence seq = buses.getBus(bus);
|
||||||
|
|
||||||
|
|||||||
@ -14,13 +14,13 @@ public class HbmFace {
|
|||||||
public TextureCoordinate[] textureCoordinates;
|
public TextureCoordinate[] textureCoordinates;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addFaceForRender(Tessellator tessellator)
|
public void addFaceForRender(float currentTime, Tessellator tessellator)
|
||||||
{
|
{
|
||||||
addFaceForRender(tessellator, 0.0005F);
|
addFaceForRender(currentTime, tessellator, 0.0005F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addFaceForRender(Tessellator tessellator, float textureOffset)
|
public void addFaceForRender(float currentTime, Tessellator tessellator, float textureOffset)
|
||||||
{
|
{
|
||||||
if (faceNormal == null)
|
if (faceNormal == null)
|
||||||
{
|
{
|
||||||
@ -31,6 +31,7 @@ public class HbmFace {
|
|||||||
|
|
||||||
float averageU = 0F;
|
float averageU = 0F;
|
||||||
float averageV = 0F;
|
float averageV = 0F;
|
||||||
|
float animOffset = 0F;
|
||||||
|
|
||||||
if ((textureCoordinates != null) && (textureCoordinates.length > 0))
|
if ((textureCoordinates != null) && (textureCoordinates.length > 0))
|
||||||
{
|
{
|
||||||
@ -42,6 +43,7 @@ public class HbmFace {
|
|||||||
|
|
||||||
averageU = averageU / textureCoordinates.length;
|
averageU = averageU / textureCoordinates.length;
|
||||||
averageV = averageV / textureCoordinates.length;
|
averageV = averageV / textureCoordinates.length;
|
||||||
|
animOffset = (float)(((double)currentTime % HmfController.modoloMod) / HmfController.quotientMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
float offsetU, offsetV;
|
float offsetU, offsetV;
|
||||||
@ -63,7 +65,7 @@ public class HbmFace {
|
|||||||
offsetV = -offsetV;
|
offsetV = -offsetV;
|
||||||
}
|
}
|
||||||
|
|
||||||
tessellator.addVertexWithUV(vertices[i].x, vertices[i].y, vertices[i].z, textureCoordinates[i].u + offsetU, textureCoordinates[i].v + offsetV + (((double)System.currentTimeMillis() % HmfController.modoloMod) / HmfController.quotientMod));
|
tessellator.addVertexWithUV(vertices[i].x, vertices[i].y, vertices[i].z, textureCoordinates[i].u + offsetU, textureCoordinates[i].v + offsetV + animOffset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,25 +29,25 @@ public class HbmGroupObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void render()
|
public void render(float currentTime)
|
||||||
{
|
{
|
||||||
if (faces.size() > 0)
|
if (faces.size() > 0)
|
||||||
{
|
{
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
tessellator.startDrawing(glDrawingMode);
|
tessellator.startDrawing(glDrawingMode);
|
||||||
render(tessellator);
|
render(currentTime, tessellator);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void render(Tessellator tessellator)
|
public void render(float currentTime, Tessellator tessellator)
|
||||||
{
|
{
|
||||||
if (faces.size() > 0)
|
if (faces.size() > 0)
|
||||||
{
|
{
|
||||||
for (HbmFace face : faces)
|
for (HbmFace face : faces)
|
||||||
{
|
{
|
||||||
face.addFaceForRender(tessellator);
|
face.addFaceForRender(currentTime, tessellator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import net.minecraftforge.client.model.ModelFormatException;
|
|||||||
import net.minecraftforge.client.model.obj.TextureCoordinate;
|
import net.minecraftforge.client.model.obj.TextureCoordinate;
|
||||||
import net.minecraftforge.client.model.obj.Vertex;
|
import net.minecraftforge.client.model.obj.Vertex;
|
||||||
|
|
||||||
|
import com.hbm.util.Clock;
|
||||||
|
|
||||||
public class HbmModelObject implements IModelCustom {
|
public class HbmModelObject implements IModelCustom {
|
||||||
private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
||||||
private static Pattern vertexNormalPattern = Pattern.compile("(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
private static Pattern vertexNormalPattern = Pattern.compile("(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
|
||||||
@ -188,9 +190,10 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void tessellateAll(Tessellator tessellator)
|
public void tessellateAll(Tessellator tessellator)
|
||||||
{
|
{
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
groupObject.render(tessellator);
|
groupObject.render(currentTime, tessellator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,13 +201,14 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void renderOnly(String... groupNames)
|
public void renderOnly(String... groupNames)
|
||||||
{
|
{
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
for (String groupName : groupNames)
|
for (String groupName : groupNames)
|
||||||
{
|
{
|
||||||
if (groupName.equalsIgnoreCase(groupObject.name))
|
if (groupName.equalsIgnoreCase(groupObject.name))
|
||||||
{
|
{
|
||||||
groupObject.render();
|
groupObject.render(currentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,13 +216,14 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void tessellateOnly(Tessellator tessellator, String... groupNames) {
|
public void tessellateOnly(Tessellator tessellator, String... groupNames) {
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
for (String groupName : groupNames)
|
for (String groupName : groupNames)
|
||||||
{
|
{
|
||||||
if (groupName.equalsIgnoreCase(groupObject.name))
|
if (groupName.equalsIgnoreCase(groupObject.name))
|
||||||
{
|
{
|
||||||
groupObject.render(tessellator);
|
groupObject.render(currentTime, tessellator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,22 +233,24 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void renderPart(String partName)
|
public void renderPart(String partName)
|
||||||
{
|
{
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
if (partName.equalsIgnoreCase(groupObject.name))
|
if (partName.equalsIgnoreCase(groupObject.name))
|
||||||
{
|
{
|
||||||
groupObject.render();
|
groupObject.render(currentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void tessellatePart(Tessellator tessellator, String partName) {
|
public void tessellatePart(Tessellator tessellator, String partName) {
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
if (partName.equalsIgnoreCase(groupObject.name))
|
if (partName.equalsIgnoreCase(groupObject.name))
|
||||||
{
|
{
|
||||||
groupObject.render(tessellator);
|
groupObject.render(currentTime, tessellator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -252,6 +259,7 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void renderAllExcept(String... excludedGroupNames)
|
public void renderAllExcept(String... excludedGroupNames)
|
||||||
{
|
{
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
boolean skipPart=false;
|
boolean skipPart=false;
|
||||||
@ -264,7 +272,7 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
}
|
}
|
||||||
if(!skipPart)
|
if(!skipPart)
|
||||||
{
|
{
|
||||||
groupObject.render();
|
groupObject.render(currentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,6 +280,7 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames)
|
public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames)
|
||||||
{
|
{
|
||||||
|
float currentTime = Clock.get_ms();
|
||||||
boolean exclude;
|
boolean exclude;
|
||||||
for (HbmGroupObject groupObject : groupObjects)
|
for (HbmGroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
@ -285,7 +294,7 @@ public class HbmModelObject implements IModelCustom {
|
|||||||
}
|
}
|
||||||
if(!exclude)
|
if(!exclude)
|
||||||
{
|
{
|
||||||
groupObject.render(tessellator);
|
groupObject.render(currentTime, tessellator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL11;
|
|||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
import com.hbm.util.Clock;
|
||||||
import com.hbm.render.loader.HmfController;
|
import com.hbm.render.loader.HmfController;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ public class RenderChemplant extends TileEntitySpecialRenderer {
|
|||||||
|
|
||||||
bindTexture(ResourceManager.chemplant_spinner_tex);
|
bindTexture(ResourceManager.chemplant_spinner_tex);
|
||||||
|
|
||||||
int rotation = (int) (System.currentTimeMillis() % (360 * 5)) / 5;
|
int rotation = (int) (Clock.get_ms() % (360 * 5)) / 5;
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslated(-0.625, 0, 0.625);
|
GL11.glTranslated(-0.625, 0, 0.625);
|
||||||
@ -101,7 +102,7 @@ public class RenderChemplant extends TileEntitySpecialRenderer {
|
|||||||
ResourceManager.chemplant_spinner.renderAll();
|
ResourceManager.chemplant_spinner.renderAll();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
double push = Math.sin((System.currentTimeMillis() % 2000) / 1000D * Math.PI) * 0.25 - 0.25;
|
double push = Math.sin((Clock.get_ms() % 2000) / 1000D * Math.PI) * 0.25 - 0.25;
|
||||||
|
|
||||||
bindTexture(ResourceManager.chemplant_piston_tex);
|
bindTexture(ResourceManager.chemplant_piston_tex);
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import org.lwjgl.opengl.GL11;
|
|||||||
|
|
||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.wiaj.WorldInAJar;
|
import com.hbm.wiaj.WorldInAJar;
|
||||||
|
import com.hbm.util.Clock;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
@ -272,7 +273,7 @@ public class RenderOverhead {
|
|||||||
|
|
||||||
tagList.add(entry);
|
tagList.add(entry);
|
||||||
|
|
||||||
if(marker.expire > 0 && System.currentTimeMillis() > marker.expire) {
|
if(marker.expire > 0 && Clock.get_ms() > marker.expire) {
|
||||||
it.remove();
|
it.remove();
|
||||||
} else if(marker.maxDist > 0) {
|
} else if(marker.maxDist > 0) {
|
||||||
double aX = pX + (maxX - minX) / 2D;
|
double aX = pX + (maxX - minX) / 2D;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.hbm.interfaces.Untested;
|
|||||||
import com.hbm.items.weapon.sedna.Crosshair;
|
import com.hbm.items.weapon.sedna.Crosshair;
|
||||||
import com.hbm.items.weapon.sedna.impl.ItemGunStinger;
|
import com.hbm.items.weapon.sedna.impl.ItemGunStinger;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.util.Clock;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
@ -47,8 +48,8 @@ public class RenderScreenOverlay {
|
|||||||
|
|
||||||
radiation = lastResult - prevResult;
|
radiation = lastResult - prevResult;
|
||||||
|
|
||||||
if(System.currentTimeMillis() >= lastSurvey + 1000) {
|
if(Clock.get_ms() >= lastSurvey + 1000) {
|
||||||
lastSurvey = System.currentTimeMillis();
|
lastSurvey = Clock.get_ms();
|
||||||
prevResult = lastResult;
|
prevResult = lastResult;
|
||||||
lastResult = in;
|
lastResult = in;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -173,7 +173,7 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
|||||||
if(isProgressing && volume > 0) {
|
if(isProgressing && volume > 0) {
|
||||||
|
|
||||||
if(audio == null) {
|
if(audio == null) {
|
||||||
audio = this.createAudioLoop();
|
audio = createAudioLoop();
|
||||||
audio.updateVolume(volume);
|
audio.updateVolume(volume);
|
||||||
audio.startSound();
|
audio.startSound();
|
||||||
} else if(!audio.isPlaying()) {
|
} else if(!audio.isPlaying()) {
|
||||||
|
|||||||
11
src/main/java/com/hbm/util/Clock.java
Normal file
11
src/main/java/com/hbm/util/Clock.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.hbm.util;
|
||||||
|
|
||||||
|
public class Clock {
|
||||||
|
private static long time_ms;
|
||||||
|
public static void update(){
|
||||||
|
time_ms = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
public static long get_ms(){
|
||||||
|
return time_ms;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user