修改斩首武器效果,修复爆炸level错误
This commit is contained in:
parent
eb675e7cf4
commit
3b5427560f
2 changed files with 6 additions and 3 deletions
|
@ -782,9 +782,9 @@ public class LivingEventHandler {
|
|||
var entity = event.getEntity();
|
||||
int level = PerkHelper.getItemPerkLevel(ModPerks.VORPAL_WEAPON.get(), stack);
|
||||
if (level <= 0) return;
|
||||
if (entity.getMaxHealth() < 100.0f) return;
|
||||
if (entity.getHealth() < 100.0f) return;
|
||||
|
||||
event.setAmount(event.getAmount() * (1.15f + 0.05f * level));
|
||||
event.setAmount((float) (event.getAmount() + entity.getHealth() * 0.00002f * Math.pow(level,2)));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig;
|
|||
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
|
@ -72,8 +73,10 @@ public class CustomExplosion extends Explosion {
|
|||
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(20 + 0.02 * damage,3 * pRadius,50 + 0.05 * damage, pToBlowX, pToBlowY, pToBlowZ));
|
||||
}
|
||||
}
|
||||
if (pLevel instanceof ServerLevel) {
|
||||
pLevel.explode(source == null ? null : source.getEntity(), pToBlowX, pToBlowY, pToBlowZ, pRadius / 2, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomExplosion(Level pLevel, @Nullable Entity pSource, @Nullable DamageSource source, float damage, double pToBlowX, double pToBlowY, double pToBlowZ, float pRadius) {
|
||||
this(pLevel, pSource, source, null, damage, pToBlowX, pToBlowY, pToBlowZ, pRadius, BlockInteraction.KEEP);
|
||||
|
|
Loading…
Add table
Reference in a new issue