@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ChunkProviderServer.java
|
||||
+++ b/net/minecraft/server/level/ChunkProviderServer.java
|
||||
@@ -85,6 +85,16 @@
|
||||
@@ -83,6 +83,16 @@
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
@Override
|
||||
public LightEngineThreaded getLightEngine() {
|
||||
return this.lightEngine;
|
||||
@@ -129,7 +139,7 @@
|
||||
@@ -127,7 +137,7 @@
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
if (k == this.lastChunkPos[l] && chunkstatus == this.lastChunkStatus[l]) {
|
||||
ichunkaccess = this.lastChunk[l];
|
||||
@@ -26,7 +26,7 @@
|
||||
return ichunkaccess;
|
||||
}
|
||||
}
|
||||
@@ -177,12 +187,12 @@
|
||||
@@ -175,12 +185,12 @@
|
||||
if (playerchunk == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
if (ichunkaccess1 != null) {
|
||||
this.storeInCache(k, ichunkaccess1, ChunkStatus.FULL);
|
||||
@@ -230,7 +240,15 @@
|
||||
@@ -228,7 +238,15 @@
|
||||
int l = ChunkLevel.byStatus(chunkstatus);
|
||||
PlayerChunk playerchunk = this.getVisibleChunkIfPresent(k);
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
||||
if (this.chunkAbsent(playerchunk, l)) {
|
||||
GameProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||
@@ -249,7 +267,7 @@
|
||||
@@ -247,7 +265,7 @@
|
||||
}
|
||||
|
||||
private boolean chunkAbsent(@Nullable PlayerChunk playerchunk, int i) {
|
||||
@@ -67,7 +67,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -317,7 +335,7 @@
|
||||
@@ -315,7 +333,7 @@
|
||||
} else if (!this.level.shouldTickBlocksAt(i)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
return either != null && either.left().isPresent();
|
||||
}
|
||||
@@ -330,11 +348,31 @@
|
||||
@@ -328,11 +346,31 @@
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
@@ -109,25 +109,21 @@
|
||||
@Override
|
||||
public void tick(BooleanSupplier booleansupplier, boolean flag) {
|
||||
this.level.getProfiler().push("purge");
|
||||
@@ -366,7 +404,7 @@
|
||||
@@ -379,11 +417,11 @@
|
||||
|
||||
gameprofilerfiller.push("pollingChunks");
|
||||
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
|
||||
- boolean flag1 = worlddata.getGameTime() % 400L == 0L;
|
||||
+ boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
gameprofilerfiller.popPush("spawnAndTick");
|
||||
- boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING);
|
||||
+ boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||
|
||||
gameprofilerfiller.push("naturalSpawnCount");
|
||||
int l = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
@@ -387,7 +425,7 @@
|
||||
}
|
||||
SystemUtils.shuffle(list, this.level.random);
|
||||
int l = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
|
||||
- boolean flag1 = this.level.getLevelData().getGameTime() % 400L == 0L;
|
||||
+ boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
|
||||
Iterator iterator1 = list.iterator();
|
||||
|
||||
gameprofilerfiller.popPush("spawnAndTick");
|
||||
- boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING);
|
||||
+ boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !level.players().isEmpty(); // CraftBukkit
|
||||
|
||||
Collections.shuffle(list);
|
||||
Iterator iterator1 = list.iterator();
|
||||
@@ -592,13 +630,19 @@
|
||||
while (iterator1.hasNext()) {
|
||||
@@ -586,13 +624,19 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -151,6 +151,37 @@
|
||||
@@ -157,6 +157,38 @@
|
||||
import net.minecraft.world.scores.criteria.IScoreboardCriteria;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.util.CraftDimensionUtil;
|
||||
+import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
+import org.bukkit.event.entity.EntityExhaustionEvent;
|
||||
+import org.bukkit.event.player.PlayerBedLeaveEvent;
|
||||
+import org.bukkit.event.player.PlayerChangedMainHandEvent;
|
||||
+import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
@@ -38,7 +39,7 @@
|
||||
public class EntityPlayer extends EntityHuman {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -185,7 +216,7 @@
|
||||
@@ -192,7 +224,7 @@
|
||||
private int levitationStartTime;
|
||||
private boolean disconnected;
|
||||
private int requestedViewDistance;
|
||||
@@ -47,7 +48,7 @@
|
||||
@Nullable
|
||||
private Vec3D startingToFallPosition;
|
||||
@Nullable
|
||||
@@ -210,6 +241,20 @@
|
||||
@@ -217,6 +249,20 @@
|
||||
private int containerCounter;
|
||||
public boolean wonGame;
|
||||
|
||||
@@ -68,7 +69,7 @@
|
||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, ClientInformation clientinformation) {
|
||||
super(worldserver, worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle(), gameprofile);
|
||||
this.chatVisibility = EnumChatVisibility.FULL;
|
||||
@@ -276,12 +321,56 @@
|
||||
@@ -283,12 +329,56 @@
|
||||
this.setMaxUpStep(1.0F);
|
||||
this.fudgeSpawnLocation(worldserver);
|
||||
this.updateOptions(clientinformation);
|
||||
@@ -77,8 +78,8 @@
|
||||
+ this.displayName = this.getScoreboardName();
|
||||
+ this.bukkitPickUpLoot = true;
|
||||
+ this.maxHealthCache = this.getMaxHealth();
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ // Yes, this doesn't match Vanilla, but it's the best we can do for now.
|
||||
+ // If this is an issue, PRs are welcome
|
||||
+ public final BlockPosition getSpawnPoint(WorldServer worldserver) {
|
||||
@@ -115,9 +116,9 @@
|
||||
+ }
|
||||
+
|
||||
+ return blockposition;
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
private void fudgeSpawnLocation(WorldServer worldserver) {
|
||||
BlockPosition blockposition = worldserver.getSharedSpawnPos();
|
||||
|
||||
@@ -126,7 +127,7 @@
|
||||
int i = Math.max(0, this.server.getSpawnRadius(worldserver));
|
||||
int j = MathHelper.floor(worldserver.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
|
||||
|
||||
@@ -330,7 +419,7 @@
|
||||
@@ -337,7 +427,7 @@
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.readAdditionalSaveData(nbttagcompound);
|
||||
if (nbttagcompound.contains("warden_spawn_tracker", 10)) {
|
||||
@@ -135,7 +136,7 @@
|
||||
Logger logger = EntityPlayer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -349,17 +438,26 @@
|
||||
@@ -356,17 +446,26 @@
|
||||
if (nbttagcompound.contains("recipeBook", 10)) {
|
||||
this.recipeBook.fromNbt(nbttagcompound.getCompound("recipeBook"), this.server.getRecipeManager());
|
||||
}
|
||||
@@ -163,7 +164,7 @@
|
||||
Logger logger1 = EntityPlayer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger1);
|
||||
@@ -372,7 +470,7 @@
|
||||
@@ -379,7 +478,7 @@
|
||||
@Override
|
||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.addAdditionalSaveData(nbttagcompound);
|
||||
@@ -172,7 +173,7 @@
|
||||
Logger logger = EntityPlayer.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -393,7 +491,20 @@
|
||||
@@ -400,7 +499,20 @@
|
||||
Entity entity = this.getRootVehicle();
|
||||
Entity entity1 = this.getVehicle();
|
||||
|
||||
@@ -194,7 +195,7 @@
|
||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
||||
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
|
||||
|
||||
@@ -418,8 +529,32 @@
|
||||
@@ -425,8 +537,32 @@
|
||||
nbttagcompound.put("SpawnDimension", nbtbase);
|
||||
});
|
||||
}
|
||||
@@ -227,7 +228,7 @@
|
||||
|
||||
public void setExperiencePoints(int i) {
|
||||
float f = (float) this.getXpNeededForNextLevel();
|
||||
@@ -479,6 +614,11 @@
|
||||
@@ -486,6 +622,11 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -239,7 +240,7 @@
|
||||
this.gameMode.tick();
|
||||
this.wardenSpawnTracker.tick();
|
||||
--this.spawnInvulnerableTime;
|
||||
@@ -535,7 +675,7 @@
|
||||
@@ -542,7 +683,7 @@
|
||||
}
|
||||
|
||||
if (this.getHealth() != this.lastSentHealth || this.lastSentFood != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastFoodSaturationZero) {
|
||||
@@ -248,7 +249,7 @@
|
||||
this.lastSentHealth = this.getHealth();
|
||||
this.lastSentFood = this.foodData.getFoodLevel();
|
||||
this.lastFoodSaturationZero = this.foodData.getSaturationLevel() == 0.0F;
|
||||
@@ -566,6 +706,12 @@
|
||||
@@ -573,6 +714,12 @@
|
||||
this.updateScoreForCriteria(IScoreboardCriteria.EXPERIENCE, MathHelper.ceil((float) this.lastRecordedExperience));
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@
|
||||
if (this.experienceLevel != this.lastRecordedLevel) {
|
||||
this.lastRecordedLevel = this.experienceLevel;
|
||||
this.updateScoreForCriteria(IScoreboardCriteria.LEVEL, MathHelper.ceil((float) this.lastRecordedLevel));
|
||||
@@ -580,6 +726,20 @@
|
||||
@@ -587,6 +734,20 @@
|
||||
CriterionTriggers.LOCATION.trigger(this);
|
||||
}
|
||||
|
||||
@@ -282,17 +283,17 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking player");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Player being ticked");
|
||||
@@ -622,7 +782,8 @@
|
||||
@@ -629,7 +790,8 @@
|
||||
}
|
||||
|
||||
private void updateScoreForCriteria(IScoreboardCriteria iscoreboardcriteria, int i) {
|
||||
- this.getScoreboard().forAllObjectives(iscoreboardcriteria, this.getScoreboardName(), (scoreboardscore) -> {
|
||||
- this.getScoreboard().forAllObjectives(iscoreboardcriteria, this, (scoreaccess) -> {
|
||||
+ // CraftBukkit - Use our scores instead
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(iscoreboardcriteria, this.getScoreboardName(), (scoreboardscore) -> {
|
||||
scoreboardscore.setScore(i);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(iscoreboardcriteria, this, (scoreaccess) -> {
|
||||
scoreaccess.set(i);
|
||||
});
|
||||
}
|
||||
@@ -631,9 +792,47 @@
|
||||
@@ -638,9 +800,47 @@
|
||||
public void die(DamageSource damagesource) {
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||
@@ -342,7 +343,7 @@
|
||||
|
||||
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getId(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> {
|
||||
boolean flag1 = true;
|
||||
@@ -664,12 +863,18 @@
|
||||
@@ -671,12 +871,18 @@
|
||||
if (this.level().getGameRules().getBoolean(GameRules.RULE_FORGIVE_DEAD_PLAYERS)) {
|
||||
this.tellNeutralMobsThatIDied();
|
||||
}
|
||||
@@ -356,41 +357,41 @@
|
||||
+ this.getInventory().clearContent();
|
||||
}
|
||||
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.DEATH_COUNT, this.getScoreboardName(), ScoreboardScore::increment);
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.DEATH_COUNT, this, ScoreAccess::increment);
|
||||
+ this.setCamera(this); // Remove spectated target
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ // CraftBukkit - Get our scores instead
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.DEATH_COUNT, this.getScoreboardName(), ScoreboardScore::increment);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(IScoreboardCriteria.DEATH_COUNT, this, ScoreAccess::increment);
|
||||
EntityLiving entityliving = this.getKillCredit();
|
||||
|
||||
if (entityliving != null) {
|
||||
@@ -707,10 +912,12 @@
|
||||
String s = this.getScoreboardName();
|
||||
String s1 = entity.getScoreboardName();
|
||||
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.KILL_COUNT_ALL, s, ScoreboardScore::increment);
|
||||
@@ -711,10 +917,12 @@
|
||||
if (entity != this) {
|
||||
super.awardKillScore(entity, i, damagesource);
|
||||
this.increaseScore(i);
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.KILL_COUNT_ALL, this, ScoreAccess::increment);
|
||||
+ // CraftBukkit - Get our scores instead
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_ALL, s, ScoreboardScore::increment);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(IScoreboardCriteria.KILL_COUNT_ALL, this, ScoreAccess::increment);
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.awardStat(StatisticList.PLAYER_KILLS);
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.KILL_COUNT_PLAYERS, s, ScoreboardScore::increment);
|
||||
- this.getScoreboard().forAllObjectives(IScoreboardCriteria.KILL_COUNT_PLAYERS, this, ScoreAccess::increment);
|
||||
+ // CraftBukkit - Get our scores instead
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_PLAYERS, s, ScoreboardScore::increment);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(IScoreboardCriteria.KILL_COUNT_PLAYERS, this, ScoreAccess::increment);
|
||||
} else {
|
||||
this.awardStat(StatisticList.MOB_KILLS);
|
||||
}
|
||||
@@ -728,7 +935,8 @@
|
||||
@@ -732,7 +940,8 @@
|
||||
int i = scoreboardteam.getColor().getId();
|
||||
|
||||
if (i >= 0 && i < aiscoreboardcriteria.length) {
|
||||
- this.getScoreboard().forAllObjectives(aiscoreboardcriteria[i], s, ScoreboardScore::increment);
|
||||
- this.getScoreboard().forAllObjectives(aiscoreboardcriteria[i], scoreholder, ScoreAccess::increment);
|
||||
+ // CraftBukkit - Get our scores instead
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(aiscoreboardcriteria[i], s, ScoreboardScore::increment);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(aiscoreboardcriteria[i], scoreholder, ScoreAccess::increment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,18 +986,20 @@
|
||||
@@ -782,18 +991,20 @@
|
||||
}
|
||||
|
||||
private boolean isPvpAllowed() {
|
||||
@@ -414,7 +415,7 @@
|
||||
} else {
|
||||
return shapedetectorshape;
|
||||
}
|
||||
@@ -798,11 +1008,20 @@
|
||||
@@ -802,11 +1013,20 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
@@ -438,7 +439,7 @@
|
||||
this.unRide();
|
||||
this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
if (!this.wonGame) {
|
||||
@@ -813,6 +1032,8 @@
|
||||
@@ -817,6 +1037,8 @@
|
||||
|
||||
return this;
|
||||
} else {
|
||||
@@ -447,7 +448,7 @@
|
||||
WorldData worlddata = worldserver.getLevelData();
|
||||
|
||||
this.connection.send(new PacketPlayOutRespawn(this.createCommonSpawnInfo(worldserver), (byte) 3));
|
||||
@@ -822,20 +1043,50 @@
|
||||
@@ -826,20 +1048,50 @@
|
||||
playerlist.sendPlayerPermissionLevel(this);
|
||||
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
this.unsetRemoved();
|
||||
@@ -503,7 +504,7 @@
|
||||
this.connection.resetPosition();
|
||||
worldserver.addDuringPortalTeleport(this);
|
||||
worldserver1.getProfiler().pop();
|
||||
@@ -855,39 +1106,66 @@
|
||||
@@ -859,39 +1111,66 @@
|
||||
this.lastSentExp = -1;
|
||||
this.lastSentHealth = -1.0F;
|
||||
this.lastSentFood = -1;
|
||||
@@ -576,7 +577,7 @@
|
||||
}
|
||||
|
||||
return optional1;
|
||||
@@ -897,13 +1175,21 @@
|
||||
@@ -901,13 +1180,21 @@
|
||||
public void triggerDimensionChangeTriggers(WorldServer worldserver) {
|
||||
ResourceKey<World> resourcekey = worldserver.dimension();
|
||||
ResourceKey<World> resourcekey1 = this.level().dimension();
|
||||
@@ -601,7 +602,7 @@
|
||||
this.enteredNetherPosition = null;
|
||||
}
|
||||
|
||||
@@ -920,19 +1206,17 @@
|
||||
@@ -924,19 +1211,17 @@
|
||||
this.containerMenu.broadcastChanges();
|
||||
}
|
||||
|
||||
@@ -625,7 +626,7 @@
|
||||
if (this.level().isDay()) {
|
||||
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_NOW);
|
||||
} else {
|
||||
@@ -949,7 +1233,36 @@
|
||||
@@ -953,7 +1238,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,7 +664,7 @@
|
||||
this.awardStat(StatisticList.SLEEP_IN_BED);
|
||||
CriterionTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
@@ -962,9 +1275,8 @@
|
||||
@@ -966,9 +1280,8 @@
|
||||
return either;
|
||||
}
|
||||
}
|
||||
@@ -674,7 +675,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -991,13 +1303,31 @@
|
||||
@@ -995,13 +1308,31 @@
|
||||
|
||||
@Override
|
||||
public void stopSleepInBed(boolean flag, boolean flag1) {
|
||||
@@ -707,7 +708,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1039,8 +1369,9 @@
|
||||
@@ -1051,8 +1382,9 @@
|
||||
this.connection.send(new PacketPlayOutOpenSignEditor(tileentitysign.getBlockPos(), flag));
|
||||
}
|
||||
|
||||
@@ -718,7 +719,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1048,13 +1379,35 @@
|
||||
@@ -1060,13 +1392,35 @@
|
||||
if (itileinventory == null) {
|
||||
return OptionalInt.empty();
|
||||
} else {
|
||||
@@ -754,7 +755,7 @@
|
||||
if (container == null) {
|
||||
if (this.isSpectator()) {
|
||||
this.displayClientMessage(IChatBaseComponent.translatable("container.spectatorCantOpen").withStyle(EnumChatFormat.RED), true);
|
||||
@@ -1062,9 +1415,11 @@
|
||||
@@ -1074,9 +1428,11 @@
|
||||
|
||||
return OptionalInt.empty();
|
||||
} else {
|
||||
@@ -768,7 +769,7 @@
|
||||
return OptionalInt.of(this.containerCounter);
|
||||
}
|
||||
}
|
||||
@@ -1077,13 +1432,24 @@
|
||||
@@ -1089,13 +1445,24 @@
|
||||
|
||||
@Override
|
||||
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
|
||||
@@ -795,7 +796,7 @@
|
||||
this.initMenu(this.containerMenu);
|
||||
}
|
||||
|
||||
@@ -1106,6 +1472,7 @@
|
||||
@@ -1118,6 +1485,7 @@
|
||||
|
||||
@Override
|
||||
public void closeContainer() {
|
||||
@@ -803,7 +804,7 @@
|
||||
this.connection.send(new PacketPlayOutCloseWindow(this.containerMenu.containerId));
|
||||
this.doCloseContainer();
|
||||
}
|
||||
@@ -1128,6 +1495,16 @@
|
||||
@@ -1140,6 +1508,16 @@
|
||||
}
|
||||
|
||||
this.jumping = flag;
|
||||
@@ -820,34 +821,65 @@
|
||||
this.setShiftKeyDown(flag1);
|
||||
}
|
||||
|
||||
@@ -1136,7 +1513,7 @@
|
||||
@@ -1173,19 +1551,19 @@
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.SWIM_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.SWIM); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.isEyeInFluid(TagsFluid.WATER)) {
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.WALK_UNDER_WATER_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK_UNDERWATER); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.isInWater()) {
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.WALK_ON_WATER_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK_ON_WATER); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.onClimbable()) {
|
||||
if (d1 > 0.0D) {
|
||||
@@ -1196,13 +1574,13 @@
|
||||
if (i > 0) {
|
||||
if (this.isSprinting()) {
|
||||
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.1F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.1F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.SPRINT); // CraftBukkit - EntityExhaustionEvent
|
||||
} else if (this.isCrouching()) {
|
||||
this.awardStat(StatisticList.CROUCH_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.0F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.0F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.CROUCH); // CraftBukkit - EntityExhaustionEvent
|
||||
} else {
|
||||
this.awardStat(StatisticList.WALK_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.0F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.0F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
}
|
||||
} else if (this.isFallFlying()) {
|
||||
@@ -1245,7 +1623,7 @@
|
||||
@Override
|
||||
public void awardStat(Statistic<?> statistic, int i) {
|
||||
this.stats.increment(this, statistic, i);
|
||||
- this.getScoreboard().forAllObjectives(statistic, this.getScoreboardName(), (scoreboardscore) -> {
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(statistic, this.getScoreboardName(), (scoreboardscore) -> { // CraftBukkit - Get our scores instead
|
||||
scoreboardscore.add(i);
|
||||
- this.getScoreboard().forAllObjectives(statistic, this, (scoreaccess) -> {
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(statistic, this, (scoreaccess) -> {
|
||||
scoreaccess.add(i);
|
||||
});
|
||||
}
|
||||
@@ -1144,7 +1521,7 @@
|
||||
@@ -1253,7 +1631,7 @@
|
||||
@Override
|
||||
public void resetStat(Statistic<?> statistic) {
|
||||
this.stats.setValue(this, statistic, 0);
|
||||
- this.getScoreboard().forAllObjectives(statistic, this.getScoreboardName(), ScoreboardScore::reset);
|
||||
+ this.level().getCraftServer().getScoreboardManager().getScoreboardScores(statistic, this.getScoreboardName(), ScoreboardScore::reset); // CraftBukkit - Get our scores instead
|
||||
- this.getScoreboard().forAllObjectives(statistic, this, ScoreAccess::reset);
|
||||
+ this.level().getCraftServer().getScoreboardManager().forAllObjectives(statistic, this, ScoreAccess::reset); // CraftBukkit - Get our scores instead
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1165,7 +1542,7 @@
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
MinecraftKey minecraftkey = aminecraftkey1[j];
|
||||
- Optional optional = this.server.getRecipeManager().byKey(minecraftkey);
|
||||
+ Optional<? extends RecipeHolder<?>> optional = this.server.getRecipeManager().byKey(minecraftkey); // CraftBukkit - decompile error
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
optional.ifPresent(list::add);
|
||||
@@ -1200,6 +1577,7 @@
|
||||
@@ -1301,6 +1679,7 @@
|
||||
|
||||
public void resetSentInfo() {
|
||||
this.lastSentHealth = -1.0E8F;
|
||||
@@ -855,7 +887,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1257,7 +1635,7 @@
|
||||
@@ -1358,7 +1737,7 @@
|
||||
this.lastSentExp = -1;
|
||||
this.lastSentHealth = -1.0F;
|
||||
this.lastSentFood = -1;
|
||||
@@ -864,7 +896,7 @@
|
||||
this.seenCredits = entityplayer.seenCredits;
|
||||
this.enteredNetherPosition = entityplayer.enteredNetherPosition;
|
||||
this.chunkTrackingView = entityplayer.chunkTrackingView;
|
||||
@@ -1308,6 +1686,12 @@
|
||||
@@ -1409,6 +1788,12 @@
|
||||
|
||||
@Override
|
||||
public boolean teleportTo(WorldServer worldserver, double d0, double d1, double d2, Set<RelativeMovement> set, float f, float f1) {
|
||||
@@ -877,7 +909,7 @@
|
||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(BlockPosition.containing(d0, d1, d2));
|
||||
|
||||
worldserver.getChunkSource().addRegionTicket(TicketType.POST_TELEPORT, chunkcoordintpair, 1, this.getId());
|
||||
@@ -1317,9 +1701,9 @@
|
||||
@@ -1418,9 +1803,9 @@
|
||||
}
|
||||
|
||||
if (worldserver == this.level()) {
|
||||
@@ -889,7 +921,7 @@
|
||||
}
|
||||
|
||||
this.setYHeadRot(f);
|
||||
@@ -1423,6 +1807,16 @@
|
||||
@@ -1524,6 +1909,16 @@
|
||||
}
|
||||
|
||||
public void updateOptions(ClientInformation clientinformation) {
|
||||
@@ -906,7 +938,7 @@
|
||||
this.language = clientinformation.language();
|
||||
this.requestedViewDistance = clientinformation.viewDistance();
|
||||
this.chatVisibility = clientinformation.chatVisibility();
|
||||
@@ -1506,7 +1900,7 @@
|
||||
@@ -1607,7 +2002,7 @@
|
||||
if (world instanceof WorldServer) {
|
||||
WorldServer worldserver = (WorldServer) world;
|
||||
|
||||
@@ -915,7 +947,7 @@
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
@@ -1543,7 +1937,7 @@
|
||||
@@ -1644,7 +2039,7 @@
|
||||
|
||||
@Nullable
|
||||
public IChatBaseComponent getTabListDisplayName() {
|
||||
@@ -924,7 +956,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1564,9 +1958,16 @@
|
||||
@@ -1665,9 +2060,16 @@
|
||||
return this.advancements;
|
||||
}
|
||||
|
||||
@@ -941,7 +973,7 @@
|
||||
if (worldserver == this.level()) {
|
||||
this.connection.teleport(d0, d1, d2, f, f1);
|
||||
} else {
|
||||
@@ -1586,6 +1987,9 @@
|
||||
@@ -1687,6 +2089,9 @@
|
||||
this.server.getPlayerList().sendLevelInfo(this, worldserver);
|
||||
this.server.getPlayerList().sendAllPlayerInfo(this);
|
||||
}
|
||||
@@ -951,7 +983,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1607,6 +2011,32 @@
|
||||
@@ -1708,6 +2113,32 @@
|
||||
}
|
||||
|
||||
public void setRespawnPosition(ResourceKey<World> resourcekey, @Nullable BlockPosition blockposition, float f, boolean flag, boolean flag1) {
|
||||
@@ -984,7 +1016,7 @@
|
||||
if (blockposition != null) {
|
||||
boolean flag2 = blockposition.equals(this.respawnPosition) && resourcekey.equals(this.respawnDimension);
|
||||
|
||||
@@ -1812,4 +2242,146 @@
|
||||
@@ -1913,4 +2344,146 @@
|
||||
public CommonPlayerSpawnInfo createCommonSpawnInfo(WorldServer worldserver) {
|
||||
return new CommonPlayerSpawnInfo(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), this.getLastDeathLocation(), this.getPortalCooldown());
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
+ org.bukkit.block.BlockState state = bblock.getState();
|
||||
+ level.captureDrops = new ArrayList<>();
|
||||
+ // CraftBukkit end
|
||||
block.playerWillDestroy(this.level, blockposition, iblockdata, this.player);
|
||||
IBlockData iblockdata1 = block.playerWillDestroy(this.level, blockposition, iblockdata, this.player);
|
||||
boolean flag = this.level.removeBlock(blockposition, false);
|
||||
|
||||
@@ -256,19 +399,32 @@
|
||||
@@ -238,12 +238,12 @@
|
||||
} else {
|
||||
ItemStack itemstack = this.player.getMainHandItem();
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
boolean flag1 = this.player.hasCorrectToolForDrops(iblockdata);
|
||||
boolean flag1 = this.player.hasCorrectToolForDrops(iblockdata1);
|
||||
|
||||
itemstack.mineBlock(this.level, iblockdata, blockposition, this.player);
|
||||
itemstack.mineBlock(this.level, iblockdata1, blockposition, this.player);
|
||||
- if (flag && flag1) {
|
||||
+ if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
|
||||
block.playerDestroy(this.level, this.player, blockposition, iblockdata, tileentity, itemstack1);
|
||||
block.playerDestroy(this.level, this.player, blockposition, iblockdata1, tileentity, itemstack1);
|
||||
}
|
||||
|
||||
- return true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/net/minecraft/server/level/WorldServer.java
|
||||
@@ -162,6 +162,26 @@
|
||||
@@ -164,6 +164,26 @@
|
||||
import net.minecraft.world.ticks.TickListServer;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
||||
@@ -175,7 +195,7 @@
|
||||
@@ -177,7 +197,7 @@
|
||||
final List<EntityPlayer> players;
|
||||
private final ChunkProviderServer chunkSource;
|
||||
private final MinecraftServer server;
|
||||
@@ -36,7 +36,7 @@
|
||||
final EntityTickList entityTickList;
|
||||
public final PersistentEntitySectionManager<Entity> entityManager;
|
||||
private final GameEventDispatcher gameEventDispatcher;
|
||||
@@ -200,12 +220,30 @@
|
||||
@@ -202,12 +222,30 @@
|
||||
private final boolean tickTime;
|
||||
private final RandomSequences randomSequences;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
this.players = Lists.newArrayList();
|
||||
this.entityTickList = new EntityTickList();
|
||||
this.blockTicks = new TickListServer<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||
@@ -219,6 +257,22 @@
|
||||
@@ -221,6 +259,22 @@
|
||||
this.customSpawners = list;
|
||||
this.serverLevelData = iworlddataserver;
|
||||
ChunkGenerator chunkgenerator = worlddimension.generator();
|
||||
@@ -95,7 +95,7 @@
|
||||
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);
|
||||
@@ -246,9 +300,9 @@
|
||||
@@ -248,9 +302,9 @@
|
||||
long l = minecraftserver.getWorldData().worldGenOptions().seed();
|
||||
|
||||
this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this.chunkSource.randomState(), this, chunkgenerator.getBiomeSource(), l, datafixer);
|
||||
@@ -108,7 +108,7 @@
|
||||
} else {
|
||||
this.dragonFight = null;
|
||||
}
|
||||
@@ -258,6 +312,7 @@
|
||||
@@ -260,6 +314,7 @@
|
||||
this.randomSequences = (RandomSequences) Objects.requireNonNullElseGet(randomsequences, () -> {
|
||||
return (RandomSequences) this.getDataStorage().computeIfAbsent(RandomSequences.factory(l), "random_sequences");
|
||||
});
|
||||
@@ -116,7 +116,7 @@
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
@@ -296,12 +351,20 @@
|
||||
@@ -304,12 +359,20 @@
|
||||
long j;
|
||||
|
||||
if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||
@@ -140,25 +140,25 @@
|
||||
if (this.getGameRules().getBoolean(GameRules.RULE_WEATHER_CYCLE) && this.isRaining()) {
|
||||
this.resetWeatherCycle();
|
||||
}
|
||||
@@ -327,7 +390,7 @@
|
||||
this.runBlockEvents();
|
||||
@@ -344,7 +407,7 @@
|
||||
|
||||
this.handlingTick = false;
|
||||
gameprofilerfiller.pop();
|
||||
- boolean flag = !this.players.isEmpty() || !this.getForcedChunks().isEmpty();
|
||||
+ boolean flag = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
|
||||
- boolean flag1 = !this.players.isEmpty() || !this.getForcedChunks().isEmpty();
|
||||
+ boolean flag1 = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
|
||||
|
||||
if (flag) {
|
||||
if (flag1) {
|
||||
this.resetEmptyTime();
|
||||
@@ -343,7 +406,7 @@
|
||||
@@ -360,7 +423,7 @@
|
||||
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
if (!entity.isRemoved()) {
|
||||
- if (this.shouldDiscardEntity(entity)) {
|
||||
+ if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
} else {
|
||||
} else if (!tickratemanager.isEntityFrozen(entity)) {
|
||||
gameprofilerfiller.push("checkDespawn");
|
||||
@@ -415,7 +478,7 @@
|
||||
@@ -432,7 +495,7 @@
|
||||
|
||||
private void wakeUpAllPlayers() {
|
||||
this.sleepStatus.removeAllSleepers();
|
||||
@@ -167,7 +167,7 @@
|
||||
entityplayer.stopSleepInBed(false, false);
|
||||
});
|
||||
}
|
||||
@@ -442,7 +505,7 @@
|
||||
@@ -459,7 +522,7 @@
|
||||
entityhorseskeleton.setTrap(true);
|
||||
entityhorseskeleton.setAge(0);
|
||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
@@ -176,7 +176,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +514,7 @@
|
||||
@@ -468,7 +531,7 @@
|
||||
if (entitylightning != null) {
|
||||
entitylightning.moveTo(Vec3D.atBottomCenterOf(blockposition));
|
||||
entitylightning.setVisualOnly(flag1);
|
||||
@@ -185,7 +185,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,7 +569,7 @@
|
||||
@@ -524,7 +587,7 @@
|
||||
BiomeBase biomebase = (BiomeBase) this.getBiome(blockposition1).value();
|
||||
|
||||
if (biomebase.shouldFreeze(this, blockposition2)) {
|
||||
@@ -193,8 +193,8 @@
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition2, Blocks.ICE.defaultBlockState(), null); // CraftBukkit
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
@@ -522,10 +585,10 @@
|
||||
if (this.isRaining()) {
|
||||
@@ -540,10 +603,10 @@
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockSnow.LAYERS, j + 1);
|
||||
|
||||
Block.pushEntitiesUp(iblockdata, iblockdata1, this, blockposition1);
|
||||
@@ -207,7 +207,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,6 +749,7 @@
|
||||
@@ -704,6 +767,7 @@
|
||||
this.rainLevel = MathHelper.clamp(this.rainLevel, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
if (this.oRainLevel != this.rainLevel) {
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel), this.dimension());
|
||||
}
|
||||
@@ -704,14 +768,47 @@
|
||||
@@ -722,15 +786,48 @@
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel));
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.THUNDER_LEVEL_CHANGE, this.thunderLevel));
|
||||
}
|
||||
@@ -243,7 +243,8 @@
|
||||
|
||||
}
|
||||
|
||||
private void resetWeatherCycle() {
|
||||
@VisibleForTesting
|
||||
public void resetWeatherCycle() {
|
||||
- this.serverLevelData.setRainTime(0);
|
||||
+ // CraftBukkit start
|
||||
this.serverLevelData.setRaining(false);
|
||||
@@ -265,7 +266,7 @@
|
||||
}
|
||||
|
||||
public void resetEmptyTime() {
|
||||
@@ -746,6 +843,7 @@
|
||||
@@ -765,6 +862,7 @@
|
||||
});
|
||||
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
||||
entity.tick();
|
||||
@@ -273,7 +274,7 @@
|
||||
this.getProfiler().pop();
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
@@ -769,6 +867,7 @@
|
||||
@@ -788,6 +886,7 @@
|
||||
});
|
||||
gameprofilerfiller.incrementCounter("tickPassenger");
|
||||
entity1.rideTick();
|
||||
@@ -281,7 +282,7 @@
|
||||
gameprofilerfiller.pop();
|
||||
Iterator iterator = entity1.getPassengers().iterator();
|
||||
|
||||
@@ -793,6 +892,7 @@
|
||||
@@ -812,6 +911,7 @@
|
||||
ChunkProviderServer chunkproviderserver = this.getChunkSource();
|
||||
|
||||
if (!flag1) {
|
||||
@@ -289,7 +290,7 @@
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.progressStartNoAbort(IChatBaseComponent.translatable("menu.savingLevel"));
|
||||
}
|
||||
@@ -810,11 +910,19 @@
|
||||
@@ -829,11 +929,19 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -310,7 +311,7 @@
|
||||
}
|
||||
|
||||
this.getChunkSource().getDataStorage().save();
|
||||
@@ -879,15 +987,37 @@
|
||||
@@ -898,15 +1006,37 @@
|
||||
|
||||
@Override
|
||||
public boolean addFreshEntity(Entity entity) {
|
||||
@@ -351,7 +352,7 @@
|
||||
}
|
||||
|
||||
public void addDuringCommandTeleport(EntityPlayer entityplayer) {
|
||||
@@ -918,24 +1048,37 @@
|
||||
@@ -937,24 +1067,37 @@
|
||||
this.entityManager.addNewEntity(entityplayer);
|
||||
}
|
||||
|
||||
@@ -393,7 +394,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -949,10 +1092,32 @@
|
||||
@@ -968,10 +1111,32 @@
|
||||
entityplayer.remove(entity_removalreason);
|
||||
}
|
||||
|
||||
@@ -426,7 +427,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -961,6 +1126,12 @@
|
||||
@@ -980,6 +1145,12 @@
|
||||
double d1 = (double) blockposition.getY() - entityplayer.getY();
|
||||
double d2 = (double) blockposition.getZ() - entityplayer.getZ();
|
||||
|
||||
@@ -439,7 +440,7 @@
|
||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||
entityplayer.connection.send(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
||||
}
|
||||
@@ -1020,7 +1191,18 @@
|
||||
@@ -1039,7 +1210,18 @@
|
||||
Iterator iterator = this.navigatingMobs.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -459,10 +460,10 @@
|
||||
NavigationAbstract navigationabstract = entityinsentient.getNavigation();
|
||||
|
||||
if (navigationabstract.shouldRecomputePath(blockposition)) {
|
||||
@@ -1082,6 +1264,11 @@
|
||||
@@ -1101,6 +1283,11 @@
|
||||
@Override
|
||||
public Explosion explode(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, World.a world_a) {
|
||||
Explosion explosion = this.explode(entity, damagesource, explosiondamagecalculator, d0, d1, d2, f, flag, world_a, false);
|
||||
public Explosion explode(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, World.a world_a, ParticleParam particleparam, ParticleParam particleparam1, SoundEffect soundeffect) {
|
||||
Explosion explosion = this.explode(entity, damagesource, explosiondamagecalculator, d0, d1, d2, f, flag, world_a, false, particleparam, particleparam1, soundeffect);
|
||||
+ // CraftBukkit start
|
||||
+ if (explosion.wasCanceled) {
|
||||
+ return explosion;
|
||||
@@ -471,7 +472,7 @@
|
||||
|
||||
if (!explosion.interactsWithBlocks()) {
|
||||
explosion.clearToBlow();
|
||||
@@ -1154,13 +1341,20 @@
|
||||
@@ -1173,13 +1360,20 @@
|
||||
}
|
||||
|
||||
public <T extends ParticleParam> int sendParticles(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
||||
@@ -494,7 +495,7 @@
|
||||
++j;
|
||||
}
|
||||
}
|
||||
@@ -1211,7 +1405,7 @@
|
||||
@@ -1230,7 +1424,7 @@
|
||||
|
||||
@Nullable
|
||||
public BlockPosition findNearestMapStructure(TagKey<Structure> tagkey, BlockPosition blockposition, int i, boolean flag) {
|
||||
@@ -503,7 +504,7 @@
|
||||
return null;
|
||||
} else {
|
||||
Optional<HolderSet.Named<Structure>> optional = this.registryAccess().registryOrThrow(Registries.STRUCTURE).getTag(tagkey);
|
||||
@@ -1253,6 +1447,7 @@
|
||||
@@ -1277,6 +1471,7 @@
|
||||
|
||||
@Override
|
||||
public void setMapData(String s, WorldMap worldmap) {
|
||||
@@ -511,7 +512,7 @@
|
||||
this.getServer().overworld().getDataStorage().set(s, worldmap);
|
||||
}
|
||||
|
||||
@@ -1550,6 +1745,11 @@
|
||||
@@ -1574,6 +1769,11 @@
|
||||
@Override
|
||||
public void blockUpdated(BlockPosition blockposition, Block block) {
|
||||
if (!this.isDebug()) {
|
||||
@@ -523,7 +524,7 @@
|
||||
this.updateNeighborsAt(blockposition, block);
|
||||
}
|
||||
|
||||
@@ -1569,12 +1769,12 @@
|
||||
@@ -1593,12 +1793,12 @@
|
||||
}
|
||||
|
||||
public boolean isFlat() {
|
||||
@@ -538,7 +539,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1597,7 +1797,7 @@
|
||||
@@ -1621,7 +1821,7 @@
|
||||
private static <T> String getTypeCount(Iterable<T> iterable, Function<T, String> function) {
|
||||
try {
|
||||
Object2IntOpenHashMap<String> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||
@@ -547,7 +548,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
T t0 = iterator.next();
|
||||
@@ -1606,7 +1806,7 @@
|
||||
@@ -1630,7 +1830,7 @@
|
||||
object2intopenhashmap.addTo(s, 1);
|
||||
}
|
||||
|
||||
@@ -556,7 +557,7 @@
|
||||
String s1 = (String) entry.getKey();
|
||||
|
||||
return s1 + ":" + entry.getIntValue();
|
||||
@@ -1617,17 +1817,33 @@
|
||||
@@ -1641,17 +1841,33 @@
|
||||
}
|
||||
|
||||
public static void makeObsidianPlatform(WorldServer worldserver) {
|
||||
@@ -592,7 +593,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1703,7 +1919,9 @@
|
||||
@@ -1737,7 +1953,9 @@
|
||||
|
||||
a() {}
|
||||
|
||||
@@ -603,7 +604,7 @@
|
||||
|
||||
public void onDestroyed(Entity entity) {
|
||||
WorldServer.this.getScoreboard().entityRemoved(entity);
|
||||
@@ -1751,6 +1969,7 @@
|
||||
@@ -1785,6 +2003,7 @@
|
||||
}
|
||||
|
||||
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
|
||||
@@ -611,7 +612,7 @@
|
||||
}
|
||||
|
||||
public void onTrackingEnd(Entity entity) {
|
||||
@@ -1787,6 +2006,14 @@
|
||||
@@ -1821,6 +2040,14 @@
|
||||
}
|
||||
|
||||
entity.updateDynamicGameEventListener(DynamicGameEventListener::remove);
|
||||
|
||||
Reference in New Issue
Block a user