mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
hollow-cube/remove-default-damage-behaviour (#64)
* Remove automatic void damage * Remove automatic fire damage
This commit is contained in:
parent
30699ec3fd
commit
517b195b5e
@ -558,8 +558,6 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||
// handle block contacts
|
||||
touchTick();
|
||||
|
||||
handleVoid();
|
||||
|
||||
// Call the abstract update method
|
||||
update(time);
|
||||
|
||||
@ -747,16 +745,6 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||
return ticks;
|
||||
}
|
||||
|
||||
/**
|
||||
* How does this entity handle being in the void?
|
||||
*/
|
||||
protected void handleVoid() {
|
||||
// Kill if in void
|
||||
if (getInstance().isInVoid(this.position)) {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Each entity has an unique id (server-wide) which will change after a restart.
|
||||
*
|
||||
|
@ -63,11 +63,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
|
||||
*/
|
||||
private long fireExtinguishTime;
|
||||
|
||||
/**
|
||||
* Last time the fire damage was applied
|
||||
*/
|
||||
private long lastFireDamageTime;
|
||||
|
||||
/**
|
||||
* Period, in ms, between two fire damage applications
|
||||
*/
|
||||
@ -189,15 +184,8 @@ public class LivingEntity extends Entity implements EquipmentHandler {
|
||||
|
||||
@Override
|
||||
public void update(long time) {
|
||||
if (isOnFire()) {
|
||||
if (time > fireExtinguishTime) {
|
||||
setOnFire(false);
|
||||
} else {
|
||||
if (time - lastFireDamageTime > fireDamagePeriod) {
|
||||
damage(DamageType.ON_FIRE, 1.0f);
|
||||
lastFireDamageTime = time;
|
||||
}
|
||||
}
|
||||
if (isOnFire() && time > fireExtinguishTime) {
|
||||
setOnFire(false);
|
||||
}
|
||||
|
||||
// Items picking
|
||||
@ -582,14 +570,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
|
||||
return new EntityPropertiesPacket(getEntityId(), List.copyOf(attributeModifiers.values()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVoid() {
|
||||
// Kill if in void
|
||||
if (getInstance().isInVoid(this.position)) {
|
||||
damage(DamageType.VOID, 10f);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the time in ms between two fire damage applications.
|
||||
*
|
||||
|
@ -367,9 +367,7 @@ public abstract class Instance implements Block.Getter, Block.Setter,
|
||||
public abstract boolean hasEnabledAutoChunkLoad();
|
||||
|
||||
/**
|
||||
* Determines whether a position in the void. If true, entities should take damage and die.
|
||||
* <p>
|
||||
* Always returning false allow entities to survive in the void.
|
||||
* Determines whether a position in the void.
|
||||
*
|
||||
* @param point the point in the world
|
||||
* @return true if the point is inside the void
|
||||
|
Loading…
Reference in New Issue
Block a user