/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/hazard/HazardEntry.java
53 строки
1 KB
Boblet
fixed SILEX recipes, ZFB textures, more ItemHazard entries & modifiers
01 окт 2021, 16:25
01 окт 2021, 16:25
82911a9
Код
Авторство
О чём код?
package com.hbm.hazard; import java.util.ArrayList; import java.util.List; import com.hbm.hazard.modifier.HazardModifier; import com.hbm.hazard.type.HazardTypeBase; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; public class HazardEntry { HazardTypeBase type; float baseLevel; /* * Modifiers are evaluated in the order they're being applied to the entry. */ List<HazardModifier> mods = new ArrayList(); public HazardEntry(HazardTypeBase type) { this(type, 1F); } public HazardEntry(HazardTypeBase type, float level) { this.type = type; this.baseLevel = level; } public HazardEntry addMod(HazardModifier mod) { this.mods.add(mod); return this; } public void applyHazard(ItemStack stack, EntityLivingBase entity) { type.onUpdate(entity, HazardModifier.evalAllModifiers(stack, entity, baseLevel, mods), stack); } public HazardTypeBase getType() { return this.type; } public HazardEntry clone() { return clone(1F); } public HazardEntry clone(float mult) { HazardEntry clone = new HazardEntry(type, baseLevel * mult); clone.mods = this.mods; return clone; } }