[ci skip] Add more patch identifying comments

This commit is contained in:
Nassim Jahnke
2024-01-16 12:41:40 +01:00
parent 73b42e843e
commit 22185798a5
41 changed files with 176 additions and 171 deletions

View File

@@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public boolean bukkitPickUpLoot;
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
+ public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper
+ public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
@Override
public float getBukkitYaw() {
@@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public boolean shouldDiscardFriction() {
- return this.discardFriction;
+ return !this.frictionState.toBooleanOrElse(!this.discardFriction); // Paper
+ return !this.frictionState.toBooleanOrElse(!this.discardFriction); // Paper - Friction API
}
public void setDiscardFriction(boolean noDrag) {
@@ -29,11 +29,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
+ // Paper start
+ // Paper start - Friction API
+ if (this.frictionState != net.kyori.adventure.util.TriState.NOT_SET) {
+ nbt.putString("Paper.FrictionState", this.frictionState.toString());
+ }
+ // Paper end
+ // Paper end - Friction API
nbt.putFloat("Health", this.getHealth());
nbt.putShort("HurtTime", (short) this.hurtTime);
nbt.putInt("HurtByTimestamp", this.lastHurtByMobTimestamp);
@@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
absorptionAmount = 0;
}
this.internalSetAbsorptionAmount(absorptionAmount);
+
+ // Paper start - Friction API
+ if (nbt.contains("Paper.FrictionState")) {
+ String fs = nbt.getString("Paper.FrictionState");
+ try {
@@ -50,6 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ LOGGER.error("Unknown friction state " + fs + " for " + this);
+ }
+ }
+ // Paper end - Friction API
// Paper end
if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
this.getAttributes().load(nbt.getList("Attributes", 10));
@@ -61,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
public boolean canMobPickup = true; // Paper
private int despawnRate = -1; // Paper
+ public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper
+ public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
public ItemEntity(EntityType<? extends ItemEntity> type, Level world) {
super(type, world);
@@ -70,11 +71,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
float f1 = 0.98F;
- if (this.onGround()) {
+ // Paper start
+ // Paper start - Friction API
+ if (frictionState == net.kyori.adventure.util.TriState.FALSE) {
+ f1 = 1F;
+ } else if (this.onGround()) {
+ // Paper end
+ // Paper end - Friction API
f1 = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F;
}
@@ -82,11 +83,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
+ // Paper start
+ // Paper start - Friction API
+ if (this.frictionState != net.kyori.adventure.util.TriState.NOT_SET) {
+ nbt.putString("Paper.FrictionState", this.frictionState.toString());
+ }
+ // Paper end
+ // Paper end - Friction API
nbt.putShort("Health", (short) this.health);
nbt.putShort("Age", (short) this.age);
nbt.putShort("PickupDelay", (short) this.pickupDelay);
@@ -94,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.cachedThrower = null;
}
+ // Paper start
+ // Paper start - Friction API
+ if (nbt.contains("Paper.FrictionState")) {
+ String fs = nbt.getString("Paper.FrictionState");
+ try {
@@ -103,7 +104,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ com.mojang.logging.LogUtils.getLogger().error("Unknown friction state " + fs + " for " + this);
+ }
+ }
+ // Paper end
+ // Paper end - Friction API
+
CompoundTag nbttagcompound1 = nbt.getCompound("Item");