Skip to content

Commit

Permalink
🎱 Snapshot 8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
petrolpark committed Oct 1, 2024
1 parent 3397a4f commit 3e72bf0
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false

# Destroy info
mod_version = 0.1.0-snapshot-7
mod_version = 0.1.0-snapshot-8
minecraft_version = 1.20.1
forge_version = 47.3.7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public float getTemperature() {
};

/**
* Get the pressure above room pressure of the gas in this Vat.
* Get the pressure above room pressure of the gas in this Vat (in Pa).
*/
@SuppressWarnings("null")
public float getPressure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,16 @@ public VatFluidHandler(IFluidHandler[] handlers) {

@Override
public int fill(FluidStack resource, FluidAction action) {
if (liquidFull) return 0;
if (!DestroyFluids.isMixture(resource)) return 0;

boolean simulate = action == FluidAction.SIMULATE;

Phases phases = LegacyMixture.readNBT(resource.getOrCreateChildTag("Mixture")).separatePhases(resource.getAmount());
double amountScale = 1f;
double amountScale = 1d;

if (phases.liquidVolume() > getLiquidHandler().getSpace()) {
if (phases.liquidVolume() > getLiquidHandler().getSpace() - 1) {
if (!simulate) liquidFull = true;
amountScale = (phases.liquidVolume() - getLiquidHandler().getSpace()) / phases.liquidVolume();
amountScale = ((double)getLiquidHandler().getSpace() - 1d) / (double)phases.liquidVolume();
};

// Add liquid - as this is a child of Genius Fluid Tank the mixing-in of the Mixture to the existing Mixture Fluid is already handled
Expand All @@ -195,7 +194,7 @@ public int fill(FluidStack resource, FluidAction action) {

Map<LegacyMixture, Double> mixtures = new HashMap<>(2);
double combinedVolume = 0d;
int freeSpace = vatCapacity - getLiquidHandler().getFluidAmount();
int freeSpace = vatCapacity - getLiquidHandler().getFluidAmount() + 1;

if (!getGasHandler().isEmpty()) {
FluidStack existingGas = getGasHandler().getFluid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ public static final void vatFluids(SceneBuilder scene, SceneBuildingUtil util) {
.pointAt(util.vector.topOf(pump1));
scene.world.propagatePipeChange(pump1);
scene.idle(120);

scene.overlay.showText(100)
.text("This text is defined in a language file.")
.colored(PonderPalette.RED)
.pointAt(util.vector.topOf(5, 4, 5));
scene.idle(120);

scene.world.showSection(invalidPipe, Direction.DOWN);
scene.idle(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import com.petrolpark.destroy.Destroy;
import com.petrolpark.destroy.chemistry.legacy.LegacyMixture;
import com.petrolpark.destroy.chemistry.legacy.LegacySpecies;
import com.petrolpark.destroy.chemistry.legacy.ReadOnlyMixture;
import com.petrolpark.destroy.chemistry.legacy.index.DestroyMolecules;
import com.petrolpark.destroy.config.DestroyAllConfigs;
import com.petrolpark.destroy.fluid.DestroyFluids;
import com.petrolpark.destroy.fluid.MixtureFluid;
import com.petrolpark.destroy.item.DestroyItems;
import com.petrolpark.destroy.item.MoleculeDisplayItem;
Expand Down Expand Up @@ -89,7 +91,14 @@ public String getErrorInfo(@Nullable LegacySpecies ingredient) {
@Override
public ItemStack getCheatItemStack(LegacySpecies ingredient) {
if (ingredient.isHypothetical() || ingredient == DestroyMolecules.PROTON) return illegalFish;
return DestroyItems.TEST_TUBE.get().of(MixtureFluid.of(TestTubeItem.CAPACITY, LegacyMixture.pure(ingredient), ""));
ReadOnlyMixture mixture;
if (ingredient.getBoilingPoint() > 273f) { // Liquids at RTP
mixture = LegacyMixture.pure(ingredient);
} else { // Gases at RTP
mixture = new ReadOnlyMixture();
mixture.addMolecule(ingredient, (float)DestroyFluids.AIR_MOLAR_DENSITY);
};
return DestroyItems.TEST_TUBE.get().of(MixtureFluid.of(TestTubeItem.CAPACITY, mixture, ""));
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ else if (recipeCategory instanceof ReactionCategory) {

// Add Reaction Recipes
else if (recipeCategory instanceof ReactionCategory) molecule.getProductReactions().forEach(reaction -> {
Optional.ofNullable((T)(ReactionCategory.RECIPES.get(reaction))).ifPresent(recipes::add);
Optional.ofNullable((T)(ReactionCategory.RECIPES.get(reaction.getReactionDisplayedInJEI()))).ifPresent(recipes::add);
}); // This is an unchecked conversion but I think it's fine

// Add non-Reaction Recipes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ public static void registerIngredientTypes(RegisterEvent event) {
if (event.getRegistryKey().equals(ForgeRegistries.Keys.RECIPE_SERIALIZERS)) {
// Ingredient types
CraftingHelper.register(Destroy.asResource("circuit_pattern_item"), CircuitPatternIngredient.SERIALIZER);
CraftingHelper.register(Destroy.asResource("example_circuit_mask"), CircuitDeployerApplicationRecipe.ExampleMaskIngredient.SERIALIZER); // Should never actually appear in a JSON recipe
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class DestroyFluids {

public static final double AIR_MOLAR_DENSITY = 42.0352380152d;
public static final double AIR_MOLAR_DENSITY = 0.0420352380152d; // In moles/liter
public static FluidStack air(int amount, float temperature) {
return MixtureFluid.of(amount, MixtureFluid.airMixture(temperature), "fluid.destroy.air");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class CircuitDeployerApplicationRecipe extends DeployerApplicationRecipe

private int recipeId = 0;

protected static class ExampleMaskIngredient extends Ingredient {
public static class ExampleMaskIngredient extends Ingredient {
public static final Serializer SERIALIZER = new Serializer();
private final Ingredient parent;

Expand Down
15 changes: 8 additions & 7 deletions src/main/resources/assets/destroy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -889,13 +889,14 @@
"destroy.ponder.vat.construction.text_10": "The edges of a Vat are not needed, and do not form part of the Vat.",
"destroy.ponder.vat.fluids.header": "Getting Fluids in and out of Vats",
"destroy.ponder.vat.fluids.text_1": "Fluids can be pumped in and out of Vats on any face.",
"destroy.ponder.vat.fluids.text_2": "Edges and corners do allow access to the Vat.",
"destroy.ponder.vat.fluids.text_3": "Only Mixtures - and some Fluids which convert to Mixtures - can go in a Vat.",
"destroy.ponder.vat.fluids.text_4": "Mixtures can only really go in Vats and Basins - not usually tanks from other mods.",
"destroy.ponder.vat.fluids.text_5": "Basins can only store liquids.",
"destroy.ponder.vat.fluids.text_6": "Vats store both a liquid phase and a gas phase.",
"destroy.ponder.vat.fluids.text_7": "The liquid level inside the Vat will determine whether a pipe pulls out liquid or gas.",
"destroy.ponder.vat.fluids.text_8": "Mixtures cannot be filtered with Smart Pipes (or any Filter).",
"destroy.ponder.vat.fluids.text_2": "As gases cannot be infinitely compressed, the Vat can never be completely filled with liquid.",
"destroy.ponder.vat.fluids.text_3": "Edges and corners do allow access to the Vat.",
"destroy.ponder.vat.fluids.text_4": "Only Mixtures - and some Fluids which convert to Mixtures - can go in a Vat.",
"destroy.ponder.vat.fluids.text_5": "Mixtures can only really go in Vats and Basins - not usually tanks from other mods.",
"destroy.ponder.vat.fluids.text_6": "Basins can only store liquids.",
"destroy.ponder.vat.fluids.text_7": "Vats store both a liquid phase and a gas phase.",
"destroy.ponder.vat.fluids.text_8": "The liquid level inside the Vat will determine whether a pipe pulls out liquid or gas.",
"destroy.ponder.vat.fluids.text_9": "Mixtures cannot be filtered with Smart Pipes (or any Filter).",
"destroy.ponder.vat.items.header": "Getting Items in and out of Vats",
"destroy.ponder.vat.items.text_1": "Items can be pulled in and out of Vats with Funnels on any face.",
"destroy.ponder.vat.items.text_2": "Again, the edges and corners do not count.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"Concentration": 0.16969298
},
{
"Molecule": "destroy:tetrahydroxy_borate",
"Molecule": "destroy:tetrahydroxyborate",
"Concentration": 0.1201766
},
{
Expand Down

0 comments on commit 3e72bf0

Please sign in to comment.