mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 19:14:30 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -12,8 +12,7 @@ public class MillisTimer {
|
||||
private long field_74285_i;
|
||||
private double timeSyncAdjustment = 1.0D;
|
||||
|
||||
public MillisTimer(float p_i1018_1_)
|
||||
{
|
||||
public MillisTimer(float p_i1018_1_) {
|
||||
this.ticksPerSecond = p_i1018_1_;
|
||||
this.lastSyncSysClock = this.getLastSyncSysClock();
|
||||
this.lastSyncHRClock = System.nanoTime() / 1000000L;
|
||||
@@ -22,33 +21,27 @@ public class MillisTimer {
|
||||
/**
|
||||
* Updates all fields of the Timer using the current time
|
||||
*/
|
||||
public void updateTimer()
|
||||
{
|
||||
public void updateTimer() {
|
||||
long i = this.getLastSyncSysClock();
|
||||
long j = i - this.lastSyncSysClock;
|
||||
long k = System.nanoTime() / 1000000L;
|
||||
double d0 = (double)k / 1000.0D;
|
||||
double d0 = (double) k / 1000.0D;
|
||||
|
||||
if (j <= 1000L && j >= 0L)
|
||||
{
|
||||
if (j <= 1000L && j >= 0L) {
|
||||
this.field_74285_i += j;
|
||||
|
||||
if (this.field_74285_i > 1000L)
|
||||
{
|
||||
if (this.field_74285_i > 1000L) {
|
||||
long l = k - this.lastSyncHRClock;
|
||||
double d1 = (double)this.field_74285_i / (double)l;
|
||||
double d1 = (double) this.field_74285_i / (double) l;
|
||||
this.timeSyncAdjustment += (d1 - this.timeSyncAdjustment) * 0.20000000298023224D;
|
||||
this.lastSyncHRClock = k;
|
||||
this.field_74285_i = 0L;
|
||||
}
|
||||
|
||||
if (this.field_74285_i < 0L)
|
||||
{
|
||||
if (this.field_74285_i < 0L) {
|
||||
this.lastSyncHRClock = k;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.lastHRTime = d0;
|
||||
}
|
||||
|
||||
@@ -56,22 +49,19 @@ public class MillisTimer {
|
||||
double d2 = (d0 - this.lastHRTime) * this.timeSyncAdjustment;
|
||||
this.lastHRTime = d0;
|
||||
|
||||
if (d2 < 0.0D)
|
||||
{
|
||||
if (d2 < 0.0D) {
|
||||
d2 = 0.0D;
|
||||
}
|
||||
|
||||
if (d2 > 1.0D)
|
||||
{
|
||||
if (d2 > 1.0D) {
|
||||
d2 = 1.0D;
|
||||
}
|
||||
|
||||
this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + d2 * (double)this.timerSpeed * (double)this.ticksPerSecond);
|
||||
this.elapsedTicks = (int)this.elapsedPartialTicks;
|
||||
this.elapsedPartialTicks -= (float)this.elapsedTicks;
|
||||
this.elapsedPartialTicks = (float) ((double) this.elapsedPartialTicks + d2 * (double) this.timerSpeed * (double) this.ticksPerSecond);
|
||||
this.elapsedTicks = (int) this.elapsedPartialTicks;
|
||||
this.elapsedPartialTicks -= (float) this.elapsedTicks;
|
||||
|
||||
if (this.elapsedTicks > 10)
|
||||
{
|
||||
if (this.elapsedTicks > 10) {
|
||||
this.elapsedTicks = 10;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user