Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
01a13871de
Patch documentation to come Issues with the old system that are fixed now: - World generation does not scale with cpu cores effectively. - Relies on the main thread for scheduling and maintaining chunk state, dropping chunk load/generate rates at lower tps. - Unreliable prioritisation of chunk gen/load calls that block the main thread. - Shutdown logic is utterly unreliable, as it has to wait for all chunks to unload - is it guaranteed that the chunk system is in a state on shutdown that it can reliably do this? Watchdog shutdown also typically failed due to thread checks, which is now resolved. - Saving of data is not unified (i.e can save chunk data without saving entity data, poses problems for desync if shutdown is really abnormal. - Entities are not loaded with chunks. This caused quite a bit of headache for Chunk#getEntities API, but now the new chunk system loads entities with chunks so that they are ready whenever the chunk loads in. Effectively brings the behavior back to 1.16 era, but still storing entities in their own separate regionfiles. The above list is not complete. The patch documentation will complete it. New chunk system hard relies on starlight and dataconverter, and most importantly the new concurrent utilities in ConcurrentUtil. Some of the old async chunk i/o interface (i.e the old file io thread reroutes _some_ calls to the new file io thread) is kept for plugin compat reasons. It will be removed in the next major version of minecraft. The old legacy chunk system patches have been moved to the removed folder in case we need them again.
54 Zeilen
3.8 KiB
Diff
54 Zeilen
3.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sat, 21 Jul 2018 01:51:27 -0500
|
|
Subject: [PATCH] EnderDragon Events
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
index 68e27569f44efd7fa234c19c7fd51da709a06a43..f18830d9d0f821e5603992846c335bba04ab640f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
@@ -83,7 +83,13 @@ public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
|
|
this.flame.setDuration(200);
|
|
this.flame.setParticle(ParticleTypes.DRAGON_BREATH);
|
|
this.flame.addEffect(new MobEffectInstance(MobEffects.HARM));
|
|
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.dragon.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.flame.getBukkitEntity()).callEvent()) { // Paper
|
|
this.dragon.level.addFreshEntity(this.flame);
|
|
+ // Paper start
|
|
+ } else {
|
|
+ this.end();
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
|
index 62b4b9a63452e8af7425c4d8ea4b4bada441c563..c2a14305cb737fbc6447c555d8a15e2d3977e3fa 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
|
@@ -74,7 +74,9 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
|
|
|
|
DragonFireball dragonFireball = new DragonFireball(this.dragon.level, this.dragon, r, s, t);
|
|
dragonFireball.moveTo(o, p, q, 0.0F, 0.0F);
|
|
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper
|
|
this.dragon.level.addFreshEntity(dragonFireball);
|
|
+ else dragonFireball.discard(); // Paper
|
|
this.fireballCharge = 0;
|
|
if (this.currentPath != null) {
|
|
while(!this.currentPath.isDone()) {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
index a7935042497a108a21814c28b01a0ab27aefbbc4..6afe37e42d88701af38df5793a9ea9d7d2cda5c5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
@@ -52,8 +52,10 @@ public class DragonFireball extends AbstractHurtingProjectile {
|
|
}
|
|
}
|
|
|
|
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper
|
|
this.level.levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
|
this.level.addFreshEntity(areaEffectCloud);
|
|
+ } else areaEffectCloud.discard(); // Paper
|
|
this.discard();
|
|
}
|
|
|