mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
Toggleable player crits
This commit is contained in:
parent
4b38f09815
commit
b9319698ce
@ -270,7 +270,15 @@
|
|||||||
flag1 = true;
|
flag1 = true;
|
||||||
} else {
|
} else {
|
||||||
flag1 = false;
|
flag1 = false;
|
||||||
@@ -1223,8 +1294,13 @@
|
@@ -1168,6 +1239,7 @@
|
||||||
|
f += itemstack.getItem().getAttackDamageBonus(target, f, damagesource);
|
||||||
|
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting();
|
||||||
|
|
||||||
|
+ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
||||||
|
if (flag2) {
|
||||||
|
f *= 1.5F;
|
||||||
|
}
|
||||||
|
@@ -1223,8 +1295,13 @@
|
||||||
if (entityliving2 != this && entityliving2 != target && !this.isAlliedTo((Entity) entityliving2) && (!(entityliving2 instanceof ArmorStand) || !((ArmorStand) entityliving2).isMarker()) && this.distanceToSqr((Entity) entityliving2) < 9.0D) {
|
if (entityliving2 != this && entityliving2 != target && !this.isAlliedTo((Entity) entityliving2) && (!(entityliving2 instanceof ArmorStand) || !((ArmorStand) entityliving2).isMarker()) && this.distanceToSqr((Entity) entityliving2) < 9.0D) {
|
||||||
float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2;
|
float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2;
|
||||||
|
|
||||||
@ -285,7 +293,7 @@
|
|||||||
Level world = this.level();
|
Level world = this.level();
|
||||||
|
|
||||||
if (world instanceof ServerLevel) {
|
if (world instanceof ServerLevel) {
|
||||||
@@ -1235,26 +1311,43 @@
|
@@ -1235,26 +1312,43 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +341,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1308,9 +1401,14 @@
|
@@ -1308,9 +1402,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +358,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1351,7 +1449,14 @@
|
@@ -1351,7 +1450,14 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(Entity.RemovalReason reason) {
|
public void remove(Entity.RemovalReason reason) {
|
||||||
@ -366,7 +374,7 @@
|
|||||||
this.inventoryMenu.removed(this);
|
this.inventoryMenu.removed(this);
|
||||||
if (this.containerMenu != null && this.hasContainerOpen()) {
|
if (this.containerMenu != null && this.hasContainerOpen()) {
|
||||||
this.doCloseContainer();
|
this.doCloseContainer();
|
||||||
@@ -1391,7 +1496,13 @@
|
@@ -1391,7 +1497,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos pos) {
|
public Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos pos) {
|
||||||
@ -381,7 +389,7 @@
|
|||||||
this.sleepCounter = 0;
|
this.sleepCounter = 0;
|
||||||
return Either.right(Unit.INSTANCE);
|
return Either.right(Unit.INSTANCE);
|
||||||
}
|
}
|
||||||
@@ -1545,12 +1656,24 @@
|
@@ -1545,12 +1657,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFallFlying() {
|
public void startFallFlying() {
|
||||||
@ -407,7 +415,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1664,11 +1787,30 @@
|
@@ -1664,11 +1788,30 @@
|
||||||
public int getXpNeededForNextLevel() {
|
public int getXpNeededForNextLevel() {
|
||||||
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
||||||
}
|
}
|
||||||
@ -439,7 +447,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1748,13 +1890,20 @@
|
@@ -1748,13 +1891,20 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
|
public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
|
||||||
@ -467,7 +475,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1798,26 +1947,55 @@
|
@@ -1798,26 +1948,55 @@
|
||||||
|
|
||||||
public void removeEntitiesOnShoulder() {
|
public void removeEntitiesOnShoulder() {
|
||||||
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {
|
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user