Skip to content

Commit

Permalink
fix some patches, skip protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed May 7, 2024
1 parent f48c7b0 commit 9c8100c
Show file tree
Hide file tree
Showing 46 changed files with 217 additions and 295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ Subject: [PATCH] Fix gravity block duper


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index dcd8ab90212237764cc64a71321d739bd857a34a..87b0eead81c06afa276b74bf1c7fce573027702f 100644
index 1d8be1e7b71db074b7616d0a5e0c5075f09877ac..96ad6c4ae0a9f3745e4a6503e6010d9278d8eb54 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -441,6 +441,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -443,6 +443,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.originWorld;
}
// Paper end - Entity origin API
+ /* Leaves - fix gravity block duper
// Paper start - make end portalling safe
public BlockPos portalBlock;
public ServerLevel portalWorld;
@@ -471,6 +472,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -473,6 +474,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.teleportTo(worldserver, null);
}
// Paper end - make end portalling safe
+ */
// Paper start - optimise entity tracking
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);

@@ -3199,7 +3201,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3260,7 +3262,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}

this.processPortalCooldown();
Expand All @@ -34,7 +34,7 @@ index dcd8ab90212237764cc64a71321d739bd857a34a..87b0eead81c06afa276b74bf1c7fce57
}

diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index 4ba24bced9a2de4616a0418857d3738e0e322ea0..6482c2456d9dc9b4983f691f388b7ec045d2cab6 100644
index 7272d70c672b54dcf595beafd7a2ed33c96e35cb..d8d355b4ee4869fa9a5d7b4dcd81a3375dd976ba 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -61,15 +61,19 @@ public class EndPortalBlock extends BaseEntityBlock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Fix trading with the void


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ccc645f225bb0cf898dbc2ee7abb21b53ff8660b..a15e1d95da33bf543df96e9b97b79d84583332bd 100644
index 880aefaaaa8b9dca7a69237c0d3fd4b99f22e942..8eab567e184781409018ba28b119e451ac88fb56 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2800,11 +2800,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2751,11 +2751,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Make snowball and egg can knockback player


diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
index 5e82549ea2e80b3968b793b7b4b685c4891e9a91..14c14d12b7ae34a6631828e8dcc531b62b9aa1ed 100644
index 2b4d206c0d31ba38d7b2af654bd420e85145d441..2234d5680f4f89916279a058eeca037d3064d061 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.projectile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Subject: [PATCH] Make shears in dispenser can unlimited use


diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
index ec43e8294d7e7112478a2fc1475f0852690a4882..840524c55d52b5ecaf0b1decfdc871c1fd8e0f42 100644
index a024c697a65bbab27408da1d6a75e531d9719b47..4d088fa857ffb0ac39f9222d251dd49b8deffef6 100644
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
@@ -63,7 +63,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
@@ -64,7 +64,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING));

