Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -2,7 +2,7 @@
+++ b/net/minecraft/server/commands/CommandEffect.java
@@ -84,7 +84,7 @@
if (entity instanceof EntityLiving) {
MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag);
MobEffect mobeffect = new MobEffect(holder, k, i, false, flag);
- if (((EntityLiving) entity).addEffect(mobeffect, commandlistenerwrapper.getEntity())) {
+ if (((EntityLiving) entity).addEffect(mobeffect, commandlistenerwrapper.getEntity(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
@@ -22,8 +22,8 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
- if (entity instanceof EntityLiving && ((EntityLiving) entity).removeEffect(mobeffectlist)) {
+ if (entity instanceof EntityLiving && ((EntityLiving) entity).removeEffect(mobeffectlist, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
- if (entity instanceof EntityLiving && ((EntityLiving) entity).removeEffect(holder)) {
+ if (entity instanceof EntityLiving && ((EntityLiving) entity).removeEffect(holder, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
++i;
}
}

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/server/commands/CommandGive.java
+++ b/net/minecraft/server/commands/CommandGive.java
@@ -61,7 +61,7 @@
@@ -60,7 +60,7 @@
EntityItem entityitem;
if (flag && itemstack1.isEmpty()) {
itemstack1.setCount(1);
- entityitem = entityplayer.drop(itemstack1, false);
+ entityitem = entityplayer.drop(itemstack1, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event
- entityitem = entityplayer.drop(itemstack, false);
+ entityitem = entityplayer.drop(itemstack, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event
if (entityitem != null) {
entityitem.makeFakeItem();
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/commands/CommandLoot.java
+++ b/net/minecraft/server/commands/CommandLoot.java
@@ -90,7 +90,7 @@
@@ -91,7 +91,7 @@
}
private static <T extends ArgumentBuilder<CommandListenerWrapper, T>> T addTargets(T t0, CommandLoot.c commandloot_c) {
@@ -9,7 +9,7 @@
return entityReplace(ArgumentEntity.getEntities(commandcontext, "entities"), ArgumentInventorySlot.getSlot(commandcontext, "slot"), list.size(), list, commandloot_a);
}).then(commandloot_c.construct(net.minecraft.commands.CommandDispatcher.argument("count", IntegerArgumentType.integer(0)), (commandcontext, list, commandloot_a) -> {
return entityReplace(ArgumentEntity.getEntities(commandcontext, "entities"), ArgumentInventorySlot.getSlot(commandcontext, "slot"), IntegerArgumentType.getInteger(commandcontext, "count"), list, commandloot_a);
@@ -247,6 +247,7 @@
@@ -246,6 +246,7 @@
private static int dropInWorld(CommandListenerWrapper commandlistenerwrapper, Vec3D vec3d, List<ItemStack> list, CommandLoot.a commandloot_a) throws CommandSyntaxException {
WorldServer worldserver = commandlistenerwrapper.getLevel();

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/server/commands/CommandSummon.java
+++ b/net/minecraft/server/commands/CommandSummon.java
@@ -67,7 +67,7 @@
((EntityInsentient) entity).finalizeSpawn(commandlistenerwrapper.getLevel(), commandlistenerwrapper.getLevel().getCurrentDifficultyAt(entity.blockPosition()), EnumMobSpawn.COMMAND, (GroupDataEntity) null, (NBTTagCompound) null);
((EntityInsentient) entity).finalizeSpawn(commandlistenerwrapper.getLevel(), commandlistenerwrapper.getLevel().getCurrentDifficultyAt(entity.blockPosition()), EnumMobSpawn.COMMAND, (GroupDataEntity) null);
}
- if (!worldserver.tryAddFreshEntityWithPassengers(entity)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/commands/PlaceCommand.java
+++ b/net/minecraft/server/commands/PlaceCommand.java
@@ -130,6 +130,7 @@
@@ -132,6 +132,7 @@
if (!structurestart.isValid()) {
throw PlaceCommand.ERROR_STRUCTURE_FAILED.create();
} else {