Spigot Timings
Overhauls the Timings System adding performance tracking all around the Minecraft Server By: Aikar <aikar@aikar.co>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.FenceGateBlock;
|
||||
@@ -138,9 +138,67 @@
|
||||
@@ -138,9 +138,68 @@
|
||||
import net.minecraft.world.scores.ScoreHolder;
|
||||
import net.minecraft.world.scores.Team;
|
||||
import org.slf4j.Logger;
|
||||
@@ -33,6 +33,7 @@
|
||||
+import org.bukkit.entity.Hanging;
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.entity.Vehicle;
|
||||
+import org.spigotmc.CustomTimingsHandler; // Spigot
|
||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
+import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
|
||||
@@ -61,13 +62,13 @@
|
||||
+// CraftBukkit end
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder {
|
||||
+
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ private static final int CURRENT_LEVEL = 2;
|
||||
+ static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
||||
+ return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
+ }
|
||||
|
||||
+
|
||||
+ private CraftEntity bukkitEntity;
|
||||
+
|
||||
+ public CraftEntity getBukkitEntity() {
|
||||
@@ -86,7 +87,7 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final String ID_TAG = "id";
|
||||
public static final String PASSENGERS_TAG = "Passengers";
|
||||
@@ -224,7 +282,7 @@
|
||||
@@ -224,7 +283,7 @@
|
||||
private static final EntityDataAccessor<Boolean> DATA_CUSTOM_NAME_VISIBLE = SynchedEntityData.defineId(Entity.class, EntityDataSerializers.BOOLEAN);
|
||||
private static final EntityDataAccessor<Boolean> DATA_SILENT = SynchedEntityData.defineId(Entity.class, EntityDataSerializers.BOOLEAN);
|
||||
private static final EntityDataAccessor<Boolean> DATA_NO_GRAVITY = SynchedEntityData.defineId(Entity.class, EntityDataSerializers.BOOLEAN);
|
||||
@@ -95,7 +96,7 @@
|
||||
private static final EntityDataAccessor<Integer> DATA_TICKS_FROZEN = SynchedEntityData.defineId(Entity.class, EntityDataSerializers.INT);
|
||||
private EntityInLevelCallback levelCallback;
|
||||
private final VecDeltaCodec packetPositionCodec;
|
||||
@@ -253,7 +311,31 @@
|
||||
@@ -253,7 +312,32 @@
|
||||
private final List<Entity.Movement> movementThisTick;
|
||||
private final Set<BlockState> blocksInside;
|
||||
private final LongSet visitedBlocks;
|
||||
@@ -114,6 +115,7 @@
|
||||
+ // Marks an entity, that it was removed by a plugin via Entity#remove
|
||||
+ // Main use case currently is for SPIGOT-7487, preventing dropping of leash when leash is removed
|
||||
+ public boolean pluginRemoved = false;
|
||||
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot
|
||||
|
||||
+ public float getBukkitYaw() {
|
||||
+ return this.yRot;
|
||||
@@ -127,7 +129,7 @@
|
||||
public Entity(EntityType<?> type, Level world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
this.passengers = ImmutableList.of();
|
||||
@@ -292,7 +374,7 @@
|
||||
@@ -292,7 +376,7 @@
|
||||
datawatcher_a.define(Entity.DATA_CUSTOM_NAME, Optional.empty());
|
||||
datawatcher_a.define(Entity.DATA_SILENT, false);
|
||||
datawatcher_a.define(Entity.DATA_NO_GRAVITY, false);
|
||||
@@ -136,7 +138,7 @@
|
||||
datawatcher_a.define(Entity.DATA_TICKS_FROZEN, 0);
|
||||
this.defineSynchedData(datawatcher_a);
|
||||
this.entityData = datawatcher_a.build();
|
||||
@@ -362,20 +444,36 @@
|
||||
@@ -362,20 +446,36 @@
|
||||
}
|
||||
|
||||
public void kill(ServerLevel world) {
|
||||
@@ -175,7 +177,7 @@
|
||||
public boolean equals(Object object) {
|
||||
return object instanceof Entity ? ((Entity) object).id == this.id : false;
|
||||
}
|
||||
@@ -385,22 +483,34 @@
|
||||
@@ -385,22 +485,34 @@
|
||||
}
|
||||
|
||||
public void remove(Entity.RemovalReason reason) {
|
||||
@@ -215,7 +217,7 @@
|
||||
return this.getPose() == pose;
|
||||
}
|
||||
|
||||
@@ -417,6 +527,33 @@
|
||||
@@ -417,6 +529,33 @@
|
||||
}
|
||||
|
||||
public void setRot(float yaw, float pitch) {
|
||||
@@ -249,7 +251,7 @@
|
||||
this.setYRot(yaw % 360.0F);
|
||||
this.setXRot(pitch % 360.0F);
|
||||
}
|
||||
@@ -462,6 +599,15 @@
|
||||
@@ -462,6 +601,15 @@
|
||||
this.baseTick();
|
||||
}
|
||||
|
||||
@@ -265,7 +267,7 @@
|
||||
public void baseTick() {
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
@@ -475,7 +621,7 @@
|
||||
@@ -475,7 +623,7 @@
|
||||
--this.boardingCooldown;
|
||||
}
|
||||
|
||||
@@ -274,7 +276,7 @@
|
||||
if (this.canSpawnSprintParticle()) {
|
||||
this.spawnSprintParticle();
|
||||
}
|
||||
@@ -514,6 +660,10 @@
|
||||
@@ -514,6 +662,10 @@
|
||||
if (this.isInLava()) {
|
||||
this.lavaHurt();
|
||||
this.fallDistance *= 0.5F;
|
||||
@@ -285,7 +287,7 @@
|
||||
}
|
||||
|
||||
this.checkBelowWorld();
|
||||
@@ -525,7 +675,7 @@
|
||||
@@ -525,7 +677,7 @@
|
||||
world = this.level();
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
if (this instanceof Leashable) {
|
||||
@@ -294,7 +296,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,15 +718,32 @@
|
||||
@@ -568,15 +720,32 @@
|
||||
|
||||
public void lavaHurt() {
|
||||
if (!this.fireImmune()) {
|
||||
@@ -329,7 +331,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -587,9 +754,25 @@
|
||||
@@ -587,9 +756,25 @@
|
||||
}
|
||||
|
||||
public final void igniteForSeconds(float seconds) {
|
||||
@@ -356,7 +358,7 @@
|
||||
public void igniteForTicks(int ticks) {
|
||||
if (this.remainingFireTicks < ticks) {
|
||||
this.setRemainingFireTicks(ticks);
|
||||
@@ -610,7 +793,7 @@
|
||||
@@ -610,7 +795,7 @@
|
||||
}
|
||||
|
||||
protected void onBelowWorld() {
|
||||
@@ -365,13 +367,18 @@
|
||||
}
|
||||
|
||||
public boolean isFree(double offsetX, double offsetY, double offsetZ) {
|
||||
@@ -747,8 +930,30 @@
|
||||
@@ -672,6 +857,7 @@
|
||||
}
|
||||
|
||||
public void move(MoverType type, Vec3 movement) {
|
||||
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -750,6 +936,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (movement.y != vec3d1.y) {
|
||||
block.updateEntityMovementAfterFallOn(this.level(), this);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ if (this.horizontalCollision && this.getBukkitEntity() instanceof Vehicle) {
|
||||
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
@@ -385,22 +392,30 @@
|
||||
+ bl = bl.getRelative(BlockFace.SOUTH);
|
||||
+ } else if (movement.z < vec3d1.z) {
|
||||
+ bl = bl.getRelative(BlockFace.NORTH);
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ if (!bl.getType().isAir()) {
|
||||
+ VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(vehicle, bl);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
+
|
||||
if (!this.level().isClientSide() || this.isControlledByLocalInstance()) {
|
||||
Entity.MovementEmission entity_movementemission = this.getMovementEmission();
|
||||
@@ -1131,7 +1336,21 @@
|
||||
|
||||
@@ -764,6 +972,7 @@
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
}
|
||||
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
private void applyMovementEmissionAndPlaySound(Entity.MovementEmission moveEffect, Vec3 movement, BlockPos landingPos, BlockState landingState) {
|
||||
@@ -1132,6 +1341,20 @@
|
||||
protected SoundEvent getSwimHighSpeedSplashSound() {
|
||||
return SoundEvents.GENERIC_SPLASH;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - Add delegate methods
|
||||
+ public SoundEvent getSwimSound0() {
|
||||
@@ -413,12 +428,12 @@
|
||||
+
|
||||
+ public SoundEvent getSwimHighSpeedSplashSound0() {
|
||||
+ return this.getSwimHighSpeedSplashSound();
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public void recordMovementThroughBlocks(Vec3 oldPos, Vec3 newPos) {
|
||||
this.movementThisTick.add(new Entity.Movement(oldPos, newPos));
|
||||
@@ -1609,6 +1828,7 @@
|
||||
@@ -1609,6 +1832,7 @@
|
||||
this.yo = y;
|
||||
this.zo = d4;
|
||||
this.setPos(d3, y, d4);
|
||||
@@ -426,7 +441,7 @@
|
||||
}
|
||||
|
||||
public void moveTo(Vec3 pos) {
|
||||
@@ -1861,6 +2081,12 @@
|
||||
@@ -1861,6 +2085,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -439,7 +454,7 @@
|
||||
public void awardKillScore(Entity entityKilled, DamageSource damageSource) {
|
||||
if (entityKilled instanceof ServerPlayer) {
|
||||
CriteriaTriggers.ENTITY_KILLED_PLAYER.trigger((ServerPlayer) entityKilled, this, damageSource);
|
||||
@@ -1889,16 +2115,22 @@
|
||||
@@ -1889,16 +2119,22 @@
|
||||
}
|
||||
|
||||
public boolean saveAsPassenger(CompoundTag nbt) {
|
||||
@@ -465,22 +480,21 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1909,54 +2141,97 @@
|
||||
@@ -1909,54 +2145,97 @@
|
||||
}
|
||||
|
||||
public CompoundTag saveWithoutId(CompoundTag nbt) {
|
||||
- try {
|
||||
- if (this.vehicle != null) {
|
||||
- nbt.put("Pos", this.newDoubleList(this.vehicle.getX(), this.getY(), this.vehicle.getZ()));
|
||||
- } else {
|
||||
- nbt.put("Pos", this.newDoubleList(this.getX(), this.getY(), this.getZ()));
|
||||
+ // CraftBukkit start - allow excluding certain data when saving
|
||||
+ return this.saveWithoutId(nbt, true);
|
||||
+ }
|
||||
+
|
||||
+ public CompoundTag saveWithoutId(CompoundTag nbttagcompound, boolean includeAll) {
|
||||
+ // CraftBukkit end
|
||||
+ try {
|
||||
try {
|
||||
- if (this.vehicle != null) {
|
||||
- nbt.put("Pos", this.newDoubleList(this.vehicle.getX(), this.getY(), this.vehicle.getZ()));
|
||||
- } else {
|
||||
- nbt.put("Pos", this.newDoubleList(this.getX(), this.getY(), this.getZ()));
|
||||
+ // CraftBukkit start - selectively save position
|
||||
+ if (includeAll) {
|
||||
+ if (this.vehicle != null) {
|
||||
@@ -584,7 +598,7 @@
|
||||
}
|
||||
|
||||
ListTag nbttaglist;
|
||||
@@ -1972,10 +2247,10 @@
|
||||
@@ -1972,10 +2251,10 @@
|
||||
nbttaglist.add(StringTag.valueOf(s));
|
||||
}
|
||||
|
||||
@@ -597,7 +611,7 @@
|
||||
if (this.isVehicle()) {
|
||||
nbttaglist = new ListTag();
|
||||
iterator = this.getPassengers().iterator();
|
||||
@@ -1984,17 +2259,22 @@
|
||||
@@ -1984,17 +2263,22 @@
|
||||
Entity entity = (Entity) iterator.next();
|
||||
CompoundTag nbttagcompound1 = new CompoundTag();
|
||||
|
||||
@@ -623,7 +637,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being saved");
|
||||
@@ -2080,6 +2360,45 @@
|
||||
@@ -2080,6 +2364,45 @@
|
||||
} else {
|
||||
throw new IllegalStateException("Entity has invalid position");
|
||||
}
|
||||
@@ -669,7 +683,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
|
||||
@@ -2101,6 +2420,12 @@
|
||||
@@ -2101,6 +2424,12 @@
|
||||
return entitytypes.canSerialize() && minecraftkey != null ? minecraftkey.toString() : null;
|
||||
}
|
||||
|
||||
@@ -682,7 +696,7 @@
|
||||
protected abstract void readAdditionalSaveData(CompoundTag nbt);
|
||||
|
||||
protected abstract void addAdditionalSaveData(CompoundTag nbt);
|
||||
@@ -2153,9 +2478,22 @@
|
||||
@@ -2153,9 +2482,22 @@
|
||||
if (stack.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -705,7 +719,7 @@
|
||||
world.addFreshEntity(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
@@ -2184,6 +2522,12 @@
|
||||
@@ -2184,6 +2526,12 @@
|
||||
if (this.isAlive() && this instanceof Leashable leashable) {
|
||||
if (leashable.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -718,7 +732,7 @@
|
||||
if (player.hasInfiniteMaterials()) {
|
||||
leashable.removeLeash();
|
||||
} else {
|
||||
@@ -2200,6 +2544,13 @@
|
||||
@@ -2200,6 +2548,13 @@
|
||||
|
||||
if (itemstack.is(Items.LEAD) && leashable.canHaveALeashAttachedToIt()) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -732,7 +746,7 @@
|
||||
leashable.setLeashedTo(player, true);
|
||||
}
|
||||
|
||||
@@ -2265,7 +2616,7 @@
|
||||
@@ -2265,7 +2620,7 @@
|
||||
}
|
||||
|
||||
public boolean showVehicleHealth() {
|
||||
@@ -741,7 +755,7 @@
|
||||
}
|
||||
|
||||
public boolean startRiding(Entity entity, boolean force) {
|
||||
@@ -2273,7 +2624,7 @@
|
||||
@@ -2273,7 +2628,7 @@
|
||||
return false;
|
||||
} else if (!entity.couldAcceptPassenger()) {
|
||||
return false;
|
||||
@@ -750,7 +764,7 @@
|
||||
return false;
|
||||
} else {
|
||||
for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) {
|
||||
@@ -2285,11 +2636,32 @@
|
||||
@@ -2285,11 +2640,32 @@
|
||||
if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -784,7 +798,7 @@
|
||||
this.vehicle = entity;
|
||||
this.vehicle.addPassenger(this);
|
||||
entity.getIndirectPassengersStream().filter((entity2) -> {
|
||||
@@ -2318,7 +2690,7 @@
|
||||
@@ -2318,7 +2694,7 @@
|
||||
Entity entity = this.vehicle;
|
||||
|
||||
this.vehicle = null;
|
||||
@@ -793,7 +807,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2349,21 +2721,50 @@
|
||||
@@ -2349,21 +2725,50 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,7 +864,7 @@
|
||||
}
|
||||
|
||||
protected boolean canAddPassenger(Entity passenger) {
|
||||
@@ -2464,7 +2865,7 @@
|
||||
@@ -2464,7 +2869,7 @@
|
||||
if (teleporttransition != null) {
|
||||
ServerLevel worldserver1 = teleporttransition.newLevel();
|
||||
|
||||
@@ -859,7 +873,7 @@
|
||||
this.teleport(teleporttransition);
|
||||
}
|
||||
}
|
||||
@@ -2547,7 +2948,7 @@
|
||||
@@ -2547,7 +2952,7 @@
|
||||
}
|
||||
|
||||
public boolean isCrouching() {
|
||||
@@ -868,7 +882,7 @@
|
||||
}
|
||||
|
||||
public boolean isSprinting() {
|
||||
@@ -2563,7 +2964,7 @@
|
||||
@@ -2563,7 +2968,7 @@
|
||||
}
|
||||
|
||||
public boolean isVisuallySwimming() {
|
||||
@@ -877,7 +891,7 @@
|
||||
}
|
||||
|
||||
public boolean isVisuallyCrawling() {
|
||||
@@ -2571,6 +2972,13 @@
|
||||
@@ -2571,6 +2976,13 @@
|
||||
}
|
||||
|
||||
public void setSwimming(boolean swimming) {
|
||||
@@ -891,7 +905,7 @@
|
||||
this.setSharedFlag(4, swimming);
|
||||
}
|
||||
|
||||
@@ -2624,8 +3032,12 @@
|
||||
@@ -2624,8 +3036,12 @@
|
||||
return this.getTeam() != null ? this.getTeam().isAlliedTo(team) : false;
|
||||
}
|
||||
|
||||
@@ -905,7 +919,7 @@
|
||||
}
|
||||
|
||||
public boolean getSharedFlag(int index) {
|
||||
@@ -2644,7 +3056,7 @@
|
||||
@@ -2644,7 +3060,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -914,7 +928,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -2652,7 +3064,18 @@
|
||||
@@ -2652,7 +3068,18 @@
|
||||
}
|
||||
|
||||
public void setAirSupply(int air) {
|
||||
@@ -934,7 +948,7 @@
|
||||
}
|
||||
|
||||
public int getTicksFrozen() {
|
||||
@@ -2679,11 +3102,40 @@
|
||||
@@ -2679,11 +3106,40 @@
|
||||
|
||||
public void thunderHit(ServerLevel world, LightningBolt lightning) {
|
||||
this.setRemainingFireTicks(this.remainingFireTicks + 1);
|
||||
@@ -977,7 +991,7 @@
|
||||
}
|
||||
|
||||
public void onAboveBubbleCol(boolean drag) {
|
||||
@@ -2713,7 +3165,7 @@
|
||||
@@ -2713,7 +3169,7 @@
|
||||
this.resetFallDistance();
|
||||
}
|
||||
|
||||
@@ -986,7 +1000,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2852,6 +3304,18 @@
|
||||
@@ -2852,6 +3308,18 @@
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
if (!this.isRemoved()) {
|
||||
@@ -1005,7 +1019,7 @@
|
||||
ServerLevel worldserver1 = teleportTarget.newLevel();
|
||||
boolean flag = worldserver1.dimension() != worldserver.dimension();
|
||||
|
||||
@@ -2920,8 +3384,12 @@
|
||||
@@ -2920,8 +3388,12 @@
|
||||
} else {
|
||||
entity.restoreFrom(this);
|
||||
this.removeAfterChangingDimensions();
|
||||
@@ -1019,7 +1033,7 @@
|
||||
Iterator iterator1 = list1.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
@@ -2947,7 +3415,7 @@
|
||||
@@ -2947,7 +3419,7 @@
|
||||
}
|
||||
|
||||
private void sendTeleportTransitionToRidingPlayers(TeleportTransition teleportTarget) {
|
||||
@@ -1028,7 +1042,7 @@
|
||||
Iterator iterator = this.getIndirectPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -2995,8 +3463,9 @@
|
||||
@@ -2995,8 +3467,9 @@
|
||||
}
|
||||
|
||||
protected void removeAfterChangingDimensions() {
|
||||
@@ -1039,7 +1053,7 @@
|
||||
leashable.removeLeash();
|
||||
}
|
||||
|
||||
@@ -3004,7 +3473,21 @@
|
||||
@@ -3004,7 +3477,21 @@
|
||||
|
||||
public Vec3 getRelativePortalPosition(Direction.Axis portalAxis, BlockUtil.FoundRectangle portalRect) {
|
||||
return PortalShape.getRelativePosition(portalRect, portalAxis, this.position(), this.getDimensions(this.getPose()));
|
||||
@@ -1061,7 +1075,7 @@
|
||||
|
||||
public boolean canUsePortal(boolean allowVehicles) {
|
||||
return (allowVehicles || !this.isPassenger()) && this.isAlive();
|
||||
@@ -3134,10 +3617,16 @@
|
||||
@@ -3134,10 +3621,16 @@
|
||||
return (Boolean) this.entityData.get(Entity.DATA_CUSTOM_NAME_VISIBLE);
|
||||
}
|
||||
|
||||
@@ -1081,7 +1095,7 @@
|
||||
return entity != null;
|
||||
}
|
||||
|
||||
@@ -3187,7 +3676,7 @@
|
||||
@@ -3187,7 +3680,7 @@
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
protected void fixupDimensions() {
|
||||
@@ -1090,7 +1104,7 @@
|
||||
EntityDimensions entitysize = this.getDimensions(entitypose);
|
||||
|
||||
this.dimensions = entitysize;
|
||||
@@ -3196,7 +3685,7 @@
|
||||
@@ -3196,7 +3689,7 @@
|
||||
|
||||
public void refreshDimensions() {
|
||||
EntityDimensions entitysize = this.dimensions;
|
||||
@@ -1099,7 +1113,7 @@
|
||||
EntityDimensions entitysize1 = this.getDimensions(entitypose);
|
||||
|
||||
this.dimensions = entitysize1;
|
||||
@@ -3258,10 +3747,29 @@
|
||||
@@ -3258,10 +3751,29 @@
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AABB boundingBox) {
|
||||
@@ -1131,7 +1145,7 @@
|
||||
return this.getDimensions(pose).eyeHeight();
|
||||
}
|
||||
|
||||
@@ -3335,7 +3843,7 @@
|
||||
@@ -3335,7 +3847,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1140,7 +1154,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3435,7 +3943,7 @@
|
||||
@@ -3435,7 +3947,7 @@
|
||||
}
|
||||
|
||||
public boolean isControlledByLocalInstance() {
|
||||
@@ -1149,7 +1163,7 @@
|
||||
|
||||
if (entityliving instanceof Player entityhuman) {
|
||||
return entityhuman.isLocalPlayer();
|
||||
@@ -3445,7 +3953,7 @@
|
||||
@@ -3445,7 +3957,7 @@
|
||||
}
|
||||
|
||||
public boolean isControlledByClient() {
|
||||
@@ -1158,7 +1172,7 @@
|
||||
|
||||
return entityliving != null && entityliving.isControlledByClient();
|
||||
}
|
||||
@@ -3463,7 +3971,7 @@
|
||||
@@ -3463,7 +3975,7 @@
|
||||
return new Vec3((double) f1 * d2 / (double) f3, 0.0D, (double) f2 * d2 / (double) f3);
|
||||
}
|
||||
|
||||
@@ -1167,7 +1181,7 @@
|
||||
return new Vec3(this.getX(), this.getBoundingBox().maxY, this.getZ());
|
||||
}
|
||||
|
||||
@@ -3489,8 +3997,37 @@
|
||||
@@ -3489,8 +4001,37 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1206,7 +1220,7 @@
|
||||
}
|
||||
|
||||
public void lookAt(EntityAnchorArgument.Anchor anchorPoint, Vec3 target) {
|
||||
@@ -3551,6 +4088,11 @@
|
||||
@@ -3551,6 +4092,11 @@
|
||||
vec3d = vec3d.add(vec3d1);
|
||||
++k1;
|
||||
}
|
||||
@@ -1218,7 +1232,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3613,7 +4155,7 @@
|
||||
@@ -3613,7 +4159,7 @@
|
||||
return new ClientboundAddEntityPacket(this, entityTrackerEntry);
|
||||
}
|
||||
|
||||
@@ -1227,7 +1241,7 @@
|
||||
return this.type.getDimensions();
|
||||
}
|
||||
|
||||
@@ -3818,8 +4360,16 @@
|
||||
@@ -3818,8 +4364,16 @@
|
||||
|
||||
@Override
|
||||
public final void setRemoved(Entity.RemovalReason reason) {
|
||||
@@ -1245,7 +1259,7 @@
|
||||
}
|
||||
|
||||
if (this.removalReason.shouldDestroy()) {
|
||||
@@ -3827,8 +4377,8 @@
|
||||
@@ -3827,8 +4381,8 @@
|
||||
}
|
||||
|
||||
this.getPassengers().forEach(Entity::stopRiding);
|
||||
@@ -1256,7 +1270,7 @@
|
||||
}
|
||||
|
||||
public void unsetRemoved() {
|
||||
@@ -3887,7 +4437,7 @@
|
||||
@@ -3887,7 +4441,7 @@
|
||||
}
|
||||
|
||||
public Vec3 getKnownMovement() {
|
||||
|
||||
Reference in New Issue
Block a user