Add particles

Add missing Textures
Add client functionality
This commit is contained in:
2024-08-02 15:42:51 +02:00
parent 3bd5e3d3ba
commit ec90a2e292
29 changed files with 492 additions and 71 deletions

View File

@@ -0,0 +1,40 @@
package systems.brn.plasticgun.effects;
import eu.pb4.polymer.core.api.other.PolymerStatusEffect;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.server.network.ServerPlayerEntity;
import systems.brn.plasticgun.PlasticGun;
import static systems.brn.plasticgun.PlasticGun.flashbangEffect;
public class FlashbangEffect extends StatusEffect implements PolymerStatusEffect {
public FlashbangEffect() {
// category: StatusEffectCategory - describes if the effect is helpful (BENEFICIAL), harmful (HARMFUL) or useless (NEUTRAL)
// color: int - Color is the color assigned to the effect (in RGB)
super(StatusEffectCategory.HARMFUL, 0xe9b8b3);
}
// Called every tick to check if the effect can be applied or not
@Override
public boolean canApplyUpdateEffect(int duration, int amplifier) {
// In our case, we just make it return true so that it applies the effect every tick
return true;
}
// Called when the effect is applied.
@Override
public boolean applyUpdateEffect(LivingEntity entity, int amplifier) {
return super.applyUpdateEffect(entity, amplifier);
}
@Override
public StatusEffect getPolymerReplacement(ServerPlayerEntity player){
if (PlasticGun.clientsWithMod.contains(player)){
return flashbangEffect.value();
}
return StatusEffects.BLINDNESS.value();
}
}