优化装备微型导弹情况下的智慧芯片锁定效果

This commit is contained in:
Light_Quanta 2025-07-05 13:16:12 +08:00
parent b49f4c27d9
commit 6c50715d9a
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
4 changed files with 12 additions and 6 deletions

View file

@ -1499,7 +1499,9 @@ public class ClientEventHandler {
Vec3 playerVec = new Vec3(Mth.lerp(event.getPartialTick(), player.xo - 0.1 * player.getViewVector(1).x, player.getX() - 0.1 * player.getViewVector(1).x),
Mth.lerp(event.getPartialTick(), player.yo + player.getEyeHeight() - 0.1 * player.getViewVector(1).y, player.getEyeY() - 0.1 * player.getViewVector(1).y),
Mth.lerp(event.getPartialTick(), player.zo - 0.1 * player.getViewVector(1).z, player.getZ() - 0.1 * player.getViewVector(1).z));
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, entity.getDeltaMovement(), data.velocity(), 0.03);
var hasGravity = data.perk.getLevel(ModPerks.MICRO_MISSILE) <= 0;
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, entity.getDeltaMovement(), data.velocity(), hasGravity ? 0.03 : 0);
look(player, toVec);
}
}

View file

@ -691,11 +691,13 @@ public abstract class GunItem extends Item implements CustomRendererItem, GeoIte
if (zoom && !player.isShiftKeyDown()) {
Entity target = findEntity(player.level(), String.valueOf(uuid));
int intelligentChipLevel = GunData.from(stack).perk.getLevel(ModPerks.INTELLIGENT_CHIP);
var gunData = GunData.from(stack);
int intelligentChipLevel = gunData.perk.getLevel(ModPerks.INTELLIGENT_CHIP);
if (intelligentChipLevel > 0 && target != null) {
Vec3 targetVec = target.getEyePosition();
Vec3 playerVec = player.getEyePosition();
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, Vec3.ZERO, data.velocity(), 0.03);
var hasGravity = gunData.perk.getLevel(ModPerks.MICRO_MISSILE) <= 0;
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, Vec3.ZERO, data.velocity(), hasGravity ? 0.03 : 0);
x = toVec.x;
y = toVec.y;
z = toVec.z;

View file

@ -254,11 +254,13 @@ public class SecondaryCataclysm extends GunItem implements EnergyStorageItem {
if (zoom && !player.isShiftKeyDown()) {
Entity target = findEntity(player.level(), String.valueOf(uuid));
int intelligentChipLevel = GunData.from(stack).perk.getLevel(ModPerks.INTELLIGENT_CHIP);
var gunData = GunData.from(stack);
int intelligentChipLevel = gunData.perk.getLevel(ModPerks.INTELLIGENT_CHIP);
if (intelligentChipLevel > 0 && target != null) {
Vec3 targetVec = target.getEyePosition();
Vec3 playerVec = player.getEyePosition();
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, Vec3.ZERO, (isChargedFire ? 4 : 1) * velocity, 0.05);
var hasGravity = gunData.perk.getLevel(ModPerks.MICRO_MISSILE) <= 0;
Vec3 toVec = RangeTool.calculateFiringSolution(playerVec, targetVec, Vec3.ZERO, (isChargedFire ? 4 : 1) * velocity, hasGravity ? 0.05 : 0);
x = toVec.x;
y = toVec.y;
z = toVec.z;

View file

@ -41,7 +41,7 @@ public class HomemadeShotgunItem extends GunItem {
}
@Override
public int getBarWidth(ItemStack pStack) {
public int getBarWidth(@NotNull ItemStack pStack) {
return Math.round(13.0F - (float) pStack.getDamageValue() * 13.0F / (float) this.getMaxDamage(pStack));
}