mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-05 17:22:42 -05:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a54723e05 | ||
|
|
f0388e2f38 | ||
|
|
102c8bbc54 |
No files matched your search
@@ -38,6 +38,7 @@ subprojects {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = 21
|
||||
options.isFork = true
|
||||
options.isWarnings = false
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
|
||||
+12
-12
@@ -577,7 +577,7 @@
|
||||
|
||||
this.player.connection.send(new ClientboundSetHeldSlotPacket(inventory.selected));
|
||||
this.player.inventoryMenu.broadcastChanges();
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1103,7 +1103,7 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.player.stopUsingItem();
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1125,21 +1125,21 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.player.drop(false);
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
|
||||
return;
|
||||
case DROP_ALL_ITEMS:
|
||||
if (!this.player.isSpectator()) {
|
||||
this.player.drop(true);
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
|
||||
return;
|
||||
case RELEASE_USE_ITEM:
|
||||
- this.player.releaseUsingItem();
|
||||
+ if (this.player.getUseItem() == this.player.getItemInHand(this.player.getUsedItemHand())) this.player.releaseUsingItem(); // Paper - validate use item before processing release
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
return;
|
||||
case START_DESTROY_BLOCK:
|
||||
case ABORT_DESTROY_BLOCK:
|
||||
@@ -1172,7 +1172,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Send block entities after destroy prediction
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
return;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid player action");
|
||||
@@ -1247,7 +1247,7 @@
|
||||
|
||||
this.player.connection.send(new ClientboundBlockUpdatePacket(serverLevel, blockPos));
|
||||
this.player.connection.send(new ClientboundBlockUpdatePacket(serverLevel, blockPos.relative(direction)));
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
} else {
|
||||
LOGGER.warn(
|
||||
"Rejecting UseItemOnPacket from {}: Location {} too far away from hit block {}.",
|
||||
@@ -1397,7 +1397,7 @@
|
||||
|
||||
this.player.getInventory().selected = packet.getSlot();
|
||||
this.player.resetLastActionTime();
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
} else {
|
||||
LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
||||
+ this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // CraftBukkit // Paper - kick event cause
|
||||
@@ -2004,7 +2004,7 @@
|
||||
+ });
|
||||
+ }
|
||||
+ // Paper end - PlayerUseUnknownEntityEvent
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2410,7 +2410,7 @@
|
||||
} else {
|
||||
this.player.containerMenu.broadcastChanges();
|
||||
}
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2487,7 +2487,7 @@
|
||||
if (flag) {
|
||||
this.player.containerMenu.broadcastChanges();
|
||||
}
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2536,7 +2536,7 @@
|
||||
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
|
||||
this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
|
||||
this.player.inventoryMenu.broadcastChanges();
|
||||
+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
||||
} else if (flag && flag2) {
|
||||
if (this.dropSpamThrottler.isUnderThreshold()) {
|
||||
this.dropSpamThrottler.increment();
|
||||
|
||||
@@ -15,3 +15,12 @@
|
||||
ServerLevel serverLevel = (ServerLevel)attacker.level();
|
||||
attacker.setDeltaMovement(attacker.getDeltaMovement().with(Direction.Axis.Y, 0.01F));
|
||||
if (attacker instanceof ServerPlayer serverPlayer) {
|
||||
@@ -139,7 +_,7 @@
|
||||
double knockbackPower = getKnockbackPower(attacker, livingEntity, vec3);
|
||||
Vec3 vec31 = vec3.normalize().scale(knockbackPower);
|
||||
if (knockbackPower > 0.0) {
|
||||
- livingEntity.push(vec31.x, 0.7F, vec31.z);
|
||||
+ livingEntity.push(vec31.x, 0.7F, vec31.z, attacker); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
if (livingEntity instanceof ServerPlayer serverPlayer) {
|
||||
serverPlayer.connection.send(new ClientboundSetEntityMotionPacket(serverPlayer));
|
||||
}
|
||||
@@ -184,6 +184,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean skipVanillaDamageTickWhenShieldBlocked = false;
|
||||
@Comment("This setting controls what compression format is used for region files.")
|
||||
public CompressionFormat compressionFormat = CompressionFormat.ZLIB;
|
||||
@Comment("This setting controls if equipment should be updated when handling certain player actions.")
|
||||
public boolean updateEquipmentOnPlayerActions = true;
|
||||
|
||||
public enum CompressionFormat {
|
||||
GZIP,
|
||||
|
||||
Reference in new issue
Block a user