fix more int->long stuff
This commit is contained in:
parent
ccaa83a2f9
commit
3f3b899ecb
|
@ -62,6 +62,15 @@ public abstract class CastingEnvironment {
|
|||
public void precheckAction(PatternShapeMatch match) throws Mishap {
|
||||
// TODO: this doesn't let you select special handlers.
|
||||
// Might be worth making a "no casting" tag on each thing
|
||||
ResourceLocation key = actionKey(match);
|
||||
|
||||
if (!HexConfig.server().isActionAllowed(key)) {
|
||||
throw new MishapDisallowedSpell();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected ResourceLocation actionKey(PatternShapeMatch match) {
|
||||
ResourceLocation key;
|
||||
if (match instanceof PatternShapeMatch.Normal normal) {
|
||||
key = normal.key.location();
|
||||
|
@ -72,9 +81,7 @@ public abstract class CastingEnvironment {
|
|||
} else {
|
||||
key = null;
|
||||
}
|
||||
if (!HexConfig.server().isActionAllowed(key)) {
|
||||
throw new MishapDisallowedSpell();
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,15 +2,20 @@ package at.petrak.hexcasting.api.casting.eval.env;
|
|||
|
||||
import at.petrak.hexcasting.api.HexAPI;
|
||||
import at.petrak.hexcasting.api.casting.ParticleSpray;
|
||||
import at.petrak.hexcasting.api.casting.PatternShapeMatch;
|
||||
import at.petrak.hexcasting.api.casting.circles.BlockEntityAbstractImpetus;
|
||||
import at.petrak.hexcasting.api.casting.circles.CircleExecutionState;
|
||||
import at.petrak.hexcasting.api.casting.eval.CastResult;
|
||||
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment;
|
||||
import at.petrak.hexcasting.api.casting.eval.MishapEnvironment;
|
||||
import at.petrak.hexcasting.api.casting.eval.sideeffects.OperatorSideEffect;
|
||||
import at.petrak.hexcasting.api.casting.mishaps.Mishap;
|
||||
import at.petrak.hexcasting.api.casting.mishaps.MishapDisallowedSpell;
|
||||
import at.petrak.hexcasting.api.mod.HexConfig;
|
||||
import at.petrak.hexcasting.api.pigment.FrozenPigment;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -55,6 +60,17 @@ public class CircleCastEnv extends CastingEnvironment {
|
|||
return new CircleMishapEnv(this.world, this.execState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void precheckAction(PatternShapeMatch match) throws Mishap {
|
||||
super.precheckAction(match);
|
||||
|
||||
ResourceLocation key = actionKey(match);
|
||||
|
||||
if (!HexConfig.server().isActionAllowedInCircles(key)) {
|
||||
throw new MishapDisallowedSpell("disallowed_circle");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postExecution(CastResult result) {
|
||||
// we always want to play this sound one at a time
|
||||
|
|
|
@ -189,6 +189,8 @@ public abstract class PlayerBasedCastEnv extends CastingEnvironment {
|
|||
protected long extractMediaFromInventory(long costLeft, boolean allowOvercast) {
|
||||
List<ADMediaHolder> sources = MediaHelper.scanPlayerForMediaStuff(this.caster);
|
||||
|
||||
var startCost = costLeft;
|
||||
|
||||
for (var source : sources) {
|
||||
var found = MediaHelper.extractMedia(source, (int) costLeft, true, false);
|
||||
costLeft -= found;
|
||||
|
@ -212,6 +214,8 @@ public abstract class PlayerBasedCastEnv extends CastingEnvironment {
|
|||
costLeft -= actuallyTaken;
|
||||
}
|
||||
|
||||
this.caster.awardStat(HexStatistics.MEDIA_USED, (int) (startCost - costLeft));
|
||||
|
||||
return costLeft;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package at.petrak.hexcasting.api.casting.eval.sideeffects
|
|||
import at.petrak.hexcasting.api.advancements.HexAdvancementTriggers
|
||||
import at.petrak.hexcasting.api.casting.ParticleSpray
|
||||
import at.petrak.hexcasting.api.casting.RenderedSpell
|
||||
import at.petrak.hexcasting.api.casting.eval.env.PlayerBasedCastEnv
|
||||
import at.petrak.hexcasting.api.casting.eval.vm.CastingVM
|
||||
import at.petrak.hexcasting.api.casting.mishaps.Mishap
|
||||
import at.petrak.hexcasting.api.mod.HexStatistics
|
||||
|
|
|
@ -13,11 +13,11 @@ import java.util.List;
|
|||
public class HexConfig {
|
||||
public interface CommonConfigAccess {
|
||||
|
||||
int dustMediaAmount();
|
||||
long dustMediaAmount();
|
||||
|
||||
int shardMediaAmount();
|
||||
long shardMediaAmount();
|
||||
|
||||
int chargedCrystalMediaAmount();
|
||||
long chargedCrystalMediaAmount();
|
||||
|
||||
double mediaToHealthRate();
|
||||
|
||||
|
@ -27,9 +27,9 @@ public class HexConfig {
|
|||
|
||||
int artifactCooldown();
|
||||
|
||||
int DEFAULT_DUST_MEDIA_AMOUNT = MediaConstants.DUST_UNIT;
|
||||
int DEFAULT_SHARD_MEDIA_AMOUNT = MediaConstants.SHARD_UNIT;
|
||||
int DEFAULT_CHARGED_MEDIA_AMOUNT = MediaConstants.CRYSTAL_UNIT;
|
||||
long DEFAULT_DUST_MEDIA_AMOUNT = MediaConstants.DUST_UNIT;
|
||||
long DEFAULT_SHARD_MEDIA_AMOUNT = MediaConstants.SHARD_UNIT;
|
||||
long DEFAULT_CHARGED_MEDIA_AMOUNT = MediaConstants.CRYSTAL_UNIT;
|
||||
double DEFAULT_MEDIA_TO_HEALTH_RATE = 2 * MediaConstants.CRYSTAL_UNIT / 20.0;
|
||||
|
||||
int DEFAULT_CYPHER_COOLDOWN = 8;
|
||||
|
|
|
@ -11,9 +11,9 @@ import static at.petrak.hexcasting.api.HexAPI.modLoc;
|
|||
|
||||
public class HexStatistics {
|
||||
public static final ResourceLocation MEDIA_USED = makeCustomStat("media_used",
|
||||
mediamount -> StatFormatter.DEFAULT.format(mediamount / MediaConstants.DUST_UNIT));
|
||||
mediamount -> StatFormatter.DEFAULT.format((int) (mediamount / MediaConstants.DUST_UNIT)));
|
||||
public static final ResourceLocation MEDIA_OVERCAST = makeCustomStat("media_overcast",
|
||||
mediamount -> StatFormatter.DEFAULT.format(mediamount / MediaConstants.DUST_UNIT));
|
||||
mediamount -> StatFormatter.DEFAULT.format((int) (mediamount / MediaConstants.DUST_UNIT)));
|
||||
public static final ResourceLocation PATTERNS_DRAWN = makeCustomStat("patterns_drawn", StatFormatter.DEFAULT);
|
||||
public static final ResourceLocation SPELLS_CAST = makeCustomStat("spells_cast", StatFormatter.DEFAULT);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import at.petrak.hexcasting.api.mod.HexTags
|
|||
import at.petrak.hexcasting.common.casting.actions.spells.great.OpTeleport
|
||||
import net.minecraft.world.entity.Entity
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
object OpBlink : SpellAction {
|
||||
override val argc = 2
|
||||
|
@ -46,7 +46,7 @@ object OpBlink : SpellAction {
|
|||
|
||||
return SpellAction.Result(
|
||||
Spell(target, delta),
|
||||
(MediaConstants.SHARD_UNIT * delta.absoluteValue * 0.5).roundToInt(),
|
||||
(MediaConstants.SHARD_UNIT * delta.absoluteValue * 0.5).roundToLong(),
|
||||
listOf(
|
||||
ParticleSpray.cloud(targetMiddlePos, 2.0, 50),
|
||||
ParticleSpray.burst(targetMiddlePos.add(dvec), 2.0, 100)
|
||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.world.level.block.state.BlockState
|
|||
import net.minecraft.world.level.material.Fluid
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class OpCreateFluid(val cost: Int, val bucket: Item, val cauldron: BlockState, val fluid: Fluid) : SpellAction {
|
||||
class OpCreateFluid(val cost: Long, val bucket: Item, val cauldron: BlockState, val fluid: Fluid) : SpellAction {
|
||||
override val argc = 1
|
||||
override fun execute(
|
||||
args: List<Iota>,
|
||||
|
|
|
@ -29,7 +29,7 @@ class OpExplode(val fire: Boolean) : SpellAction {
|
|||
val cost = MediaConstants.DUST_UNIT * (3 * clampedStrength + if (fire) 1.0 else 0.125)
|
||||
return SpellAction.Result(
|
||||
Spell(pos, strength, this.fire),
|
||||
cost.toInt(),
|
||||
cost.toLong(),
|
||||
listOf(ParticleSpray.burst(pos, strength, 50))
|
||||
)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.world.item.ItemStack
|
|||
import net.minecraft.world.phys.Vec3
|
||||
import kotlin.math.max
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
class OpFlight(val type: Type) : SpellAction {
|
||||
override val argc = 2
|
||||
|
@ -38,7 +39,7 @@ class OpFlight(val type: Type) : SpellAction {
|
|||
Type.LimitRange -> theArg * MediaConstants.DUST_UNIT
|
||||
// A second of flight should cost 1 shard
|
||||
Type.LimitTime -> theArg * MediaConstants.SHARD_UNIT
|
||||
}.roundToInt()
|
||||
}.roundToLong()
|
||||
|
||||
// Convert to ticks
|
||||
return SpellAction.Result(
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.world.entity.item.ItemEntity
|
|||
import net.minecraft.world.item.ItemStack
|
||||
|
||||
// TODO: How to handle in circles
|
||||
class OpMakePackagedSpell<T : ItemPackagedHex>(val itemType: T, val cost: Int) : SpellAction {
|
||||
class OpMakePackagedSpell<T : ItemPackagedHex>(val itemType: T, val cost: Long) : SpellAction {
|
||||
override val argc = 2
|
||||
override fun execute(
|
||||
args: List<Iota>,
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.world.entity.LivingEntity
|
|||
|
||||
class OpPotionEffect(
|
||||
val effect: MobEffect,
|
||||
val baseCost: Int,
|
||||
val baseCost: Long,
|
||||
val allowPotency: Boolean,
|
||||
val potencyCubic: Boolean,
|
||||
) : SpellAction {
|
||||
|
@ -36,7 +36,7 @@ class OpPotionEffect(
|
|||
}
|
||||
return SpellAction.Result(
|
||||
Spell(effect, target, duration, potency),
|
||||
cost.toInt(),
|
||||
cost.toLong(),
|
||||
listOf(ParticleSpray.cloud(target.position().add(0.0, target.eyeHeight / 2.0, 0.0), 1.0))
|
||||
)
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ object OpTheOnlyReasonAnyoneDownloadedPsi : SpellAction {
|
|||
|
||||
return SpellAction.Result(
|
||||
Spell(target),
|
||||
(MediaConstants.DUST_UNIT * 1.125).toInt(),
|
||||
(MediaConstants.DUST_UNIT * 1.125).toLong(),
|
||||
listOf(ParticleSpray.burst(Vec3.atCenterOf(BlockPos(target)), 1.0))
|
||||
)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public record BrainsweepRecipe(
|
|||
ResourceLocation id,
|
||||
StateIngredient blockIn,
|
||||
BrainsweepeeIngredient entityIn,
|
||||
int mediaCost,
|
||||
long mediaCost,
|
||||
BlockState result
|
||||
) implements Recipe<Container> {
|
||||
public boolean matches(BlockState blockIn, Entity victim, ServerLevel level) {
|
||||
|
@ -97,7 +97,7 @@ public record BrainsweepRecipe(
|
|||
public void toNetwork(FriendlyByteBuf buf, BrainsweepRecipe recipe) {
|
||||
recipe.blockIn.write(buf);
|
||||
recipe.entityIn.wrapWrite(buf);
|
||||
buf.writeVarInt(recipe.mediaCost);
|
||||
buf.writeVarLong(recipe.mediaCost);
|
||||
buf.writeVarInt(Block.getId(recipe.result));
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public record BrainsweepRecipe(
|
|||
public @NotNull BrainsweepRecipe fromNetwork(ResourceLocation recipeID, FriendlyByteBuf buf) {
|
||||
var blockIn = StateIngredientHelper.read(buf);
|
||||
var brainsweepeeIn = BrainsweepeeIngredient.read(buf);
|
||||
var cost = buf.readVarInt();
|
||||
var cost = buf.readVarLong();
|
||||
var result = Block.stateById(buf.readVarInt());
|
||||
return new BrainsweepRecipe(recipeID, blockIn, brainsweepeeIn, cost, result);
|
||||
}
|
||||
|
|
|
@ -58,13 +58,13 @@ public class HexAdvancements extends PaucalAdvancementSubProvider {
|
|||
.parent(root)
|
||||
.addCriterion("waste_amt", new SpendMediaTrigger.Instance(ContextAwarePredicate.ANY,
|
||||
MinMaxBounds.Ints.ANY,
|
||||
MinMaxBounds.Ints.atLeast(89 * MediaConstants.DUST_UNIT / 10)))
|
||||
MinMaxBounds.Ints.atLeast((int) (89 * MediaConstants.DUST_UNIT / 10))))
|
||||
.save(consumer, prefix("aaa_wasteful_cast"));
|
||||
Advancement.Builder.advancement()
|
||||
.display(simpleDisplay(HexItems.CHARGED_AMETHYST, "big_cast", FrameType.TASK))
|
||||
.parent(root)
|
||||
.addCriterion("cast_amt", new SpendMediaTrigger.Instance(ContextAwarePredicate.ANY,
|
||||
MinMaxBounds.Ints.atLeast(64 * MediaConstants.CRYSTAL_UNIT),
|
||||
MinMaxBounds.Ints.atLeast((int) (64 * MediaConstants.CRYSTAL_UNIT)),
|
||||
MinMaxBounds.Ints.ANY))
|
||||
.save(consumer, prefix("aab_big_cast"));
|
||||
|
||||
|
|
|
@ -236,19 +236,19 @@ public class HexplatRecipes extends PaucalRecipeProvider {
|
|||
.unlockedBy("has_item", hasItem(Items.AMETHYST_SHARD)).save(recipes);
|
||||
|
||||
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, HexItems.AMETHYST_DUST,
|
||||
(MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.DUST_UNIT) + 1)
|
||||
(int) (MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.DUST_UNIT) + 1)
|
||||
.requires(HexItems.QUENCHED_SHARD)
|
||||
.requires(HexItems.AMETHYST_DUST)
|
||||
.unlockedBy("has_item", hasItem(HexItems.QUENCHED_SHARD))
|
||||
.save(recipes, modLoc("decompose_quenched_shard/dust"));
|
||||
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.AMETHYST_SHARD,
|
||||
(MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.SHARD_UNIT) + 1)
|
||||
(int) (MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.SHARD_UNIT) + 1)
|
||||
.requires(HexItems.QUENCHED_SHARD)
|
||||
.requires(Items.AMETHYST_SHARD)
|
||||
.unlockedBy("has_item", hasItem(HexItems.QUENCHED_SHARD))
|
||||
.save(recipes, modLoc("decompose_quenched_shard/shard"));
|
||||
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, HexItems.CHARGED_AMETHYST,
|
||||
(MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.CRYSTAL_UNIT) + 1)
|
||||
(int) (MediaConstants.QUENCHED_SHARD_UNIT / MediaConstants.CRYSTAL_UNIT) + 1)
|
||||
.requires(HexItems.QUENCHED_SHARD)
|
||||
.requires(HexItems.CHARGED_AMETHYST)
|
||||
.unlockedBy("has_item", hasItem(HexItems.QUENCHED_SHARD))
|
||||
|
|
|
@ -23,13 +23,13 @@ import java.util.function.Consumer;
|
|||
public class BrainsweepRecipeBuilder implements RecipeBuilder {
|
||||
private final StateIngredient blockIn;
|
||||
private final BrainsweepeeIngredient entityIn;
|
||||
private final int mediaCost;
|
||||
private final long mediaCost;
|
||||
private final BlockState result;
|
||||
|
||||
private final Advancement.Builder advancement;
|
||||
|
||||
public BrainsweepRecipeBuilder(StateIngredient blockIn, BrainsweepeeIngredient entityIn, BlockState result,
|
||||
int mediaCost) {
|
||||
long mediaCost) {
|
||||
this.blockIn = blockIn;
|
||||
this.entityIn = entityIn;
|
||||
this.result = result;
|
||||
|
@ -71,7 +71,7 @@ public class BrainsweepRecipeBuilder implements RecipeBuilder {
|
|||
}
|
||||
|
||||
public record Result(ResourceLocation id, StateIngredient blockIn, BrainsweepeeIngredient villagerIn,
|
||||
int mediaCost, BlockState result, Advancement.Builder advancement,
|
||||
long mediaCost, BlockState result, Advancement.Builder advancement,
|
||||
ResourceLocation advancementId) implements FinishedRecipe {
|
||||
@Override
|
||||
public void serializeRecipeData(JsonObject json) {
|
||||
|
|
|
@ -13,7 +13,7 @@ import net.minecraft.world.item.Items;
|
|||
import java.util.List;
|
||||
|
||||
public class PhialRecipeStackBuilder {
|
||||
private static ItemStack makeBattery(int unit, int size) {
|
||||
private static ItemStack makeBattery(long unit, int size) {
|
||||
return ItemMediaBattery.withMedia(new ItemStack(HexItems.BATTERY), unit * size, unit * size);
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,11 @@ public class PhialRecipeStackBuilder {
|
|||
List<ItemStack> inputItems = Lists.newArrayList();
|
||||
List<ItemStack> outputItems = Lists.newArrayList();
|
||||
|
||||
int dust = HexConfig.common().dustMediaAmount();
|
||||
int shard = HexConfig.common().shardMediaAmount();
|
||||
int charged = HexConfig.common().chargedCrystalMediaAmount();
|
||||
int quenchedShard = MediaConstants.QUENCHED_SHARD_UNIT;
|
||||
int quenchedBlock = MediaConstants.QUENCHED_BLOCK_UNIT;
|
||||
long dust = HexConfig.common().dustMediaAmount();
|
||||
long shard = HexConfig.common().shardMediaAmount();
|
||||
long charged = HexConfig.common().chargedCrystalMediaAmount();
|
||||
long quenchedShard = MediaConstants.QUENCHED_SHARD_UNIT;
|
||||
long quenchedBlock = MediaConstants.QUENCHED_BLOCK_UNIT;
|
||||
|
||||
|
||||
if (dust > 0) {
|
||||
|
|
|
@ -62,11 +62,11 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData {
|
|||
@Config(name = "common")
|
||||
public static final class Common implements HexConfig.CommonConfigAccess, ConfigData {
|
||||
@ConfigEntry.Gui.Tooltip
|
||||
private int dustMediaAmount = DEFAULT_DUST_MEDIA_AMOUNT;
|
||||
private long dustMediaAmount = DEFAULT_DUST_MEDIA_AMOUNT;
|
||||
@ConfigEntry.Gui.Tooltip
|
||||
private int shardMediaAmount = DEFAULT_SHARD_MEDIA_AMOUNT;
|
||||
private long shardMediaAmount = DEFAULT_SHARD_MEDIA_AMOUNT;
|
||||
@ConfigEntry.Gui.Tooltip
|
||||
private int chargedCrystalMediaAmount = DEFAULT_CHARGED_MEDIA_AMOUNT;
|
||||
private long chargedCrystalMediaAmount = DEFAULT_CHARGED_MEDIA_AMOUNT;
|
||||
@ConfigEntry.Gui.Tooltip
|
||||
private double mediaToHealthRate = DEFAULT_MEDIA_TO_HEALTH_RATE;
|
||||
|
||||
|
@ -87,17 +87,17 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int dustMediaAmount() {
|
||||
public long dustMediaAmount() {
|
||||
return dustMediaAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int shardMediaAmount() {
|
||||
public long shardMediaAmount() {
|
||||
return shardMediaAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int chargedCrystalMediaAmount() {
|
||||
public long chargedCrystalMediaAmount() {
|
||||
return chargedCrystalMediaAmount;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,10 @@ public abstract class CCMediaHolder extends ItemComponent implements ADMediaHold
|
|||
}
|
||||
|
||||
public static class Static extends CCMediaHolder {
|
||||
private final Supplier<Integer> baseWorth;
|
||||
private final Supplier<Long> baseWorth;
|
||||
private final int consumptionPriority;
|
||||
|
||||
public Static(Supplier<Integer> baseWorth, int consumptionPriority, ItemStack stack) {
|
||||
public Static(Supplier<Long> baseWorth, int consumptionPriority, ItemStack stack) {
|
||||
super(stack);
|
||||
this.baseWorth = baseWorth;
|
||||
this.consumptionPriority = consumptionPriority;
|
||||
|
@ -82,7 +82,7 @@ public abstract class CCMediaHolder extends ItemComponent implements ADMediaHold
|
|||
|
||||
@Override
|
||||
public long getMedia() {
|
||||
return (long) baseWorth.get() * stack.getCount();
|
||||
return baseWorth.get() * stack.getCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,9 +11,9 @@ import java.util.List;
|
|||
import static at.petrak.hexcasting.api.mod.HexConfig.noneMatch;
|
||||
|
||||
public class ForgeHexConfig implements HexConfig.CommonConfigAccess {
|
||||
private static ForgeConfigSpec.IntValue dustMediaAmount;
|
||||
private static ForgeConfigSpec.IntValue shardMediaAmount;
|
||||
private static ForgeConfigSpec.IntValue chargedCrystalMediaAmount;
|
||||
private static ForgeConfigSpec.LongValue dustMediaAmount;
|
||||
private static ForgeConfigSpec.LongValue shardMediaAmount;
|
||||
private static ForgeConfigSpec.LongValue chargedCrystalMediaAmount;
|
||||
private static ForgeConfigSpec.DoubleValue mediaToHealthRate;
|
||||
|
||||
private static ForgeConfigSpec.IntValue cypherCooldown;
|
||||
|
@ -43,17 +43,17 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int dustMediaAmount() {
|
||||
public long dustMediaAmount() {
|
||||
return dustMediaAmount.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int shardMediaAmount() {
|
||||
public long shardMediaAmount() {
|
||||
return shardMediaAmount.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int chargedCrystalMediaAmount() {
|
||||
public long chargedCrystalMediaAmount() {
|
||||
return chargedCrystalMediaAmount.get();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@ import java.util.function.Supplier;
|
|||
/**
|
||||
* Things that always hold a constant amount of media, like amethyst
|
||||
*/
|
||||
public record CapStaticMediaHolder(Supplier<Integer> baseWorth,
|
||||
public record CapStaticMediaHolder(Supplier<Long> baseWorth,
|
||||
int consumptionPriority,
|
||||
ItemStack stack) implements ADMediaHolder {
|
||||
@Override
|
||||
public long getMedia() {
|
||||
return (long) baseWorth.get() * stack.getCount();
|
||||
return baseWorth.get() * stack.getCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue