本文整理汇总了Java中it.unimi.dsi.fastutil.floats.Float2IntMap类的典型用法代码示例。如果您正苦于以下问题:Java Float2IntMap类的具体用法?Java Float2IntMap怎么用?Java Float2IntMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Float2IntMap类属于it.unimi.dsi.fastutil.floats包,在下文中一共展示了Float2IntMap类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncMultiplier
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
private void syncMultiplier(float healthPerMax) {
if (!this.isEnabled.getAsBoolean())
return;
boolean found = false;
for (Float2IntMap.Entry entry : map.float2IntEntrySet()) {
if (healthPerMax < entry.getFloatKey()) {
ticks = 0;
activeMultiplier = entry.getIntValue();
found = true;
break;
}
}
if (!found)
activeMultiplier = 0;
}
示例2: handleDamageTaken
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
@Override
public void handleDamageTaken(float damage, float healthPerMax, EntityPlayerMP player) {
if (!this.isEnabled.getAsBoolean())
return;
int value = -1;
for (Float2IntMap.Entry entry : map.float2IntEntrySet()) {
if (damage >= entry.getFloatKey()) {
value = Math.max(value, entry.getIntValue());
player.addPotionEffect(new PotionEffect(effect, entry.getIntValue(), 0, false, false));
}
}
if (value != -1 && sound != null)
FirstAid.NETWORKING.sendTo(new MessagePlayHurtSound(sound, value), player);
}
示例3: getKeyForValue
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private int getKeyForValue(float value) {
Float2IntMap map = (Float2IntMap) _groupKeyMap;
int groupId = map.get(value);
if (groupId == INVALID_ID) {
groupId = _numGroupKeys;
map.put(value, _numGroupKeys++);
}
return groupId;
}
示例4: ConstantDebuff
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
public ConstantDebuff(@Nonnull String potionName, @Nonnull Float2IntMap map, @Nonnull BooleanSupplier isEnabled) {
super(potionName, map, isEnabled);
}
示例5: AbstractDebuff
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
public AbstractDebuff(@Nonnull String potionName, @Nonnull Float2IntMap map, @Nonnull BooleanSupplier isEnabled) {
this.effect = Objects.requireNonNull(ForgeRegistries.POTIONS.getValue(new ResourceLocation(potionName)));
this.isEnabled = isEnabled;
this.map = map;
}
示例6: OnHitDebuff
import it.unimi.dsi.fastutil.floats.Float2IntMap; //导入依赖的package包/类
public OnHitDebuff(@Nonnull String potionName, @Nonnull Float2IntMap map, @Nonnull BooleanSupplier isEnabled, @Nullable SoundEvent sound) {
super(potionName, map, isEnabled);
this.sound = sound;
}