Yarn: Change PotionEffect and PotionEffectType to EffectStack and Effect

Created on 4 Nov 2018  路  2Comments  路  Source: FabricMC/yarn

  • remove Potion prefix from Effect classes, move them to effect package
  • switch what is "base" name and what is "qualified" name
    Compare to similar classes for items: stateless thing is just Item, and wrapper around it is ItemStack.

Also, I personally prefer EffectDamageModifier to EffectDamage, despite it's a bit longer.

List of classes to cnange:

PotionEffect -> EffectStack
PotionEffectType -> Effect
PotionEffectTypeAbsorption -> EffectAbsorption
PotionEffectTypeDamage -> EffectDamageModifier
PotionEffectTypeHealthBoost -> EffectHealthBoost
PotionEffectTypeInstant -> EffectInstant
PotionEffectTypes -> Effects
PotionEffectUtil -> EffectUtils

Most helpful comment

There's another precedent: AttributeInstance. Likewise, we could use EffectInstance. ItemStack relates to the stackability of Items, which potion effects, well, don't.

All 2 comments

There's another precedent: AttributeInstance. Likewise, we could use EffectInstance. ItemStack relates to the stackability of Items, which potion effects, well, don't.

In fact, official nomenclature refers to them as "mob effects". So MobEffect and MobEffectInstance it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enbrain picture enbrain  路  4Comments

ChloeDawn picture ChloeDawn  路  6Comments

Runemoro picture Runemoro  路  3Comments

copygirl picture copygirl  路  6Comments

Sollace picture Sollace  路  5Comments