Skip to content

Commit c07ab6f

Browse files
committed
Some fixes and optimizations
1 parent 698cba3 commit c07ab6f

File tree

7 files changed

+103
-75
lines changed

7 files changed

+103
-75
lines changed

buildSrc/src/main/groovy/thermos/InstallBundle.groovy

-24
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,6 @@ class InstallBundle extends DefaultTask {
3232
def install() {
3333
installLocation.deleteDir()
3434
installLocation.mkdirs()
35-
new File(installLocation, "README.txt").withWriter {
36-
def String jarPath = 'bin/ca/tcpr/Thermos/' << project.version << File.separator << 'Thermos-' << project.version << '.jar'
37-
38-
it << '''Thermos installation guide
39-
40-
# This is Thermos from https://github.com/TCPR/Thermos
41-
42-
# Installation and usage
43-
1. Unpack this zip into server directory
44-
2. Use following line to start the server:
45-
java -Xmx1024M -jar '''
46-
it << jarPath
47-
it << '''
48-
49-
or
50-
51-
java -Xmx1024M -jar Thermos.jar
52-
53-
3. Enjoy
54-
55-
Public builds can be found at: https://tcpr.ca/downloads/thermos
56-
57-
'''
58-
}
5935
def cp = bootstrapClasspath
6036
for (int i = 0; i < 3; i++) {
6137
def result = project.javaexec { it ->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--- ../src-base/minecraft/cpw/mods/fml/relauncher/FMLInjectionData.java
2+
+++ ../src-work/minecraft/cpw/mods/fml/relauncher/FMLInjectionData.java
3+
@@ -38,28 +38,13 @@
4+
static void build(File mcHome, LaunchClassLoader classLoader)
5+
{
6+
minecraftHome = mcHome;
7+
- InputStream stream = classLoader.getResourceAsStream("fmlversion.properties");
8+
- Properties properties = new Properties();
9+
-
10+
- if (stream != null)
11+
- {
12+
- try
13+
- {
14+
- properties.load(stream);
15+
- }
16+
- catch (IOException ex)
17+
- {
18+
- FMLRelaunchLog.log(Level.ERROR, ex, "Could not get FML version information - corrupted installation detected!");
19+
- }
20+
- }
21+
-
22+
- major = properties.getProperty("fmlbuild.major.number", "missing");
23+
- minor = properties.getProperty("fmlbuild.minor.number", "missing");
24+
- rev = properties.getProperty("fmlbuild.revision.number", "missing");
25+
- build = properties.getProperty("fmlbuild.build.number", "missing");
26+
- mccversion = properties.getProperty("fmlbuild.mcversion", "missing");
27+
- mcpversion = properties.getProperty("fmlbuild.mcpversion", "missing");
28+
- deobfuscationDataHash = properties.getProperty("fmlbuild.deobfuscation.hash","deadbeef");
29+
+ major = "7";
30+
+ minor = "99";
31+
+ rev = "4";
32+
+ build = "1614";
33+
+ mccversion = "1.7.10";
34+
+ mcpversion = "9.05";
35+
+ deobfuscationDataHash = "deadbeef";
36+
}
37+
38+
static String debfuscationDataName()

patches/net/minecraft/block/BlockBasePressurePlate.java.patch

+13
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@
3030
if (p_150062_5_ != i1)
3131
{
3232
p_150062_1_.setBlockMetadataWithNotify(p_150062_2_, p_150062_3_, p_150062_4_, this.func_150066_d(i1), 2);
33+
@@ -141,7 +156,11 @@
34+
35+
if (flag1)
36+
{
37+
- p_150062_1_.scheduleBlockUpdate(p_150062_2_, p_150062_3_, p_150062_4_, this, this.tickRate(p_150062_1_));
38+
+ if(i1!=p_150062_5_){
39+
+ p_150062_1_.scheduleBlockUpdate(p_150062_2_, p_150062_3_, p_150062_4_, this, this.tickRate(p_150062_1_));
40+
+ }else{
41+
+ p_150062_1_.func_147446_b(p_150062_2_, p_150062_3_, p_150062_4_, this, this.tickRate(p_150062_1_),0);
42+
+ }
43+
}
44+
}
45+

patches/net/minecraft/world/chunk/Chunk.java.patch

+24-28
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818
public class Chunk
1919
{
2020
private static final Logger logger = LogManager.getLogger();
21-
@@ -62,15 +73,49 @@
21+
@@ -62,15 +73,45 @@
2222
public int heightMapMinimum;
2323
public long inhabitedTime;
2424
private int queuedLightChecks;
2525
+ public gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot (Cauldron protected -> public)
26-
+ // PaperSpigot start - Asynchronous light updates
27-
+ public java.util.concurrent.atomic.AtomicInteger pendingLightUpdates = new java.util.concurrent.atomic.AtomicInteger();
28-
+ public long lightUpdateTime;
29-
+ // PaperSpigot end
3026
+ public int lastAccessedTick; // Cauldron track last time the chunk was accessed
3127
private static final String __OBFID = "CL_00000373";
3228

@@ -69,7 +65,7 @@
6965
this.queuedLightChecks = 4096;
7066
this.entityLists = new List[16];
7167
this.worldObj = p_i1995_1_;
72-
@@ -80,13 +125,22 @@
68+
@@ -80,13 +121,22 @@
7369

7470
for (int k = 0; k < this.entityLists.length; ++k)
7571
{
@@ -93,7 +89,7 @@
9389
public Chunk(World p_i45446_1_, Block[] p_i45446_2_, int p_i45446_3_, int p_i45446_4_)
9490
{
9591
this(p_i45446_1_, p_i45446_3_, p_i45446_4_);
96-
@@ -505,17 +559,17 @@
92+
@@ -505,17 +555,17 @@
9793
public Block getBlock(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_)
9894
{
9995
Block block = Blocks.air;
@@ -117,7 +113,7 @@
117113
catch (Throwable throwable)
118114
{
119115
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block");
120-
@@ -529,7 +583,7 @@
116+
@@ -529,7 +579,7 @@
121117
}
122118
});
123119
throw new ReportedException(crashreport);
@@ -126,7 +122,7 @@
126122
}
127123
}
128124

129-
@@ -589,9 +643,10 @@
125+
@@ -589,9 +639,10 @@
130126

131127
if (!this.worldObj.isRemote)
132128
{
@@ -138,7 +134,7 @@
138134
extendedblockstorage.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_);
139135
extendedblockstorage.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); // This line duplicates the one below, so breakBlock fires with valid worldstate
140136

141-
@@ -777,8 +832,20 @@
137+
@@ -777,8 +828,20 @@
142138

143139
if (i != this.xPosition || j != this.zPosition)
144140
{
@@ -161,7 +157,7 @@
161157
}
162158

163159
int k = MathHelper.floor_double(p_76612_1_.posY / 16.0D);
164-
@@ -799,6 +866,26 @@
160+
@@ -799,6 +862,26 @@
165161
p_76612_1_.chunkCoordY = k;
166162
p_76612_1_.chunkCoordZ = this.zPosition;
167163
this.entityLists[k].add(p_76612_1_);
@@ -188,7 +184,7 @@
188184
}
189185

190186
public void removeEntity(Entity p_76622_1_)
191-
@@ -819,6 +906,26 @@
187+
@@ -819,6 +902,26 @@
192188
}
193189

194190
this.entityLists[p_76608_2_].remove(p_76608_1_);
@@ -215,7 +211,7 @@
215211
}
216212

