Skip to content

Commit

Permalink
Just can apply
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 20, 2024
1 parent 80d9144 commit aad07eb
Show file tree
Hide file tree
Showing 37 changed files with 202 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Spider jockeys drop gapples


diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index e675f1e3e5b6f9e1aa0d928ebb9abe76458edb38..902119c7501e98b2a4a67504216ad2cded138f87 100644
index 91e521414c3ea5722aac7506b7589fbb399e9636..c38aa7d17c8a3e8cfa6a738588b6592eb6f13dd1 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -145,6 +145,18 @@ public class Spider extends Monster {
Expand All @@ -14,16 +14,16 @@ index e675f1e3e5b6f9e1aa0d928ebb9abe76458edb38..902119c7501e98b2a4a67504216ad2cd

+ // Leaves start - spider jockeys drop gapples
+ @Override
+ protected void dropFromLootTable(DamageSource damageSource, boolean causedByPlayer) {
+ super.dropFromLootTable(damageSource, causedByPlayer);
+ protected void dropFromLootTable(net.minecraft.server.level.ServerLevel wolrd, DamageSource damageSource, boolean causedByPlayer) {
+ super.dropFromLootTable(wolrd, damageSource, causedByPlayer);
+ if (org.leavesmc.leaves.LeavesConfig.spiderJockeysDropGapples > 0.0D) {
+ if (this.hasPassenger(entity -> entity.getType() == EntityType.SKELETON) && this.random.nextDouble() < org.leavesmc.leaves.LeavesConfig.spiderJockeysDropGapples) {
+ this.spawnAtLocation(new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ENCHANTED_GOLDEN_APPLE));
+ this.spawnAtLocation(wolrd, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ENCHANTED_GOLDEN_APPLE));
+ }
+ }
+ }
+ // Leaves end - spider jockeys drop gapples
+
@Nullable
@Override
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData) {
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) {
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Force Void Trade


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 ebdb1546fb057bf4881d53538f8e44c14fe88b74..c3c70493e418e70c4cb6ef3cb67caf2a2cf23896 100644
index c7f0a3e36959843b557615f55d32e6f1b3e9f456..8ebc52da0f6914e5641e2f5a220a0e94d461b488 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -64,6 +64,7 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
Expand Down Expand Up @@ -74,7 +74,7 @@ index ebdb1546fb057bf4881d53538f8e44c14fe88b74..c3c70493e418e70c4cb6ef3cb67caf2a
+ // Leaves end - force void trade
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 18642b4e43d0725690be44b53bbddb6d4486e5f1..8a21e03c012b047eef3948e10bdb23766194b670 100644
index a98f9c22f8485ff3a9812cce19d47a0b08f2c054..5f1b12bc2294d7c2e21c9bea212e29dbb93c7e02 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -348,6 +348,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
Expand All @@ -85,7 +85,7 @@ index 18642b4e43d0725690be44b53bbddb6d4486e5f1..8a21e03c012b047eef3948e10bdb2376
this.updateSpecialPrices(customer);
this.setTradingPlayer(customer);
this.openTradingScreen(customer, this.getDisplayName(), this.getVillagerData().getLevel());
@@ -645,8 +646,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -639,8 +640,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
protected void rewardTradeXp(MerchantOffer offer) {
int i = 3 + this.random.nextInt(4);

Expand All @@ -101,10 +101,10 @@ index 18642b4e43d0725690be44b53bbddb6d4486e5f1..8a21e03c012b047eef3948e10bdb2376
this.updateMerchantTimer = 40;
this.increaseProfessionLevelOnUpdate = true;
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
index 0af34e0f9c9696fbcb11b12fb27472ef17ad532a..422d537014520383503f06e834ef6fb31813beb8 100644
index 1e77cce428d9e53142aaa2cf780b7f862d536eca..2bac91f7f6943c7e1b5f63ea7dfeb3c3e390bcb7 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
@@ -122,9 +122,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
@@ -123,9 +123,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
return InteractionResult.CONSUME;
}

Expand All @@ -116,10 +116,10 @@ index 0af34e0f9c9696fbcb11b12fb27472ef17ad532a..422d537014520383503f06e834ef6fb3
+ this.openTradingScreen(player, this.getDisplayName(), 1);
+ }

