Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SuppressWarnings("all")
- public class BoundDamageSource extends DamageSource {
- protected final PlayerEntity damageSourcePlayerIn;
- public BoundDamageSource(String damageTypeIn, PlayerEntity damageSourcePlayerIn) {
- super(damageTypeIn);
- this.damageSourcePlayerIn = damageSourcePlayerIn;
- }
- public ITextComponent getDeathMessage(LivingEntity playerEntityIn) {
- PlayerEntity playerEntity = (PlayerEntity) playerEntityIn;
- String s = "death.attack." + this.damageType;
- String s1 = s + ".boundPlayer";
- IBoundCapability boundPlayer = playerEntity.getCapability(BindingCapabilities.LIFE_BOUND_CAPABILITY).orElse(null);
- return playerEntity != null ? new TranslationTextComponent(s1, playerEntityIn.getDisplayName(), playerEntity.getServer().getPlayerList().getPlayerByUUID(boundPlayer.getUUID())) : new TranslationTextComponent(s, playerEntityIn.getDisplayName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement