mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
Checkpoint
This commit is contained in:
@@ -137,8 +137,8 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
// Paper end - rewrite chunk system
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
@@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@Nullable
|
@Nullable
|
||||||
public CompoundTag read(ChunkPos pos) throws IOException {
|
public CompoundTag read(ChunkPos pos) throws IOException {
|
||||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
DataInputStream datainputstream = regionfile.getChunkDataInputStream(pos);
|
DataInputStream datainputstream = regionfile.getChunkDataInputStream(pos);
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
CompoundTag nbttagcompound;
|
CompoundTag nbttagcompound;
|
||||||
label43:
|
label43:
|
||||||
{
|
{
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NbtIo.write(nbt, (DataOutput) dataoutputstream);
|
NbtIo.write(nbt, (DataOutput) dataoutputstream);
|
@@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.mojang.datafixers.DataFixer;
|
import com.mojang.datafixers.DataFixer;
|
||||||
import com.mojang.datafixers.util.Pair;
|
import com.mojang.datafixers.util.Pair;
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
++TimingHistory.entityTicks; // Paper - timings
|
++TimingHistory.entityTicks; // Paper - timings
|
||||||
// Spigot start
|
// Spigot start
|
||||||
co.aikar.timings.Timing timer; // Paper
|
co.aikar.timings.Timing timer; // Paper
|
||||||
@@ -50,41 +50,35 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
try {
|
try {
|
||||||
// Paper end - timings
|
// Paper end - timings
|
||||||
entity.setOldPosAndRot();
|
entity.setOldPosAndRot();
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
|
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
|
||||||
});
|
});
|
||||||
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
||||||
+ if (isActive) { // Paper - EAR 2
|
+ if (isActive) { // Paper - EAR 2
|
||||||
+ TimingHistory.activatedEntityTicks++;
|
|
||||||
entity.tick();
|
entity.tick();
|
||||||
entity.postTick(); // CraftBukkit
|
entity.postTick(); // CraftBukkit
|
||||||
+ } else { entity.inactiveTick(); } // Paper - EAR 2
|
+ } else { entity.inactiveTick(); } // Paper - EAR 2
|
||||||
this.getProfiler().pop();
|
gameprofilerfiller.pop();
|
||||||
+ } finally { timer.stopTiming(); } // Paper - timings
|
+ } finally { timer.stopTiming(); } // Paper - timings // EAR 2
|
||||||
Iterator iterator = entity.getPassengers().iterator();
|
Iterator iterator = entity.getPassengers().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
Entity entity1 = (Entity) iterator.next();
|
||||||
|
|
||||||
this.tickPassenger(entity, entity1);
|
- this.tickPassenger(entity, entity1);
|
||||||
|
+ this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
|
||||||
}
|
}
|
||||||
- } finally { timer.stopTiming(); } // Paper - timings
|
- } finally { timer.stopTiming(); } // Paper - timings
|
||||||
+ // } finally { timer.stopTiming(); } // Paper - timings - move up
|
+ // } finally { timer.stopTiming(); } // Paper - timings // EAR 2
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tickPassenger(Entity vehicle, Entity passenger) {
|
- private void tickPassenger(Entity vehicle, Entity passenger) {
|
||||||
|
+ private void tickPassenger(Entity vehicle, Entity passenger, boolean isActive) { // Paper - EAR 2
|
||||||
if (!passenger.isRemoved() && passenger.getVehicle() == vehicle) {
|
if (!passenger.isRemoved() && passenger.getVehicle() == vehicle) {
|
||||||
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
||||||
+ // Paper - EAR 2
|
|
||||||
+ final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
|
||||||
+ co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper
|
|
||||||
+ try {
|
|
||||||
+ // Paper end
|
|
||||||
passenger.setOldPosAndRot();
|
passenger.setOldPosAndRot();
|
||||||
++passenger.tickCount;
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
||||||
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
|
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
|
||||||
});
|
});
|
||||||
gameprofilerfiller.incrementCounter("tickPassenger");
|
gameprofilerfiller.incrementCounter("tickPassenger");
|
||||||
@@ -102,14 +96,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
Iterator iterator = passenger.getPassengers().iterator();
|
Iterator iterator = passenger.getPassengers().iterator();
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
while (iterator.hasNext()) {
|
||||||
this.tickPassenger(passenger, entity2);
|
Entity entity2 = (Entity) iterator.next();
|
||||||
|
|
||||||
|
- this.tickPassenger(passenger, entity2);
|
||||||
|
+ this.tickPassenger(passenger, entity2, isActive); // Paper - EAR 2
|
||||||
}
|
}
|
||||||
|
|
||||||
+ } finally { timer.stopTiming(); }// Paper - EAR2 timings
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
passenger.stopRiding();
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -126,9 +120,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
} else {
|
} else {
|
||||||
this.wasOnFire = this.isOnFire();
|
this.wasOnFire = this.isOnFire();
|
||||||
if (movementType == MoverType.PISTON) {
|
if (type == MoverType.PISTON) {
|
||||||
+ this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper
|
+ this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper - EAR 2
|
||||||
+ this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper
|
+ this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper - EAR 2
|
||||||
movement = this.limitPistonMovement(movement);
|
movement = this.limitPistonMovement(movement);
|
||||||
if (movement.equals(Vec3.ZERO)) {
|
if (movement.equals(Vec3.ZERO)) {
|
||||||
return;
|
return;
|
||||||
@@ -137,14 +131,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.setDeltaMovement(Vec3.ZERO);
|
this.setDeltaMovement(Vec3.ZERO);
|
||||||
}
|
}
|
||||||
+ // Paper start - ignore movement changes while inactive.
|
+ // Paper start - ignore movement changes while inactive.
|
||||||
+ if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
|
+ if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) {
|
||||||
+ setDeltaMovement(Vec3.ZERO);
|
+ setDeltaMovement(Vec3.ZERO);
|
||||||
+ this.level.getProfiler().pop();
|
+ gameprofilerfiller.pop();
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
||||||
movement = this.maybeBackOffFromEdge(movement, movementType);
|
movement = this.maybeBackOffFromEdge(movement, type);
|
||||||
Vec3 vec3d1 = this.collide(movement);
|
Vec3 vec3d1 = this.collide(movement);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
@@ -188,18 +182,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||||
@@ -0,0 +0,0 @@ public class GoalSelector {
|
@@ -0,0 +0,0 @@ public class GoalSelector {
|
||||||
|
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
|
||||||
private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>();
|
private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>();
|
||||||
private final Supplier<ProfilerFiller> profiler;
|
|
||||||
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class);
|
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class);
|
||||||
+ private int curRate;
|
+ private int curRate; // Paper - EAR 2
|
||||||
|
|
||||||
public GoalSelector(Supplier<ProfilerFiller> profiler) {
|
public void addGoal(int priority, Goal goal) {
|
||||||
this.profiler = profiler;
|
this.availableGoals.add(new WrappedGoal(priority, goal));
|
||||||
@@ -0,0 +0,0 @@ public class GoalSelector {
|
@@ -0,0 +0,0 @@ public class GoalSelector {
|
||||||
this.availableGoals.removeIf(goal -> predicate.test(goal.getGoal()));
|
this.availableGoals.removeIf(goal -> predicate.test(goal.getGoal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start - EAR 2
|
||||||
+ public boolean inactiveTick() {
|
+ public boolean inactiveTick() {
|
||||||
+ this.curRate++;
|
+ this.curRate++;
|
||||||
+ return this.curRate % 3 == 0; // TODO newGoalRate was already unused in 1.20.4, check if this is correct
|
+ return this.curRate % 3 == 0; // TODO newGoalRate was already unused in 1.20.4, check if this is correct
|
||||||
@@ -212,7 +206,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end - EAR 2
|
||||||
public void removeGoal(Goal goal) {
|
public void removeGoal(Goal goal) {
|
||||||
for (WrappedGoal wrappedGoal : this.availableGoals) {
|
for (WrappedGoal wrappedGoal : this.availableGoals) {
|
||||||
if (wrappedGoal.getGoal() == goal && wrappedGoal.isRunning()) {
|
if (wrappedGoal.getGoal() == goal && wrappedGoal.isRunning()) {
|
||||||
@@ -252,37 +246,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public void inactiveTick() {
|
public void inactiveTick() {
|
||||||
// SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
|
// SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
|
||||||
- if (this.level().spigotConfig.tickInactiveVillagers && this.isEffectiveAi()) {
|
- if (this.level().spigotConfig.tickInactiveVillagers && this.isEffectiveAi()) {
|
||||||
- this.customServerAiStep();
|
- this.customServerAiStep((ServerLevel) this.level());
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (this.getUnhappyCounter() > 0) {
|
+ if (this.getUnhappyCounter() > 0) {
|
||||||
+ this.setUnhappyCounter(this.getUnhappyCounter() - 1);
|
+ this.setUnhappyCounter(this.getUnhappyCounter() - 1);
|
||||||
}
|
+ }
|
||||||
+ if (this.isEffectiveAi()) {
|
+ if (this.isEffectiveAi()) {
|
||||||
+ if (this.level().spigotConfig.tickInactiveVillagers) {
|
+ if (this.level().spigotConfig.tickInactiveVillagers) {
|
||||||
+ this.customServerAiStep();
|
+ this.customServerAiStep(this.level().getMinecraftWorld());
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.customServerAiStep(true);
|
+ this.customServerAiStep(this.level().getMinecraftWorld(), true);
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
|
}
|
||||||
+ maybeDecayGossip();
|
+ maybeDecayGossip();
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
|
||||||
super.inactiveTick();
|
super.inactiveTick();
|
||||||
}
|
}
|
||||||
// Spigot End
|
// Spigot End
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
+ @Deprecated // Paper
|
protected void customServerAiStep(ServerLevel world) {
|
||||||
protected void customServerAiStep() {
|
+ // Paper start - EAR 2
|
||||||
+ // Paper start
|
+ this.customServerAiStep(world, false);
|
||||||
+ this.customServerAiStep(false);
|
|
||||||
+ }
|
+ }
|
||||||
+ protected void customServerAiStep(final boolean inactive) {
|
+ protected void customServerAiStep(ServerLevel world, final boolean inactive) {
|
||||||
+ // Paper end
|
+ // Paper end - EAR 2
|
||||||
this.level().getProfiler().push("villagerBrain");
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||||
- this.getBrain().tick((ServerLevel) this.level(), this);
|
|
||||||
+ if (!inactive) this.getBrain().tick((ServerLevel) this.level(), this); // Paper
|
gameprofilerfiller.push("villagerBrain");
|
||||||
this.level().getProfiler().pop();
|
- this.getBrain().tick(world, this);
|
||||||
|
+ if (!inactive) this.getBrain().tick(world, this);
|
||||||
|
gameprofilerfiller.pop();
|
||||||
if (this.assignProfessionWhenSpawned) {
|
if (this.assignProfessionWhenSpawned) {
|
||||||
this.assignProfessionWhenSpawned = false;
|
this.assignProfessionWhenSpawned = false;
|
||||||
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
@@ -290,17 +284,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
- if (!this.isNoAi() && this.random.nextInt(100) == 0) {
|
- if (!this.isNoAi() && this.random.nextInt(100) == 0) {
|
||||||
+ if (!inactive && !this.isNoAi() && this.random.nextInt(100) == 0) { // Paper
|
+ if (!inactive && !this.isNoAi() && this.random.nextInt(100) == 0) { // Paper - EAR 2
|
||||||
Raid raid = ((ServerLevel) this.level()).getRaidAt(this.blockPosition());
|
Raid raid = world.getRaidAt(this.blockPosition());
|
||||||
|
|
||||||
if (raid != null && raid.isActive() && !raid.isOver()) {
|
if (raid != null && raid.isActive() && !raid.isOver()) {
|
||||||
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.isTrading()) {
|
if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.isTrading()) {
|
||||||
this.stopTrading();
|
this.stopTrading();
|
||||||
}
|
}
|
||||||
+ if (inactive) return; // Paper
|
+ if (inactive) return; // Paper - EAR 2
|
||||||
|
|
||||||
super.customServerAiStep();
|
super.customServerAiStep(world);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
@@ -344,7 +338,7 @@ diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
|
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
|
||||||
public List<ItemEntity> captureDrops;
|
public List<ItemEntity> captureDrops;
|
||||||
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
|
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
|
||||||
@@ -606,7 +600,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- return true;
|
- return true;
|
||||||
+ return 10; // Paper
|
+ return 10; // Paper
|
||||||
}
|
}
|
||||||
} else if ( !( (AbstractArrow) entity ).inGround )
|
} else if ( !( (AbstractArrow) entity ).isInGround() )
|
||||||
{
|
{
|
||||||
- return true;
|
- return true;
|
||||||
+ return 1; // Paper
|
+ return 1; // Paper
|
@@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- WorldGenerationContext worldgenerationcontext = new WorldGenerationContext(this, region);
|
- WorldGenerationContext worldgenerationcontext = new WorldGenerationContext(this, region);
|
||||||
+ WorldGenerationContext worldgenerationcontext = new WorldGenerationContext(this, region, region.getMinecraftWorld()); // Paper - Flat bedrock generator settings
|
+ WorldGenerationContext worldgenerationcontext = new WorldGenerationContext(this, region, region.getMinecraftWorld()); // Paper - Flat bedrock generator settings
|
||||||
|
|
||||||
this.buildSurface(chunk, worldgenerationcontext, noiseConfig, structures, region.getBiomeManager(), region.registryAccess().registryOrThrow(Registries.BIOME), Blender.of(region));
|
this.buildSurface(chunk, worldgenerationcontext, noiseConfig, structures, region.getBiomeManager(), region.registryAccess().lookupOrThrow(Registries.BIOME), Blender.of(region));
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
@@ -0,0 +0,0 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||||
return this.createNoiseChunk(ichunkaccess1, structureAccessor, Blender.of(chunkRegion), noiseConfig);
|
return this.createNoiseChunk(ichunkaccess1, structureAccessor, Blender.of(chunkRegion), noiseConfig);
|
||||||
@@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
Aquifer aquifer = noisechunk.aquifer();
|
Aquifer aquifer = noisechunk.aquifer();
|
||||||
- CarvingContext carvingcontext = new CarvingContext(this, chunkRegion.registryAccess(), chunk.getHeightAccessorForGeneration(), noisechunk, noiseConfig, ((NoiseGeneratorSettings) this.settings.value()).surfaceRule());
|
- CarvingContext carvingcontext = new CarvingContext(this, chunkRegion.registryAccess(), chunk.getHeightAccessorForGeneration(), noisechunk, noiseConfig, ((NoiseGeneratorSettings) this.settings.value()).surfaceRule());
|
||||||
+ CarvingContext carvingcontext = new CarvingContext(this, chunkRegion.registryAccess(), chunk.getHeightAccessorForGeneration(), noisechunk, noiseConfig, ((NoiseGeneratorSettings) this.settings.value()).surfaceRule(), chunkRegion.getMinecraftWorld()); // Paper - Flat bedrock generator settings
|
+ CarvingContext carvingcontext = new CarvingContext(this, chunkRegion.registryAccess(), chunk.getHeightAccessorForGeneration(), noisechunk, noiseConfig, ((NoiseGeneratorSettings) this.settings.value()).surfaceRule(), chunkRegion.getMinecraftWorld()); // Paper - Flat bedrock generator settings
|
||||||
CarvingMask carvingmask = ((ProtoChunk) chunk).getOrCreateCarvingMask(carverStep);
|
CarvingMask carvingmask = ((ProtoChunk) chunk).getOrCreateCarvingMask();
|
||||||
|
|
||||||
for (int j = -8; j <= 8; ++j) {
|
for (int j = -8; j <= 8; ++j) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenerationContext.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenerationContext.java
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenerationContext.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenerationContext.java
|
||||||
@@ -151,7 +151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world) {
|
- public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world) {
|
||||||
+ public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world) { this(generator, world, null); } // Paper - Flat bedrock generator settings
|
+ public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world) { this(generator, world, null); } // Paper - Flat bedrock generator settings
|
||||||
+ public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world, @org.jetbrains.annotations.Nullable net.minecraft.world.level.Level level) { // Paper - Flat bedrock generator settings
|
+ public WorldGenerationContext(ChunkGenerator generator, LevelHeightAccessor world, @org.jetbrains.annotations.Nullable net.minecraft.world.level.Level level) { // Paper - Flat bedrock generator settings
|
||||||
this.minY = Math.max(world.getMinBuildHeight(), generator.getMinY());
|
this.minY = Math.max(world.getMinY(), generator.getMinY());
|
||||||
this.height = Math.min(world.getHeight(), generator.getGenDepth());
|
this.height = Math.min(world.getHeight(), generator.getGenDepth());
|
||||||
+ this.level = level; // Paper - Flat bedrock generator settings
|
+ this.level = level; // Paper - Flat bedrock generator settings
|
||||||
}
|
}
|
@@ -16,7 +16,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
{
|
{
|
||||||
if ( iter.next().player == entity )
|
if ( iter.next().player == entity )
|
||||||
{
|
{
|
||||||
@@ -24,14 +24,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity {
|
@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
|
||||||
return null;
|
this.awardStat(Stats.DROP);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
|
||||||
+ // Paper start - remove player from map on drop
|
+ // Paper start - remove player from map on drop
|
||||||
+ if (itemstack.getItem() == Items.FILLED_MAP) {
|
+ if (itemstack.getItem() == Items.FILLED_MAP) {
|
||||||
+ net.minecraft.world.level.saveddata.maps.MapItemSavedData worldmap = net.minecraft.world.item.MapItem.getSavedData(itemstack, this.level());
|
+ net.minecraft.world.level.saveddata.maps.MapItemSavedData worldmap = net.minecraft.world.item.MapItem.getSavedData(itemstack, this.level());
|
||||||
@@ -40,9 +40,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
||||||
return entityitem;
|
return entityitem;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
+ worldmap.vanillaRender.buffer = abyte; // Paper
|
+ worldmap.vanillaRender.buffer = abyte; // Paper
|
||||||
|
|
||||||
RegistryOps<Tag> registryops = registryLookup.createSerializationContext(NbtOps.INSTANCE);
|
RegistryOps<Tag> registryops = registries.createSerializationContext(NbtOps.INSTANCE);
|
||||||
List<MapBanner> list = (List) MapBanner.LIST_CODEC.parse(registryops, nbt.get("banners")).resultOrPartial((s) -> {
|
List<MapBanner> list = (List) MapBanner.LIST_CODEC.parse(registryops, nbt.get("banners")).resultOrPartial((s) -> {
|
||||||
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
||||||
--this.trackedDecorationCount;
|
--this.trackedDecorationCount;
|
||||||
@@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
||||||
@Nullable
|
@Nullable
|
||||||
Packet<?> nextUpdatePacket(MapId mapId) {
|
Packet<?> nextUpdatePacket(MapId mapId) {
|
||||||
MapItemSavedData.MapPatch worldmap_b;
|
MapItemSavedData.MapPatch worldmap_c;
|
||||||
- org.bukkit.craftbukkit.map.RenderData render = MapItemSavedData.this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) this.player.getBukkitEntity()); // CraftBukkit
|
- org.bukkit.craftbukkit.map.RenderData render = MapItemSavedData.this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) this.player.getBukkitEntity()); // CraftBukkit
|
||||||
+ if (!this.dirtyData && this.tick % 5 != 0) { this.tick++; return null; } // Paper - this won't end up sending, so don't render it!
|
+ if (!this.dirtyData && this.tick % 5 != 0) { this.tick++; return null; } // Paper - this won't end up sending, so don't render it!
|
||||||
+ boolean vanillaMaps = shouldUseVanillaMap(); // Paper
|
+ boolean vanillaMaps = shouldUseVanillaMap(); // Paper
|
@@ -32,7 +32,7 @@ diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public boolean isInWorldBounds(BlockPos pos) {
|
public boolean isInWorldBounds(BlockPos pos) {
|
||||||
@@ -45,7 +45,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/sr
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
@@ -0,0 +0,0 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||||
return GameEventListenerRegistry.NOOP;
|
return GameEventListenerRegistry.NOOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.ja
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
|
||||||
@@ -0,0 +0,0 @@ public class ImposterProtoChunk extends ProtoChunk implements ca.spottedleaf.moo
|
@@ -0,0 +0,0 @@ public class ImposterProtoChunk extends ProtoChunk {
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
return this.wrapped.getBlockState(pos);
|
return this.wrapped.getBlockState(pos);
|
||||||
}
|
}
|
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
|
||||||
this.handlingTick = false;
|
this.handlingTick = false;
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
Reference in New Issue
Block a user