mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
More more more patches
This commit is contained in:
parent
c02edac0c7
commit
8f5ec00c38
98 changed files with 82 additions and 102 deletions
|
@ -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,8 +34,8 @@ 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) {
|
||||
|
@ -45,15 +45,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
+ } // 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();
|
||||
return flag1;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
if (!flag) {
|
||||
this.indicateDamage(d0, d1);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -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,20 +8,21 @@ 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
|
Loading…
Reference in a new issue