geforkt von Mirrors/Paper
Option to prevent armor stands from doing entity lookups
Dieser Commit ist enthalten in:
Ursprung
85be8cc620
Commit
1549b076df
@ -97,7 +97,15 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -341,7 +362,7 @@
|
||||
@@ -327,6 +348,7 @@
|
||||
|
||||
@Override
|
||||
protected void pushEntities() {
|
||||
+ if (!this.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return; // Paper - Option to prevent armor stands from doing entity lookups
|
||||
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), ArmorStand.RIDABLE_MINECARTS);
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
@@ -341,7 +363,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -106,7 +114,7 @@
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
|
||||
if (!this.isMarker() && !itemstack.is(Items.NAME_TAG)) {
|
||||
@@ -350,11 +371,11 @@
|
||||
@@ -350,11 +372,11 @@
|
||||
} else if (player.level().isClientSide) {
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
} else {
|
||||
@ -121,7 +129,7 @@
|
||||
|
||||
if (this.hasItemInSlot(enumitemslot2) && this.swapItem(player, enumitemslot2, itemstack, hand)) {
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
@@ -364,7 +385,7 @@
|
||||
@@ -364,7 +386,7 @@
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
|
||||
@ -130,7 +138,7 @@
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
|
||||
@@ -380,39 +401,57 @@
|
||||
@@ -380,39 +402,57 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +212,7 @@
|
||||
this.setItemSlot(slot, stack.copyWithCount(1));
|
||||
return true;
|
||||
} else if (!stack.isEmpty() && stack.getCount() > 1) {
|
||||
@@ -427,6 +466,7 @@
|
||||
@@ -427,6 +467,7 @@
|
||||
player.setItemInHand(hand, itemstack1);
|
||||
return true;
|
||||
}
|
||||
@ -212,7 +220,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -436,12 +476,22 @@
|
||||
@@ -436,12 +477,22 @@
|
||||
} else if (!world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && source.getEntity() instanceof Mob) {
|
||||
return false;
|
||||
} else if (source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
|
||||
@ -238,7 +246,7 @@
|
||||
return false;
|
||||
} else if (source.is(DamageTypeTags.IGNITES_ARMOR_STANDS)) {
|
||||
if (this.isOnFire()) {
|
||||
@@ -463,8 +513,8 @@
|
||||
@@ -463,8 +514,8 @@
|
||||
} else {
|
||||
Entity entity = source.getEntity();
|
||||
|
||||
@ -249,7 +257,7 @@
|
||||
|
||||
if (!entityhuman.getAbilities().mayBuild) {
|
||||
return false;
|
||||
@@ -474,7 +524,7 @@
|
||||
@@ -474,7 +525,7 @@
|
||||
if (source.isCreativePlayer()) {
|
||||
this.playBrokenSound();
|
||||
this.showBreakingParticles();
|
||||
@ -258,7 +266,7 @@
|
||||
return true;
|
||||
} else {
|
||||
long i = world.getGameTime();
|
||||
@@ -486,7 +536,7 @@
|
||||
@@ -486,7 +537,7 @@
|
||||
} else {
|
||||
this.brokenByPlayer(world, source);
|
||||
this.showBreakingParticles();
|
||||
@ -267,7 +275,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -536,7 +586,7 @@
|
||||
@@ -536,7 +587,7 @@
|
||||
f1 -= amount;
|
||||
if (f1 <= 0.5F) {
|
||||
this.brokenByAnything(world, damageSource);
|
||||
@ -276,7 +284,7 @@
|
||||
} else {
|
||||
this.setHealth(f1);
|
||||
this.gameEvent(GameEvent.ENTITY_DAMAGE, damageSource.getEntity());
|
||||
@@ -548,13 +598,13 @@
|
||||
@@ -548,13 +599,13 @@
|
||||
ItemStack itemstack = new ItemStack(Items.ARMOR_STAND);
|
||||
|
||||
itemstack.set(DataComponents.CUSTOM_NAME, this.getCustomName());
|
||||
@ -292,7 +300,7 @@
|
||||
|
||||
ItemStack itemstack;
|
||||
int i;
|
||||
@@ -562,7 +612,7 @@
|
||||
@@ -562,7 +613,7 @@
|
||||
for (i = 0; i < this.handItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.handItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@ -301,7 +309,7 @@
|
||||
this.handItems.set(i, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
@@ -570,15 +620,16 @@
|
||||
@@ -570,15 +621,16 @@
|
||||
for (i = 0; i < this.armorItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.armorItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@ -320,7 +328,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -663,10 +714,24 @@
|
||||
@@ -663,10 +715,24 @@
|
||||
public boolean isBaby() {
|
||||
return this.isSmall();
|
||||
}
|
||||
@ -346,7 +354,7 @@
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
}
|
||||
|
||||
@@ -788,7 +853,7 @@
|
||||
@@ -788,7 +854,7 @@
|
||||
|
||||
@Override
|
||||
public boolean skipAttackInteraction(Entity attacker) {
|
||||
@ -355,7 +363,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -882,4 +947,13 @@
|
||||
@@ -882,4 +948,13 @@
|
||||
public boolean canBeSeenByAnyone() {
|
||||
return !this.isInvisible() && !this.isMarker();
|
||||
}
|
||||
|
@ -237,7 +237,7 @@
|
||||
|
||||
+ // Paper start - if loaded
|
||||
@Nullable
|
||||
+ @Override
|
||||
@Override
|
||||
+ public final ChunkAccess getChunkIfLoadedImmediately(int x, int z) {
|
||||
+ return ((ServerLevel)this).chunkSource.getChunkAtIfLoadedImmediately(x, z);
|
||||
+ }
|
||||
@ -290,7 +290,7 @@
|
||||
+ return getWorldBorder().isWithinBounds(blockposition) ? getBlockStateIfLoaded(blockposition) : null;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
+ @Override
|
||||
public ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
|
||||
+ // Paper end
|
||||
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
|
||||
@ -475,7 +475,7 @@
|
||||
|
||||
return chunk.getBlockState(pos);
|
||||
}
|
||||
@@ -446,32 +720,44 @@
|
||||
@@ -446,34 +720,53 @@
|
||||
this.pendingBlockEntityTickers.clear();
|
||||
}
|
||||
|
||||
@ -528,16 +528,25 @@
|
||||
+ // Paper end - Prevent block entity and entity crashes
|
||||
}
|
||||
}
|
||||
+ // Paper start - Option to prevent armor stands from doing entity lookups
|
||||
+ @Override
|
||||
+ public boolean noCollision(@Nullable Entity entity, AABB box) {
|
||||
+ if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false;
|
||||
+ return LevelAccessor.super.noCollision(entity, box);
|
||||
+ }
|
||||
+ // Paper end - Option to prevent armor stands from doing entity lookups
|
||||
|
||||
@@ -510,13 +796,29 @@
|
||||
public boolean shouldTickDeath(Entity entity) {
|
||||
return true;
|
||||
@@ -510,13 +803,29 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity getBlockEntity(BlockPos pos) {
|
||||
- return this.isOutsideBuildHeight(pos) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(pos).getBlockEntity(pos, LevelChunk.EntityCreationType.IMMEDIATE));
|
||||
+ // CraftBukkit start
|
||||
+ return this.getBlockEntity(pos, true);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ @Nullable
|
||||
+ public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {
|
||||
+ if (this.capturedTileEntities.containsKey(blockposition)) {
|
||||
@ -545,8 +554,8 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE));
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
public void setBlockEntity(BlockEntity blockEntity) {
|
||||
BlockPos blockposition = blockEntity.getBlockPos();
|
||||
|
||||
@ -560,7 +569,7 @@
|
||||
this.getChunkAt(blockposition).addAndRegisterBlockEntity(blockEntity);
|
||||
}
|
||||
}
|
||||
@@ -643,7 +945,7 @@
|
||||
@@ -643,7 +952,7 @@
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EnderDragonPart entitycomplexpart = aentitycomplexpart[k];
|
||||
@ -569,7 +578,7 @@
|
||||
|
||||
if (t0 != null && predicate.test(t0)) {
|
||||
result.add(t0);
|
||||
@@ -912,7 +1214,7 @@
|
||||
@@ -912,7 +1221,7 @@
|
||||
|
||||
public static enum ExplosionInteraction implements StringRepresentable {
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren