Merge branch 'mc1.18/dev' into mc1.18/global-railways
This commit is contained in:
commit
87bdd8d586
7 changed files with 33 additions and 32 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.actors;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.backend.Backend;
|
||||
import com.jozufozu.flywheel.core.PartialModel;
|
||||
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
@ -34,6 +35,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer<Por
|
|||
@Override
|
||||
protected void renderSafe(PortableStorageInterfaceTileEntity te, float partialTicks, PoseStack ms,
|
||||
MultiBufferSource buffer, int light, int overlay) {
|
||||
if (Backend.isOn()) return;
|
||||
|
||||
BlockState blockState = te.getBlockState();
|
||||
float progress = te.getExtensionDistance(partialTicks);
|
||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||
|
|
|
@ -19,11 +19,10 @@ public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
|
|||
|
||||
Block block = blockState
|
||||
.getBlock();
|
||||
if (!(block instanceof EngineBlock))
|
||||
if (!(block instanceof EngineBlock engineBlock))
|
||||
return;
|
||||
|
||||
EngineBlock engineBlock = (EngineBlock) block;
|
||||
PartialModel frame = engineBlock.getFrameModel();
|
||||
PartialModel frame = engineBlock.getFrameModel();
|
||||
|
||||
Direction facing = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING);
|
||||
|
||||
|
@ -33,7 +32,7 @@ public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
|
|||
|
||||
this.frame.loadIdentity()
|
||||
.translate(getInstancePosition())
|
||||
.nudge(tile.hashCode())
|
||||
.nudge(pos.hashCode())
|
||||
.centre()
|
||||
.rotate(Direction.UP, angle)
|
||||
.unCentre()
|
||||
|
|
|
@ -66,9 +66,8 @@ public class FurnaceEngineBlock extends EngineBlock implements ITE<FurnaceEngine
|
|||
@SubscribeEvent
|
||||
public static void usingFurnaceEngineOnFurnacePreventsGUI(RightClickBlock event) {
|
||||
ItemStack item = event.getItemStack();
|
||||
if (!(item.getItem() instanceof BlockItem))
|
||||
if (!(item.getItem() instanceof BlockItem blockItem))
|
||||
return;
|
||||
BlockItem blockItem = (BlockItem) item.getItem();
|
||||
if (blockItem.getBlock() != AllBlocks.FURNACE_ENGINE.get())
|
||||
return;
|
||||
BlockState state = event.getWorld().getBlockState(event.getPos());
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -32,6 +32,6 @@ Technology that empowers the player.'''
|
|||
[[dependencies.create]]
|
||||
modId="flywheel"
|
||||
mandatory=true
|
||||
versionRange="[1.18-0.6.0,1.18-0.6.1)"
|
||||
versionRange="[1.18-0.6.1,1.18-0.6.2)"
|
||||
ordering="AFTER"
|
||||
side="CLIENT"
|
||||
|
|
Loading…
Reference in a new issue