Skip to content

Commit

Permalink
Remove BuildNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Jan 26, 2025
1 parent 475318c commit b54ca76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.mohistmc.tasks.BuildNumber
import net.minecraftforge.forge.tasks.*
import net.minecraftforge.forge.tasks.checks.*
import net.minecraftforge.gradle.common.tasks.*
Expand Down Expand Up @@ -62,7 +61,7 @@ ext {
GIT_INFO = gradleutils.gitInfo
VERSION = MC_VERSION + "-" + project.forge_version
FORGE_VERSION = project.forge_version
MOHIST_VERSION = BuildNumber.string()
MOHIST_VERSION = gradleutils.gitInfo.abbreviatedId
ADVENTURE_VERSION = '4.14.0'

SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.11.0'
Expand Down
12 changes: 0 additions & 12 deletions buildSrc/src/main/groovy/com/mohistmc/tasks/BuildNumber.groovy

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,11 @@

+ // Spigot start
+ Arrays.fill( recentTps, 20 );
+ long tickSection = Util.m_137569_(), curTime, tickCount = 1; // Paper
+ long curTime, tickSection = Util.m_137550_(), tickCount = 1;
while(this.f_129764_) {
- long i = Util.m_137550_() - this.f_129726_;
- if (i > 2000L && this.f_129726_ - this.f_129718_ >= 15000L) {
+ long i = ((curTime = System.nanoTime()) / (1000L * 1000L)) - this.f_129726_; // Paper
+ long i = (curTime = Util.m_137550_()) - this.f_129726_;
+ if (i > 5000L && this.f_129726_ - this.f_129718_ >= 30000L) { // CraftBukkit
long j = i / 50L;
- f_129750_.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
Expand All @@ -522,7 +522,7 @@
this.f_129718_ = this.f_129726_;
}

+ if ( ++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0 )
+ if ( tickCount++ % SAMPLE_INTERVAL == 0 )
+ {
+ curTime = Util.m_137569_();
+ final long diff = curTime - tickSection;
Expand All @@ -540,15 +540,15 @@
+ // Purpur end
+ // Paper end
+ tickSection = curTime;
+ } else curTime = Util.m_137569_();
+ }
+ // Spigot end
+
if (this.f_177877_) {
this.f_177877_ = false;
this.f_177876_ = new MinecraftServer.TimeProfiler(Util.m_137569_(), this.f_129766_);
}

+ // MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
+ lastTick = curTime;
this.f_129726_ += 50L;
this.m_177945_();
Expand Down

0 comments on commit b54ca76

Please sign in to comment.