mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 12:33:57 +01:00
Update to Flywheel 0.6.1
- Make SchematicWorld use plains instead of forest biome
This commit is contained in:
parent
2a4cfef7a8
commit
d71b10cf72
@ -19,7 +19,7 @@ parchment_version = 2022.01.23
|
||||
|
||||
# dependency versions
|
||||
registrate_version = MC1.18-1.0.21
|
||||
flywheel_version = 1.18-0.6.0.50
|
||||
flywheel_version = 1.18-0.6.1.56
|
||||
jei_minecraft_version = 1.18.1
|
||||
jei_version = 9.2.1.69
|
||||
|
||||
|
@ -7,6 +7,7 @@ import javax.annotation.Nullable;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.jozufozu.flywheel.api.instance.DynamicInstance;
|
||||
import com.jozufozu.flywheel.backend.instancing.TaskEngine;
|
||||
import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstanceManager;
|
||||
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
|
||||
@ -15,52 +16,51 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Mov
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
|
||||
|
||||
public class ContraptionInstanceManager extends BlockEntityInstanceManager {
|
||||
|
||||
protected ArrayList<ActorInstance> actors = new ArrayList<>();
|
||||
protected ArrayList<ActorInstance> actors = new ArrayList<>();
|
||||
|
||||
private final VirtualRenderWorld renderWorld;
|
||||
private final VirtualRenderWorld renderWorld;
|
||||
|
||||
ContraptionInstanceManager(MaterialManager materialManager, VirtualRenderWorld contraption) {
|
||||
ContraptionInstanceManager(MaterialManager materialManager, VirtualRenderWorld contraption) {
|
||||
super(materialManager);
|
||||
this.renderWorld = contraption;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
actors.forEach(ActorInstance::tick);
|
||||
}
|
||||
public void tick() {
|
||||
actors.forEach(ActorInstance::tick);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void beginFrame(TaskEngine taskEngine, Camera info) {
|
||||
super.beginFrame(taskEngine, info);
|
||||
|
||||
actors.forEach(ActorInstance::beginFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldFrameUpdate(BlockPos worldPos, float lookX, float lookY, float lookZ, int cX, int cY, int cZ) {
|
||||
return true;
|
||||
@Override
|
||||
protected void updateInstance(DynamicInstance dyn, float lookX, float lookY, float lookZ, int cX, int cY, int cZ) {
|
||||
dyn.beginFrame();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ActorInstance createActor(Pair<StructureBlockInfo, MovementContext> actor) {
|
||||
StructureBlockInfo blockInfo = actor.getLeft();
|
||||
MovementContext context = actor.getRight();
|
||||
@Nullable
|
||||
public ActorInstance createActor(Pair<StructureBlockInfo, MovementContext> actor) {
|
||||
StructureBlockInfo blockInfo = actor.getLeft();
|
||||
MovementContext context = actor.getRight();
|
||||
|
||||
MovementBehaviour movementBehaviour = AllMovementBehaviours.of(blockInfo.state);
|
||||
MovementBehaviour movementBehaviour = AllMovementBehaviours.of(blockInfo.state);
|
||||
|
||||
if (movementBehaviour != null && movementBehaviour.hasSpecialInstancedRendering()) {
|
||||
ActorInstance instance = movementBehaviour.createInstance(materialManager, renderWorld, context);
|
||||
if (movementBehaviour != null && movementBehaviour.hasSpecialInstancedRendering()) {
|
||||
ActorInstance instance = movementBehaviour.createInstance(materialManager, renderWorld, context);
|
||||
|
||||
actors.add(instance);
|
||||
actors.add(instance);
|
||||
|
||||
return instance;
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class SchematicWorld extends WrappedWorld implements ServerLevelAccessor
|
||||
|
||||
@Override
|
||||
public Biome getBiome(BlockPos pos) {
|
||||
return ForgeRegistries.BIOMES.getValue(Biomes.FOREST.location());
|
||||
return ForgeRegistries.BIOMES.getValue(Biomes.PLAINS.location());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user