2021-09-30 21:44:30 -05:00
|
|
|
//
|
|
|
|
|
// Source code recreated from a .class file by IntelliJ IDEA
|
|
|
|
|
// (powered by FernFlower decompiler)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
package noppes.npcs.scripted.wrapper;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.util.DamageSource;
|
2022-05-11 13:30:13 -05:00
|
|
|
import noppes.npcs.controllers.ScriptController;
|
2021-10-18 06:33:39 -05:00
|
|
|
import noppes.npcs.scripted.interfaces.IDamageSource;
|
2022-05-11 16:43:14 -05:00
|
|
|
import noppes.npcs.scripted.interfaces.entity.IEntity;
|
2021-09-30 21:44:30 -05:00
|
|
|
|
|
|
|
|
public class ScriptDamageSource implements IDamageSource {
|
|
|
|
|
private DamageSource source;
|
|
|
|
|
|
|
|
|
|
public ScriptDamageSource(DamageSource source) {
|
|
|
|
|
this.source = source;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getType() {
|
|
|
|
|
return this.source.getDamageType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isUnblockable() {
|
|
|
|
|
return this.source.isUnblockable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isProjectile() {
|
|
|
|
|
return this.source.isProjectile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DamageSource getMCDamageSource() {
|
|
|
|
|
return this.source;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEntity getTrueSource() {
|
2022-05-11 13:30:13 -05:00
|
|
|
return ScriptController.Instance.getScriptForEntity(this.source.getEntity());
|
2021-09-30 21:44:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEntity getImmediateSource() {
|
2022-05-11 13:30:13 -05:00
|
|
|
return ScriptController.Instance.getScriptForEntity(this.source.getSourceOfDamage());
|
2021-09-30 21:44:30 -05:00
|
|
|
}
|
|
|
|
|
}
|