Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
This commit is contained in:
parent
752f957e12
commit
dc684c60d1
478 changed files with 55 additions and 74 deletions
30
patches/server/0768-Add-PrePlayerAttackEntityEvent.patch
Normal file
30
patches/server/0768-Add-PrePlayerAttackEntityEvent.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
||||
Date: Sun, 18 Sep 2022 13:10:18 -0400
|
||||
Subject: [PATCH] Add PrePlayerAttackEntityEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 538c530ce9a2ce94dc013d8237b68b66bfcaa610..4ff41cc3e2ff69c6f0c3cd7be3e22d6948010599 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1256,8 +1256,17 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
public void attack(Entity target) {
|
||||
- if (target.isAttackable()) {
|
||||
- if (!target.skipAttackInteraction(this)) {
|
||||
+ // Paper start - PlayerAttackEntityEvent
|
||||
+ boolean willAttack = target.isAttackable() && !target.skipAttackInteraction(this); // Vanilla logic
|
||||
+ io.papermc.paper.event.player.PrePlayerAttackEntityEvent playerAttackEntityEvent = new io.papermc.paper.event.player.PrePlayerAttackEntityEvent(
|
||||
+ (org.bukkit.entity.Player) this.getBukkitEntity(),
|
||||
+ target.getBukkitEntity(),
|
||||
+ willAttack
|
||||
+ );
|
||||
+
|
||||
+ if (playerAttackEntityEvent.callEvent() && willAttack) { // Logic moved to willAttack local variable.
|
||||
+ {
|
||||
+ // Paper end - PlayerAttackEntityEvent
|
||||
float f = this.isAutoSpinAttack() ? this.autoSpinAttackDmg : (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE);
|
||||
ItemStack itemstack = this.getWeaponItem();
|
||||
DamageSource damagesource = this.damageSources().playerAttack(this);
|
Loading…
Add table
Add a link
Reference in a new issue