Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
shadowImplementation("org.eclipse.elk:org.eclipse.elk.alg.layered:0.11.0")
shadowImplementation("org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.36.0")

devOnlyNonPublishable("com.github.GTNewHorizons:StructureLib:1.4.42:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:StructureLib:1.4.44:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.36:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.8.128-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-1045-GTNH:dev")
Expand Down Expand Up @@ -61,7 +61,7 @@ dependencies {
annotationProcessor("com.google.auto.value:auto-value:1.10.4")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.12.2")
testImplementation("com.github.GTNewHorizons:StructureLib:1.4.42:dev")
testImplementation("com.github.GTNewHorizons:StructureLib:1.4.44:dev")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.12.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.12.2")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.hfstudio.guidenh.integration.structurelib;

import net.minecraftforge.fluids.FluidStack;

import javax.annotation.Nonnull;

import com.gtnewhorizon.structurelib.fluid.IFluidSource;

/**
* A fluid source that always holds as much of the requested fluid as asked for.
* <p>
* Guide book scenes are built with a creative item source, and this is its fluid counterpart: it lets a scene fill the
* positions a multiblock wants a fluid at, e.g. the water an ore washing plant needs, without anybody having to carry
* that fluid.
*/
public class CreativeFluidSource implements IFluidSource {

public static final CreativeFluidSource instance = new CreativeFluidSource();

@Nonnull
@Override
public FluidStack take(FluidStack resource, boolean simulate) {
if (resource == null || resource.getFluid() == null) throw new IllegalArgumentException();
return new FluidStack(resource, resource.amount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ private static void buildStructure(IConstructable constructable, ItemStack trigg
boolean useSurvival = constructable instanceof ISurvivalConstructable;
if (useSurvival) {
ISurvivalConstructable sc = (ISurvivalConstructable) constructable;
ISurvivalBuildEnvironment env = ISurvivalBuildEnvironment.create(createItemSource(), fakePlayer);
ISurvivalBuildEnvironment env = ISurvivalBuildEnvironment
.create(createItemSource(), CreativeFluidSource.instance, fakePlayer);
int rounds = 0;
while (rounds++ < SURVIVAL_MAX_ROUNDS) {
int result = sc.survivalConstruct(trigger, SURVIVAL_BUDGET, env);
Expand Down
Loading