13
0
geforkt von Mirrors/Paper
Dieser Commit ist enthalten in:
Jake Potrebic 2024-04-23 19:46:06 -07:00
Ursprung e45f4f85f4
Commit 840f63b25a
33 geänderte Dateien mit 61 neuen und 63 gelöschten Zeilen

Datei anzeigen

@ -46,7 +46,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, EntityAccess, CommandSource, S @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;

Datei anzeigen

@ -45,9 +45,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {
this.enablePlugins(PluginLoadOrder.STARTUP);
this.enablePlugins(PluginLoadOrder.POSTWORLD); this.enablePlugins(PluginLoadOrder.POSTWORLD);
this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
+ org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload + org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload
} }

Datei anzeigen

@ -33,17 +33,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
@@ -0,0 +0,0 @@ public class Phantom extends FlyingMob implements Enemy { @@ -0,0 +0,0 @@ public class Phantom extends FlyingMob implements Enemy {
return -0.125F; return entitysize.scale(1.0F + 0.15F * (float) i);
} }
+ // Paper start + // Paper start
+ @Nullable
+ java.util.UUID spawningEntity; + java.util.UUID spawningEntity;
+ +
+ @Nullable
+ public java.util.UUID getSpawningEntity() { + public java.util.UUID getSpawningEntity() {
+ return spawningEntity; + return this.spawningEntity;
+ } + }
+ public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } + public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
+ // Paper end + // Paper end
+
private static enum AttackPhase { private static enum AttackPhase {
CIRCLE, SWOOP; CIRCLE, SWOOP;
@ -69,7 +72,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (entityphantom != null) { if (entityphantom != null) {
+ entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper - PhantomPreSpawnEvent + entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper - PhantomPreSpawnEvent
entityphantom.moveTo(blockposition1, 0.0F, 0.0F); entityphantom.moveTo(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null); groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity);
world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

Datei anzeigen

@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/block/TntBlock.java --- a/src/main/java/net/minecraft/world/level/block/TntBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java
@@ -0,0 +0,0 @@ public class TntBlock extends Block { @@ -0,0 +0,0 @@ public class TntBlock extends Block {
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (!oldState.is(state.getBlock())) { if (!oldState.is(state.getBlock())) {
if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, null)) { // CraftBukkit - TNTPrimeEvent if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, null)) { // CraftBukkit - TNTPrimeEvent
+ // Paper start - TNTPrimeEvent + // Paper start - TNTPrimeEvent
@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@@ -0,0 +0,0 @@ public class TntBlock extends Block { @@ -0,0 +0,0 @@ public class TntBlock extends Block {
@Override @Override
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, sourcePos)) { // CraftBukkit - TNTPrimeEvent if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, sourcePos)) { // CraftBukkit - TNTPrimeEvent
+ // Paper start - TNTPrimeEvent + // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); + org.bukkit.block.Block tntBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int i = entitytntprimed.getFuse(); int i = entitytntprimed.getFuse();
@@ -0,0 +0,0 @@ public class TntBlock extends Block { @@ -0,0 +0,0 @@ public class TntBlock extends Block {
return InteractionResult.CONSUME; return ItemInteractionResult.CONSUME;
} }
// CraftBukkit end // CraftBukkit end
+ // Paper start - TNTPrimeEvent + // Paper start - TNTPrimeEvent
@ -101,7 +101,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - TNTPrimeEvent + // Paper end - TNTPrimeEvent
TntBlock.explode(world, pos, player); TntBlock.explode(world, pos, player);
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11);
Item item = itemstack.getItem(); Item item = stack.getItem();
@@ -0,0 +0,0 @@ public class TntBlock extends Block { @@ -0,0 +0,0 @@ public class TntBlock extends Block {
return; return;
} }

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -0,0 +0,0 @@ public final class ItemStack { @@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
enuminteractionresult = InteractionResult.FAIL; // cancel placement enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed // PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory(); placeEvent.getPlayer().updateInventory();

Datei anzeigen

@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.canTickSetByAPI = true; + this.canTickSetByAPI = true;
+ } + }
+ // Paper end - Allow ArmorStands not to tick + // Paper end - Allow ArmorStands not to tick
CompoundTag nbttagcompound1 = nbt.getCompound("Pose"); CompoundTag nbttagcompound2 = nbt.getCompound("Pose");
this.readPose(nbttagcompound1); this.readPose(nbttagcompound2);
@@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity { @@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity {
@Override @Override

Datei anzeigen

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -0,0 +0,0 @@ public class AnvilMenu extends ItemCombinerMenu { @@ -0,0 +0,0 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) { if (!player.hasInfiniteMaterials() && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
BlockState iblockdata1 = AnvilBlock.damage(iblockdata); BlockState iblockdata1 = AnvilBlock.damage(iblockdata);
+ // Paper start - AnvilDamageEvent + // Paper start - AnvilDamageEvent

Datei anzeigen

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
@@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup { @@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override @Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) { if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
@ -39,11 +39,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - Configurable speed for water flowing over lava + // Paper end - Configurable speed for water flowing over lava
+ +
@Override @Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) {
@@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup { @@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override @Override
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) { if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava

Datei anzeigen

@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - cancellable death event + // Paper end - cancellable death event
// CraftBukkit start // CraftBukkit start
public String displayName; public CraftPlayer.TransferCookieConnection transferCookieConnection;
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
@Override @Override
@ -95,10 +95,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.isDeadOrDying()) { if (this.isDeadOrDying()) {
if (!this.checkTotemDeathProtection(source)) { if (!this.checkTotemDeathProtection(source)) {
- SoundEvent soundeffect = this.getDeathSound(); - if (flag1) {
- - this.makeSound(this.getDeathSound());
- if (flag1 && soundeffect != null) {
- this.playSound(soundeffect, this.getSoundVolume(), this.getVoicePitch());
- } - }
+ // Paper start - moved into CraftEventFactory event caller for cancellable death event + // Paper start - moved into CraftEventFactory event caller for cancellable death event
+ this.silentDeath = !flag1; // mark entity as dying silently + this.silentDeath = !flag1; // mark entity as dying silently
@ -131,8 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (world instanceof ServerLevel) { if (world instanceof ServerLevel) {
ServerLevel worldserver = (ServerLevel) world; ServerLevel worldserver = (ServerLevel) world;
+ // Paper - move below into if for onKill + // Paper - move below into if for onKill
+
- if (entity == null || entity.killedEntity(worldserver, this)) {
+ // Paper start + // Paper start
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource); + org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource);
+ if (deathEvent == null || !deathEvent.isCancelled()) { + if (deathEvent == null || !deathEvent.isCancelled()) {
@ -155,7 +152,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (!this.level().isClientSide && this.hasCustomName()) { + if (!this.level().isClientSide && this.hasCustomName()) {
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot + if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
+ } + }
+
- if (entity == null || entity.killedEntity(worldserver, this)) {
+ this.getCombatTracker().recheckStatus(); + this.getCombatTracker().recheckStatus();
+ if (entity != null) { + if (entity != null) {
+ entity.killedEntity((ServerLevel) this.level(), this); + entity.killedEntity((ServerLevel) this.level(), this);
@ -237,7 +235,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
} }
@ -250,7 +248,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops); super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
EquipmentSlot enumitemslot = aenumitemslot[k]; EquipmentSlot enumitemslot = aenumitemslot[k];
@ -258,7 +256,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ItemStack itemstack = this.getItemBySlot(enumitemslot); ItemStack itemstack = this.getItemBySlot(enumitemslot);
float f = this.getEquipmentDropChance(enumitemslot); float f = this.getEquipmentDropChance(enumitemslot);
boolean flag1 = f > 1.0F; boolean flag1 = f > 1.0F;
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
} }
this.spawnAtLocation(itemstack); this.spawnAtLocation(itemstack);
@ -317,7 +315,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return deathEvent; // Paper - Cancellable death event + return deathEvent; // Paper - Cancellable death event
} }
@Override public static boolean isPathClear(Fox fox, LivingEntity chasedEntity) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
@ -390,10 +388,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper + private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper
ItemStack itemstack = new ItemStack(Items.ARMOR_STAND); ItemStack itemstack = new ItemStack(Items.ARMOR_STAND);
if (this.hasCustomName()) { itemstack.set(DataComponents.CUSTOM_NAME, this.getCustomName());
@@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity {
}
this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
- this.brokenByAnything(damageSource); - this.brokenByAnything(damageSource);
+ return this.brokenByAnything(damageSource); // Paper + return this.brokenByAnything(damageSource); // Paper

Datei anzeigen

@ -19,12 +19,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(); - private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>();
- private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>(); - private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>();
- private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>(); - private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>();
- private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>(); - private final Map<ResourceKey<T>, RegistrationInfo> registrationInfos = new IdentityHashMap<>();
+ private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(2048), map -> map.defaultReturnValue(-1)); // Paper - Perf: Use bigger expected size to reduce collisions + private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(2048), map -> map.defaultReturnValue(-1)); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map<ResourceKey<T>, RegistrationInfo> registrationInfos = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
private Lifecycle registryLifecycle; private Lifecycle registryLifecycle;
private volatile Map<TagKey<T>, HolderSet.Named<T>> tags = new IdentityHashMap<>(); private volatile Map<TagKey<T>, HolderSet.Named<T>> tags = new IdentityHashMap<>();
private boolean frozen; private boolean frozen;

Datei anzeigen

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Nov 2016 00:40:42 -0500
Subject: [PATCH] Remove unnecessary itemmeta handling
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
// CraftBukkit start
ItemStack itemstack = new ItemStack(holder, i, datacomponentpatch);
- if (!datacomponentpatch.isEmpty()) {
+ if (false && !datacomponentpatch.isEmpty()) { // Paper - This is no longer needed with raw NBT being handled in metadata
CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
}
return itemstack;
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
// Spigot start - filter
itemstack = itemstack.copy();
- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
+ // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata
// Spigot end
ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error
DataComponentPatch.STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.components.asPatch());

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapG
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
@@ -0,0 +0,0 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; @@ -0,0 +0,0 @@ import net.minecraft.world.item.enchantment.ItemEnchantments;
public class SkeletonTrapGoal extends Goal { public class SkeletonTrapGoal extends Goal {
private final SkeletonHorse horse; private final SkeletonHorse horse;

Datei anzeigen

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Nov 2016 00:40:42 -0500
Subject: [PATCH] Remove unnecessary itemmeta handling
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
// Spigot start - filter
stack = stack.copy();
- CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack));
+ // CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack)); // Paper - This is no longer with raw NBT being handled in metadata
// Spigot end
nbttagcompound = stack.getTag();
}
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
itemstack.setTag(this.readNbt());
// CraftBukkit start
- if (itemstack.getTag() != null) {
+ if (false && itemstack.getTag() != null) { // Paper - This is no longer needed with raw NBT being handled in metadata
CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
}
// CraftBukkit end