Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'ver/1.16.5' of github.com:YatopiaMC/Yatopia into pr/fix…
Browse files Browse the repository at this point in the history
…-374
  • Loading branch information
Titaniumtown committed Feb 15, 2021
2 parents c4edab2 + e34bf40 commit 39341c7
Show file tree
Hide file tree
Showing 94 changed files with 862 additions and 253 deletions.
6 changes: 6 additions & 0 deletions PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This is an overview over all patches that are currently used.
| api | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
| server | Add demo command | BillyGalbreath | |
| server | Add enderman and creeper griefing controls | William Blake Galbreath | |
| server | Add ghast allow-griefing option | BillyGalbreath | |
| server | Add last tick time API | Ivan Pekov | tr7zw |
| api | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add mobGriefing bypass to everything affected | Encode42 | |
Expand All @@ -62,6 +63,8 @@ This is an overview over all patches that are currently used.
| server | Add timings for Behavior | Phoenix616 | |
| server | Add timings for Pathfinder | MrIvanPlays | |
| server | Add twisting and weeping vines growth rates | BillyGalbreath | |
| server | Add unsafe Entity serialization API | Mariell Hoversholm | |
| api | Add unsafe Entity serialization API | Mariell Hoversholm | |
| server | Add vindicator johnny spawn chance | William Blake Galbreath | |
| server | Add wither skeleton takes wither damage option | William Blake Galbreath | |
| server | Advancement API | William Blake Galbreath | |
Expand Down Expand Up @@ -102,6 +105,7 @@ This is an overview over all patches that are currently used.
| server | Config migration: climbing should not bypass cramming | jmp | |
| server | Config migration: disable saving projectiles to disk -> | jmp | |
| server | Config to allow Note Block sounds when blocked | Encode42 | |
| server | Config to always tame in Creative | Encode42 | |
| server | Config to use infinity bows without arrows | Encode42 | |
| server | Configurable BlockPhysicsEvent | Mykyta Komarnytskyy | |
| server | Configurable TPS Catchup | William Blake Galbreath | |
Expand Down Expand Up @@ -154,6 +158,7 @@ This is an overview over all patches that are currently used.
| server | EMC - Configurable disable give dropping | Aikar | |
| server | EMC - MonsterEggSpawnEvent | Aikar | |
| api | EMC - MonsterEggSpawnEvent | Aikar | |
| server | End crystal explosion options | Ben Kerllenevich | |
| server | End gateway should check if entity can use portal | William Blake Galbreath | |
| server | Ender dragon always drop full exp | William Blake Galbreath | |
| server | Ensure pools create daemon threads | Ivan Pekov | |
Expand Down Expand Up @@ -308,6 +313,7 @@ This is an overview over all patches that are currently used.
| server | Reduce allocs & improve perf of StructureManager | Paul Sauve | |
| server | Reduce chunk loading & lookups | Paul Sauve | |
| server | Reduce iterator allocation from chunk gen | Spottedleaf | |
| server | Reduce memory allocations | Paul Sauve | |
| server | Reduce pathfinder branches | Spottedleaf | |
| server | Reduce projectile chunk loading | Paul Sauve | |
| server | Remove some streams and object allocations | Phoenix616 | |
Expand Down
2 changes: 1 addition & 1 deletion Paper
Submodule Paper updated 36 files
+2 −2 Spigot-API-Patches/0096-Expand-World.spawnParticle-API-and-add-Builder.patch
+2 −2 Spigot-API-Patches/0111-Expand-Explosions-API.patch
+2 −2 Spigot-API-Patches/0156-Add-sun-related-API.patch
+2 −2 Spigot-API-Patches/0201-World-view-distance-api.patch
+3 −3 Spigot-API-Patches/0203-Spawn-Reason-API.patch
+8 −8 Spigot-Server-Patches/0004-MC-Utils.patch
+5 −5 Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
+3 −3 Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch
+4 −4 Spigot-Server-Patches/0009-Timings-v2.patch
+2 −2 Spigot-Server-Patches/0021-Remove-invalid-mob-spawner-tile-entities.patch
+2 −2 Spigot-Server-Patches/0054-Add-exception-reporting-event.patch
+2 −2 Spigot-Server-Patches/0073-Configurable-Chunk-Inhabited-Time.patch
+2 −2 Spigot-Server-Patches/0114-Option-to-remove-corrupt-tile-entities.patch
+2 −2 Spigot-Server-Patches/0136-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
+3 −3 Spigot-Server-Patches/0212-Expand-World.spawnParticle-API-and-add-Builder.patch
+2 −2 Spigot-Server-Patches/0216-Allow-spawning-Item-entities-with-World.spawnEntity.patch
+2 −2 Spigot-Server-Patches/0228-Expand-Explosions-API.patch
+2 −2 Spigot-Server-Patches/0232-Implement-World.getEntity-UUID-API.patch
+3 −3 Spigot-Server-Patches/0248-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
+5 −5 Spigot-Server-Patches/0249-Add-some-Debug-to-Chunk-Entity-slices.patch
+11 −11 Spigot-Server-Patches/0253-Ignore-Dead-Entities-in-entityList-iteration.patch
+4 −4 Spigot-Server-Patches/0294-Add-sun-related-API.patch
+4 −4 Spigot-Server-Patches/0350-Duplicate-UUID-Resolve-Option.patch
+4 −4 Spigot-Server-Patches/0352-Configurable-Keep-Spawn-Loaded-range-per-world.patch
+5 −5 Spigot-Server-Patches/0367-Avoid-hopper-searches-if-there-are-no-items.patch
+4 −4 Spigot-Server-Patches/0368-Asynchronous-chunk-IO-and-loading.patch
+2 −2 Spigot-Server-Patches/0380-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch
+2 −2 Spigot-Server-Patches/0407-Optimise-random-block-ticking.patch
+4 −4 Spigot-Server-Patches/0469-No-Tick-view-distance-implementation.patch
+2 −2 Spigot-Server-Patches/0484-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
+2 −2 Spigot-Server-Patches/0494-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
+2 −2 Spigot-Server-Patches/0536-Add-missing-strikeLighting-call-to-World-spigot-stri.patch
+3 −3 Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch
+1 −1 work/Bukkit
+1 −1 work/CraftBukkit
+1 −1 work/Spigot
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,36 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ae07ea2a34f5cd82ce2eae523359cb7540065335..7b8036840dcca16904b3063c209d5ff10ab8a6af 100644
index 68d6fb69a0c1b98b3c11b6d80783faaa58272526..fa1d559a07199bf52d8ae04b2c34261efdebdcdb 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -53,6 +53,17 @@ public class Chunk implements IChunkAccess {
@@ -53,6 +53,18 @@ public class Chunk implements IChunkAccess {
private final ChunkCoordIntPair loc; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key
private volatile boolean x;

+ // Airplane start - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
+ private int lightningTick = -1;
+ public boolean shouldDoLightning() {
+ boolean doTick = this.lightningTick == 0;
+ private int lightningTick;
+ // shouldDoLightning compiles down to 29 bytes, which with the default of 35 byte inlining should guarantee an inline
+ public final boolean shouldDoLightning(java.util.Random random) {
+ if (this.lightningTick-- <= 0) {
+ this.lightningTick = this.world.random.nextInt(100000) << 1;
+ this.lightningTick = random.nextInt(100000) << 1;
+ return true;
+ }
+ return doTick;
+ return false;
+ }
+ // Airplane end
+
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) {
this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null);
}
@@ -325,6 +337,7 @@ public class Chunk implements IChunkAccess {

// CraftBukkit start
this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
+ this.lightningTick = this.world.random.nextInt(100000) << 1; // Airplane - initialize lightning tick
}

public org.bukkit.Chunk bukkitChunk;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 1da5c7def8b476cf638548b05d3e2015bc372f51..03bcd704e3c08f5b54b124df1583e3ccdb4cb485 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
Expand All @@ -68,7 +77,7 @@ index 1da5c7def8b476cf638548b05d3e2015bc372f51..03bcd704e3c08f5b54b124df1583e3cc
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit

diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 994c1822a4b53552befc64d88e922285715fa31d..2a60d8fc88ab83a157f00ce5e5ccd99ce3660453 100644
index 994c1822a4b53552befc64d88e922285715fa31d..f3e8e5dafa528075acc76fa2e75907f63438a93d 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1019,6 +1019,8 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Expand All @@ -85,7 +94,7 @@ index 994c1822a4b53552befc64d88e922285715fa31d..2a60d8fc88ab83a157f00ce5e5ccd99c
final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change

- if (!this.paperConfig.disableThunder && flag && this.random.nextInt(100000) == 0 && this.W()) { // Paper - Disable thunder // Airplane - check this.W last
+ if (!this.paperConfig.disableThunder && flag && chunk.shouldDoLightning() && this.W()) { // Paper - Disable thunder // Airplane - check this.W last // Airplane - replace random with shouldDoLighting
+ if (!this.paperConfig.disableThunder && flag && chunk.shouldDoLightning(this.random) && this.W()) { // Paper - Disable thunder // Airplane - check this.W last // Airplane - replace random with shouldDoLighting
blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ index 4feb9686f45ce4ae9f474447496b8e0f6fcb7e31..c39c9929a251b41ab60e1509b4e6c90d
+
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 63eb29635957d4e6ce1274ee17a59af62d442d4e..d74086ee72cfae3d2bead9fb08c808299d755e2a 100644
index a2ba87dac005572d2617b6fe2c92f6984665588c..0fe4c8f9c669f343fef3e2869f22b46d8ef7136b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -197,6 +197,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
Expand Down Expand Up @@ -98,7 +98,7 @@ index 4a3469aca9f9e47d2ea3f3bae6ce77f5f11d6b50..5af5b50889961b10e812598dbea657c4
++this.conversionTicks;
if (this.conversionTicks > 300) {
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index dac0d2f9f4c8c909f0c03baa30c0565633d3af42..288e57fd58d5dfa91dce23e137ad078e455db4d3 100644
index 65841a7bb58e210f07c0afd74c2fd5b3873bdd60..4c2e0b8aafecbc2a4b68e2c30b64db1c692d3667 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -133,10 +133,10 @@ public abstract class EntityInsentient extends EntityLiving {
Expand Down
Loading

0 comments on commit 39341c7

Please sign in to comment.