mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-27 20:34:43 +01:00
Exit stage right
- Update to implicit render stage API. - Fix bounding sphere transformers. - Bump flywheel version. - Update flywheel mixin config jsons.
This commit is contained in:
parent
5038d04ac4
commit
633a7abc23
42 changed files with 90 additions and 157 deletions
24
build.gradle
24
build.gradle
|
@ -33,8 +33,9 @@ println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getPro
|
|||
mixin {
|
||||
add sourceSets.main, 'create.refmap.json'
|
||||
|
||||
config 'flywheel.mixins.json'
|
||||
config 'flywheel.sodium.mixins.json'
|
||||
config 'flywheel.backend.mixins.json'
|
||||
config 'flywheel.impl.mixins.json'
|
||||
config 'flywheel.impl.sodium.mixins.json'
|
||||
config 'create.mixins.json'
|
||||
|
||||
debug.verbose = true
|
||||
|
@ -160,23 +161,6 @@ repositories {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Fix for loading non-mod libraries in dev-env, used for Miniball.
|
||||
// https://gist.github.com/SizableShrimp/66b22f1b24c255e1491c8d98d3f11f83
|
||||
// v--------------------------------------------------------------------v
|
||||
configurations {
|
||||
library
|
||||
implementation.extendsFrom library
|
||||
}
|
||||
|
||||
minecraft.runs.configureEach {
|
||||
lazyToken('minecraft_classpath') {
|
||||
configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
|
||||
}
|
||||
}
|
||||
// ^--------------------------------------------------------------------^
|
||||
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
|
||||
|
@ -187,8 +171,6 @@ dependencies {
|
|||
jarJar.ranged(it, '[1.0,2.0)')
|
||||
}
|
||||
|
||||
library 'com.dreizak:miniball:1.0.3'
|
||||
|
||||
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
|
||||
|
||||
if (flywheelInWorkspace) {
|
||||
|
|
|
@ -23,7 +23,7 @@ use_parchment = true
|
|||
# dependency versions
|
||||
registrate_version = MC1.20-1.3.3
|
||||
flywheel_minecraft_version = 1.20.1
|
||||
flywheel_version = 1.0.0-alpha-32
|
||||
flywheel_version = 1.0.0-alpha-43
|
||||
jei_minecraft_version = 1.20.1
|
||||
jei_version = 15.2.0.22
|
||||
curios_minecraft_version = 1.20.1
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.actors.harvester;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
import com.jozufozu.flywheel.lib.instance.TransformedInstance;
|
||||
|
@ -38,7 +37,7 @@ public class HarvesterActorVisual extends ActorVisual {
|
|||
|
||||
facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING);
|
||||
|
||||
harvester = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(getRollingPartial()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
harvester = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(getRollingPartial()))
|
||||
.createInstance();
|
||||
|
||||
horizontalAngle = facing.toYRot() + ((facing.getAxis() == Direction.Axis.X) ? 180 : 0);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.actors.psi;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.InstancerProvider;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
|
@ -36,9 +35,9 @@ public class PIInstance {
|
|||
|
||||
public void init(boolean lit) {
|
||||
this.lit = lit;
|
||||
middle = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getMiddleForState(blockState, lit)), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
middle = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getMiddleForState(blockState, lit)))
|
||||
.createInstance();
|
||||
top = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getTopForState(blockState)), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
top = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getTopForState(blockState)))
|
||||
.createInstance();
|
||||
}
|
||||
|
||||
|
@ -65,7 +64,7 @@ public class PIInstance {
|
|||
public void tick(boolean lit) {
|
||||
if (this.lit != lit) {
|
||||
this.lit = lit;
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getMiddleForState(blockState, lit)), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(PortableStorageInterfaceRenderer.getMiddleForState(blockState, lit)))
|
||||
.stealInstance(middle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.actors.roller;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
import com.jozufozu.flywheel.lib.instance.TransformedInstance;
|
||||
|
@ -21,7 +20,7 @@ public class RollerActorVisual extends HarvesterActorVisual {
|
|||
MovementContext movementContext) {
|
||||
super(visualizationContext, simulationWorld, movementContext);
|
||||
|
||||
frame = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ROLLER_FRAME), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
frame = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ROLLER_FRAME))
|
||||
.createInstance();
|
||||
frame.setBlockLight(localBlockLight());
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.function.Consumer;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -40,7 +39,7 @@ public class BearingVisual<B extends KineticBlockEntity & IBearingBlockEntity> e
|
|||
PartialModel top =
|
||||
blockEntity.isWoodenTop() ? AllPartialModels.BEARING_TOP_WOODEN : AllPartialModels.BEARING_TOP;
|
||||
|
||||
topInstance = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(top), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
topInstance = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(top))
|
||||
.createInstance();
|
||||
|
||||
topInstance.setPosition(getVisualPosition())
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.bearing;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
import com.jozufozu.flywheel.lib.instance.OrientedInstance;
|
||||
|
@ -39,7 +38,7 @@ public class StabilizedBearingVisual extends ActorVisual {
|
|||
|
||||
blockOrientation = BearingVisual.getBlockStateOrientation(facing);
|
||||
|
||||
topInstance = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.BEARING_TOP), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
topInstance = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.BEARING_TOP))
|
||||
.createInstance();
|
||||
|
||||
int blockLight = localBlockLight();
|
||||
|
@ -47,7 +46,7 @@ public class StabilizedBearingVisual extends ActorVisual {
|
|||
.setRotation(blockOrientation)
|
||||
.setBlockLight(blockLight);
|
||||
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, blockState.getValue(BlockStateProperties.FACING).getOpposite()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, blockState.getValue(BlockStateProperties.FACING).getOpposite()))
|
||||
.createInstance();
|
||||
|
||||
// not rotating so no need to set speed, axis, etc.
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.chassis;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -30,7 +29,7 @@ public class StickerVisual extends AbstractBlockEntityVisual<StickerBlockEntity>
|
|||
public StickerVisual(VisualizationContext context, StickerBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
head = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.STICKER_HEAD), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
head = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.STICKER_HEAD)).createInstance();
|
||||
|
||||
fakeWorld = blockEntity.getLevel() != Minecraft.getInstance().level;
|
||||
facing = blockState.getValue(StickerBlock.FACING);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.gantry;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -35,7 +34,7 @@ public class GantryCarriageVisual extends ShaftVisual<GantryCarriageBlockEntity>
|
|||
public GantryCarriageVisual(VisualizationContext context, GantryCarriageBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
gantryCogs = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GANTRY_COGS), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
gantryCogs = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GANTRY_COGS))
|
||||
.createInstance();
|
||||
|
||||
facing = blockState.getValue(GantryCarriageBlock.FACING);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.pulley;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
|
@ -17,23 +16,23 @@ public class HosePulleyVisual extends AbstractPulleyVisual<HosePulleyBlockEntity
|
|||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getRopeModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getMagnetModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_MAGNET), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_MAGNET));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getHalfMagnetModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_HALF_MAGNET), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_HALF_MAGNET));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getCoilModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_COIL, rotatingAbout), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_COIL, rotatingAbout));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getHalfRopeModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_HALF), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.HOSE_HALF));
|
||||
}
|
||||
|
||||
protected float getOffset() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.simibubi.create.content.contraptions.pulley;
|
||||
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
|
@ -18,23 +17,23 @@ public class RopePulleyVisual extends AbstractPulleyVisual<PulleyBlockEntity> {
|
|||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getRopeModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, VirtualRenderHelper.blockModel(AllBlocks.ROPE.getDefaultState()), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, VirtualRenderHelper.blockModel(AllBlocks.ROPE.getDefaultState()));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getMagnetModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, VirtualRenderHelper.blockModel(AllBlocks.PULLEY_MAGNET.getDefaultState()), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, VirtualRenderHelper.blockModel(AllBlocks.PULLEY_MAGNET.getDefaultState()));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getHalfMagnetModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_HALF_MAGNET), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_HALF_MAGNET));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getCoilModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_COIL, rotatingAbout), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_COIL, rotatingAbout));
|
||||
}
|
||||
|
||||
protected Instancer<OrientedInstance> getHalfRopeModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_HALF), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.ROPE_HALF));
|
||||
}
|
||||
|
||||
protected float getOffset() {
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.equipment.toolbox;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -32,10 +31,10 @@ public class ToolBoxVisual extends AbstractBlockEntityVisual<ToolboxBlockEntity>
|
|||
|
||||
@Override
|
||||
public void init(float pt) {
|
||||
Instancer<TransformedInstance> drawerModel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.TOOLBOX_DRAWER), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<TransformedInstance> drawerModel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.TOOLBOX_DRAWER));
|
||||
|
||||
drawers = new TransformedInstance[]{drawerModel.createInstance(), drawerModel.createInstance()};
|
||||
lid = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.TOOLBOX_LIDS.get(blockEntity.getColor())), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
lid = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.TOOLBOX_LIDS.get(blockEntity.getColor())))
|
||||
.createInstance();
|
||||
|
||||
super.init(pt);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.fluids.pipes.valve;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -43,7 +42,7 @@ public class FluidValveVisual extends ShaftVisual<FluidValveBlockEntity> impleme
|
|||
pointerRotationOffset = twist ? 90 : 0;
|
||||
settled = false;
|
||||
|
||||
pointer = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.FLUID_VALVE_POINTER), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
pointer = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.FLUID_VALVE_POINTER)).createInstance();
|
||||
|
||||
transformPointer();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.base;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
|
@ -19,7 +18,7 @@ public class SingleRotatingVisual<T extends KineticBlockEntity> extends KineticB
|
|||
|
||||
@Override
|
||||
public void init(float pt) {
|
||||
rotatingModel = instancerProvider.instancer(AllInstanceTypes.ROTATING, model(), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
rotatingModel = instancerProvider.instancer(AllInstanceTypes.ROTATING, model())
|
||||
.createInstance();
|
||||
setup(rotatingModel);
|
||||
super.init(pt);
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.function.Consumer;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
|
@ -65,7 +64,7 @@ public class BeltVisual extends KineticBlockEntityVisual<BeltBlockEntity> {
|
|||
PartialModel beltPartial = BeltRenderer.getBeltPartial(diagonal, start, end, bottom);
|
||||
SpriteShiftEntry spriteShift = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom);
|
||||
|
||||
Instancer<BeltInstance> beltModel = instancerProvider.instancer(AllInstanceTypes.BELTS, Models.partial(beltPartial), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<BeltInstance> beltModel = instancerProvider.instancer(AllInstanceTypes.BELTS, Models.partial(beltPartial));
|
||||
|
||||
keys.add(setup(beltModel.createInstance(), bottom, spriteShift));
|
||||
|
||||
|
@ -138,7 +137,7 @@ public class BeltVisual extends KineticBlockEntityVisual<BeltBlockEntity> {
|
|||
msr.uncenter();
|
||||
});
|
||||
|
||||
return instancerProvider.instancer(AllInstanceTypes.ROTATING, model, RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(AllInstanceTypes.ROTATING, model);
|
||||
}
|
||||
|
||||
private Direction getOrientation() {
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.crank;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -25,7 +24,7 @@ public class HandCrankVisual extends SingleRotatingVisual<HandCrankBlockEntity>
|
|||
super(modelManager, blockEntity);
|
||||
facing = blockState.getValue(BlockStateProperties.FACING);
|
||||
Model model = blockEntity.getRenderedHandleInstance();
|
||||
crank = instancerProvider.instancer(InstanceTypes.TRANSFORMED, model, RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
crank = instancerProvider.instancer(InstanceTypes.TRANSFORMED, model)
|
||||
.createInstance();
|
||||
rotateCrank();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.simibubi.create.content.kinetics.deployer;
|
|||
import static com.simibubi.create.content.kinetics.base.DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE;
|
||||
import static com.simibubi.create.content.kinetics.base.DirectionalKineticBlock.FACING;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
import com.jozufozu.flywheel.lib.instance.TransformedInstance;
|
||||
|
@ -59,11 +58,11 @@ public class DeployerActorVisual extends ActorVisual {
|
|||
xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0;
|
||||
zRot = rotatePole ? 90 : 0;
|
||||
|
||||
pole = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.DEPLOYER_POLE), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
hand = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(handPose), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
pole = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.DEPLOYER_POLE)).createInstance();
|
||||
hand = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(handPose)).createInstance();
|
||||
|
||||
Direction.Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state);
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, VirtualRenderHelper.blockModel(KineticBlockEntityVisual.shaft(axis)), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, VirtualRenderHelper.blockModel(KineticBlockEntityVisual.shaft(axis)))
|
||||
.createInstance();
|
||||
|
||||
int blockLight = localBlockLight();
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.function.Consumer;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.TickableVisual;
|
||||
|
@ -54,11 +53,11 @@ public class DeployerVisual extends ShaftVisual<DeployerBlockEntity> implements
|
|||
xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0;
|
||||
zRot = rotatePole ? 90 : 0;
|
||||
|
||||
pole = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.DEPLOYER_POLE), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
pole = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.DEPLOYER_POLE)).createInstance();
|
||||
|
||||
currentHand = this.blockEntity.getHandPose();
|
||||
|
||||
hand = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(currentHand), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
hand = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(currentHand)).createInstance();
|
||||
|
||||
progress = getProgress(AnimationTickHolder.getPartialTicks());
|
||||
updateRotation(pole, hand, yRot, xRot, zRot);
|
||||
|
@ -71,7 +70,7 @@ public class DeployerVisual extends ShaftVisual<DeployerBlockEntity> implements
|
|||
|
||||
if (currentHand != handPose) {
|
||||
currentHand = handPose;
|
||||
instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(currentHand), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(currentHand))
|
||||
.stealInstance(hand);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.drill;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.model.Models;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
|
@ -39,7 +38,7 @@ public class DrillActorVisual extends ActorVisual {
|
|||
else
|
||||
eulerY = facing.toYRot() + ((axis == Direction.Axis.X) ? 180 : 0);
|
||||
|
||||
drillHead = instancerProvider.instancer(AllInstanceTypes.ACTORS, Models.partial(AllPartialModels.DRILL_HEAD), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
drillHead = instancerProvider.instancer(AllInstanceTypes.ACTORS, Models.partial(AllPartialModels.DRILL_HEAD))
|
||||
.createInstance();
|
||||
|
||||
drillHead.setPosition(context.localPos)
|
||||
|
|
|
@ -4,7 +4,6 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.model.Models;
|
||||
|
@ -30,8 +29,8 @@ public class FanVisual extends KineticBlockEntityVisual<EncasedFanBlockEntity> {
|
|||
direction = blockState.getValue(FACING);
|
||||
|
||||
opposite = direction.getOpposite();
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, opposite), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
fan = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.ENCASED_FAN_INNER, opposite), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
shaft = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, opposite)).createInstance();
|
||||
fan = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.ENCASED_FAN_INNER, opposite))
|
||||
.createInstance();
|
||||
|
||||
setup(shaft);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.flywheel;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -29,9 +28,9 @@ public class FlywheelVisual extends KineticBlockEntityVisual<FlywheelBlockEntity
|
|||
public FlywheelVisual(VisualizationContext context, FlywheelBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
shaft = setup(instancerProvider.instancer(AllInstanceTypes.ROTATING, VirtualRenderHelper.blockModel(shaft()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
shaft = setup(instancerProvider.instancer(AllInstanceTypes.ROTATING, VirtualRenderHelper.blockModel(shaft()))
|
||||
.createInstance());
|
||||
wheel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(blockState), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
wheel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(blockState))
|
||||
.createInstance();
|
||||
|
||||
animate(blockEntity.angle);
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.simibubi.create.content.kinetics.gauge;
|
|||
import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -36,7 +35,7 @@ public abstract class GaugeVisual extends ShaftVisual<GaugeBlockEntity> implemen
|
|||
|
||||
GaugeBlock gaugeBlock = (GaugeBlock) blockState.getBlock();
|
||||
|
||||
Instancer<TransformedInstance> dialModel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_DIAL), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<TransformedInstance> dialModel = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_DIAL));
|
||||
Instancer<TransformedInstance> headModel = getHeadModel();
|
||||
|
||||
ms = new PoseStack();
|
||||
|
@ -160,7 +159,7 @@ public abstract class GaugeVisual extends ShaftVisual<GaugeBlockEntity> implemen
|
|||
|
||||
@Override
|
||||
protected Instancer<TransformedInstance> getHeadModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_HEAD_SPEED), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_HEAD_SPEED));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +170,7 @@ public abstract class GaugeVisual extends ShaftVisual<GaugeBlockEntity> implemen
|
|||
|
||||
@Override
|
||||
protected Instancer<TransformedInstance> getHeadModel() {
|
||||
return instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_HEAD_STRESS), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
return instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GAUGE_HEAD_STRESS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.EnumMap;
|
|||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.AbstractInstance;
|
||||
|
@ -41,7 +40,7 @@ public class GearboxVisual extends KineticBlockEntityVisual<GearboxBlockEntity>
|
|||
if (boxAxis == axis)
|
||||
continue;
|
||||
|
||||
RotatingInstance key = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
RotatingInstance key = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF))
|
||||
.createInstance();
|
||||
|
||||
key.setRotationAxis(axis)
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -49,18 +48,18 @@ public class ArmVisual extends SingleRotatingVisual<ArmBlockEntity> implements D
|
|||
public ArmVisual(VisualizationContext context, ArmBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
base = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_BASE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
base = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_BASE))
|
||||
.createInstance();
|
||||
lowerBody = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_LOWER_BODY), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
lowerBody = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_LOWER_BODY))
|
||||
.createInstance();
|
||||
upperBody = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_UPPER_BODY), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
upperBody = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_UPPER_BODY))
|
||||
.createInstance();
|
||||
claw = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(blockEntity.goggles ? AllPartialModels.ARM_CLAW_BASE_GOGGLES : AllPartialModels.ARM_CLAW_BASE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
claw = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(blockEntity.goggles ? AllPartialModels.ARM_CLAW_BASE_GOGGLES : AllPartialModels.ARM_CLAW_BASE))
|
||||
.createInstance();
|
||||
|
||||
TransformedInstance clawGrip1 = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_CLAW_GRIP_UPPER), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
TransformedInstance clawGrip1 = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_CLAW_GRIP_UPPER))
|
||||
.createInstance();
|
||||
TransformedInstance clawGrip2 = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_CLAW_GRIP_LOWER), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
TransformedInstance clawGrip2 = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ARM_CLAW_GRIP_LOWER))
|
||||
.createInstance();
|
||||
|
||||
clawGrips = Lists.newArrayList(clawGrip1, clawGrip2);
|
||||
|
@ -181,7 +180,7 @@ public class ArmVisual extends SingleRotatingVisual<ArmBlockEntity> implements D
|
|||
super.update(pt);
|
||||
models.remove(claw);
|
||||
claw.delete();
|
||||
claw = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(blockEntity.goggles ? AllPartialModels.ARM_CLAW_BASE_GOGGLES : AllPartialModels.ARM_CLAW_BASE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
claw = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(blockEntity.goggles ? AllPartialModels.ARM_CLAW_BASE_GOGGLES : AllPartialModels.ARM_CLAW_BASE))
|
||||
.createInstance();
|
||||
models.add(claw);
|
||||
updateLight();
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.mixer;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -29,12 +28,12 @@ public class MixerVisual extends EncasedCogVisual implements DynamicVisual {
|
|||
super(context, blockEntity, false);
|
||||
this.mixer = blockEntity;
|
||||
|
||||
mixerHead = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.MECHANICAL_MIXER_HEAD), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
mixerHead = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.MECHANICAL_MIXER_HEAD))
|
||||
.createInstance();
|
||||
|
||||
mixerHead.setRotationAxis(Direction.Axis.Y);
|
||||
|
||||
mixerPole = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.MECHANICAL_MIXER_POLE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
mixerPole = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.MECHANICAL_MIXER_POLE))
|
||||
.createInstance();
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.function.Consumer;
|
|||
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -25,7 +24,7 @@ public class PressVisual extends ShaftVisual<MechanicalPressBlockEntity> impleme
|
|||
public PressVisual(VisualizationContext context, MechanicalPressBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
pressHead = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.MECHANICAL_PRESS_HEAD), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
pressHead = instancerProvider.instancer(InstanceTypes.ORIENTED, Models.partial(AllPartialModels.MECHANICAL_PRESS_HEAD))
|
||||
.createInstance();
|
||||
|
||||
Quaternionf q = Axis.YP
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.simpleRelays;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
|
@ -40,7 +39,7 @@ public class BracketedKineticBlockEntityVisual extends SingleRotatingVisual<Brac
|
|||
BlockPos pos = blockEntity.getBlockPos();
|
||||
float offset = BracketedKineticBlockEntityRenderer.getShaftAngleOffset(axis, pos);
|
||||
var model = Models.partial(AllPartialModels.COGWHEEL_SHAFT, axis, BracketedKineticBlockEntityVisual::rotateToAxis);
|
||||
Instancer<RotatingInstance> half = instancerProvider.instancer(AllInstanceTypes.ROTATING, model, RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<RotatingInstance> half = instancerProvider.instancer(AllInstanceTypes.ROTATING, model);
|
||||
|
||||
additionalShaft = setup(half.createInstance(), speed);
|
||||
additionalShaft.setRotationOffset(offset)
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.simibubi.create.content.kinetics.simpleRelays.encased;
|
|||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.model.Model;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
|
@ -51,7 +50,7 @@ public class EncasedCogVisual extends KineticBlockEntityVisual<KineticBlockEntit
|
|||
|
||||
@Override
|
||||
public void init(float pt) {
|
||||
var instancer = instancerProvider.instancer(AllInstanceTypes.ROTATING, getCogModel(), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
var instancer = instancerProvider.instancer(AllInstanceTypes.ROTATING, getCogModel());
|
||||
rotatingModel = setup(instancer.createInstance());
|
||||
|
||||
Block block = blockState.getBlock();
|
||||
|
@ -64,7 +63,7 @@ public class EncasedCogVisual extends KineticBlockEntityVisual<KineticBlockEntit
|
|||
for (Direction d : Iterate.directionsInAxis(axis)) {
|
||||
if (!def.hasShaftTowards(blockEntity.getLevel(), blockEntity.getBlockPos(), blockState, d))
|
||||
continue;
|
||||
RotatingInstance data = setup(instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, d), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
RotatingInstance data = setup(instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, d))
|
||||
.createInstance());
|
||||
if (large)
|
||||
data.setRotationOffset(BracketedKineticBlockEntityRenderer.getShaftAngleOffset(axis, pos));
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.kinetics.steamEngine;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -28,11 +27,11 @@ public class SteamEngineVisual extends AbstractBlockEntityVisual<SteamEngineBloc
|
|||
public SteamEngineVisual(VisualizationContext context, SteamEngineBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
piston = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_PISTON), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
piston = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_PISTON))
|
||||
.createInstance();
|
||||
linkage = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_LINKAGE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
linkage = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_LINKAGE))
|
||||
.createInstance();
|
||||
connector = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_CONNECTOR), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
connector = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ENGINE_CONNECTOR))
|
||||
.createInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.simibubi.create.content.kinetics.transmission;
|
|||
import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.AbstractInstance;
|
||||
|
@ -33,7 +32,7 @@ public class SplitShaftVisual extends KineticBlockEntityVisual<SplitShaftBlockEn
|
|||
|
||||
float splitSpeed = speed * blockEntity.getRotationSpeedModifier(dir);
|
||||
|
||||
var instance = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, dir), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
var instance = instancerProvider.instancer(AllInstanceTypes.ROTATING, Models.partial(AllPartialModels.SHAFT_HALF, dir))
|
||||
.createInstance();
|
||||
|
||||
keys.add(setup(instance, splitSpeed));
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.logistics.depot;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -23,7 +22,7 @@ public class EjectorVisual extends ShaftVisual<EjectorBlockEntity> implements Dy
|
|||
public EjectorVisual(VisualizationContext dispatcher, EjectorBlockEntity blockEntity) {
|
||||
super(dispatcher, blockEntity);
|
||||
|
||||
plate = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.EJECTOR_TOP), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
plate = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.EJECTOR_TOP)).createInstance();
|
||||
|
||||
pivotPlate();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.simibubi.create.content.logistics.funnel;
|
|||
import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -34,7 +33,7 @@ public class FunnelVisual extends AbstractBlockEntityVisual<FunnelBlockEntity> i
|
|||
|
||||
PartialModel flapPartial = (blockState.getBlock() instanceof FunnelBlock ? AllPartialModels.FUNNEL_FLAP
|
||||
: AllPartialModels.BELT_FUNNEL_FLAP);
|
||||
Instancer<FlapInstance> model = instancerProvider.instancer(AllInstanceTypes.FLAPS, Models.partial(flapPartial), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<FlapInstance> model = instancerProvider.instancer(AllInstanceTypes.FLAPS, Models.partial(flapPartial));
|
||||
|
||||
int blockLight = level.getBrightness(LightLayer.BLOCK, pos);
|
||||
int skyLight = level.getBrightness(LightLayer.SKY, pos);
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.EnumMap;
|
|||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.instance.Instancer;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
|
@ -33,7 +32,7 @@ public class BeltTunnelVisual extends AbstractBlockEntityVisual<BeltTunnelBlockE
|
|||
|
||||
tunnelFlaps = new EnumMap<>(Direction.class);
|
||||
|
||||
Instancer<FlapInstance> model = instancerProvider.instancer(AllInstanceTypes.FLAPS, Models.partial(AllPartialModels.BELT_TUNNEL_FLAP), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
Instancer<FlapInstance> model = instancerProvider.instancer(AllInstanceTypes.FLAPS, Models.partial(AllPartialModels.BELT_TUNNEL_FLAP));
|
||||
|
||||
int blockLight = level.getBrightness(LightLayer.BLOCK, pos);
|
||||
int skyLight = level.getBrightness(LightLayer.SKY, pos);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.redstone.analogLever;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -32,9 +31,9 @@ public class AnalogLeverVisual extends AbstractBlockEntityVisual<AnalogLeverBloc
|
|||
public AnalogLeverVisual(VisualizationContext context, AnalogLeverBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
handle = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ANALOG_LEVER_HANDLE), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
handle = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ANALOG_LEVER_HANDLE))
|
||||
.createInstance();
|
||||
indicator = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ANALOG_LEVER_INDICATOR), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
indicator = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.ANALOG_LEVER_INDICATOR))
|
||||
.createInstance();
|
||||
|
||||
AttachFace face = blockState.getValue(AnalogLeverBlock.FACE);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.redstone.diodes;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.TickableVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualTickContext;
|
||||
|
@ -23,7 +22,7 @@ public class BrassDiodeVisual extends AbstractBlockEntityVisual<BrassDiodeBlockE
|
|||
public BrassDiodeVisual(VisualizationContext context, BrassDiodeBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
indicator = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.FLEXPEATER_INDICATOR), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
indicator = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.FLEXPEATER_INDICATOR)).createInstance();
|
||||
|
||||
indicator.loadIdentity()
|
||||
.translate(getVisualPosition())
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.content.schematics.cannon;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visual.DynamicVisual;
|
||||
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
|
||||
|
@ -25,8 +24,8 @@ public class SchematicannonVisual extends AbstractBlockEntityVisual<Schematicann
|
|||
public SchematicannonVisual(VisualizationContext context, SchematicannonBlockEntity blockEntity) {
|
||||
super(context, blockEntity);
|
||||
|
||||
connector = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SCHEMATICANNON_CONNECTOR), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
pipe = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SCHEMATICANNON_PIPE), RenderStage.AFTER_BLOCK_ENTITIES).createInstance();
|
||||
connector = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SCHEMATICANNON_CONNECTOR)).createInstance();
|
||||
pipe = instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SCHEMATICANNON_PIPE)).createInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.joml.Matrix3f;
|
|||
import org.joml.Matrix4f;
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
|
||||
import com.jozufozu.flywheel.lib.instance.TransformedInstance;
|
||||
|
@ -196,7 +195,7 @@ public abstract class BogeyRenderer {
|
|||
*/
|
||||
public void createModelInstance(VisualizationContext context, PartialModel model, int count) {
|
||||
var instancer = context.instancerProvider()
|
||||
.instancer(InstanceTypes.TRANSFORMED, Models.partial(model), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
.instancer(InstanceTypes.TRANSFORMED, Models.partial(model));
|
||||
BogeyModelData[] modelData = IntStream.range(0, count)
|
||||
.mapToObj(i -> instancer.createInstance())
|
||||
.map(BogeyModelData::new)
|
||||
|
@ -213,7 +212,7 @@ public abstract class BogeyRenderer {
|
|||
*/
|
||||
public void createModelInstance(VisualizationContext context, BlockState state, int count) {
|
||||
var instancer = context.instancerProvider()
|
||||
.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(state), RenderStage.AFTER_BLOCK_ENTITIES);
|
||||
.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(state));
|
||||
BogeyModelData[] modelData = IntStream.range(0, count)
|
||||
.mapToObj(i -> instancer.createInstance())
|
||||
.map(BogeyModelData::new)
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.function.Consumer;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.api.event.RenderStage;
|
||||
import com.jozufozu.flywheel.api.instance.Instance;
|
||||
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
|
||||
import com.jozufozu.flywheel.lib.box.Box;
|
||||
|
@ -114,11 +113,11 @@ public class TrackVisual extends AbstractBlockEntityVisual<TrackBlockEntity> {
|
|||
|
||||
TrackMaterial.TrackModelHolder modelHolder = bc.getMaterial().getModelHolder();
|
||||
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.tie()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.tie()))
|
||||
.createInstances(ties);
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.segment_left()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.segment_left()))
|
||||
.createInstances(left);
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.segment_right()), RenderStage.AFTER_BLOCK_ENTITIES)
|
||||
instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(modelHolder.segment_right()))
|
||||
.createInstances(right);
|
||||
|
||||
SegmentAngles[] segments = bc.getBakedSegments();
|
||||
|
@ -194,10 +193,10 @@ public class TrackVisual extends AbstractBlockEntityVisual<TrackBlockEntity> {
|
|||
beams = Couple.create(() -> new TransformedInstance[segCount]);
|
||||
beamCaps = Couple.create(() -> Couple.create(() -> new TransformedInstance[segCount]));
|
||||
lightPos = new BlockPos[segCount];
|
||||
beams.forEach(instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GIRDER_SEGMENT_MIDDLE), RenderStage.AFTER_BLOCK_ENTITIES)::createInstances);
|
||||
beams.forEach(instancerProvider.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GIRDER_SEGMENT_MIDDLE))::createInstances);
|
||||
beamCaps.forEachWithContext((c, top) -> {
|
||||
var partialModel = Models.partial(top ? AllPartialModels.GIRDER_SEGMENT_TOP : AllPartialModels.GIRDER_SEGMENT_BOTTOM);
|
||||
c.forEach(instancerProvider.instancer(InstanceTypes.TRANSFORMED, partialModel, RenderStage.AFTER_BLOCK_ENTITIES)::createInstances);
|
||||
c.forEach(instancerProvider.instancer(InstanceTypes.TRANSFORMED, partialModel)::createInstances);
|
||||
});
|
||||
|
||||
GirderAngles[] bakedGirders = bc.getBakedGirders();
|
||||
|
|
|
@ -124,6 +124,8 @@ public class AllInstanceTypes {
|
|||
MemoryUtil.memPutFloat(ptr + 42, instance.speed);
|
||||
})
|
||||
.register();
|
||||
|
||||
// TODO: remove
|
||||
public static final InstanceType<FlapInstance> FLAPS = SimpleInstanceType.builder(FlapInstance::new)
|
||||
.cullShader(asResource("instance/cull/flap.glsl"))
|
||||
.vertexShader(asResource("instance/flap.vert"))
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "flywheel:util/quaternion.glsl"
|
||||
|
||||
void flw_transformBoundingSphere(in FlwInstance instance, inout vec3 center, inout float radius) {
|
||||
// FIXME: this is incorrect, but it compiles
|
||||
center = rotateByQuaternion(center - .5, instance.rotation) + instance.pos + .5;
|
||||
radius += length(center - 0.5);
|
||||
center += instance.pos;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#include "flywheel:util/quaternion.glsl"
|
||||
|
||||
void flw_transformBoundingSphere(in FlwInstance instance, inout vec3 center, inout float radius) {
|
||||
// FIXME: this is incorrect, but it compiles
|
||||
float degrees = instance.offset + flw_renderSeconds * instance.speed;
|
||||
// The instance will spin about the rotation center, so we need to expand the radius to account for that
|
||||
float extraForKinetic = length(center - instance.rotationCenter);
|
||||
float extraForModel = length(center - 0.5);
|
||||
|
||||
vec4 kineticRot = quaternion(instance.axis, degrees);
|
||||
vec3 rotated = rotateByQuaternion(center - instance.rotationCenter, kineticRot) + instance.rotationCenter;
|
||||
|
||||
center = rotateByQuaternion(rotated - .5, instance.rotation) + instance.pos + .5;
|
||||
radius += extraForKinetic + extraForModel;
|
||||
center += instance.pos;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
#include "flywheel:util/matrix.glsl"
|
||||
|
||||
mat3 kineticRotation(float offset, float speed, vec3 axis) {
|
||||
float degrees = offset + flw_renderTicks * speed * 3./10.;
|
||||
|
||||
return rotationDegrees(axis, degrees);
|
||||
}
|
||||
|
||||
void flw_transformBoundingSphere(in FlwInstance instance, inout vec3 center, inout float radius) {
|
||||
// FIXME: this is incorrect, but it compiles
|
||||
mat3 spin = kineticRotation(instance.offset, instance.speed, instance.axis);
|
||||
|
||||
vec3 worldPos = spin * (center - .5);
|
||||
center = worldPos + instance.pos + .5;
|
||||
// The instance will spin about (0.5, 0.5, 0.5), so we need to expand the radius to account for that
|
||||
radius += length(center - 0.5);
|
||||
center += instance.pos;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue