@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -147,6 +147,35 @@
|
||||
@@ -148,6 +148,35 @@
|
||||
import net.minecraft.world.scores.criteria.IScoreboardCriteria;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
public class EntityPlayer extends EntityHuman {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -201,6 +230,21 @@
|
||||
@@ -202,6 +231,21 @@
|
||||
public int latency;
|
||||
public boolean wonGame;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, @Nullable ProfilePublicKey profilepublickey) {
|
||||
super(worldserver, worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle(), gameprofile, profilepublickey);
|
||||
this.chatVisibility = EnumChatVisibility.FULL;
|
||||
@@ -263,12 +307,56 @@
|
||||
@@ -264,12 +308,56 @@
|
||||
this.advancements = minecraftserver.getPlayerList().getPlayerAdvancements(this);
|
||||
this.maxUpStep = 1.0F;
|
||||
this.fudgeSpawnLocation(worldserver);
|
||||
@@ -116,7 +116,7 @@
|
||||
int i = Math.max(0, this.server.getSpawnRadius(worldserver));
|
||||
int j = MathHelper.floor(worldserver.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
|
||||
|
||||
@@ -326,17 +414,26 @@
|
||||
@@ -327,17 +415,26 @@
|
||||
if (nbttagcompound.contains("recipeBook", 10)) {
|
||||
this.recipeBook.fromNbt(nbttagcompound.getCompound("recipeBook"), this.server.getRecipeManager());
|
||||
}
|
||||
@@ -144,7 +144,7 @@
|
||||
Logger logger = EntityPlayer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -363,7 +460,20 @@
|
||||
@@ -364,7 +461,20 @@
|
||||
Entity entity = this.getRootVehicle();
|
||||
Entity entity1 = this.getVehicle();
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
||||
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
|
||||
|
||||
@@ -381,7 +491,7 @@
|
||||
@@ -382,7 +492,7 @@
|
||||
nbttagcompound.putInt("SpawnZ", this.respawnPosition.getZ());
|
||||
nbttagcompound.putBoolean("SpawnForced", this.respawnForced);
|
||||
nbttagcompound.putFloat("SpawnAngle", this.respawnAngle);
|
||||
@@ -175,7 +175,7 @@
|
||||
Logger logger = EntityPlayer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -389,8 +499,32 @@
|
||||
@@ -390,8 +500,32 @@
|
||||
nbttagcompound.put("SpawnDimension", nbtbase);
|
||||
});
|
||||
}
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
public void setExperiencePoints(int i) {
|
||||
float f = (float) this.getXpNeededForNextLevel();
|
||||
@@ -450,6 +584,11 @@
|
||||
@@ -451,6 +585,11 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -220,7 +220,7 @@
|
||||
this.gameMode.tick();
|
||||
--this.spawnInvulnerableTime;
|
||||
if (this.invulnerableTime > 0) {
|
||||
@@ -505,7 +644,7 @@
|
||||
@@ -506,7 +645,7 @@
|
||||
}
|
||||
|
||||
if (this.getHealth() != this.lastSentHealth || this.lastSentFood != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastFoodSaturationZero) {
|
||||
@@ -229,7 +229,7 @@
|
||||
this.lastSentHealth = this.getHealth();
|
||||
this.lastSentFood = this.foodData.getFoodLevel();
|
||||
this.lastFoodSaturationZero = this.foodData.getSaturationLevel() == 0.0F;
|
||||
@@ -536,6 +675,12 @@
|
||||
@@ -537,6 +676,12 @@
|
||||
this.updateScoreForCriteria(IScoreboardCriteria.EXPERIENCE, MathHelper.ceil((float) this.lastRecordedExperience));
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
if (this.experienceLevel != this.lastRecordedLevel) {
|
||||
this.lastRecordedLevel = this.experienceLevel;
|
||||
this.updateScoreForCriteria(IScoreboardCriteria.LEVEL, MathHelper.ceil((float) this.lastRecordedLevel));
|
||||
@@ -550,6 +695,20 @@
|
||||
@@ -551,6 +696,20 @@
|
||||
CriterionTriggers.LOCATION.trigger(this);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking player");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Player being ticked");
|
||||
@@ -592,7 +751,8 @@
|
||||
@@ -593,7 +752,8 @@
|
||||
}
|
||||
|
||||
private void updateScoreForCriteria(IScoreboardCriteria iscoreboardcriteria, int i) {
|
||||
@@ -273,7 +273,7 @@
|
||||
scoreboardscore.setScore(i);
|
||||
});
|
||||
}
|
||||
@@ -601,9 +761,47 @@
|
||||
@@ -602,9 +762,47 @@
|
||||
public void die(DamageSource damagesource) {
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||
@@ -321,9 +321,9 @@
|
||||
+ ichatbasecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromStringOrNull(deathMessage);
|
||||
+ }
|
||||
|
||||
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), (future) -> {
|
||||
if (!future.isSuccess()) {
|
||||
@@ -637,12 +835,18 @@
|
||||
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> {
|
||||
boolean flag1 = true;
|
||||
@@ -635,12 +833,18 @@
|
||||
if (this.level.getGameRules().getBoolean(GameRules.RULE_FORGIVE_DEAD_PLAYERS)) {
|
||||
this.tellNeutralMobsThatIDied();
|
||||
}
|
||||
@@ -346,7 +346,7 @@
|
||||
EntityLiving entityliving = this.getKillCredit();
|
||||
|
||||
if (entityliving != null) {
|
||||
@@ -680,10 +884,12 @@
|
||||
@@ -678,10 +882,12 @@
|
||||
String s = this.getScoreboardName();
|
||||
String s1 = entity.getScoreboardName();
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
} else {
|
||||
this.awardStat(StatisticList.MOB_KILLS);
|
||||
}
|
||||
@@ -701,7 +907,8 @@
|
||||
@@ -699,7 +905,8 @@
|
||||
int i = scoreboardteam.getColor().getId();
|
||||
|
||||
if (i >= 0 && i < aiscoreboardcriteria.length) {
|
||||
@@ -371,7 +371,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,18 +952,20 @@
|
||||
@@ -743,18 +950,20 @@
|
||||
}
|
||||
|
||||
private boolean isPvpAllowed() {
|
||||
@@ -395,7 +395,7 @@
|
||||
} else {
|
||||
return shapedetectorshape;
|
||||
}
|
||||
@@ -765,11 +974,20 @@
|
||||
@@ -763,11 +972,20 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
@@ -419,7 +419,7 @@
|
||||
this.unRide();
|
||||
this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
if (!this.wonGame) {
|
||||
@@ -780,6 +998,8 @@
|
||||
@@ -778,6 +996,8 @@
|
||||
|
||||
return this;
|
||||
} else {
|
||||
@@ -428,7 +428,7 @@
|
||||
WorldData worlddata = worldserver.getLevelData();
|
||||
|
||||
this.connection.send(new PacketPlayOutRespawn(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true, this.getLastDeathLocation()));
|
||||
@@ -789,22 +1009,52 @@
|
||||
@@ -787,22 +1007,52 @@
|
||||
playerlist.sendPlayerPermissionLevel(this);
|
||||
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
this.unsetRemoved();
|
||||
@@ -487,7 +487,7 @@
|
||||
worldserver1.getProfiler().pop();
|
||||
this.triggerDimensionChangeTriggers(worldserver1);
|
||||
this.connection.send(new PacketPlayOutAbilities(this.getAbilities()));
|
||||
@@ -822,12 +1072,31 @@
|
||||
@@ -820,12 +1070,31 @@
|
||||
this.lastSentExp = -1;
|
||||
this.lastSentHealth = -1.0F;
|
||||
this.lastSentFood = -1;
|
||||
@@ -519,7 +519,7 @@
|
||||
private void createEndPlatform(WorldServer worldserver, BlockPosition blockposition) {
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
||||
|
||||
@@ -844,17 +1113,17 @@
|
||||
@@ -842,17 +1111,17 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -542,7 +542,7 @@
|
||||
}
|
||||
|
||||
return optional1;
|
||||
@@ -864,13 +1133,21 @@
|
||||
@@ -862,13 +1131,21 @@
|
||||
public void triggerDimensionChangeTriggers(WorldServer worldserver) {
|
||||
ResourceKey<World> resourcekey = worldserver.dimension();
|
||||
ResourceKey<World> resourcekey1 = this.level.dimension();
|
||||
@@ -567,7 +567,7 @@
|
||||
this.enteredNetherPosition = null;
|
||||
}
|
||||
|
||||
@@ -887,12 +1164,10 @@
|
||||
@@ -885,12 +1162,10 @@
|
||||
this.containerMenu.broadcastChanges();
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@
|
||||
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
|
||||
} else if (!this.bedInRange(blockposition, enumdirection)) {
|
||||
return Either.left(EntityHuman.EnumBedResult.TOO_FAR_AWAY);
|
||||
@@ -916,7 +1191,36 @@
|
||||
@@ -914,7 +1189,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@
|
||||
this.awardStat(StatisticList.SLEEP_IN_BED);
|
||||
CriterionTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
@@ -929,9 +1233,8 @@
|
||||
@@ -927,9 +1231,8 @@
|
||||
return either;
|
||||
}
|
||||
}
|
||||
@@ -632,7 +632,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -958,6 +1261,24 @@
|
||||
@@ -956,6 +1259,24 @@
|
||||
|
||||
@Override
|
||||
public void stopSleepInBed(boolean flag, boolean flag1) {
|
||||
@@ -657,7 +657,7 @@
|
||||
if (this.isSleeping()) {
|
||||
this.getLevel().getChunkSource().broadcastAndSend(this, new PacketPlayOutAnimation(this, 2));
|
||||
}
|
||||
@@ -1039,8 +1360,9 @@
|
||||
@@ -1037,8 +1358,9 @@
|
||||
this.connection.send(new PacketPlayOutOpenSignEditor(tileentitysign.getBlockPos()));
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1048,13 +1370,35 @@
|
||||
@@ -1046,13 +1368,35 @@
|
||||
if (itileinventory == null) {
|
||||
return OptionalInt.empty();
|
||||
} else {
|
||||
@@ -704,7 +704,7 @@
|
||||
if (container == null) {
|
||||
if (this.isSpectator()) {
|
||||
this.displayClientMessage(IChatBaseComponent.translatable("container.spectatorCantOpen").withStyle(EnumChatFormat.RED), true);
|
||||
@@ -1062,9 +1406,11 @@
|
||||
@@ -1060,9 +1404,11 @@
|
||||
|
||||
return OptionalInt.empty();
|
||||
} else {
|
||||
@@ -718,7 +718,7 @@
|
||||
return OptionalInt.of(this.containerCounter);
|
||||
}
|
||||
}
|
||||
@@ -1077,13 +1423,24 @@
|
||||
@@ -1075,13 +1421,24 @@
|
||||
|
||||
@Override
|
||||
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
|
||||
@@ -745,7 +745,7 @@
|
||||
this.initMenu(this.containerMenu);
|
||||
}
|
||||
|
||||
@@ -1106,6 +1463,7 @@
|
||||
@@ -1104,6 +1461,7 @@
|
||||
|
||||
@Override
|
||||
public void closeContainer() {
|
||||
@@ -753,7 +753,7 @@
|
||||
this.connection.send(new PacketPlayOutCloseWindow(this.containerMenu.containerId));
|
||||
this.doCloseContainer();
|
||||
}
|
||||
@@ -1135,7 +1493,7 @@
|
||||
@@ -1133,7 +1491,7 @@
|
||||
@Override
|
||||
public void awardStat(Statistic<?> statistic, int i) {
|
||||
this.stats.increment(this, statistic, i);
|
||||
@@ -762,7 +762,7 @@
|
||||
scoreboardscore.add(i);
|
||||
});
|
||||
}
|
||||
@@ -1143,7 +1501,7 @@
|
||||
@@ -1141,7 +1499,7 @@
|
||||
@Override
|
||||
public void resetStat(Statistic<?> statistic) {
|
||||
this.stats.setValue(this, statistic, 0);
|
||||
@@ -771,7 +771,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1159,7 +1517,7 @@
|
||||
@@ -1157,7 +1515,7 @@
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
MinecraftKey minecraftkey = aminecraftkey1[j];
|
||||
@@ -780,7 +780,7 @@
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
optional.ifPresent(list::add);
|
||||
@@ -1194,6 +1552,7 @@
|
||||
@@ -1192,6 +1550,7 @@
|
||||
|
||||
public void resetSentInfo() {
|
||||
this.lastSentHealth = -1.0E8F;
|
||||
@@ -788,7 +788,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1249,7 +1608,7 @@
|
||||
@@ -1247,7 +1606,7 @@
|
||||
this.lastSentExp = -1;
|
||||
this.lastSentHealth = -1.0F;
|
||||
this.lastSentFood = -1;
|
||||
@@ -797,7 +797,7 @@
|
||||
this.seenCredits = entityplayer.seenCredits;
|
||||
this.enteredNetherPosition = entityplayer.enteredNetherPosition;
|
||||
this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft());
|
||||
@@ -1397,7 +1756,20 @@
|
||||
@@ -1390,7 +1749,20 @@
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -818,7 +818,7 @@
|
||||
this.chatVisibility = packetplayinsettings.chatVisibility();
|
||||
this.canChatColor = packetplayinsettings.chatColors();
|
||||
this.textFilteringEnabled = packetplayinsettings.textFilteringEnabled();
|
||||
@@ -1472,7 +1844,7 @@
|
||||
@@ -1461,7 +1833,7 @@
|
||||
this.camera = (Entity) (entity == null ? this : entity);
|
||||
if (entity1 != this.camera) {
|
||||
this.connection.send(new PacketPlayOutCamera(this.camera));
|
||||
@@ -827,7 +827,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1501,7 +1873,7 @@
|
||||
@@ -1490,7 +1862,7 @@
|
||||
|
||||
@Nullable
|
||||
public IChatBaseComponent getTabListDisplayName() {
|
||||
@@ -836,7 +836,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1522,9 +1894,16 @@
|
||||
@@ -1511,9 +1883,16 @@
|
||||
return this.advancements;
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@
|
||||
if (worldserver == this.level) {
|
||||
this.connection.teleport(d0, d1, d2, f, f1);
|
||||
} else {
|
||||
@@ -1544,6 +1923,9 @@
|
||||
@@ -1533,6 +1912,9 @@
|
||||
this.server.getPlayerList().sendLevelInfo(this, worldserver);
|
||||
this.server.getPlayerList().sendAllPlayerInfo(this);
|
||||
}
|
||||
@@ -863,7 +863,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1713,4 +2095,146 @@
|
||||
@@ -1702,4 +2084,146 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user