Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import meteordevelopment.meteorclient.mixininterface.IVec3;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerEntity;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
Expand Down Expand Up @@ -306,10 +307,11 @@ private static float protectionReduction(LivingEntity player, float damage, Dama

int damageProtection = 0;

Object2IntMap<Holder<Enchantment>> enchantments = new Object2IntOpenHashMap<>();

for (EquipmentSlot slot : EquipmentSlotGroup.ARMOR) {
ItemStack stack = player.getItemBySlot(slot);

Object2IntMap<Holder<Enchantment>> enchantments = new Object2IntOpenHashMap<>();
Utils.getEnchantments(stack, enchantments);

int protection = Utils.getEnchantmentLevel(enchantments, Enchantments.PROTECTION);
Expand Down Expand Up @@ -384,12 +386,15 @@ private static float getExposure(Vec3 source, AABB box, RaycastFactory raycastFa
double endY = box.maxY;
double endZ = box.maxZ + zOffset;

Vec3 position = new Vec3(0, 0, 0);
ExposureRaycastContext context = new ExposureRaycastContext(position, source);

for (double x = startX; x <= endX; x += xStep) {
for (double y = startY; y <= endY; y += yStep) {
for (double z = startZ; z <= endZ; z += zStep) {
Vec3 position = new Vec3(x, y, z);
((IVec3) position).meteor$set(x, y, z);

if (raycast(new ExposureRaycastContext(position, source), raycastFactory) == null) misses++;
if (raycast(context, raycastFactory) == null) misses++;

hits++;
}
Expand Down