mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
even moar workkkkk
This commit is contained in:
parent
983b5e1680
commit
a84faa9d7d
@ -1,52 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aikar <aikar@aikar.co>
|
|
||||||
Date: Thu, 8 Oct 2020 00:00:25 -0400
|
|
||||||
Subject: [PATCH] Fix "Not a string" Map Conversion spam
|
|
||||||
|
|
||||||
The maps did convert successfully, but had noisy logs due to Spigot
|
|
||||||
implementing this logic incorrectly.
|
|
||||||
|
|
||||||
This stops the spam by converting the old format to new before
|
|
||||||
requesting the world.
|
|
||||||
|
|
||||||
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
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.nbt.ListTag;
|
|
||||||
import net.minecraft.nbt.NbtOps;
|
|
||||||
+import net.minecraft.nbt.NumericTag;
|
|
||||||
+import net.minecraft.nbt.StringTag;
|
|
||||||
import net.minecraft.nbt.Tag;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.network.protocol.Packet;
|
|
||||||
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(CompoundTag tag) {
|
|
||||||
- DataResult<ResourceKey<Level>> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, tag.get("dimension"))); // CraftBukkit - decompile error
|
|
||||||
+ // Paper start - fix "Not a string" spam
|
|
||||||
+ Tag dimension = tag.get("dimension");
|
|
||||||
+ if (dimension instanceof NumericTag && ((NumericTag) dimension).getAsInt() >= CraftWorld.CUSTOM_DIMENSION_OFFSET) {
|
|
||||||
+ long least = tag.getLong("UUIDLeast");
|
|
||||||
+ long most = tag.getLong("UUIDMost");
|
|
||||||
+
|
|
||||||
+ if (least != 0L && most != 0L) {
|
|
||||||
+ this.uniqueId = new UUID(most, least);
|
|
||||||
+ CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId);
|
|
||||||
+ if (world != null) {
|
|
||||||
+ dimension = StringTag.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
|
||||||
+ } else {
|
|
||||||
+ dimension = StringTag.create("bukkit:_invalidworld_");
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ dimension = StringTag.create("bukkit:_invalidworld_");
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ DataResult<ResourceKey<Level>> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, dimension)); // CraftBukkit - decompile error
|
|
||||||
+ // Paper end - fix "Not a string" spam
|
|
||||||
Logger logger = MapItemSavedData.LOGGER;
|
|
||||||
|
|
||||||
logger.getClass();
|
|
@ -17,14 +17,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public static Optional<EntityType<?>> byString(String id) {
|
public static Optional<EntityType<?>> byString(String id) {
|
||||||
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
|
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
|
||||||
return this.category;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public String getDescriptionId() { return getDescriptionId(); } // Paper - OBFHELPER
|
|
||||||
public String getDescriptionId() {
|
|
||||||
if (this.descriptionId == null) {
|
|
||||||
this.descriptionId = Util.makeDescriptionId("entity", Registry.ENTITY_TYPE.getKey(this));
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
|
@ -78,4 +78,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
// Paper start
|
this.getHandle().closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLUGIN);
|
@ -19,26 +19,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
return this.level.isRainingAt(blockposition) || this.level.isRainingAt(new BlockPos((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
|
return this.level.isRainingAt(blockposition) || this.level.isRainingAt(new BlockPos((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public final boolean isInBubbleColumn() { return isInBubbleColumn(); } // Paper - OBFHELPER
|
- private boolean isInBubbleColumn() {
|
||||||
private boolean isInBubbleColumn() {
|
+ public boolean isInBubbleColumn() { // Paper - make public
|
||||||
return this.level.getBlockState(this.blockPosition()).is(Blocks.BUBBLE_COLUMN);
|
return this.level.getBlockState(this.blockPosition()).is(Blocks.BUBBLE_COLUMN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
return this.isInWater() || this.isInRain();
|
||||||
|
}
|
||||||
|
|
||||||
|
- public final boolean isInWaterOrRainOrBubble() { return isInWaterRainOrBubble(); } // Paper - OBFHELPER
|
||||||
|
public boolean isInWaterRainOrBubble() {
|
||||||
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
|
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public final boolean isInWaterOrBubbleColumn() { return isInWaterOrBubble(); } // Paper - OBFHELPER
|
|
||||||
public boolean isInWaterOrBubble() {
|
|
||||||
return this.isInWater() || this.isInBubbleColumn();
|
|
||||||
}
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
||||||
return this.fluidOnEyes == fluidTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public final boolean isInLava() { return isInLava(); } // Paper - OBFHELPER
|
|
||||||
public boolean isInLava() {
|
|
||||||
return !this.firstTick && this.fluidHeight.getDouble(FluidTags.LAVA) > 0.0D;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@ -61,11 +54,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public boolean isInWaterOrBubbleColumn() {
|
+ public boolean isInWaterOrBubbleColumn() {
|
||||||
+ return getHandle().isInWaterOrBubbleColumn();
|
+ return getHandle().isInWaterOrBubble();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public boolean isInWaterOrRainOrBubbleColumn() {
|
+ public boolean isInWaterOrRainOrBubbleColumn() {
|
||||||
+ return getHandle().isInWaterOrRainOrBubble();
|
+ return getHandle().isInWaterRainOrBubble();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public boolean isInLava() {
|
+ public boolean isInLava() {
|
||||||
|
@ -4,6 +4,25 @@ Date: Sun, 23 Aug 2020 15:28:35 +0200
|
|||||||
Subject: [PATCH] Add more Evoker API
|
Subject: [PATCH] Add more Evoker API
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||||
|
@@ -0,0 +0,0 @@ public class Evoker extends SpellcasterIllager {
|
||||||
|
return SoundEvents.EVOKER_HURT;
|
||||||
|
}
|
||||||
|
|
||||||
|
- void setWololoTarget(@Nullable Sheep sheep) {
|
||||||
|
+ public void setWololoTarget(@Nullable Sheep sheep) { // Paper - make public
|
||||||
|
this.wololoTarget = sheep;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
- Sheep getWololoTarget() {
|
||||||
|
+ public Sheep getWololoTarget() { // Paper - make public
|
||||||
|
return this.wololoTarget;
|
||||||
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||||
|
@ -19,17 +19,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ CraftChunkData data = (CraftChunkData) createChunkData(world);
|
+ CraftChunkData data = (CraftChunkData) createChunkData(world);
|
||||||
+ // do bunch of vanilla shit
|
+ // do bunch of vanilla shit
|
||||||
+ net.minecraft.server.level.ServerLevel nmsWorld = ((CraftWorld) world).getHandle();
|
+ net.minecraft.server.level.ServerLevel nmsWorld = ((CraftWorld) world).getHandle();
|
||||||
+ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), net.minecraft.world.level.chunk.UpgradeData.getEmptyConverter(), nmsWorld);
|
+ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), null, nmsWorld);
|
||||||
+ List<net.minecraft.world.level.chunk.ChunkAccess> list = new ArrayList<>();
|
+ List<net.minecraft.world.level.chunk.ChunkAccess> list = new ArrayList<>();
|
||||||
+ list.add(protoChunk);
|
+ list.add(protoChunk);
|
||||||
+ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list);
|
+ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list, net.minecraft.world.level.chunk.ChunkStatus.EMPTY, -1);
|
||||||
+ // call vanilla generator, one feature after another. Order here is important!
|
+ // call vanilla generator, one feature after another. Order here is important!
|
||||||
+ net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator = nmsWorld.getChunkSource().generator;
|
+ net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator = nmsWorld.getChunkSource().generator;
|
||||||
+ if (chunkGenerator instanceof org.bukkit.craftbukkit.generator.CustomChunkGenerator) {
|
+ if (chunkGenerator instanceof org.bukkit.craftbukkit.generator.CustomChunkGenerator) {
|
||||||
+ chunkGenerator = ((org.bukkit.craftbukkit.generator.CustomChunkGenerator) chunkGenerator).delegate;
|
+ chunkGenerator = ((org.bukkit.craftbukkit.generator.CustomChunkGenerator) chunkGenerator).delegate;
|
||||||
+ }
|
+ }
|
||||||
+ chunkGenerator.createBiomes(nmsWorld.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), protoChunk);
|
+ chunkGenerator.createBiomes(nmsWorld.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), protoChunk);
|
||||||
+ chunkGenerator.fillFromNoise(genRegion, nmsWorld.structureFeatureManager(), protoChunk);
|
+ chunkGenerator.fillFromNoise((runnable) -> {}, nmsWorld.structureFeatureManager(), protoChunk);
|
||||||
+ chunkGenerator.buildSurfaceAndBedrock(genRegion, protoChunk);
|
+ chunkGenerator.buildSurfaceAndBedrock(genRegion, protoChunk);
|
||||||
+ // copy over generated sections
|
+ // copy over generated sections
|
||||||
+ data.setRawChunkData(protoChunk.getSections());
|
+ data.setRawChunkData(protoChunk.getSections());
|
||||||
|
@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ if (goalFloat.validConditions()) goalFloat.update();
|
+ if (goalFloat.validConditions()) goalFloat.update();
|
||||||
+ this.getJumpControl().jumpIfSet();
|
+ this.getJumpControl().jumpIfSet();
|
||||||
+ }
|
+ }
|
||||||
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterOrRainOrBubble()) {
|
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) {
|
||||||
+ hurt(DamageSource.DROWN, 1.0F);
|
+ hurt(DamageSource.DROWN, 1.0F);
|
||||||
+ }
|
+ }
|
||||||
+ return;
|
+ return;
|
||||||
|
@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
@@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData {
|
@@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData {
|
||||||
Preconditions.checkState(MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
|
Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - cache block data strings
|
+ // Paper start - cache block data strings
|
@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||||
@@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory {
|
@@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory {
|
||||||
|
|
||||||
return nms != null ? net.minecraft.locale.Language.getInstance().translateKey(nms.getItem().getDescriptionId()) : null;
|
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId()) : null;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void blockChanged(BlockPos blockposition) {
|
public void blockChanged(BlockPos pos) {
|
||||||
+ if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks
|
+ if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks
|
||||||
LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance
|
LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance
|
||||||
|
|
@ -8,15 +8,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||||||
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
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.resources.ResourceLocation;
|
@@ -0,0 +0,0 @@ import net.minecraft.resources.ResourceKey;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.server.MCUtil;
|
import net.minecraft.server.MCUtil;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ChunkMap;
|
|
||||||
+import net.minecraft.server.level.ServerChunkCache;
|
+import net.minecraft.server.level.ServerChunkCache;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.level.TicketType;
|
import net.minecraft.server.level.TicketType;
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
public static int nextEntityId() {
|
public static int nextEntityId() {
|
||||||
return ENTITY_COUNTER.incrementAndGet();
|
return ENTITY_COUNTER.incrementAndGet();
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||||||
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
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
|
||||||
void accept(Entity entity, double x, double y, double z);
|
void accept(Entity entity, double x, double y, double z);
|
||||||
}
|
}
|
@ -9,21 +9,13 @@ 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 @@ import net.minecraft.world.entity.ai.village.poi.PoiType;
|
|
||||||
import net.minecraft.world.entity.animal.horse.SkeletonHorse;
|
|
||||||
import net.minecraft.world.entity.boss.EnderDragonPart;
|
|
||||||
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
|
||||||
+import net.minecraft.world.entity.item.ItemEntity;
|
|
||||||
import net.minecraft.world.entity.monster.Drowned;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
|
||||||
import net.minecraft.world.entity.raid.Raid;
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
@@ -0,0 +0,0 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||||
} else if (this.isUUIDUsed(entity)) {
|
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
+ // Paper start - capture all item additions to the world
|
+ // Paper start - capture all item additions to the world
|
||||||
+ if (captureDrops != null && entity instanceof ItemEntity) {
|
+ if (captureDrops != null && entity instanceof net.minecraft.world.entity.item.ItemEntity) {
|
||||||
+ captureDrops.add((ItemEntity) entity);
|
+ captureDrops.add((net.minecraft.world.entity.item.ItemEntity) entity);
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
@ -12,29 +12,29 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/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 ServerGamePacketListener {
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) {
|
public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||||
if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit
|
if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit
|
||||||
- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot);
|
- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||||
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot); // Paper - use proper setPositionRotation for teleportation
|
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper setPositionRotation for teleportation
|
||||||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||||
this.lastGoodZ = this.awaitingPositionFromClient.z;
|
this.lastGoodZ = this.awaitingPositionFromClient.z;
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
|
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
|
||||||
this.player.forceCheckHighPriority(); // Paper
|
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||||
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private static final int CURRENT_LEVEL = 2;
|
private static final int CURRENT_LEVEL = 2;
|
||||||
@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
||||||
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
||||||
@ -53,9 +53,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ this.preserveMotion = false;
|
+ this.preserveMotion = false;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
this.setPosAndOldPos(x, y, z);
|
this.setPosRaw(x, y, z);
|
||||||
this.yRot = yaw;
|
this.setYRot(yaw);
|
||||||
this.xRot = pitch;
|
this.setXRot(pitch);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
@ -76,8 +76,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
// entity.setLocation() throws no event, and so cannot be cancelled
|
// entity.setLocation() throws no event, and so cannot be cancelled
|
||||||
- entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
- this.entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting
|
+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting
|
||||||
// SPIGOT-619: Force sync head rotation also
|
// SPIGOT-619: Force sync head rotation also
|
||||||
entity.setYHeadRot(location.getYaw());
|
this.entity.setYHeadRot(location.getYaw());
|
||||||
((net.minecraft.server.level.ServerLevel) entity.level).updateChunkPos(entity); // Spigot - register to new chunk
|
|
@ -8,12 +8,6 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/Ne
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
package net.minecraft.world.level.levelgen.surfacebuilders;
|
|
||||||
+<<<<<<< found
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
|
@@ -0,0 +0,0 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
|
||||||
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||||
BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, 128, m));
|
BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, 128, m));
|
||||||
@ -23,6 +17,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
mutableBlockPos.set(k, p, m);
|
mutableBlockPos.set(k, p, m);
|
||||||
BlockState blockState4 = chunk.getBlockState(mutableBlockPos);
|
BlockState blockState4 = chunk.getBlockState(mutableBlockPos);
|
||||||
if (blockState3.is(defaultBlock.getBlock()) && (blockState4.isAir() || blockState4 == defaultFluid)) {
|
if (blockState3.is(defaultBlock.getBlock()) && (blockState4.isAir() || blockState4 == defaultFluid)) {
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
|
||||||
|
|
||||||
|
protected abstract BlockState getPatchBlockState();
|
||||||
|
}
|
||||||
|
+
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
|
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
|
||||||
|
@ -49,11 +49,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ registeredGlobally = true;
|
+ registeredGlobally = true;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
net.minecraft.world.scores.Objective objective = board.registerObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
net.minecraft.world.scores.Objective objective = board.addObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
||||||
return new CraftObjective(this, objective);
|
return new CraftObjective(this, objective);
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
@@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||||
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
|
net.minecraft.world.scores.Objective objective = this.board.addObjective(name, craftCriteria.criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
||||||
|
|
||||||
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);
|
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
@ -72,19 +72,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
@@ -0,0 +0,0 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
||||||
|
|
||||||
public CraftScoreboardManager(MinecraftServer minecraftserver, net.minecraft.world.scores.Scoreboard scoreboardServer) {
|
public CraftScoreboardManager(MinecraftServer minecraftserver, net.minecraft.world.scores.Scoreboard scoreboardServer) {
|
||||||
mainScoreboard = new CraftScoreboard(scoreboardServer);
|
this.mainScoreboard = new CraftScoreboard(scoreboardServer);
|
||||||
+ mainScoreboard.registeredGlobally = true; // Paper
|
+ mainScoreboard.registeredGlobally = true; // Paper
|
||||||
server = minecraftserver;
|
this.server = minecraftserver;
|
||||||
scoreboards.add(mainScoreboard);
|
this.scoreboards.add(mainScoreboard);
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
@@ -0,0 +0,0 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
||||||
public CraftScoreboard getNewScoreboard() {
|
public CraftScoreboard getNewScoreboard() {
|
||||||
org.spigotmc.AsyncCatcher.catchOp("scoreboard creation"); // Spigot
|
org.spigotmc.AsyncCatcher.catchOp("scoreboard creation"); // Spigot
|
||||||
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(server));
|
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(this.server));
|
||||||
|
- this.scoreboards.add(scoreboard);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (com.destroystokyo.paper.PaperConfig.trackPluginScoreboards) {
|
+ if (com.destroystokyo.paper.PaperConfig.trackPluginScoreboards) {
|
||||||
+ scoreboard.registeredGlobally = true;
|
+ scoreboard.registeredGlobally = true;
|
||||||
scoreboards.add(scoreboard);
|
+ scoreboards.add(scoreboard);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
return scoreboard;
|
return scoreboard;
|
||||||
@ -99,4 +100,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
// CraftBukkit method
|
// CraftBukkit method
|
||||||
public CraftScoreboard getPlayerBoard(CraftPlayer player) {
|
public CraftScoreboard getPlayerBoard(CraftPlayer player) {
|
||||||
CraftScoreboard board = playerBoards.get(player);
|
CraftScoreboard board = this.playerBoards.get(player);
|
@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
} // Paper - timings
|
} // Paper - timings
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ catch (Exception e) {
|
+ catch (Exception e) {
|
||||||
+ Connection networkmanager = listener.a();
|
+ Connection networkmanager = listener.getConnection();
|
||||||
+ if (networkmanager.getPlayer() != null) {
|
+ if (networkmanager.getPlayer() != null) {
|
||||||
+ LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getScoreboardName(), networkmanager.getRemoteAddress(), e);
|
+ LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getScoreboardName(), networkmanager.getRemoteAddress(), e);
|
||||||
+ } else {
|
+ } else {
|
||||||
|
Loading…
Reference in New Issue
Block a user