return InteractionResult.sidedSuccess(this.level().isClientSide);
return InteractionResult.SUCCESS;
} else {
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
index 5de2030452b96a4df7ce0be82f07e002db595dee..7c2b12fcc8028fc029af17e3bae2901843b47b62 100644
index 6a529b5e289c416c0ebdc0260086ec039777aa40..f41e9303c6e118a426e779d4bbca450011ed7246 100644
--- a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
@@ -27,7 +27,7 @@ public class MerchantMenu extends AbstractContainerMenu {
Expand Down Expand Up @@ -178,10 +178,10 @@ index 0efc8d997b34302c3e0a5d7ec73a11a940dbeefe..d246c9932f3f98972124089306d6ed74

public void setToOutOfStock() {
diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
index 3f5bb5c9ceb5b31fcc9ef0a7a6157e1e1cb2a09f..3087c60589de8fc38e12d322e58886ba76749507 100644
index a7a21f071161fb7e73a046717d2462f871ab653c..8159f81defa377f56b8d836d9c3a8ff2107ff8fa 100644
--- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
@@ -118,6 +118,16 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
@@ -120,6 +120,16 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
if (tileentity instanceof TheEndGatewayBlockEntity tileentityendgateway) {
Vec3 vec3d = tileentityendgateway.getPortalPosition(world, pos);

Expand All @@ -195,6 +195,6 @@ index 3f5bb5c9ceb5b31fcc9ef0a7a6157e1e1cb2a09f..3087c60589de8fc38e12d322e58886ba
+ }
+ // Leaves end - force void trade
+
return vec3d != null ? new DimensionTransition(world, vec3d, EndGatewayBlock.calculateExitMovement(entity), entity.getYRot(), entity.getXRot(), DimensionTransition.PLACE_PORTAL_TICKET, PlayerTeleportEvent.TeleportCause.END_GATEWAY) : null; // CraftBukkit
return vec3d == null ? null : (entity instanceof ThrownEnderpearl ? new TeleportTransition(world, vec3d, Vec3.ZERO, 0.0F, 0.0F, Set.of(), TeleportTransition.PLACE_PORTAL_TICKET, PlayerTeleportEvent.TeleportCause.END_GATEWAY) : new TeleportTransition(world, vec3d, Vec3.ZERO, 0.0F, 0.0F, Relative.union(Relative.DELTA, Relative.ROTATION), TeleportTransition.PLACE_PORTAL_TICKET, PlayerTeleportEvent.TeleportCause.END_GATEWAY)); // CraftBukkit
} else {
return null;
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] CCE update suppression


diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
index 8e899549f09b8429cd63bd5c895253325f65ccab..7d88524eb5b193600c8985c68bb9ed10e3fe3c4d 100644
index 2ae2f899183e3043b524712f0944bb9e894d74ab..aa7f993654de91f2af5d52fa41ab5d77aece47e1 100644
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
@@ -243,17 +243,21 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
@@ -239,17 +239,21 @@ public class ShulkerBoxBlock extends BaseEntityBlock {

@Override
protected int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable offline warn if use proxy


diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 3e4d4c417904fba6aeba0dee2e01d3b5bd95ac20..85e7321c7b918db404fca1c75a16ec17bc6b0b2f 100644
index e57aea5bc337e182f20ae2b90407f0ec15770bc1..beb0c55454e849de092cdf5cff5af73c178a6ed0 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -303,7 +303,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -301,7 +301,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
// Paper end - Add Velocity IP Forwarding Support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable moved wrongly threshold


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2e08a927f9c3c4a4cfcad16b7a835b80efefdfca..614907d64362ae51b3f19a6d5652e23be28f795c 100644
index a0b0bee8c2c0452d41872722875dbb131ccceacf..fd05c29b888f7979e208e51cfc8a4110f3324eb9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -569,7 +569,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -574,7 +574,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end - Prevent moving into unloaded chunks

Expand All @@ -17,7 +17,7 @@ index 2e08a927f9c3c4a4cfcad16b7a835b80efefdfca..614907d64362ae51b3f19a6d5652e23b
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
this.send(new ClientboundMoveVehiclePacket(entity));
@@ -605,7 +605,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -610,7 +610,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;

Expand All @@ -26,7 +26,7 @@ index 2e08a927f9c3c4a4cfcad16b7a835b80efefdfca..614907d64362ae51b3f19a6d5652e23b
flag2 = true; // Paper - diff on change, this should be moved wrongly
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
}
@@ -1414,7 +1414,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1426,7 +1426,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
toX, toY, toZ, toYaw, toPitch, true);
if (!event.isAllowed()) {
Expand All @@ -35,7 +35,7 @@ index 2e08a927f9c3c4a4cfcad16b7a835b80efefdfca..614907d64362ae51b3f19a6d5652e23b
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return;
@@ -1484,7 +1484,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1496,7 +1496,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean movedWrongly = false; // Paper - Add fail move event; rename

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Subject: [PATCH] Armor stand cant kill by mob projectile


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 9ab1c4dccf0cc96ecc6f3a2a8dbcb38df0b530af..9883db7b41c44fdb878ae3e110b1339a87dfa7a3 100644
index dbaa552bed4d09e8b87475732dc911c95893ff89..a73ce65ed27b5cde99694210007b926a8b7112f0 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -531,6 +531,14 @@ public class ArmorStand extends LivingEntity {
boolean flag = source.is(DamageTypeTags.CAN_BREAK_ARMOR_STAND);
boolean flag1 = source.is(DamageTypeTags.ALWAYS_KILLS_ARMOR_STANDS);
@@ -532,6 +532,14 @@ public class ArmorStand extends LivingEntity {
boolean flag = source.is(DamageTypeTags.CAN_BREAK_ARMOR_STAND);
boolean flag1 = source.is(DamageTypeTags.ALWAYS_KILLS_ARMOR_STANDS);

+ // Leaves start - Armor stand cant kill by mob projectile
+ if (org.leavesmc.leaves.LeavesConfig.armorStandCantKillByMobProjectile) {
Expand All @@ -20,6 +20,6 @@ index 9ab1c4dccf0cc96ecc6f3a2a8dbcb38df0b530af..9883db7b41c44fdb878ae3e110b1339a
+ }
+ // Leaves end - Armor stand cant kill by mob projectile
+
if (!flag && !flag1) {
return false;
} else {
if (!flag && !flag1) {
return false;
} else {
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Make Item tick vanilla


diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 510735cc63968265d2e1d9deb1a06beda3112ed9..2d885a09fc7bd7c2df76321147c75eeb46808b48 100644
index 322b22577ae0269b0a4b641112130a8e96c4e344..232e0555ff0e25b528ee1a2ce6c0f0004a631cbb 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -250,6 +250,9 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -251,6 +251,9 @@ public class ItemEntity extends Entity implements TraceableEntity {
// Spigot start - copied from above
@Override
public void inactiveTick() {
Expand All @@ -18,7 +18,7 @@ index 510735cc63968265d2e1d9deb1a06beda3112ed9..2d885a09fc7bd7c2df76321147c75eeb
// Paper start - remove anti tick skipping measures / wall time - copied from above
if (this.pickupDelay > 0 && this.pickupDelay != 32767) {
--this.pickupDelay;
@@ -268,6 +271,8 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -269,6 +272,8 @@ public class ItemEntity extends Entity implements TraceableEntity {
// CraftBukkit end
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Copper Bulb 1 gt delay


diff --git a/src/main/java/net/minecraft/world/level/block/CopperBulbBlock.java b/src/main/java/net/minecraft/world/level/block/CopperBulbBlock.java
index b4250059a9068124b76268913f675babac379670..e6cfa8c1ce45c5e4b647ac6faceb838961e69dad 100644
index 7c6481fc6e84f6477a4d113a222cae51cfa9053a..4e05441e3d78559b372f2a7109aece8c254ba126 100644
--- a/src/main/java/net/minecraft/world/level/block/CopperBulbBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CopperBulbBlock.java
@@ -30,14 +30,26 @@ public class CopperBulbBlock extends Block {
@@ -32,14 +32,26 @@ public class CopperBulbBlock extends Block {
@Override
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (oldState.getBlock() != state.getBlock() && world instanceof ServerLevel serverLevel) {
Expand All @@ -24,7 +24,7 @@ index b4250059a9068124b76268913f675babac379670..e6cfa8c1ce45c5e4b647ac6faceb8389
}

@Override
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
if (world instanceof ServerLevel serverLevel) {
- this.checkAndFlip(state, serverLevel, pos);
+ // Leaves start - copper bulb 1 gt
Expand All @@ -37,7 +37,7 @@ index b4250059a9068124b76268913f675babac379670..e6cfa8c1ce45c5e4b647ac6faceb8389
}
}

@@ -54,6 +66,15 @@ public class CopperBulbBlock extends Block {
@@ -56,6 +68,15 @@ public class CopperBulbBlock extends Block {
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Crafter 1 gt delay


diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
index deb5b4fab94618c08a51e432c33e49b1627bd717..cd141680fec975b1a286974178b90d89ed8e34f5 100644
index 0e609b1e3abd50b415d8376dc550375a8a0251b6..730f5376d9d298c05d3e4cf6d4c264f16d97913c 100644
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
@@ -90,7 +90,7 @@ public class CrafterBlock extends BaseEntityBlock {
@@ -91,7 +91,7 @@ public class CrafterBlock extends BaseEntityBlock {
BlockEntity tileentity = world.getBlockEntity(pos);

if (flag1 && !flag2) {
Expand All @@ -17,7 +17,7 @@ index deb5b4fab94618c08a51e432c33e49b1627bd717..cd141680fec975b1a286974178b90d89
world.setBlock(pos, (BlockState) state.setValue(CrafterBlock.TRIGGERED, true), 2);
this.setBlockEntityTriggered(tileentity, true);
} else if (!flag1 && flag2) {
@@ -156,7 +156,7 @@ public class CrafterBlock extends BaseEntityBlock {
@@ -157,7 +157,7 @@ public class CrafterBlock extends BaseEntityBlock {
@Override
public void setPlacedBy(Level world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
if ((Boolean) state.getValue(CrafterBlock.TRIGGERED)) {
Expand Down
Loading

0 comments on commit aad07eb

Please sign in to comment.