217213
public boolean canBlockSeeTheSky(int p_76619_1_, int p_76619_2_, int p_76619_3_)
218-
@@ -874,9 +981,23 @@
214+
@@ -874,9 +977,23 @@
219215
p_150812_4_.xCoord = this.xPosition * 16 + p_150812_1_;
220216
p_150812_4_.yCoord = p_150812_2_;
221217
p_150812_4_.zCoord = this.zPosition * 16 + p_150812_3_;
@@ -240,7 +236,7 @@
240236
{
241237
if (this.chunkTileEntityMap.containsKey(chunkposition))
242238
{
243-
@@ -886,6 +1007,16 @@
239+
@@ -886,6 +1003,16 @@
244240
p_150812_4_.validate();
245241
this.chunkTileEntityMap.put(chunkposition, p_150812_4_);
246242
}
@@ -257,7 +253,7 @@
257253
}
258254

259255
public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_)
260-
@@ -936,6 +1067,21 @@
256+
@@ -936,6 +1063,21 @@
261257

262258
for (int i = 0; i < this.entityLists.length; ++i)
263259
{
@@ -279,7 +275,7 @@
279275
this.worldObj.unloadEntities(this.entityLists[i]);
280276
}
281277
MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this));
282-
@@ -952,16 +1098,20 @@
278+
@@ -952,16 +1094,20 @@
283279
int j = MathHelper.floor_double((p_76588_2_.maxY + World.MAX_ENTITY_RADIUS) / 16.0D);
284280
i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1);
285281
j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1);
@@ -303,7 +299,7 @@
303299
{
304300
p_76588_3_.add(entity1);
305301
Entity[] aentity = entity1.getParts();
306-
@@ -998,7 +1148,7 @@
302+
@@ -998,7 +1144,7 @@
307303
{
308304
Entity entity = (Entity)list1.get(l);
309305

@@ -312,7 +308,7 @@
312308
{
313309
p_76618_3_.add(entity);
314310
}
315-
@@ -1015,7 +1165,7 @@
311+
@@ -1015,7 +1161,7 @@
316312
return true;
317313
}
318314
}
@@ -321,7 +317,7 @@
321317
{
322318
return true;
323319
}
324-
@@ -1025,7 +1175,7 @@
320+
@@ -1025,7 +1171,7 @@
325321

