
org.bukkit.craftbukkit.util.CraftDamageSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package org.bukkit.craftbukkit.util;
import net.minecraft.server.DamageSource;
// Util class to create custom DamageSources.
public final class CraftDamageSource extends DamageSource {
private CraftDamageSource(String identifier) {
super(identifier);
}
public static DamageSource copyOf(final DamageSource original) {
CraftDamageSource newSource = new CraftDamageSource(original.translationIndex);
// Check ignoresArmor
if (original.ignoresArmor()) {
newSource.setIgnoreArmor();
}
// Check magic
if (original.isMagic()) {
newSource.setMagic();
}
// Check fire
if (original.isExplosion()) {
newSource.setExplosion();
}
return newSource;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy