mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
fixes cancelling PlayerTradeEvent (#5612)
This commit is contained in:
parent
f4f5a76e2a
commit
1707c10395
@ -0,0 +1,249 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Thu, 2 Jul 2020 16:12:10 -0700
|
||||
Subject: [PATCH] Add PlayerTradeEvent and PlayerPurchaseEvent
|
||||
|
||||
Co-authored-by: Alexander <protonull@protonmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
index 4a7b657265cbbc91ae85409abb3db29cfc555a2c..c75fa3274dedfafa11b94704695a2313f11c22cc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -138,11 +138,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
@Override
|
||||
public void overrideXp(int experience) {}
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public void processTrade(MerchantOffer recipe, io.papermc.paper.event.player.PlayerPurchaseEvent event) { // The MerchantRecipe passed in here is the one set by the PlayerPurchaseEvent
|
||||
+ if (event.willIncreaseTradeUses()) {
|
||||
+ recipe.increaseUses();
|
||||
+ }
|
||||
+ if (event.isRewardingExp()) {
|
||||
+ this.rewardTradeXp(recipe);
|
||||
+ }
|
||||
+ this.notifyTrade(recipe);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public void notifyTrade(MerchantOffer offer) {
|
||||
- offer.increaseUses();
|
||||
+ // offer.increaseUses(); // Paper - handled in processTrade
|
||||
this.ambientSoundTime = -this.getAmbientSoundInterval();
|
||||
- this.rewardTradeXp(offer);
|
||||
+ // this.rewardTradeXp(offer); // Paper - handled in processTrade
|
||||
if (this.tradingPlayer instanceof ServerPlayer) {
|
||||
CriteriaTriggers.TRADE.trigger((ServerPlayer) this.tradingPlayer, this, offer.getResult());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 60a67f75b4f772654e064e2b19f68a907ca4c93b..83d9fe7d92a8cb46478964d0742d0103a937648c 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -741,6 +741,14 @@ public abstract class AbstractContainerMenu {
|
||||
public abstract boolean stillValid(Player player);
|
||||
|
||||
protected boolean moveItemStackTo(ItemStack stack, int startIndex, int endIndex, boolean fromLast) {
|
||||
+ // Paper start
|
||||
+ return this.moveItemStackTo(stack, startIndex, endIndex, fromLast, false);
|
||||
+ }
|
||||
+ protected boolean moveItemStackTo(ItemStack stack, int startIndex, int endIndex, boolean fromLast, boolean isCheck) {
|
||||
+ if (isCheck) {
|
||||
+ stack = stack.copy();
|
||||
+ }
|
||||
+ // Paper end
|
||||
boolean flag1 = false;
|
||||
int k = startIndex;
|
||||
|
||||
@@ -763,18 +771,27 @@ public abstract class AbstractContainerMenu {
|
||||
|
||||
slot = (Slot) this.slots.get(k);
|
||||
itemstack1 = slot.getItem();
|
||||
+ // Paper start - clone if only a check
|
||||
+ if (isCheck) {
|
||||
+ itemstack1 = itemstack1.copy();
|
||||
+ }
|
||||
+ // Paper end
|
||||
if (!itemstack1.isEmpty() && ItemStack.isSameItemSameTags(stack, itemstack1)) {
|
||||
int l = itemstack1.getCount() + stack.getCount();
|
||||
|
||||
if (l <= stack.getMaxStackSize()) {
|
||||
stack.setCount(0);
|
||||
itemstack1.setCount(l);
|
||||
+ if (!isCheck) { // Paper - dont update if only a check
|
||||
slot.setChanged();
|
||||
+ } // Paper
|
||||
flag1 = true;
|
||||
} else if (itemstack1.getCount() < stack.getMaxStackSize()) {
|
||||
stack.shrink(stack.getMaxStackSize() - itemstack1.getCount());
|
||||
itemstack1.setCount(stack.getMaxStackSize());
|
||||
+ if (!isCheck) { // Paper - dont update if only a check
|
||||
slot.setChanged();
|
||||
+ } // Paper
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
@@ -805,14 +822,33 @@ public abstract class AbstractContainerMenu {
|
||||
|
||||
slot = (Slot) this.slots.get(k);
|
||||
itemstack1 = slot.getItem();
|
||||
+ // Paper start - clone if only a check
|
||||
+ if (isCheck) {
|
||||
+ itemstack1 = itemstack1.copy();
|
||||
+ }
|
||||
+ // Paper end
|
||||
if (itemstack1.isEmpty() && slot.mayPlace(stack)) {
|
||||
if (stack.getCount() > slot.getMaxStackSize()) {
|
||||
+ // Paper start - dont set slot if only check
|
||||
+ if (isCheck) {
|
||||
+ stack.shrink(slot.getMaxStackSize());
|
||||
+ } else {
|
||||
+ // Paper end
|
||||
slot.set(stack.split(slot.getMaxStackSize()));
|
||||
+ } // Paper
|
||||
} else {
|
||||
+ // Paper start - dont set slot if only check
|
||||
+ if (isCheck) {
|
||||
+ stack.shrink(stack.getCount());
|
||||
+ } else {
|
||||
+ // Paper end
|
||||
slot.set(stack.split(stack.getCount()));
|
||||
+ } // Paper
|
||||
}
|
||||
|
||||
+ if (!isCheck) { // Paper - dont update if only check
|
||||
slot.setChanged();
|
||||
+ } // Paper
|
||||
flag1 = true;
|
||||
break;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
|
||||
index dc036f6450b2eccdc848c66dac525ed43f70f4e4..549c13180fbbebce73771a8d82eb040f1b4fc605 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
|
||||
@@ -134,12 +134,12 @@ public class MerchantMenu extends AbstractContainerMenu {
|
||||
|
||||
itemstack = itemstack1.copy();
|
||||
if (index == 2) {
|
||||
- if (!this.moveItemStackTo(itemstack1, 3, 39, true)) {
|
||||
+ if (!this.moveItemStackTo(itemstack1, 3, 39, true, true)) { // Paper
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
- slot.onQuickCraft(itemstack1, itemstack);
|
||||
- this.playTradeSound();
|
||||
+ // slot.onQuickCraft(itemstack1, itemstack); // Paper - moved to after the non-check moveItemStackTo call
|
||||
+ // this.playTradeSound();
|
||||
} else if (index != 0 && index != 1) {
|
||||
if (index >= 3 && index < 30) {
|
||||
if (!this.moveItemStackTo(itemstack1, 30, 39, false)) {
|
||||
@@ -152,6 +152,7 @@ public class MerchantMenu extends AbstractContainerMenu {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
+ if (index != 2) { // Paper - moved down for slot 2
|
||||
if (itemstack1.isEmpty()) {
|
||||
slot.set(ItemStack.EMPTY);
|
||||
} else {
|
||||
@@ -163,6 +164,21 @@ public class MerchantMenu extends AbstractContainerMenu {
|
||||
}
|
||||
|
||||
slot.onTake(player, itemstack1);
|
||||
+ } // Paper start - handle slot 2
|
||||
+ if (index == 2) { // is merchant result slot
|
||||
+ slot.onTake(player, itemstack1);
|
||||
+ if (itemstack1.isEmpty()) {
|
||||
+ slot.set(ItemStack.EMPTY);
|
||||
+ return ItemStack.EMPTY;
|
||||
+ }
|
||||
+
|
||||
+ this.moveItemStackTo(itemstack1, 3, 39, true, false); // This should always succeed because it's checked above
|
||||
+
|
||||
+ slot.onQuickCraft(itemstack1, itemstack);
|
||||
+ this.playTradeSound();
|
||||
+ slot.set(ItemStack.EMPTY); // itemstack1 should ALWAYS be empty
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantResultSlot.java b/src/main/java/net/minecraft/world/inventory/MerchantResultSlot.java
|
||||
index 74b28315197b81f80334ae6023113904e4fac4c3..9e65c9535e01b3c858050a7881aff3f99edbeaac 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/MerchantResultSlot.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/MerchantResultSlot.java
|
||||
@@ -47,13 +47,30 @@ public class MerchantResultSlot extends Slot {
|
||||
|
||||
@Override
|
||||
public void onTake(Player player, ItemStack stack) {
|
||||
- this.checkTakeAchievements(stack);
|
||||
+ // this.checkTakeAchievements(stack); // Paper - move to after event is called and not cancelled
|
||||
MerchantOffer merchantOffer = this.slots.getActiveOffer();
|
||||
+ // Paper start
|
||||
+ io.papermc.paper.event.player.PlayerPurchaseEvent event = null;
|
||||
+ if (this.merchant instanceof net.minecraft.world.entity.npc.AbstractVillager && this.merchant.getTradingPlayer().getBukkitEntity() instanceof org.bukkit.entity.Player) {
|
||||
+ event = new io.papermc.paper.event.player.PlayerTradeEvent((org.bukkit.entity.Player) this.merchant.getTradingPlayer().getBukkitEntity(), (org.bukkit.entity.AbstractVillager) ((net.minecraft.world.entity.npc.AbstractVillager) this.merchant).getBukkitEntity(), merchantOffer.asBukkit(), true, true);
|
||||
+ } else if (this.merchant instanceof org.bukkit.craftbukkit.inventory.CraftMerchantCustom.MinecraftMerchant && this.merchant.getTradingPlayer().getBukkitEntity() instanceof org.bukkit.entity.Player) {
|
||||
+ event = new io.papermc.paper.event.player.PlayerPurchaseEvent((org.bukkit.entity.Player) this.merchant.getTradingPlayer().getBukkitEntity(), merchantOffer.asBukkit(), false, true);
|
||||
+ }
|
||||
+ if (event != null) {
|
||||
+ if (!event.callEvent()) {
|
||||
+ stack.setCount(0);
|
||||
+ event.getPlayer().updateInventory();
|
||||
+ return;
|
||||
+ }
|
||||
+ merchantOffer = org.bukkit.craftbukkit.inventory.CraftMerchantRecipe.fromBukkit(event.getTrade()).toMinecraft();
|
||||
+ }
|
||||
+ this.checkTakeAchievements(stack);
|
||||
+ // Paper end
|
||||
if (merchantOffer != null) {
|
||||
ItemStack itemStack = this.slots.getItem(0);
|
||||
ItemStack itemStack2 = this.slots.getItem(1);
|
||||
if (merchantOffer.take(itemStack, itemStack2) || merchantOffer.take(itemStack2, itemStack)) {
|
||||
- this.merchant.notifyTrade(merchantOffer);
|
||||
+ this.merchant.processTrade(merchantOffer, event); // Paper
|
||||
player.awardStat(Stats.TRADED_WITH_VILLAGER);
|
||||
this.slots.setItem(0, itemStack);
|
||||
this.slots.setItem(1, itemStack2);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/trading/Merchant.java b/src/main/java/net/minecraft/world/item/trading/Merchant.java
|
||||
index 50dca0d86dbc47f66ba2d2f262e8587853cc6f9e..f11eff88ba4b9a4f8601d70c07907cc12611a1d0 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/trading/Merchant.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/trading/Merchant.java
|
||||
@@ -21,6 +21,7 @@ public interface Merchant {
|
||||
|
||||
void overrideOffers(MerchantOffers offers);
|
||||
|
||||
+ default void processTrade(MerchantOffer merchantRecipe, io.papermc.paper.event.player.PlayerPurchaseEvent event) { this.notifyTrade(merchantRecipe); } // Paper
|
||||
void notifyTrade(MerchantOffer offer);
|
||||
|
||||
void notifyTradeUpdated(ItemStack stack);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
index f40d6a0048ad5b3f6e31d83894ee89f5ca64fb3a..22a64092e3b925e852b304376fe0a7c19acf35d0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
@@ -79,10 +79,25 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||
return this.trades;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public void processTrade(MerchantOffer merchantRecipe, io.papermc.paper.event.player.PlayerPurchaseEvent event) { // The MerchantRecipe passed in here is the one set by the PlayerPurchaseEvent
|
||||
+ /** Based on {@link net.minecraft.world.entity.npc.AbstractVillager#processTrade(MerchantOffer, io.papermc.paper.event.player.PlayerPurchaseEvent)} */
|
||||
+ if (getTradingPlayer() instanceof net.minecraft.server.level.ServerPlayer) {
|
||||
+ if (event.willIncreaseTradeUses()) {
|
||||
+ merchantRecipe.increaseUses();
|
||||
+ }
|
||||
+ if (event.isRewardingExp()) {
|
||||
+ this.tradingWorld.addFreshEntity(new net.minecraft.world.entity.ExperienceOrb(tradingWorld, tradingPlayer.getX(), tradingPlayer.getY(), tradingPlayer.getZ(), merchantRecipe.getXp(), org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.tradingPlayer, null));
|
||||
+ }
|
||||
+ }
|
||||
+ this.notifyTrade(merchantRecipe);
|
||||
+ }
|
||||
+ // Paper end
|
||||
@Override
|
||||
public void notifyTrade(MerchantOffer offer) {
|
||||
// increase recipe's uses
|
||||
- offer.increaseUses();
|
||||
+ // offer.increaseUses(); // Paper - handled above in processTrade
|
||||
}
|
||||
|
||||
@Override
|
@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Thu, 2 Jul 2020 16:12:10 -0700
|
||||
Subject: [PATCH] added PlayerTradeEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
index 4a7b657265cbbc91ae85409abb3db29cfc555a2c..e59a77c80a1bbe62aaa61bd4792d21b12c895a5c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -140,13 +140,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
|
||||
@Override
|
||||
public void notifyTrade(MerchantOffer offer) {
|
||||
- offer.increaseUses();
|
||||
- this.ambientSoundTime = -this.getAmbientSoundInterval();
|
||||
- this.rewardTradeXp(offer);
|
||||
+ // Paper - moved down
|
||||
+ // Paper start
|
||||
if (this.tradingPlayer instanceof ServerPlayer) {
|
||||
- CriteriaTriggers.TRADE.trigger((ServerPlayer) this.tradingPlayer, this, offer.getResult());
|
||||
+ io.papermc.paper.event.player.PlayerTradeEvent event = new io.papermc.paper.event.player.PlayerTradeEvent(((ServerPlayer) this.tradingPlayer).getBukkitEntity(), (org.bukkit.entity.AbstractVillager) this.getBukkitEntity(), offer.asBukkit(), true, true);
|
||||
+ event.callEvent();
|
||||
+ if (!event.isCancelled()) {
|
||||
+ MerchantOffer recipe = CraftMerchantRecipe.fromBukkit(event.getTrade()).toMinecraft();
|
||||
+ if (event.willIncreaseTradeUses()) recipe.increaseUses();
|
||||
+ this.ambientSoundTime = -this.getAmbientSoundInterval();
|
||||
+ if (event.isRewardingExp()) this.rewardTradeXp(recipe);
|
||||
+ CriteriaTriggers.TRADE.trigger((ServerPlayer) this.tradingPlayer, this, recipe.getResult());
|
||||
+ }
|
||||
+ } else {
|
||||
+ offer.increaseUses();
|
||||
+ this.ambientSoundTime = -getAmbientSoundInterval();
|
||||
+ this.rewardTradeXp(offer);
|
||||
}
|
||||
-
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
protected abstract void rewardTradeXp(MerchantOffer offer);
|
@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander <protonull@protonmail.com>
|
||||
Date: Thu, 6 May 2021 13:01:25 +0100
|
||||
Subject: [PATCH] Have CraftMerchantCustom emit PlayerPurchaseEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
index f40d6a0048ad5b3f6e31d83894ee89f5ca64fb3a..56a04cfdedfbc34be686304fc2dde59f1707d282 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
@@ -81,6 +81,35 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||
|
||||
@Override
|
||||
public void notifyTrade(MerchantOffer offer) {
|
||||
+ // Paper start
|
||||
+ /** Based on {@link net.minecraft.world.entity.npc.EntityVillagerAbstract#b(MerchantRecipe)} */
|
||||
+ if (getTradingPlayer() instanceof net.minecraft.server.level.ServerPlayer) {
|
||||
+ final net.minecraft.server.level.ServerPlayer trader = (net.minecraft.server.level.ServerPlayer) getTradingPlayer();
|
||||
+ final io.papermc.paper.event.player.PlayerPurchaseEvent event = new io.papermc.paper.event.player.PlayerPurchaseEvent(
|
||||
+ trader.getBukkitEntity(),
|
||||
+ offer.asBukkit(),
|
||||
+ false, // reward xp?
|
||||
+ true); // should increase uses?
|
||||
+ event.callEvent();
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ final org.bukkit.inventory.MerchantRecipe eventTrade = event.getTrade();
|
||||
+ if (event.willIncreaseTradeUses()) {
|
||||
+ eventTrade.setUses(eventTrade.getUses() + 1);
|
||||
+ }
|
||||
+ if (event.isRewardingExp() && eventTrade.hasExperienceReward()) {
|
||||
+ /** Based on {@link net.minecraft.world.entity.npc.EntityVillagerTrader#b(MerchantRecipe)} */
|
||||
+ final int xp = 3 + net.minecraft.world.entity.Entity.SHARED_RANDOM.nextInt(4);
|
||||
+ final Level world = trader.getCommandSenderWorld();
|
||||
+ world.addFreshEntity(new net.minecraft.world.entity.ExperienceOrb(
|
||||
+ world, trader.getX(), trader.getY() + 0.5d, trader.getZ(), xp,
|
||||
+ org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, trader, null));
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
// increase recipe's uses
|
||||
offer.increaseUses();
|
||||
}
|
@ -57,7 +57,7 @@ index 708ac03d5a849bf09c49547306e4a8c5a5ef8d91..5a8df368a4a25839cd4ac9be6972da2e
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5f7abfba4154a3191d56eddb6dc75f26d3da3ca9..1a3ebbfdeeff1dee8d6cf2e1611453172fab852e 100644
|
||||
index a9f763a0fba107b7f39c59bb20804ce69df566c0..c21ae45dce12a8079401207f83877e72e786e154 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -320,7 +320,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -5,7 +5,7 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 93826caece07029911a90919361b773e2f8dc80f..805fff130b9ed08309ed287978bd0dd2f52b95a4 100644
|
||||
index c21ae45dce12a8079401207f83877e72e786e154..d7c053043aecf7dd701773192eb54017eb87237a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1099,7 +1099,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -21,7 +21,7 @@ index f28aefd9192b26f39e71826fa87cca60a799be39..f8c0574137cab33d0b5efe5d532efb13
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 805fff130b9ed08309ed287978bd0dd2f52b95a4..640ee1b8ca4ba7308d94832fc23b0c57c81a99e1 100644
|
||||
index d7c053043aecf7dd701773192eb54017eb87237a..faa32056399e93e729c6313dc15e7315e34b8eb0 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1310,7 +1310,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -5,7 +5,7 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 07f9b6269fa156672ed8a6572ec5dd72ca08419f..3a562f0c2c851e190ca9a681bbd33721df46a06a 100644
|
||||
index faa32056399e93e729c6313dc15e7315e34b8eb0..e20f272cc4892e5527e60861b9d12f276e877d7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2225,7 +2225,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fixes kick event leave message not being sent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3a562f0c2c851e190ca9a681bbd33721df46a06a..6a0b473e3ae663644b15e3921b87e3cb28621b31 100644
|
||||
index e20f272cc4892e5527e60861b9d12f276e877d7f..93b801fec4d8f5c42d391f3c4784b8abe0fea6d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -457,7 +457,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits.
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 1c7d0f4b594cc0e0ae28c89514fa21f7d42f2644..49405404a64187e1895ca2a2449a2d4cac25cc62 100644
|
||||
index 93b801fec4d8f5c42d391f3c4784b8abe0fea6d6..0cf2b24b7f97efeec17218684baa72b2f6ea17f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -389,7 +389,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
@ -5,7 +5,7 @@ Subject: [PATCH] Config option for Piglins guarding chests
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 055f0de420fd3603b4e2580b29746c127bb1a104..a14602b6ef00e9ac544582c0d8f4f43a5fcbf908 100644
|
||||
index 34d3ca57acd3aa37a37d44cd81bdd10967f12aaa..eac8ebb2538144d584eb02152a8d1366526150fe 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -54,6 +54,11 @@ public class PaperWorldConfig {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable item frame map cursor update interval
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index a14602b6ef00e9ac544582c0d8f4f43a5fcbf908..e1f386cccdf0d2f6831c86667230e0bc8ee39cc9 100644
|
||||
index eac8ebb2538144d584eb02152a8d1366526150fe..fd7ac4be153538dcee60fade6e7a00f57770e97f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -862,6 +862,11 @@ public class PaperWorldConfig {
|
@ -10,7 +10,7 @@ schedules. Effectively, use the callback executor as a tool of
|
||||
finding issues rather than hiding these issues.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 2a85deeab49f32a897b53707d453d1a5f2972902..dd6980326a2ec41a5eb65038ee8283a7cb8195bf 100644
|
||||
index 38f84e37510dd51a8b9b37a670ae649e8f3d4abd..00e79197d59bcbca0785ff0d651220756cb57c9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -154,17 +154,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@ -10,7 +10,7 @@ chunk future to complete. We can simply schedule to the immediate
|
||||
executor to get this effect, rather than the main mailbox.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 7e750f84b7f7050bd2405ab01a233aa231db62c4..410d3d840e4858dd2a4f0ac9c61ff9bb98d57c1c 100644
|
||||
index fb647b770ffd7bc7609c98232e74a0bc9b98522b..fc170e5e477dec16515ceb0c27828c0199fefe43 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1451,9 +1451,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@ -3856,7 +3856,7 @@ index b0a6eb7846580489e0476e69565676e77fd224cd..54822e418e319db551bfea3218d00faf
|
||||
private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory;
|
||||
public int oldTicketLevel;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 410d3d840e4858dd2a4f0ac9c61ff9bb98d57c1c..6cf01d98d5d7a41f743527381d496c0d01421928 100644
|
||||
index fc170e5e477dec16515ceb0c27828c0199fefe43..82dbeb5a10104ed3599a007186f61b0c92bea2b1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -121,7 +121,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@ -914,7 +914,7 @@ index 0000000000000000000000000000000000000000..3ba094e640d7fe7803e2bbdab8ff3beb
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 7000909d2910e3e0e87e05f0a8bda8269f8d7e05..7fd55f26ad278aae27c102638ad8ab6776f27c7d 100644
|
||||
index 80f59abeb0081fe4784f3c0d027e8dfce752814b..3351c4d43b41db5a0718d7ff761b06d950b7ee87 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -437,7 +437,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -31,7 +31,7 @@ index 5fdaefc128956581be4bb9b34199fd6410563991..b7edc1121797bc1c57e25f540ed0124f
|
||||
// start copy from TickListServer // TODO check on update
|
||||
CrashReport crashreport = CrashReport.forThrowable(thr, "Exception while ticking");
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 154b0dd9bcfefbd7e7eae8c2f28bbabcd0fde531..099db3a627c1d3c08f3b923bb02a1cb8a0a268ab 100644
|
||||
index b7beb5c778c010d37e737f09cc9f0e7af3b47cef..1d7c26354eee1dff5e66b6234d408ed8f800415c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -330,6 +330,76 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@ -140,7 +140,7 @@ index 7ea86cbeb72f08d751c14006f428fe5921916061..108f2212f8bd00247bf73ff4f3ba4283
|
||||
} // Paper start - optimise chunk tick iteration
|
||||
} finally {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 7fd55f26ad278aae27c102638ad8ab6776f27c7d..12b13945702a03132d1b4c42864c8036d1357020 100644
|
||||
index 3351c4d43b41db5a0718d7ff761b06d950b7ee87..9c69855874da2c18e9c80decf4244a0f50021a28 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -190,7 +190,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -35,7 +35,7 @@ index 379ba589b0423284d63782d951c64770b160cf2d..ee668b989d661e1db1bdfe05b94d7cda
|
||||
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
|
||||
List<ServerPlayer> players = world.players;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 6cf01d98d5d7a41f743527381d496c0d01421928..ff2fbe220da7daf572298a3d65cd11257fcc147c 100644
|
||||
index 82dbeb5a10104ed3599a007186f61b0c92bea2b1..58cf34b714ba98f35bdbe3895078ae4f87a0360e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -114,9 +114,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@ -1202,7 +1202,7 @@ index 54822e418e319db551bfea3218d00faf0e043f43..de0c6316c9b75a2ecc7d6abf7bcca24e
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 83eb42f4021df19e5c58c2c0ff3d8fea89df8974..74a2e70220832257c036c40e0aa8626ab2a4ae7f 100644
|
||||
index 58cf34b714ba98f35bdbe3895078ae4f87a0360e..e343c0ad21da97c4b830c626b3d59e03fa60e494 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -187,22 +187,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@ -77,7 +77,7 @@ index bcf53ec07b8eeec7a88fb67e6fb908362e6f51b0..acc12307f61e1e055896b68fe16654c9
|
||||
});
|
||||
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 12b13945702a03132d1b4c42864c8036d1357020..b5a2445bbd691cbfed0d0bf7c688b1f10c267039 100644
|
||||
index 9c69855874da2c18e9c80decf4244a0f50021a28..a999fece43b1b3f687061b541a975d889886db60 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -962,7 +962,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Optimise collision checking in player move packet handling
|
||||
Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 49405404a64187e1895ca2a2449a2d4cac25cc62..5ef613f2436a42859cf1d518735c3c088db4fe69 100644
|
||||
index 0cf2b24b7f97efeec17218684baa72b2f6ea17f4..86ff3ee13ac571570965966fc5b2392bb928ffb0 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -582,12 +582,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user