mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fix centered weapons erroneously gaining the ADS accuracy boost
This commit is contained in:
parent
cc5371a761
commit
d4203f0334
@ -111,12 +111,20 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
|
|||||||
|
|
||||||
ItemStack gun = entity.getHeldItem();
|
ItemStack gun = entity.getHeldItem();
|
||||||
boolean offsetShot = true;
|
boolean offsetShot = true;
|
||||||
|
boolean accuracyBoost = false;
|
||||||
|
|
||||||
if(gun != null && gun.getItem() instanceof ItemGunBase) {
|
if(gun != null && gun.getItem() instanceof ItemGunBase) {
|
||||||
GunConfiguration cfg = ((ItemGunBase) gun.getItem()).mainConfig;
|
GunConfiguration cfg = ((ItemGunBase) gun.getItem()).mainConfig;
|
||||||
|
|
||||||
if(cfg != null && (cfg.hasSights && entity.isSneaking()) || cfg.isCentered) {
|
if(cfg != null) {
|
||||||
offsetShot = false;
|
if(cfg.hasSights && entity.isSneaking()) {
|
||||||
|
offsetShot = false;
|
||||||
|
accuracyBoost = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cfg.isCentered){
|
||||||
|
offsetShot = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +148,7 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
|
|||||||
this.renderDistanceWeight = 10.0D;
|
this.renderDistanceWeight = 10.0D;
|
||||||
this.setSize(0.5F, 0.5F);
|
this.setSize(0.5F, 0.5F);
|
||||||
|
|
||||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * (offsetShot ? 1F : 0.25F));
|
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * (accuracyBoost ? 0.25F : 1F));
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityBulletBaseNT(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) {
|
public EntityBulletBaseNT(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user