326322
public Random getRandomWithSeed(long p_76617_1_)
327323
{
@@ -330,23 +326,23 @@
330326
}
331327

332328
public boolean isEmpty()
333-
@@ -1035,6 +1185,7 @@
329+
@@ -1035,6 +1181,7 @@
334330

335331
public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int p_76624_3_, int p_76624_4_)
336332
{
337333
+ worldObj.timings.syncChunkLoadPostTimer.startTiming(); // Spigot
338334
if (!this.isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_))
339335
{
340336
p_76624_1_.populate(p_76624_2_, p_76624_3_, p_76624_4_);
341-
@@ -1054,6 +1205,7 @@
337+
@@ -1054,6 +1201,7 @@
342338
{
343339
p_76624_1_.populate(p_76624_2_, p_76624_3_ - 1, p_76624_4_ - 1);
344340
}
345341
+ worldObj.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot
346342
}
347343

348344
public int getPrecipitationHeight(int p_76626_1_, int p_76626_2_)
349-
@@ -1091,7 +1243,7 @@
345+
@@ -1091,7 +1239,7 @@
350346
{
351347
if (this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky && !p_150804_1_)
352348
{
@@ -355,7 +351,7 @@
355351
}
356352

357353
this.field_150815_m = true;
358-
@@ -1104,7 +1256,8 @@
354+
@@ -1104,7 +1252,8 @@
359355

360356
public boolean func_150802_k()
361357
{
@@ -365,7 +361,7 @@
365361
}
366362

367363
public ChunkCoordIntPair getChunkCoordIntPair()
368-
@@ -1184,8 +1337,10 @@
364+
@@ -1184,8 +1333,10 @@
369365
if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null)
370366
{
371367
nibblearray = this.storageArrays[l].getMetadataArray();
@@ -378,7 +374,7 @@
378374
}
379375
}
380376

381-
@@ -1194,8 +1349,10 @@
377+
@@ -1194,8 +1345,10 @@
382378
if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null)
383379
{
384380
nibblearray = this.storageArrays[l].getBlocklightArray();
@@ -391,7 +387,7 @@
391387
}
392388
}
393389

394-
@@ -1206,8 +1363,10 @@
390+
@@ -1206,8 +1359,10 @@
395391
if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null)
396392
{
397393
nibblearray = this.storageArrays[l].getSkylightArray();
@@ -404,7 +400,7 @@
404400
}
405401
}
406402
}
407-
@@ -1229,8 +1388,8 @@
403+
@@ -1229,8 +1384,8 @@
408404
nibblearray = this.storageArrays[l].createBlockMSBArray();
409405
}
410406

@@ -415,7 +411,7 @@
415411
}
416412
}
417413
else if (p_76607_4_ && this.storageArrays[l] != null && this.storageArrays[l].getBlockMSBArray() != null)
418-
@@ -1523,4 +1682,22 @@
414+
@@ -1523,4 +1678,22 @@
419415
}
420416
}
421417
}

0 commit comments

Comments
 (0)