mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
feat: merge old raid config, fix bugs (#680)
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: huanli233 <392352840@qq.com>
|
From: huanli233 <392352840@qq.com>
|
||||||
Date: Wed, 23 Oct 2024 23:10:48 +0800
|
Date: Wed, 23 Oct 2024 23:10:48 +0800
|
||||||
Subject: [PATCH] Revert raid changes
|
Subject: [PATCH] Old raid behavior
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||||
index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46edeed4d6 100644
|
index 80f17f33f670018240c854df589cf90cdeab6e70..d7f443bcf91ac7817fe79881122960f49b331365 100644
|
||||||
--- a/net/minecraft/world/effect/BadOmenMobEffect.java
|
--- a/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/BadOmenMobEffect.java
|
+++ b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||||
@@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect {
|
@@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect {
|
||||||
@@ -13,7 +13,7 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46
|
|||||||
&& level.getDifficulty() != Difficulty.PEACEFUL
|
&& level.getDifficulty() != Difficulty.PEACEFUL
|
||||||
&& level.isVillage(serverPlayer.blockPosition())) {
|
&& level.isVillage(serverPlayer.blockPosition())) {
|
||||||
+ // Leaves start - Revert raid changes
|
+ // Leaves start - Revert raid changes
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.allowBadOmenTriggerRaid) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) {
|
||||||
+ return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null;
|
+ return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null;
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves end - Revert raid changes
|
+ // Leaves end - Revert raid changes
|
||||||
@@ -21,57 +21,68 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46
|
|||||||
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
|
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
|
||||||
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
|
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
|
||||||
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
||||||
index b3a29ce523fb5de71589c7c17598bba17622f988..b74ad31e5bcac5e557f18ccfb5c92d4d94a0ba6d 100644
|
index b3a29ce523fb5de71589c7c17598bba17622f988..8f90f3234c9b80b7a194d5dbffd8ea93835dfc06 100644
|
||||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
--- a/net/minecraft/world/entity/raid/Raid.java
|
||||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
+++ b/net/minecraft/world/entity/raid/Raid.java
|
||||||
@@ -333,7 +333,20 @@ public class Raid {
|
@@ -256,7 +256,7 @@ public class Raid {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean absorbRaidOmen(ServerPlayer player) {
|
||||||
|
- MobEffectInstance effect = player.getEffect(MobEffects.RAID_OMEN);
|
||||||
|
+ MobEffectInstance effect = player.getEffect(org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior ? MobEffects.BAD_OMEN : MobEffects.RAID_OMEN); // Leaves - old Raid Behavior
|
||||||
|
if (effect == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
@@ -333,7 +333,13 @@ public class Raid {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
- this.waveSpawnPos = this.getValidSpawnPos(level);
|
- this.waveSpawnPos = this.getValidSpawnPos(level);
|
||||||
+ // Leaves Start - old FindSpawnPosition
|
+ // Leaves Start - old FindSpawnPosition
|
||||||
+ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) {
|
||||||
+ this.waveSpawnPos = this.getValidSpawnPos(level);
|
+ this.waveSpawnPos = this.preCalcRavagerSpawnLocation(level, this.raidCooldownTicks < 100 ? 1 : 0);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ int n4 = 0;
|
+ this.waveSpawnPos = this.getValidSpawnPos(level);
|
||||||
+ if (this.raidCooldownTicks < 100) {
|
|
||||||
+ n4 = 1;
|
|
||||||
+ }
|
|
||||||
+ if (this.raidCooldownTicks < 40) {
|
|
||||||
+ n4 = 2;
|
|
||||||
+ }
|
|
||||||
+ this.waveSpawnPos = this.getValidSpawnPos(level, n4);
|
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves End - old FindSpawnPosition
|
+ // Leaves End - old FindSpawnPosition
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
|
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
|
||||||
@@ -368,7 +381,14 @@ public class Raid {
|
@@ -368,7 +374,14 @@ public class Raid {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (this.shouldSpawnGroup()) {
|
while (this.shouldSpawnGroup()) {
|
||||||
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
||||||
+ // Leaves Start - old FindSpawnPosition
|
+ // Leaves Start - old FindSpawnPosition
|
||||||
+ BlockPos blockPos;
|
+ BlockPos blockPos;
|
||||||
+ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) {
|
||||||
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
+ blockPos = this.getRavagerSpawnLocation(level, i, 20);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(level, i, 20);
|
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves End - old FindSpawnPosition
|
+ // Leaves End - old FindSpawnPosition
|
||||||
if (blockPos != null) {
|
if (blockPos != null) {
|
||||||
this.started = true;
|
this.started = true;
|
||||||
this.spawnGroup(level, blockPos);
|
this.spawnGroup(level, blockPos);
|
||||||
@@ -380,7 +400,7 @@ public class Raid {
|
@@ -380,7 +393,7 @@ public class Raid {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (i > 5) {
|
- if (i > 5) {
|
||||||
+ if (i > (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition ? 3 : 5)) { // Leaves - old FindSpawnPosition
|
+ if (i > (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior ? 3 : 5)) { // Leaves - old FindSpawnPosition
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(level, this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
|
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(level, this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
|
||||||
this.stop();
|
this.stop();
|
||||||
break;
|
break;
|
||||||
@@ -686,6 +706,36 @@ public class Raid {
|
@@ -667,7 +680,7 @@ public class Raid {
|
||||||
|
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
||||||
|
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
||||||
|
int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
|
||||||
|
- if (Mth.abs(height - this.center.getY()) <= 96) {
|
||||||
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - skippable
|
||||||
|
mutableBlockPos.set(i2, height, i3);
|
||||||
|
if (!level.isVillage(mutableBlockPos) || i <= 7) {
|
||||||
|
int i4 = 10;
|
||||||
|
@@ -686,6 +699,36 @@ public class Raid {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,8 +119,52 @@ index b3a29ce523fb5de71589c7c17598bba17622f988..b74ad31e5bcac5e557f18ccfb5c92d4d
|
|||||||
private boolean addWaveMob(ServerLevel level, int wave, Raider raider) {
|
private boolean addWaveMob(ServerLevel level, int wave, Raider raider) {
|
||||||
return this.addWaveMob(level, wave, raider, true);
|
return this.addWaveMob(level, wave, raider, true);
|
||||||
}
|
}
|
||||||
|
@@ -843,4 +886,43 @@ public class Raid {
|
||||||
|
this.spawnsPerWaveBeforeBonus = spawnsPerWaveBeforeBonus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Leaves start - old FindSpawnPosition
|
||||||
|
+ private BlockPos getRavagerSpawnLocation(ServerLevel serverWorld, int proximity, int tries) {
|
||||||
|
+ int i = proximity == 0 ? 2 : 2 - proximity;
|
||||||
|
+ BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
|
||||||
|
+ SpawnPlacementType spawnLocation = SpawnPlacements.getPlacementType(EntityType.RAVAGER);
|
||||||
|
+
|
||||||
|
+ for (int j = 0; j < tries; j++) {
|
||||||
|
+ float f = serverWorld.random.nextFloat() * (float) (Math.PI * 2);
|
||||||
|
+ int k = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0F * (float) i + serverWorld.random.nextInt(5));
|
||||||
|
+ int l = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0F * (float) i + serverWorld.random.nextInt(5));
|
||||||
|
+ int m = serverWorld.getHeight(Heightmap.Types.WORLD_SURFACE, k, l);
|
||||||
|
+ mutable.set(k, m, l);
|
||||||
|
+
|
||||||
|
+ if (serverWorld.isVillage(mutable) && proximity < 2) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if (serverWorld.hasChunksAt(mutable.getX() - 10, mutable.getZ() - 10, mutable.getX() + 10, mutable.getZ() + 10)
|
||||||
|
+ && serverWorld.isPositionEntityTicking(mutable)
|
||||||
|
+ && (spawnLocation.isSpawnPositionOk(serverWorld, mutable, EntityType.RAVAGER)
|
||||||
|
+ || serverWorld.getBlockState(mutable.below()).is(Blocks.SNOW)
|
||||||
|
+ && serverWorld.getBlockState(mutable).isAir())
|
||||||
|
+ ) {
|
||||||
|
+ return mutable;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private Optional<BlockPos> preCalcRavagerSpawnLocation(ServerLevel serverWorld, int proximity) {
|
||||||
|
+ for (int i = 0; i < 3; i++) {
|
||||||
|
+ BlockPos blockPos = this.getRavagerSpawnLocation(serverWorld, proximity, 1);
|
||||||
|
+ if (blockPos != null) {
|
||||||
|
+ return Optional.of(blockPos);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return Optional.empty();
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - old FindSpawnPosition
|
||||||
|
}
|
||||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||||
index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..56995040e0bb23e55031cd1179faa770596e15a3 100644
|
index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..0e9cfb43d6620790f04b8a85e75308a306ec4ea5 100644
|
||||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||||
@@ -128,6 +128,43 @@ public abstract class Raider extends PatrollingMonster {
|
@@ -128,6 +128,43 @@ public abstract class Raider extends PatrollingMonster {
|
||||||
@@ -119,7 +174,7 @@ index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..56995040e0bb23e55031cd1179faa770
|
|||||||
+
|
+
|
||||||
+ // Leaves start - Revert raid changes
|
+ // Leaves start - Revert raid changes
|
||||||
+ if (this.level() instanceof ServerLevel) {
|
+ if (this.level() instanceof ServerLevel) {
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.giveBadOmenWhenKillPatrolLeader && !this.hasRaid()) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior && !this.hasRaid()) {
|
||||||
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||||
+ net.minecraft.world.entity.player.Player entityhuman = null;
|
+ net.minecraft.world.entity.player.Player entityhuman = null;
|
||||||
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
||||||
Date: Fri, 14 Mar 2025 10:55:57 +0800
|
|
||||||
Subject: [PATCH] Skippable raid height check
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
index b74ad31e5bcac5e557f18ccfb5c92d4d94a0ba6d..14cbc32c1ebb1eb777c9ae45ff5b2178b469dea2 100644
|
|
||||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
@@ -687,7 +687,7 @@ public class Raid {
|
|
||||||
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
|
||||||
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
|
||||||
int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
|
|
||||||
- if (Mth.abs(height - this.center.getY()) <= 96) {
|
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.skipHeightCheck || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - skippable
|
|
||||||
mutableBlockPos.set(i2, height, i3);
|
|
||||||
if (!level.isVillage(mutableBlockPos) || i <= 7) {
|
|
||||||
int i4 = 10;
|
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix SculkCatalyst exp skip
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index b093ceec2eb02fc3f069874fb828848284991e81..a659b9ecf2786dcc21b9d64d90e25f300847458e 100644
|
index 70b35fa479bdfcda2f404b3b86547552f7d6da8e..eb391c3ef663ea0267c90a8e46a658e4390040d4 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1105,7 +1105,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1105,7 +1105,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -34,7 +34,7 @@ index b093ceec2eb02fc3f069874fb828848284991e81..a659b9ecf2786dcc21b9d64d90e25f30
|
|||||||
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
|
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
|
||||||
this.level()
|
this.level()
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 557d388297f15964547701352976b085f529e402..7cab027953d92b89ea6233b15491e07f24fb9519 100644
|
index 2cc5c081a75997be637fe753ccdd222e862170c0..e3673ababa41a4d65b87adbc6d79d53a196564b7 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -277,6 +277,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -277,6 +277,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla portal handle
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 47b9ddcecd0853927a4a41264bda15a935b55671..0dde70f12ede6da06a0b9f0e78272a963a167699 100644
|
index f5ed9965394eb075faf92515181c2446981e24a2..0a29cf071cefe14f1862d4bd5ddcacff42fe9f15 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -836,6 +836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -836,6 +836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Do not reset placed block on exception
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
||||||
index 17e35aa9efc55a52ad64f05e8fdc3c7fae3ef0c4..699a0fe62204f0f4b9677ec1e0d894b918b7aef9 100644
|
index 593e65ef3a768d4039047e42e666c8382a5d38eb..cf143589407dc2146c9ce18f509077017fba0b48 100644
|
||||||
--- a/net/minecraft/world/item/BlockItem.java
|
--- a/net/minecraft/world/item/BlockItem.java
|
||||||
+++ b/net/minecraft/world/item/BlockItem.java
|
+++ b/net/minecraft/world/item/BlockItem.java
|
||||||
@@ -92,20 +92,22 @@ public class BlockItem extends Item {
|
@@ -92,20 +92,22 @@ public class BlockItem extends Item {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Spawn invulnerable time
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index a659b9ecf2786dcc21b9d64d90e25f300847458e..2860c18c95a45005f21024793d0e25400269b911 100644
|
index eb391c3ef663ea0267c90a8e46a658e4390040d4..0002efa90e736c48fbfcd365eb0c0c78d7e1def1 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -232,6 +232,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -232,6 +232,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable item damage check
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||||
index 3ba64f91883b88f3131d4582c771b511bbccfcd9..73c1972470ef19fe7fff0ed17d6ff40fe8bed38b 100644
|
index 31b5dd406de54636fd0b86e031ce247abbcde063..e59b8d42d602bbdae1071f2a5be1180420c4efb7 100644
|
||||||
--- a/net/minecraft/world/item/ItemStack.java
|
--- a/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/net/minecraft/world/item/ItemStack.java
|
+++ b/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -597,11 +597,11 @@ public final class ItemStack implements DataComponentHolder {
|
@@ -597,11 +597,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix block place desync due to update suppression
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||||
index 73c1972470ef19fe7fff0ed17d6ff40fe8bed38b..fdc92174fcb4f56fb4ff056f04c9b2429061d887 100644
|
index e59b8d42d602bbdae1071f2a5be1180420c4efb7..1186cad641786aff2ea6f664724a53511aa1440e 100644
|
||||||
--- a/net/minecraft/world/item/ItemStack.java
|
--- a/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/net/minecraft/world/item/ItemStack.java
|
+++ b/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -389,8 +389,12 @@ public final class ItemStack implements DataComponentHolder {
|
@@ -389,8 +389,12 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
@@ -7,7 +7,7 @@ caused by PaperMC/Paper#11765
|
|||||||
should remove when PaperMC/Paper#11831 merged
|
should remove when PaperMC/Paper#11831 merged
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 7cab027953d92b89ea6233b15491e07f24fb9519..72ac89d349db718125cfb9aac6453c2cba708919 100644
|
index e3673ababa41a4d65b87adbc6d79d53a196564b7..6c9a7ae3e9a340de35ca4dfcd486cfe5818d2aa5 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3945,11 +3945,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -3945,11 +3945,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Bring back LivingEntity effect CME
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 72ac89d349db718125cfb9aac6453c2cba708919..817b55dfb131b0892a670df1ad00d892b855bf0e 100644
|
index 6c9a7ae3e9a340de35ca4dfcd486cfe5818d2aa5..782138474b1b2fab525de607f542f621ca92a0e8 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -1151,7 +1151,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
@@ -1151,7 +1151,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
@@ -8,6 +8,7 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.configuration.MemorySection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
@@ -17,6 +18,7 @@ import org.leavesmc.leaves.bot.BotCommand;
|
|||||||
import org.leavesmc.leaves.bot.ServerBot;
|
import org.leavesmc.leaves.bot.ServerBot;
|
||||||
import org.leavesmc.leaves.bot.agent.Actions;
|
import org.leavesmc.leaves.bot.agent.Actions;
|
||||||
import org.leavesmc.leaves.command.LeavesCommand;
|
import org.leavesmc.leaves.command.LeavesCommand;
|
||||||
|
import org.leavesmc.leaves.config.ConfigTransformer;
|
||||||
import org.leavesmc.leaves.config.ConfigValidatorImpl.BooleanConfigValidator;
|
import org.leavesmc.leaves.config.ConfigValidatorImpl.BooleanConfigValidator;
|
||||||
import org.leavesmc.leaves.config.ConfigValidatorImpl.DoubleConfigValidator;
|
import org.leavesmc.leaves.config.ConfigValidatorImpl.DoubleConfigValidator;
|
||||||
import org.leavesmc.leaves.config.ConfigValidatorImpl.EnumConfigValidator;
|
import org.leavesmc.leaves.config.ConfigValidatorImpl.EnumConfigValidator;
|
||||||
@@ -335,21 +337,24 @@ public final class LeavesConfig {
|
|||||||
@GlobalConfig("old-zombie-piglin-drop")
|
@GlobalConfig("old-zombie-piglin-drop")
|
||||||
public boolean oldZombiePiglinDrop = false;
|
public boolean oldZombiePiglinDrop = false;
|
||||||
|
|
||||||
public RaidConfig raid = new RaidConfig();
|
@RemovedConfig(name = "revert-raid-changes", category = {"modify", "minecraft-old"}, transform = true, transformer = RaidConfigTransformer.class)
|
||||||
|
@GlobalConfig("old-raid-behavior")
|
||||||
|
public boolean oldRaidBehavior = false;
|
||||||
|
|
||||||
@GlobalConfigCategory("revert-raid-changes")
|
public static class RaidConfigTransformer implements ConfigTransformer<MemorySection, Boolean> {
|
||||||
public static class RaidConfig {
|
|
||||||
@GlobalConfig("allow-bad-omen-trigger-raid")
|
|
||||||
public boolean allowBadOmenTriggerRaid = false;
|
|
||||||
|
|
||||||
@GlobalConfig("give-bad-omen-when-kill-patrol-leader")
|
@Override
|
||||||
public boolean giveBadOmenWhenKillPatrolLeader = false;
|
public Boolean transform(@NotNull MemorySection raidConfig) {
|
||||||
|
return raidConfig.getBoolean("allow-bad-omen-trigger-raid")
|
||||||
|
|| raidConfig.getBoolean("give-bad-omen-when-kill-patrol-leader")
|
||||||
|
|| raidConfig.getBoolean("skip-height-check")
|
||||||
|
|| raidConfig.getBoolean("use-old-find-spawn-position");
|
||||||
|
}
|
||||||
|
|
||||||
@GlobalConfig("use-old-find-spawn-position")
|
@Override
|
||||||
public boolean useOldFindSpawnPosition = false;
|
public MemorySection stringConvert(String value) throws IllegalArgumentException {
|
||||||
|
return null;
|
||||||
@GlobalConfig("skip-height-check")
|
}
|
||||||
public boolean skipHeightCheck = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GlobalConfig("old-zombie-reinforcement")
|
@GlobalConfig("old-zombie-reinforcement")
|
||||||
|
|||||||
Reference in New Issue
Block a user