this.setSuccess(ShearsDispenseItemBehavior.tryShearBeehive(worldserver, blockposition) || ShearsDispenseItemBehavior.tryShearLivingEntity(worldserver, blockposition, bukkitBlock, craftItem)); // CraftBukkit
- if (this.isSuccess() && stack.hurt(1, worldserver.getRandom(), (ServerPlayer) null)) {
+ if (this.isSuccess() && stack.hurt(1, worldserver.getRandom(), (ServerPlayer) null) && !top.leavesmc.leaves.LeavesConfig.shearsInDispenserCanZeroAmount) { // Leaves - Make shears in dispenser can unlimited use
stack.setCount(0);
}
}
- if (this.isSuccess()) {
+ if (this.isSuccess() && !top.leavesmc.leaves.LeavesConfig.shearsInDispenserCanZeroAmount) { // Leaves - Make shears in dispenser can unlimited use
stack.hurtAndBreak(1, worldserver.getRandom(), (ServerPlayer) null, () -> {
stack.setCount(0);
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ Subject: [PATCH] Redstone Shears Wrench


diff --git a/src/main/java/net/minecraft/world/item/ShearsItem.java b/src/main/java/net/minecraft/world/item/ShearsItem.java
index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..c55459bb9a03432afd3ea15c8e38a5faeaedeaa1 100644
index cb809796372a4658aa617404f9fddffff9b45cb7..e236f80fc3aa70aa65b50bb390ec927dfe884960 100644
--- a/src/main/java/net/minecraft/world/item/ShearsItem.java
+++ b/src/main/java/net/minecraft/world/item/ShearsItem.java
@@ -1,7 +1,9 @@
package net.minecraft.world.item;

+import net.minecraft.Util;
@@ -3,6 +3,7 @@ package net.minecraft.world.item;
import java.util.List;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.core.BlockPos;
+import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
@@ -12,10 +14,21 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
@@ -15,9 +16,21 @@ import net.minecraft.world.item.component.Tool;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.Util;
+import net.minecraft.world.level.block.ComparatorBlock;
+import net.minecraft.world.level.block.DispenserBlock;
import net.minecraft.world.level.block.GrowingPlantHeadBlock;
Expand All @@ -40,7 +38,7 @@ index 7ce81a910ceaa979499b7be269ac8a49e75d3a1c..c55459bb9a03432afd3ea15c8e38a5fa

public class ShearsItem extends Item {
public ShearsItem(Item.Properties settings) {
@@ -79,6 +92,60 @@ public class ShearsItem extends Item {
@@ -77,6 +90,60 @@ public class ShearsItem extends Item {
return InteractionResult.sidedSuccess(level.isClientSide);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Add isShrink to EntityResurrectEvent


diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ac3d31b0ed54fd07f07a0768017cc34f7ae9709f..5a453688f9f9f48e5952b00382bbca0632995022 100644
index 900af5f8111fb615104a7263ff13306a29ac609c..36ed6c7d9ba129a1b31e5b88fb154202e965e23b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1622,12 +1622,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1648,12 +1648,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
}

org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
Expand All @@ -23,7 +23,7 @@ index ac3d31b0ed54fd07f07a0768017cc34f7ae9709f..5a453688f9f9f48e5952b00382bbca06
itemstack1.shrink(1);
}
if (itemstack != null && this instanceof ServerPlayer) {
@@ -4565,3 +4565,4 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4562,3 +4562,4 @@ public abstract class LivingEntity extends Entity implements Attackable {

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Budding Amethyst can push by piston


diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 3212771ac19044ca37bf60e231eac5615a9c240e..ee6cb4042421a74095473360126f6d083513934b 100644
index 555d255a79c6136d0df3504218a0bc4681a5489f..e27f2317e4e2f13b6ef12be727046497a750fd3a 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -603,6 +603,12 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -591,6 +591,12 @@ public class Block extends BlockBehaviour implements ItemLike {
}
// Spigot end

Expand All @@ -22,7 +22,7 @@ index 3212771ac19044ca37bf60e231eac5615a9c240e..ee6cb4042421a74095473360126f6d08

private final BlockState first;
diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
index 7f58c9f5935cd14ea1096de14633f653eb486d7e..b83efe46ecb3ebf2b3d0c4499eec29055663fd3f 100644
index 8920855b07a31715327b8102c7faafc9f916825d..1ab3e508d7ec013ac3903da880cc64fb573dd041 100644
--- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
@@ -60,4 +60,11 @@ public class BuddingAmethystBlock extends AmethystBlock {
Expand All @@ -38,10 +38,10 @@ index 7f58c9f5935cd14ea1096de14633f653eb486d7e..b83efe46ecb3ebf2b3d0c4499eec2905
+ // Leaves end - budding amethyst can push by piston
}
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 2892e586146cbc560f0bcf4b9af6d0575cb0a82e..ebba87e53105ee68a6f030476a2def609e668fb3 100644
index 2034ca2edd3aff61d94416266e75402babd3e741..d7ae3a3a63a3eb3a95534c303ba87303cb96744d 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -1157,7 +1157,7 @@ public abstract class BlockBehaviour implements FeatureElement {
@@ -1088,7 +1088,7 @@ public abstract class BlockBehaviour implements FeatureElement {
}

public PushReaction getPistonPushReaction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Spectator dont get Advancement


diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index 2694f899241ad8ce06d3bcba78550af5626561ce..f941e7add46e690e21d39111bed520df9156f154 100644
index c7e1f2bac3eca9bb72bf1f8c26cccb2905e1ddfc..d436f266b3d336bfb3421b4dfcb73eb6ec429669 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -45,6 +45,7 @@ import net.minecraft.server.level.ServerPlayer;
Expand All @@ -16,10 +16,10 @@ index 2694f899241ad8ce06d3bcba78550af5626561ce..f941e7add46e690e21d39111bed520df
import org.slf4j.Logger;

public class PlayerAdvancements {
@@ -226,6 +227,11 @@ public class PlayerAdvancements {
return false;
}
// Leaves end - bot can't get advancement
@@ -221,6 +222,11 @@ public class PlayerAdvancements {
}

public boolean award(AdvancementHolder advancement, String criterionName) {
+ // Leaves start - spectator don't get advancement
+ if (top.leavesmc.leaves.LeavesConfig.spectatorDontGetAdvancement && player.gameMode.getGameModeForPlayer() == GameType.SPECTATOR) {
+ return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Stick can change ArmorStand arm status


diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index eadcebd7845ee716e33c0ac0544502da1a6c5941..575ef3806fc89b7492f5d6b6500e37c775dfaad8 100644
index c2bd2e303f956d390319f6bbbe9a6492ebec5154..5cf7de225f702cd0c82a69779aa9ba1f931ca293 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -387,6 +387,12 @@ public class ArmorStand extends LivingEntity {
@@ -393,6 +393,12 @@ public class ArmorStand extends LivingEntity {
return InteractionResult.SUCCESS;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Fix tripwire update


diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
index efd8d77a441fd334ea4c09c5e31c6d946c1ae0b7..d9b3877257b31ca1b5acc4a47fbf5b993de69ae0 100644
index 76aca266d3f3222502ff4c196228f08fcd88c5f8..8614fad5b3df7a6030384b108b1689bf6b9f1209 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -201,8 +201,9 @@ public class TripWireHookBlock extends Block {
@@ -202,8 +202,9 @@ public class TripWireHookBlock extends Block {
BlockState iblockdata4 = aiblockdata[l];

if (iblockdata4 != null) {
Expand Down
Loading

0 comments on commit 9c8100c

Please sign in to comment.