You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In armorModifier we have a snippet of code that Prevent armor from sending players over the edge into hot or icy temperature levels.
// Prevent armor from sending players over the edge into hot or icy temperature levelsTemperatureLevelarmorAdjTemp = current.increment(heatingPieces.get() / 2 - coolingPieces.get() / 2);
if (armorAdjTemp == TemperatureLevel.HOT && current != TemperatureLevel.HOT) current = armorAdjTemp.decrement(1);
elseif (armorAdjTemp == TemperatureLevel.ICY && current != TemperatureLevel.ICY) current = armorAdjTemp.increment(1);
elsecurrent = armorAdjTemp;
I Think it would be nice, through Configuration, to have the same logic for:
protectedstaticTemperatureLevelhandheldModifier(Playerplayer, TemperatureLevelcurrent)
{
AtomicIntegercoolingItems = newAtomicInteger();
AtomicIntegerheatingItems = newAtomicInteger();
player.getHandSlots().forEach((stack -> {
if (stack.is(ModTags.Items.COOLING_HELD_ITEMS)) coolingItems.getAndIncrement();
if (stack.is(ModTags.Items.HEATING_HELD_ITEMS)) heatingItems.getAndIncrement();
}));
// Prevent handled from sending players over the edge into hot or icy temperature levelsTemperatureLevelAdjTemp = current.increment(heatingItems.get() - coolingItems.get());
if (AdjTemp == TemperatureLevel.HOT && current != TemperatureLevel.HOT) current = AdjTemp.decrement(1);
elseif (AdjTemp == TemperatureLevel.ICY && current != TemperatureLevel.ICY) current = AdjTemp.increment(1);
elsecurrent = AdjTemp;
returncurrent;
}
Proximity Block
privatestaticTemperatureLevelproximityModifier(Levellevel, BlockPospos, TemperatureLevelcurrent)
{
Set<BlockPos> heating = Sets.newHashSet();
Set<BlockPos> cooling = Sets.newHashSet();
// If the player's position is obstructed (for example, when mounted or inside a block), use the position above insteadif (!level.isEmptyBlock(pos))
pos = pos.above();
AreaFill.fill(level, pos, (checkerLevel, checkedPos) -> {
addHeatingOrCooling(heating, cooling, checkerLevel, checkedPos.pos());
});
// Prevent proximity from sending players over the edge into hot or icy temperature levelsTemperatureLevelAdjTemp;
if (heating.size() > cooling.size()) AdjTemp = current.increment(1);
elseif (cooling.size() > heating.size()) AdjTemp = current.decrement(1);
elseAdjTemp = current;
if (AdjTemp == TemperatureLevel.HOT && current != TemperatureLevel.HOT) current = AdjTemp.decrement(1);
elseif (AdjTemp == TemperatureLevel.ICY && current != TemperatureLevel.ICY) current = AdjTemp.increment(1);
elsecurrent = AdjTemp;
returncurrent;
}
Why would this feature be useful?
I think having the possibilty to Prevent handled and/or proximity from sending players over the edge into hot or icy temperature levels thorugh configuration can softer the temperature mitigation system for those who want it.
Moreover it would make Extreme Temperature Levels only Biome/Weather dependent.
The text was updated successfully, but these errors were encountered:
Overview
In armorModifier we have a snippet of code that Prevent armor from sending players over the edge into hot or icy temperature levels.
I Think it would be nice, through Configuration, to have the same logic for:
Code Proposition
Handled Items
Proximity Block
Why would this feature be useful?
I think having the possibilty to
Prevent handled and/or proximity from sending players over the edge into hot or icy temperature levels
thorugh configuration can softer the temperature mitigation system for those who want it.Moreover it would make Extreme Temperature Levels only Biome/Weather dependent.
The text was updated successfully, but these errors were encountered: