From cbe41a0f788dedbcc4a8dcd408049d2806f90c05 Mon Sep 17 00:00:00 2001 From: Chase Cooper Date: Thu, 16 Apr 2026 16:07:07 -0400 Subject: [PATCH 1/3] Remove breeding cap for animals #1416 --- Minecraft.World/MobCategory.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Minecraft.World/MobCategory.h b/Minecraft.World/MobCategory.h index 4fe5c8262b..47c14ef60e 100644 --- a/Minecraft.World/MobCategory.h +++ b/Minecraft.World/MobCategory.h @@ -19,20 +19,20 @@ class MobCategory static const int CONSOLE_SQUID_HARD_LIMIT = 5; static const int MAX_CONSOLE_BOSS = 1; // Max number of bosses (enderdragon/wither) - static const int MAX_XBOX_ANIMALS_WITH_BREEDING = CONSOLE_ANIMALS_HARD_LIMIT + 20; // Max number of animals that we can produce (in total), when breeding - static const int MAX_XBOX_CHICKENS_WITH_BREEDING = MAX_XBOX_CHICKENS + 8; // Max number of chickens that we can produce (in total), when breeding/hatching - static const int MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING = MAX_XBOX_MUSHROOMCOWS + 20; // Max number of mushroom cows that we can produce (in total), when breeding - static const int MAX_XBOX_WOLVES_WITH_BREEDING = MAX_XBOX_WOLVES + 8; // Max number of wolves that we can produce (in total), when breeding - static const int MAX_VILLAGERS_WITH_BREEDING = 35; + static constexpr int MAX_XBOX_ANIMALS_WITH_BREEDING = 0; + static constexpr int MAX_XBOX_CHICKENS_WITH_BREEDING = 0; + static constexpr int MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING = 0; + static constexpr int MAX_XBOX_WOLVES_WITH_BREEDING = 0; + static constexpr int MAX_VILLAGERS_WITH_BREEDING = 0; - static const int MAX_XBOX_ANIMALS_WITH_SPAWN_EGG = MAX_XBOX_ANIMALS_WITH_BREEDING + 20; - static const int MAX_XBOX_CHICKENS_WITH_SPAWN_EGG = MAX_XBOX_CHICKENS_WITH_BREEDING + 10; - static const int MAX_XBOX_WOLVES_WITH_SPAWN_EGG = MAX_XBOX_WOLVES_WITH_BREEDING + 10; - static const int MAX_XBOX_MONSTERS_WITH_SPAWN_EGG = CONSOLE_MONSTERS_HARD_LIMIT + 20; - static const int MAX_XBOX_VILLAGERS_WITH_SPAWN_EGG = MAX_VILLAGERS_WITH_BREEDING + 15; // 4J-PB - increased this limit due to player requests - static const int MAX_XBOX_MUSHROOMCOWS_WITH_SPAWN_EGG = MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING + 8; - static const int MAX_XBOX_SQUIDS_WITH_SPAWN_EGG = CONSOLE_SQUID_HARD_LIMIT + 8; - static const int MAX_AMBIENT_WITH_SPAWN_EGG = CONSOLE_AMBIENT_HARD_LIMIT + 8; + static constexpr int MAX_XBOX_ANIMALS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_CHICKENS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_WOLVES_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_MONSTERS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_VILLAGERS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_MUSHROOMCOWS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_XBOX_SQUIDS_WITH_SPAWN_EGG = 0; + static constexpr int MAX_AMBIENT_WITH_SPAWN_EGG = 0; /* Maximum animals = 50 + 20 + 20 = 90 From 4b911b09b7bc9dab8ea087225bd4095227acdc6f Mon Sep 17 00:00:00 2001 From: Chase Cooper Date: Sun, 19 Apr 2026 22:56:54 -0400 Subject: [PATCH 2/3] Sword blocking mechanics and interactoin locks (#1532) - Fixed #1532 by makingthe blocking correctly reduces damage; per Java 1.8 mechs. - Fixed an attack going through while blocking. - Fixed a bug where you could mine while blocking. - Swing animation while blocking was overrided; per Java 1.8 mechs. --- Minecraft.Client/LocalPlayer.cpp | 10 ++++++++-- Minecraft.Client/MultiPlayerGameMode.cpp | 9 +++++++++ Minecraft.World/Player.cpp | 17 ++++++++++++++--- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index 852b830814..f40a5867f9 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -1279,6 +1279,12 @@ void LocalPlayer::handleMouseDown(int button, bool down) if (!down) missTime = 0; if (button == 0 && missTime > 0) return; + if (isBlocking()) + { + minecraft->gameMode->stopDestroyBlock(); + return; + } + if (down && minecraft->hitResult != nullptr && minecraft->hitResult->type == HitResult::TILE && button == 0) { int x = minecraft->hitResult->x; @@ -1476,7 +1482,7 @@ bool LocalPlayer::handleMouseClick(int button) bool returnItemPlaced = false; if (button == 0 && missTime > 0) return false; - if (button == 0) + if (button == 0 && !isBlocking()) { //app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad()); swing(); @@ -1510,7 +1516,7 @@ bool LocalPlayer::handleMouseClick(int button) } else if (minecraft->hitResult->type == HitResult::ENTITY) { - if (button == 0) + if (button == 0 && !isBlocking()) { minecraft->gameMode->attack(minecraft->localplayers[GetXboxPad()], minecraft->hitResult->entity); } diff --git a/Minecraft.Client/MultiPlayerGameMode.cpp b/Minecraft.Client/MultiPlayerGameMode.cpp index 96071d283f..130879a8cc 100644 --- a/Minecraft.Client/MultiPlayerGameMode.cpp +++ b/Minecraft.Client/MultiPlayerGameMode.cpp @@ -116,6 +116,8 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) { if(!minecraft->player->isAllowedToMine()) return; + if(minecraft->player->isBlocking()) return; + if (localPlayerMode->isAdventureRestricted()) { if (!minecraft->player->mayDestroyBlockAt(x, y, z)) @@ -181,6 +183,13 @@ void MultiPlayerGameMode::stopDestroyBlock() void MultiPlayerGameMode::continueDestroyBlock(int x, int y, int z, int face) { if(!minecraft->player->isAllowedToMine()) return; + if(minecraft->player->isBlocking()) + { + isDestroying = false; + destroyProgress = 0; + minecraft->level->destroyTileProgress(minecraft->player->entityId, xDestroyBlock, yDestroyBlock, zDestroyBlock, -1); + return; + } ensureHasSentCarriedItem(); // connection.send(new PlayerActionPacket(PlayerActionPacket.CONTINUE_DESTROY_BLOCK, x, y, z, face)); diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index db6ee06e1d..ee327b1d85 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -243,9 +243,13 @@ void Player::updateFrameTick() // 4J Stu - Fix for #45508 - TU5: Gameplay: Eating one piece of food will result in a second piece being eaten as well // Original code was item != useItem. Changed this now to use the equals function, and add the nullptr check as well for the other possible not equals (useItem is not nullptr if we are here) // This is because the useItem and item could be different objects due to an inventory update from the server, but still be the same item (with the same id,count and auxvalue) - if (item == nullptr || !item->equals(useItem) ) + if (item == nullptr || !item->equals(useItem)) { - stopUsingItem(); + const UseAnim anim = useItem->getUseAnimation(); + if (anim != UseAnim_block) + { + stopUsingItem(); + } } else { @@ -1467,7 +1471,7 @@ void Player::actuallyHurt(DamageSource *source, float dmg) if (isInvulnerable()) return; if (!source->isBypassArmor() && isBlocking() && dmg > 0) { - dmg = (1 + dmg) * .5f; + dmg = dmg * 0.5f; } dmg = getDamageAfterArmorAbsorb(source, dmg); dmg = getDamageAfterMagicAbsorb(source, dmg); @@ -2482,6 +2486,13 @@ void Player::startUsingItem(shared_ptr instance, int duration) setUsingItemFlag(true); } + if (instance->getUseAnimation() == UseAnim_block) + { + swinging = false; + swingTime = 0; + attackAnim = 0.0f; + } + // 4J-JEV, hook for ItemUsed event, and ironbelly achievement. awardStat(GenericStats::itemsUsed(instance->getItem()->id), GenericStats::param_itemsUsed(dynamic_pointer_cast(shared_from_this()),instance)); From b10b897a28c8b2f834067070412f22653e71e6d0 Mon Sep 17 00:00:00 2001 From: Chase Cooper Date: Sun, 19 Apr 2026 23:18:13 -0400 Subject: [PATCH 3/3] I hate myself. --- Minecraft.World/MobCategory.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Minecraft.World/MobCategory.h b/Minecraft.World/MobCategory.h index 47c14ef60e..4fe5c8262b 100644 --- a/Minecraft.World/MobCategory.h +++ b/Minecraft.World/MobCategory.h @@ -19,20 +19,20 @@ class MobCategory static const int CONSOLE_SQUID_HARD_LIMIT = 5; static const int MAX_CONSOLE_BOSS = 1; // Max number of bosses (enderdragon/wither) - static constexpr int MAX_XBOX_ANIMALS_WITH_BREEDING = 0; - static constexpr int MAX_XBOX_CHICKENS_WITH_BREEDING = 0; - static constexpr int MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING = 0; - static constexpr int MAX_XBOX_WOLVES_WITH_BREEDING = 0; - static constexpr int MAX_VILLAGERS_WITH_BREEDING = 0; + static const int MAX_XBOX_ANIMALS_WITH_BREEDING = CONSOLE_ANIMALS_HARD_LIMIT + 20; // Max number of animals that we can produce (in total), when breeding + static const int MAX_XBOX_CHICKENS_WITH_BREEDING = MAX_XBOX_CHICKENS + 8; // Max number of chickens that we can produce (in total), when breeding/hatching + static const int MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING = MAX_XBOX_MUSHROOMCOWS + 20; // Max number of mushroom cows that we can produce (in total), when breeding + static const int MAX_XBOX_WOLVES_WITH_BREEDING = MAX_XBOX_WOLVES + 8; // Max number of wolves that we can produce (in total), when breeding + static const int MAX_VILLAGERS_WITH_BREEDING = 35; - static constexpr int MAX_XBOX_ANIMALS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_CHICKENS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_WOLVES_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_MONSTERS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_VILLAGERS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_MUSHROOMCOWS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_XBOX_SQUIDS_WITH_SPAWN_EGG = 0; - static constexpr int MAX_AMBIENT_WITH_SPAWN_EGG = 0; + static const int MAX_XBOX_ANIMALS_WITH_SPAWN_EGG = MAX_XBOX_ANIMALS_WITH_BREEDING + 20; + static const int MAX_XBOX_CHICKENS_WITH_SPAWN_EGG = MAX_XBOX_CHICKENS_WITH_BREEDING + 10; + static const int MAX_XBOX_WOLVES_WITH_SPAWN_EGG = MAX_XBOX_WOLVES_WITH_BREEDING + 10; + static const int MAX_XBOX_MONSTERS_WITH_SPAWN_EGG = CONSOLE_MONSTERS_HARD_LIMIT + 20; + static const int MAX_XBOX_VILLAGERS_WITH_SPAWN_EGG = MAX_VILLAGERS_WITH_BREEDING + 15; // 4J-PB - increased this limit due to player requests + static const int MAX_XBOX_MUSHROOMCOWS_WITH_SPAWN_EGG = MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING + 8; + static const int MAX_XBOX_SQUIDS_WITH_SPAWN_EGG = CONSOLE_SQUID_HARD_LIMIT + 8; + static const int MAX_AMBIENT_WITH_SPAWN_EGG = CONSOLE_AMBIENT_HARD_LIMIT + 8; /* Maximum animals = 50 + 20 + 20 = 90