Skip to content

Commit

Permalink
Changed fluid prop-getters to be stack-aware
Browse files Browse the repository at this point in the history
  • Loading branch information
krossgg committed Sep 22, 2024
1 parent a0dde41 commit 1b45d3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public void drawInForeground(@Nonnull GuiGraphics graphics, int mouseX, int mous
.append(" " + "mB"));
}
tooltips.add(Component.translatable("ldlib.fluid.temperature",
lastFluidInTank.getFluid().getFluidType().getTemperature()));
lastFluidInTank.getFluid().getFluidType().getTemperature(lastFluidInTank)));
tooltips.add(Component.translatable(lastFluidInTank.getFluid().getFluidType().isLighterThanAir() ?
"ldlib.fluid.state_gas" : "ldlib.fluid.state_liquid"));
} else {
Expand Down Expand Up @@ -591,7 +591,8 @@ private int tryClickContainer(boolean isShiftKeyDown) {
}
}
if (performedFill) {
SoundEvent soundevent = initialFluid.getFluid().getFluidType().getSound(SoundActions.BUCKET_FILL);
SoundEvent soundevent = initialFluid.getFluid().getFluidType().getSound(initialFluid,
SoundActions.BUCKET_FILL);
if (soundevent != null) {
player.level().playSound(null, player.position().x, player.position().y + 0.5, player.position().z,
soundevent, SoundSource.BLOCKS, 1.0F, 1.0F);
Expand All @@ -618,7 +619,8 @@ private int tryClickContainer(boolean isShiftKeyDown) {
}
var filledFluid = fluidTank.getFluidInTank(tank);
if (performedEmptying) {
SoundEvent soundevent = filledFluid.getFluid().getFluidType().getSound(SoundActions.BUCKET_EMPTY);
SoundEvent soundevent = filledFluid.getFluid().getFluidType().getSound(filledFluid,
SoundActions.BUCKET_EMPTY);
if (soundevent != null) {
player.level().playSound(null, player.position().x, player.position().y + 0.5, player.position().z,
soundevent, SoundSource.BLOCKS, 1.0F, 1.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void checkAndDestroy(@NotNull FluidStack stack) {
boolean burning = prop.getMaxFluidTemperature() < fluid.getFluidType().getTemperature(stack);
boolean leaking = !prop.isGasProof() && fluid.getFluidType().getDensity(stack) < 0;
boolean shattering = !prop.isCryoProof() &&
fluid.getFluidType().getTemperature() < FluidConstants.CRYOGENIC_FLUID_THRESHOLD;
fluid.getFluidType().getTemperature(stack) < FluidConstants.CRYOGENIC_FLUID_THRESHOLD;
boolean corroding = false;
boolean melting = false;

Expand Down

0 comments on commit 1b45d3e

Please sign in to comment.