Skip to content

Commit

Permalink
Update to 24w19b
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed May 10, 2024
1 parent e0971f9 commit f067b85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/wurstclient/hacks/AutoArmorHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ private int getArmorValue(ArmorItem item, ItemStack stack)
.map(entry -> EnchantmentHelper.getLevel(entry, stack))
.orElse(0);

// TODO: Only the server can calculate protection amount as of
// 24w18a. Might change back in later snapshots.

// ClientPlayerEntity player = MC.player;
// DamageSource dmgSource =
// player.getDamageSources().playerAttack(player);
// prtPoints = protection.getProtectionAmount(prtLvl, dmgSource);

// Only the server can calculate protection amount as of
// 24w18a (1.21). Related bug: MC-196250
prtPoints = prtLvl;
}

Expand Down
9 changes: 7 additions & 2 deletions src/main/java/net/wurstclient/hacks/AutoSoupHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
*/
package net.wurstclient.hacks;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.CraftingTableBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.StewItem;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
Expand Down Expand Up @@ -122,11 +124,14 @@ public void onUpdate()

private int findSoup(int startSlot, int endSlot)
{
List<Item> stews = List.of(Items.MUSHROOM_STEW, Items.RABBIT_STEW,
Items.BEETROOT_SOUP);

for(int i = startSlot; i < endSlot; i++)
{
ItemStack stack = MC.player.getInventory().getStack(i);

if(stack != null && stack.getItem() instanceof StewItem)
if(stack != null && stews.contains(stack.getItem()))
return i;
}

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/net/wurstclient/hacks/AutoSwordHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ private float getValue(ItemStack stack, Entity entity)
.getAttribute(item, EntityAttributes.GENERIC_ATTACK_SPEED)
.orElseThrow();

// TODO: Client-side item-specific attack damage calculation no
// longer exists as of 24w18a. Seems to be a bug, as this would make
// the damage tooltip inaccurate. Check if they add it back in later
// snapshots.
// Client-side item-specific attack damage calculation no
// longer exists as of 24w18a (1.21). Related bug: MC-196250
case DAMAGE:
// EntityType<?> group = entity.getType();
float dmg = (float)ItemUtils
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

"depends": {
"fabricloader": ">=0.15.9",
"fabric-api": ">=0.97.9",
"minecraft": "~1.21-alpha.24.18.a",
"fabric-api": ">=0.98.1",
"minecraft": "~1.21-alpha.24.19.a",
"java": ">=21"
},
"suggests": {
Expand Down

0 comments on commit f067b85

Please sign in to comment.