|
1 | 1 | --- a/net/minecraft//server/MinecraftServer.java
|
2 | 2 | +++ b/net/minecraft//server/MinecraftServer.java
|
3 |
| -@@ -166,6 +166,10 @@ |
| 3 | +@@ -163,6 +163,10 @@ |
4 | 4 |
|
5 | 5 | public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable {
|
6 | 6 |
|
|
11 | 11 | static final Logger LOGGER = LogManager.getLogger();
|
12 | 12 | private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
|
13 | 13 | private static final int TICK_STATS_SPAN = 100;
|
14 |
| -@@ -265,14 +269,14 @@ |
| 14 | +@@ -261,14 +265,14 @@ |
15 | 15 | thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
16 | 16 | MinecraftServer.LOGGER.error(throwable);
|
17 | 17 | });
|
|
28 | 28 | super("Server");
|
29 | 29 | this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
30 | 30 | this.profiler = this.metricsRecorder.getProfiler();
|
31 |
| -@@ -314,13 +318,14 @@ |
| 31 | +@@ -310,13 +314,14 @@ |
32 | 32 | this.structureManager = new StructureManager(serverresources.getResourceManager(), levelstoragesource_levelstorageaccess, datafixer);
|
33 | 33 | this.serverThread = thread;
|
34 | 34 | this.executor = Util.backgroundExecutor();
|
|
44 | 44 | ServerScoreboard serverscoreboard1 = this.getScoreboard();
|
45 | 45 |
|
46 | 46 | Objects.requireNonNull(serverscoreboard1);
|
47 |
| -@@ -631,6 +636,7 @@ |
| 47 | +@@ -639,6 +644,7 @@ |
48 | 48 |
|
49 | 49 | public void stopServer() {
|
50 | 50 | MinecraftServer.LOGGER.info("Stopping server");
|
51 | 51 | + loomServer.shutdown(); // Loom
|
52 | 52 | if (this.getConnection() != null) {
|
53 | 53 | this.getConnection().stop();
|
54 | 54 | }
|
55 |
| -@@ -679,6 +685,12 @@ |
| 55 | +@@ -687,6 +693,12 @@ |
56 | 56 | MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
|
57 | 57 | }
|
58 | 58 |
|
|
65 | 65 | }
|
66 | 66 |
|
67 | 67 | public String getLocalIp() {
|
68 |
| -@@ -713,10 +725,12 @@ |
| 68 | +@@ -721,10 +733,12 @@ |
69 | 69 | this.status.setVersion(new ServerStatus.Version(SharedConstants.getCurrentVersion().getName(), SharedConstants.getCurrentVersion().getProtocolVersion()));
|
70 | 70 | this.updateStatusIcon(this.status);
|
71 | 71 |
|
|
80 | 80 | long j = i / 50L;
|
81 | 81 |
|
82 | 82 | MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
|
83 |
| -@@ -729,6 +743,13 @@ |
| 83 | +@@ -737,6 +751,13 @@ |
84 | 84 | this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
|
85 | 85 | }
|
86 | 86 |
|
|
94 | 94 | this.nextTickTime += 50L;
|
95 | 95 | this.startMetricsRecordingTick();
|
96 | 96 | this.profiler.push("tick");
|
97 |
| -@@ -827,7 +848,7 @@ |
| 97 | +@@ -835,7 +856,7 @@ |
98 | 98 | }
|
99 | 99 | }
|
100 | 100 |
|
|
103 | 103 | this.getProfiler().incrementCounter("runTask");
|
104 | 104 | super.doRunTask(ticktask);
|
105 | 105 | }
|
106 |
| -@@ -881,6 +902,7 @@ |
| 106 | +@@ -883,6 +904,7 @@ |
107 | 107 | long i = Util.getNanos();
|
108 | 108 |
|
109 | 109 | ++this.tickCount;
|
110 | 110 | + org.loomdev.loom.event.LoomEventDispatcher.fire(new org.loomdev.loom.event.server.TickEventImpl.PreImpl(getTickCount())); // Loom :: fire TickEvent.Pre
|
111 | 111 | this.tickChildren(booleansupplier);
|
112 | 112 | if (i - this.lastServerStatus >= 5000000000L) {
|
113 | 113 | this.lastServerStatus = i;
|
114 |
| -@@ -915,17 +937,20 @@ |
| 114 | +@@ -917,17 +939,20 @@ |
115 | 115 | }
|
116 | 116 |
|
117 | 117 | this.profiler.pop();
|
|
132 | 132 | this.profiler.push("commandFunctions");
|
133 | 133 | this.getFunctions().tick();
|
134 | 134 | this.profiler.popPush("levels");
|
135 |
| -@@ -946,6 +971,7 @@ |
| 135 | +@@ -948,6 +973,7 @@ |
136 | 136 | this.profiler.push("tick");
|
137 | 137 |
|
138 | 138 | try {
|
139 | 139 | + org.loomdev.loom.event.LoomEventDispatcher.fire(new org.loomdev.loom.event.server.TickEventImpl.WorldImpl(getTickCount(), serverlevel)); // Loom :: fire TickEvent.World
|
140 | 140 | serverlevel.tick(booleansupplier);
|
141 | 141 | } catch (Throwable throwable) {
|
142 | 142 | CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
143 |
| -@@ -1030,7 +1056,7 @@ |
| 143 | +@@ -1032,7 +1058,7 @@ |
144 | 144 |
|
145 | 145 | @DontObfuscate
|
146 | 146 | public String getServerModName() {
|
|
149 | 149 | }
|
150 | 150 |
|
151 | 151 | public SystemReport fillSystemReport(SystemReport systemreport) {
|
152 |
| -@@ -1075,7 +1101,7 @@ |
| 152 | +@@ -1077,7 +1103,7 @@ |
153 | 153 | public abstract Optional<String> getModdedStatus();
|
154 | 154 |
|
155 | 155 | public void sendMessage(Component component, UUID uuid) {
|
|
158 | 158 | }
|
159 | 159 |
|
160 | 160 | public KeyPair getKeyPair() {
|
161 |
| -@@ -1396,11 +1422,11 @@ |
| 161 | +@@ -1398,11 +1424,11 @@ |
162 | 162 |
|
163 | 163 | public CompletableFuture<Void> reloadResources(Collection<String> collection) {
|
164 | 164 | CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
|
172 | 172 | }, this).thenCompose((immutablelist) -> {
|
173 | 173 | return ServerResources.loadResources(immutablelist, this.registryHolder, this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this);
|
174 | 174 | }).thenAcceptAsync((serverresources) -> {
|
175 |
| -@@ -1853,6 +1879,7 @@ |
| 175 | +@@ -1855,6 +1881,7 @@ |
176 | 176 | }
|
177 | 177 | }
|
178 | 178 |
|
179 | 179 | + /* // Loom start :: decompile error
|
180 | 180 | public void doRunTask(Runnable runnable) {
|
181 | 181 | this.doRunTask((TickTask) runnable);
|
182 | 182 | }
|
183 |
| -@@ -1864,6 +1891,7 @@ |
| 183 | +@@ -1866,6 +1893,7 @@ |
184 | 184 | public Runnable wrapRunnable(Runnable runnable) {
|
185 | 185 | return this.wrapRunnable(runnable);
|
186 | 186 | }
|
|
0 commit comments