mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-01 12:33:25 +01:00
More more more patches
This commit is contained in:
parent
c02edac0c7
commit
8f5ec00c38
98 changed files with 82 additions and 102 deletions
build-data
patches/server
API-to-get-a-BlockState-without-a-snapshot.patchAbility-to-apply-mending-to-XP-API.patchAbility-to-change-PlayerProfile-in-AsyncPreLoginEven.patchAbility-to-get-Tile-Entities-from-a-chunk-without-sn.patchAdd-ArmorStand-Item-Meta.patchAdd-Debug-Entities-option-to-debug-dupe-uuid-issues.patchAdd-Early-Warning-Feature-to-WatchDog.patchAdd-More-Creeper-API.patchAdd-PhantomPreSpawnEvent.patchAdd-PlayerArmorChangeEvent.patchAdd-PlayerJumpEvent.patchAdd-TNTPrimeEvent.patchAdd-config-to-disable-ender-dragon-legacy-check.patchAdd-openSign-method-to-HumanEntity.patchAdd-setPlayerProfile-API-for-Skulls.patchAllow-disabling-armour-stand-ticking.patchAllow-spawning-Item-entities-with-World.spawnEntity.patchAllow-specifying-a-custom-authentication-servers-dow.patchAnvilDamageEvent.patchAsyncTabCompleteEvent.patchBlock-Enderpearl-Travel-Exploit.patchBreak-up-and-make-tab-spam-limits-configurable.patchCall-PaperServerListPingEvent-for-legacy-pings.patchConfigurable-Alternative-LootPool-Luck-Formula.patchConfigurable-speed-for-water-flowing-over-lava.patchConfigurable-sprint-interruption-on-attack.patchDisable-Explicit-Network-Manager-Flushing.patchDon-t-call-getItemMeta-on-hasItemMeta.patchEnderDragon-Events.patchEnderman.teleportRandomly.patchEndermanAttackPlayerEvent.patchEndermanEscapeEvent.patchExpand-Explosions-API.patchExpand-World.spawnParticle-API-and-add-Builder.patchExpose-client-protocol-version-and-virtual-host.patchExtend-Player-Interact-cancellation.patchFill-Profile-Property-Events.patchFix-CraftEntity-hashCode.patchFix-MC-117075-TE-Unload-Lag-Spike.patchFix-NBT-type-issues.patchFix-exploit-that-allowed-colored-signs-to-be-created.patchFlag-to-disable-the-channel-limit.patchHandle-plugin-prefixes-using-Log4J-configuration.patchImplement-EntityKnockbackByEntityEvent-and-EntityPus.patchImplement-EntityTeleportEndGatewayEvent.patchImplement-Expanded-ArmorStand-API.patchImplement-World.getEntity-UUID-API.patchImplement-extended-PaperServerListPingEvent.patchImprove-BlockPosition-inlining.patchImprove-EntityShootBowEvent.patchImprove-Log4J-Configuration-Plugin-Loggers.patchImproved-Async-Task-Scheduler.patchInventoryCloseEvent-Reason-API.patchItemStack-getMaxItemUseDuration.patchLivingEntity-Hand-Raised-Item-Use-API.patchMake-legacy-ping-handler-more-reliable.patchMake-shield-blocking-delay-configurable.patchOcelot-despawns-should-honor-nametags-and-leash.patchOptimize-BlockPosition-helper-methods.patchOptimize-CraftBlockData-Creation.patchOptimize-MappedRegistry.patchOption-to-prevent-armor-stands-from-doing-entity-loo.patchPlayer.setPlayerProfile-API.patchPlayerAdvancementCriterionGrantEvent.patchPlayerElytraBoostEvent.patchPlayerLaunchProjectileEvent.patchPlayerNaturallySpawnCreaturesEvent.patchPlayerPickupExperienceEvent.patchPlayerReadyArrowEvent.patchPreCreatureSpawnEvent.patchPrevent-Frosted-Ice-from-loading-holding-chunks.patchPrevent-logins-from-being-processed-when-the-player-.patchPrint-Error-details-when-failing-to-save-player-data.patchRangedEntity-API.patchRefresh-player-inventory-when-cancelling-PlayerInter.patchRemove-unnecessary-itemmeta-handling.patchReset-spawner-timer-when-spawner-event-is-cancelled.patchRestore-vanilla-default-mob-spawn-range-and-water-an.patchSend-attack-SoundEffects-only-to-players-who-can-see.patchSkeletonHorse-Additions.patchSlime-Pathfinder-Events.patchTameable-getOwnerUniqueId-API.patchToggleable-player-crits-helps-mitigate-hacked-client.patchUnset-Ignited-flag-on-cancel-of-Explosion-Event.patchUse-AsyncAppender-to-keep-logging-IO-off-main-thread.patchUse-ConcurrentHashMap-in-JsonList.patchUse-a-Queue-for-Queueing-Commands.patchVanished-players-don-t-have-rights.patchVex-get-setSummoner-API.patchWitchConsumePotionEvent.patchWitchReadyPotionEvent.patchWitchThrowPotionEvent.patchadd-more-information-to-Entity.toString.patchgetPlayerUniqueId-API.patchhandle-ServerboundKeepAlivePacket-async.patchrevert-serverside-behavior-of-keepalives.patchuse-CB-BlockState-implementations-for-captured-block.patch
|
@ -9,4 +9,3 @@
|
|||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
|
||||
minecraft net.minecraft.WorldVersion
|
||||
|
|
|
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.updateStatusIcon(this.status);
|
||||
this.status = this.buildServerStatus();
|
||||
|
||||
// Spigot start
|
||||
+ org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
|
@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
return entitysize.scale(f);
|
||||
return (double) this.getEyeHeight();
|
||||
}
|
||||
|
||||
+ // Paper start
|
|
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
|
||||
|
||||
if (this.equipmentHasChanged(itemstack, itemstack1)) {
|
|
@ -20,5 +20,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Item.byBlock(net.minecraft.world.level.block.Blocks.DIRT)));
|
||||
+ // Paper end
|
||||
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
BlockPos pos = BlockPos.containing(x, y, z);
|
||||
entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));
|
|
@ -36,7 +36,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
protected void readAdditionalSaveData(CompoundTag nbt) {
|
||||
if (nbt.hasUUID("Owner")) {
|
||||
this.ownerUUID = nbt.getUUID("Owner");
|
|
@ -34,26 +34,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.teleport();
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
flag1 = flag && this.hurtWithCleanWater(source, (ThrownPotion) source.getDirectEntity(), amount);
|
||||
|
||||
+ if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.teleport()) {
|
||||
return true;
|
||||
+ if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.teleport()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+ } // Paper end
|
||||
|
||||
return flag1;
|
||||
}
|
||||
+ } // Paper end
|
||||
|
||||
return flag;
|
||||
} else {
|
||||
boolean flag1 = super.hurt(source, amount);
|
||||
|
||||
- if (!this.level.isClientSide() && !(source.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0) {
|
||||
+ if (!this.level.isClientSide() && !(source.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0 && this.tryEscape(source == DamageSource.DROWN ? com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.DROWN : com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - use to be critical hits as else, but mojang removed critical hits in 1.16.2 due to MC-185684
|
||||
this.teleport();
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
} else {
|
||||
if (this.target != null && !this.enderman.isPassenger()) {
|
|
@ -36,16 +36,16 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
d0 = (Math.random() - Math.random()) * 0.01D;
|
||||
}
|
||||
|
||||
this.hurtDir = (float) (Mth.atan2(d1, d0) * 57.2957763671875D - (double) this.getYRot());
|
||||
- this.knockback(0.4000000059604645D, d0, d1);
|
||||
+ this.knockback(0.4000000059604645D, d0, d1, entity1); // Paper
|
||||
} else {
|
||||
this.hurtDir = (float) ((int) (Math.random() * 2.0D) * 180);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
if (!flag) {
|
||||
this.indicateDamage(d0, d1);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void blockedByShield(LivingEntity target) {
|
||||
|
@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
private boolean checkTotemDeathProtection(DamageSource source) {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
public void knockback(double strength, double x, double z) {
|
||||
|
@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE);
|
||||
if (strength > 0.0D) {
|
||||
this.hasImpulse = true;
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
|
||||
|
||||
this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z);
|
||||
|
@ -86,7 +86,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity {
|
||||
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
if (flag) {
|
||||
if (f1 > 0.0F && target instanceof LivingEntity) {
|
||||
|
@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class RamTarget extends Behavior<Goat> {
|
||||
float f = 0.25F * (float)(i - j);
|
||||
float g = Mth.clamp(entity.getSpeed() * 1.65F, 0.2F, 3.0F) + f;
|
||||
float h = livingEntity.isDamageSourceBlocked(DamageSource.mobAttack(entity)) ? 0.5F : 1.0F;
|
||||
float h = livingEntity.isDamageSourceBlocked(world.damageSources().mobAttack(entity)) ? 0.5F : 1.0F;
|
||||
- livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z());
|
||||
+ livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z(), entity); // Paper
|
||||
this.finishRam(world, entity);
|
||||
|
@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
@@ -0,0 +0,0 @@ public class SonicBoom extends Behavior<Warden> {
|
||||
target.hurt(DamageSource.sonicBoom(entity), 10.0F);
|
||||
target.hurt(world.damageSources().sonicBoom(entity), 10.0F);
|
||||
double d = 0.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
double e = 2.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
- target.push(vec33.x() * e, vec33.y() * d, vec33.z() * e);
|
||||
|
@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D);
|
||||
+ entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D, this); // Paper
|
||||
if (!this.phaseManager.getCurrentPhase().isSitting() && ((LivingEntity) entity).getLastHurtByMobTimestamp() < entity.tickCount - 2) {
|
||||
entity.hurt(DamageSource.mobAttack(this), 5.0F);
|
||||
entity.hurt(this.damageSources().mobAttack(this), 5.0F);
|
||||
this.doEnchantDamageEffects(this, entity);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -179,9 +179,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity {
|
||||
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
||||
// CraftBukkit start - Only apply knockback if the damage hits
|
||||
if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) {
|
||||
if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) {
|
||||
- entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)));
|
||||
+ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper
|
||||
+ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Pa
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
|
@ -174,27 +174,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.util.GsonHelper;
|
||||
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
|
||||
|
||||
public class ClientboundStatusResponsePacket implements Packet<ClientStatusPacketListener> {
|
||||
- private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory()).create();
|
||||
+ private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory())
|
||||
+ .registerTypeAdapter(io.papermc.paper.adventure.AdventureComponent.class, new io.papermc.paper.adventure.AdventureComponent.Serializer())
|
||||
+ .create();
|
||||
private final ServerStatus status;
|
||||
|
||||
public ClientboundStatusResponsePacket(ServerStatus metadata) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
+import co.aikar.timings.Timings;
|
||||
|
@ -204,14 +189,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.lastServerStatus = i;
|
||||
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
|
||||
if (!this.hidesOnlinePlayers()) {
|
||||
- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)];
|
||||
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
|
||||
int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length);
|
||||
if (this.hidesOnlinePlayers()) {
|
||||
return new ServerStatus.Players(i, list.size(), List.of());
|
||||
} else {
|
||||
- int j = Math.min(list.size(), 12);
|
||||
+ int j = Math.min(list.size(), org.spigotmc.SpigotConfig.playerSample); // Paper
|
||||
ObjectArrayList<GameProfile> objectarraylist = new ObjectArrayList(j);
|
||||
int k = Mth.nextInt(this.random, 0, list.size() - j);
|
||||
|
||||
for (int k = 0; k < agameprofile.length; ++k) {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
|
@ -223,8 +208,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper start - Replace everything
|
||||
+ /*
|
||||
// CraftBukkit start
|
||||
// this.connection.send(new PacketStatusOutServerInfo(this.server.getStatus()));
|
||||
final Object[] players = this.server.getPlayerList().players.toArray();
|
||||
// this.connection.send(new PacketStatusOutServerInfo(this.status));
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
@@ -0,0 +0,0 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
|
||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (this.isUsingItem() && !this.useItem.isEmpty()) {
|
||||
Item item = this.useItem.getItem();
|
||||
|
|
@ -8,6 +8,19 @@ This can be useful for changing name or skins after a player has logged in.
|
|||
== AT ==
|
||||
public-f net.minecraft.world.entity.player.Player gameProfile
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet());
|
||||
}
|
||||
|
||||
- private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) {
|
||||
+ public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
|
||||
// CraftBukkit start
|
||||
if (Float.isNaN(f)) {
|
||||
f = 0;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
|
@ -66,8 +79,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public InetSocketAddress getAddress() {
|
||||
if (this.getHandle().connection == null) return null;
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.hiddenEntities.put(entity.getUniqueId(), hidingPlugins);
|
||||
|
||||
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
|
||||
// Remove this entity from the hidden player's EntityTrackerEntry
|
||||
- ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
|
||||
+ // Paper start
|
||||
|
@ -90,28 +103,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
this.hiddenEntities.remove(entity.getUniqueId());
|
||||
|
||||
- ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
|
||||
+ // Paper start
|
||||
Entity other = ((CraftEntity) entity).getHandle();
|
||||
+ registerEntity(other);
|
||||
+
|
||||
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||
+ }
|
||||
+ private void registerEntity(Entity other) {
|
||||
+ ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
|
||||
+ // Paper end
|
||||
|
||||
if (other instanceof ServerPlayer) {
|
||||
ServerPlayer otherPlayer = (ServerPlayer) other;
|
||||
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
|
||||
entry.updatePlayer(this.getHandle());
|
||||
}
|
||||
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper
|
||||
+ }
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
|
@ -130,22 +127,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ bukkitPlayer.unregisterEntity(self);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||
+
|
||||
+ // Set the game profile here, we should have unregistered the entity via iterating all player entities above.
|
||||
+ self.gameProfile = gameProfile;
|
||||
+
|
||||
|
||||
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||
+ // Re-register the game profile for all players
|
||||
+ for (ServerPlayer player : players) {
|
||||
+ CraftPlayer bukkitPlayer = player.getBukkitEntity();
|
||||
+ if (bukkitPlayer.canSee(this)) {
|
||||
+ bukkitPlayer.registerEntity(self);
|
||||
+ bukkitPlayer.trackAndShowEntity(self);
|
||||
+ }
|
||||
+ }
|
||||
+ // Refresh misc player things AFTER sending game profile
|
||||
+ this.refreshPlayer();
|
||||
}
|
||||
|
||||
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.trackAndShowEntity(entity);
|
||||
}
|
||||
}
|
||||
+ // Paper start
|
||||
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
|
||||
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone();
|
||||
+ }
|
||||
|
@ -160,7 +163,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ ServerLevel worldserver = handle.getLevel();
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), net.minecraft.world.level.biome.BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation()));
|
||||
+ handle.onUpdateAbilities();
|
||||
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false);
|
||||
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet());
|
||||
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
|
||||
+
|
||||
+ if (this.isOp()) {
|
||||
|
@ -169,10 +172,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
public void onEntityRemove(Entity entity) {
|
||||
this.hiddenEntities.remove(entity.getUUID());
|
||||
}
|
||||
this.invertedVisibilityEntities.remove(entity.getUUID());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
|
@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
+import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||
// CraftBukkit end
|
||||
public boolean isRealPlayer; // Paper
|
|
@ -85,8 +85,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy {
|
||||
}
|
||||
|
||||
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.slime.getYRot(), this.slime.isDealsDamage());
|
||||
}
|
||||
+
|
||||
+ // Paper start - clear timer and target when goal resets
|
||||
|
@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.chosenDegrees, false);
|
||||
MoveControl controllermove = this.slime.getMoveControl();
|
||||
@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy {
|
||||
|
||||
@Override
|
||||
|
@ -129,7 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy {
|
||||
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setWantedMovement(1.0D);
|
||||
|
||||
}
|
||||
}
|
||||
+
|
|
@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
|
||||
runtimeOnly("mysql:mysql-connector-java:8.0.29")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
|
||||
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
|
@ -8,21 +8,22 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity {
|
||||
if (!entity.isSpectator() && entity.isAlive() && entity.isPickable()) {
|
||||
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
} else {
|
||||
Entity entity1 = this.getOwner();
|
||||
|
||||
+ // Paper start - Cancel hit for vanished players
|
||||
+ if (entity1 instanceof net.minecraft.server.level.ServerPlayer && entity instanceof net.minecraft.server.level.ServerPlayer) {
|
||||
+ org.bukkit.entity.Player collided = (org.bukkit.entity.Player) entity.getBukkitEntity();
|
||||
+ org.bukkit.entity.Player shooter = (org.bukkit.entity.Player) entity1.getBukkitEntity();
|
||||
+ if (!shooter.canSee(collided)) return false;
|
||||
+ if (!shooter.canSee(collided)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
|
||||
+ // Paper end
|
||||
} else {
|
||||
return false;
|
||||
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
Loading…
Add table
Reference in a new issue