Merge remote-tracking branch 'upstream/mc1.15/dev' into mc1.15/dev

This commit is contained in:
JozsefA 2021-03-09 14:23:40 -08:00
commit dcea504184
13 changed files with 346 additions and 55 deletions

View file

@ -35,7 +35,8 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
protected void renderSafe(HarvesterTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer,
int light, int overlay) {
BlockState blockState = te.getBlockState();
SuperByteBuffer superBuffer = AllBlockPartials.HARVESTER_BLADE.renderOnHorizontal(blockState);
SuperByteBuffer superBuffer = AllBlockPartials.HARVESTER_BLADE.renderOn(blockState);
transform(blockState.get(HarvesterBlock.HORIZONTAL_FACING), superBuffer, te.manuallyAnimatedSpeed);
superBuffer.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped()));
}
@ -66,21 +67,26 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
float speed = (float) (!VecHelper.isVecPointingTowards(context.relativeMotion, facing.getOpposite())
? context.getAnimationSpeed()
: 0);
if (context.contraption.stalled)
speed = 0;
float time = AnimationTickHolder.getRenderTime() / 20;
float angle = (time * speed) % 360;
transform(facing, superBuffer, speed);
superBuffer.light(msLocal.peek()
.getModel(), ContraptionRenderDispatcher.getLightOnContraption(context))
.renderInto(ms, buffers.getBuffer(RenderType.getCutoutMipped()));
}
public static void transform(Direction facing, SuperByteBuffer superBuffer, float speed) {
float originOffset = 1 / 16f;
Vec3d rotOffset = new Vec3d(0, -2 * originOffset, originOffset).add(VecHelper.getCenterOf(BlockPos.ZERO));
float time = AnimationTickHolder.getRenderTime() / 20;
float angle = (time * speed) % 360;
superBuffer.rotateCentered(Direction.UP, AngleHelper.rad(AngleHelper.horizontalAngle(facing)))
.translate(rotOffset.x, rotOffset.y, rotOffset.z)
.rotate(Direction.WEST, AngleHelper.rad(angle))
.translate(-rotOffset.x, -rotOffset.y, -rotOffset.z)
.light(msLocal.peek()
.getModel(), ContraptionRenderDispatcher.getLightOnContraption(context))
.renderInto(ms, buffers.getBuffer(RenderType.getCutoutMipped()));
.translate(-rotOffset.x, -rotOffset.y, -rotOffset.z);
}
public static void transformHead(MatrixStack ms, float angle) {}

View file

@ -15,4 +15,11 @@ public class HarvesterTileEntity extends SyncedTileEntity {
return true;
}
// For simulations such as Ponder
float manuallyAnimatedSpeed;
public void setAnimatedSpeed(float speed) {
manuallyAnimatedSpeed = speed;
}
}

View file

@ -2,6 +2,7 @@ package com.simibubi.create.foundation.gui;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang3.mutable.MutableBoolean;
@ -145,7 +146,7 @@ public abstract class AbstractSimiScreen extends Screen {
return true;
if (code == GLFW.GLFW_KEY_BACKSPACE) {
ScreenOpener.openPreviousScreen(this);
ScreenOpener.openPreviousScreen(this, Optional.empty());
return true;
}
@ -242,9 +243,7 @@ public abstract class AbstractSimiScreen extends Screen {
private static String screenTitle(Screen screen) {
if (screen instanceof AbstractSimiScreen)
return ((AbstractSimiScreen) screen).getBreadcrumbTitle();
return screen.getClass()
.getSimpleName();
return "<";
}
protected String getBreadcrumbTitle() {
@ -280,4 +279,6 @@ public abstract class AbstractSimiScreen extends Screen {
return false;
}
public void shareContextWith(AbstractSimiScreen other) {}
}

View file

@ -4,6 +4,7 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
@ -34,14 +35,17 @@ public class ScreenOpener {
openScreen(toOpen);
}
public static void openPreviousScreen(Screen current) {
public static void openPreviousScreen(Screen current, Optional<AbstractSimiScreen> screenWithContext) {
if (backStack.isEmpty())
return;
backSteppedFrom = current;
Screen previousScreen = backStack.pop();
if (previousScreen instanceof AbstractSimiScreen)
((AbstractSimiScreen) previousScreen).transition.startWithValue(-0.1)
if (previousScreen instanceof AbstractSimiScreen) {
AbstractSimiScreen previousAbstractSimiScreen = (AbstractSimiScreen) previousScreen;
screenWithContext.ifPresent(s -> s.shareContextWith(previousAbstractSimiScreen));
previousAbstractSimiScreen.transition.startWithValue(-0.1)
.chase(-1, .4f, LerpedFloat.Chaser.EXP);
}
openScreen(previousScreen);
}
@ -65,7 +69,7 @@ public class ScreenOpener {
if (!screen.isEquivalentTo((AbstractSimiScreen) previouslyRenderedScreen))
return false;
openPreviousScreen(Minecraft.getInstance().currentScreen);
openPreviousScreen(Minecraft.getInstance().currentScreen, Optional.of(screen));
return true;
}

View file

@ -39,15 +39,20 @@ public class PonderRegistry {
public static final PonderChapterRegistry chapters = new PonderChapterRegistry();
public static Map<ResourceLocation, List<PonderStoryBoardEntry>> all = new HashMap<>();
public static PonderSceneBuilder addStoryBoard(ItemProviderEntry<?> component, String schematic, PonderStoryBoard storyBoard) {
public static PonderSceneBuilder addStoryBoard(ItemProviderEntry<?> component, String schematic,
PonderStoryBoard storyBoard, PonderTag... tags) {
ResourceLocation id = component.getId();
PonderStoryBoardEntry entry = new PonderStoryBoardEntry(storyBoard, schematic, id);
PonderSceneBuilder builder = new PonderSceneBuilder(entry);
all.computeIfAbsent(id, _$ -> new ArrayList<>()).add(entry);
if (tags.length > 0)
builder.highlightTags(tags);
all.computeIfAbsent(id, _$ -> new ArrayList<>())
.add(entry);
return builder;
}
public static PonderSceneBuilder addStoryBoard(PonderChapter chapter, ResourceLocation component, String schematic, PonderStoryBoard storyBoard) {
public static PonderSceneBuilder addStoryBoard(PonderChapter chapter, ResourceLocation component, String schematic,
PonderStoryBoard storyBoard) {
if (component == null)
component = new ResourceLocation("minecraft", "stick");
@ -94,7 +99,8 @@ public class PonderRegistry {
public static PonderScene compileScene(int i, PonderStoryBoardEntry sb, PonderWorld world) {
PonderScene scene = new PonderScene(world, sb.getComponent(), sb.getTags());
SceneBuilder builder = scene.builder();
sb.getBoard().program(builder, scene.getSceneBuildingUtil());
sb.getBoard()
.program(builder, scene.getSceneBuildingUtil());
return scene;
}
@ -135,10 +141,16 @@ public class PonderRegistry {
}
public MultiSceneBuilder addStoryBoard(String schematicPath, PonderStoryBoard storyBoard) {
return addStoryBoard(schematicPath, storyBoard, PonderSceneBuilder::highlightAllTags);
return addStoryBoard(schematicPath, storyBoard, $ -> {
});
}
public MultiSceneBuilder addStoryBoard(String schematicPath, PonderStoryBoard storyBoard, Consumer<PonderSceneBuilder> extras) {
public MultiSceneBuilder addStoryBoard(String schematicPath, PonderStoryBoard storyBoard, PonderTag... tags) {
return addStoryBoard(schematicPath, storyBoard, sb -> sb.highlightTags(tags));
}
public MultiSceneBuilder addStoryBoard(String schematicPath, PonderStoryBoard storyBoard,
Consumer<PonderSceneBuilder> extras) {
components.forEach(c -> extras.accept(PonderRegistry.addStoryBoard(c, schematicPath, storyBoard)));
return this;
}
@ -154,12 +166,14 @@ public class PonderRegistry {
}
public PonderSceneBuilder highlightAllTags() {
entry.getTags().add(PonderTag.Highlight.ALL);
entry.getTags()
.add(PonderTag.Highlight.ALL);
return this;
}
public PonderSceneBuilder highlightTags(PonderTag... tags) {
entry.getTags().addAll(Arrays.asList(tags));
entry.getTags()
.addAll(Arrays.asList(tags));
return this;
}

View file

@ -77,6 +77,7 @@ public class PonderUI extends AbstractSimiScreen {
private LerpedFloat lazyIndex;
private int index = 0;
private PonderTag referredToByTag;
private PonderButton left, right, scan, chap;
@ -85,6 +86,13 @@ public class PonderUI extends AbstractSimiScreen {
.getRegistryName()));
}
public static PonderUI of(ItemStack item, PonderTag tag) {
PonderUI ponderUI = new PonderUI(PonderRegistry.compile(item.getItem()
.getRegistryName()));
ponderUI.referredToByTag = tag;
return ponderUI;
}
public static PonderUI of(PonderChapter chapter) {
PonderUI ui = new PonderUI(PonderRegistry.compile(chapter));
ui.chapter = chapter;
@ -186,6 +194,26 @@ public class PonderUI extends AbstractSimiScreen {
@Override
public void tick() {
super.tick();
if (referredToByTag != null) {
for (int i = 0; i < scenes.size(); i++) {
PonderScene ponderScene = scenes.get(i);
if (!ponderScene.tags.contains(referredToByTag))
continue;
if (i == index)
break;
scenes.get(index)
.fadeOut();
index = i;
scenes.get(index)
.begin();
lazyIndex.chase(index, 1 / 4f, Chaser.EXP);
identifyMode = false;
break;
}
referredToByTag = null;
}
PonderScene activeScene = scenes.get(index);
if (!identifyMode)
activeScene.tick();
@ -743,4 +771,10 @@ public class PonderUI extends AbstractSimiScreen {
return super.isEquivalentTo(other);
}
@Override
public void shareContextWith(AbstractSimiScreen other) {
if (other instanceof PonderUI)
((PonderUI) other).referredToByTag = referredToByTag;
}
}

View file

@ -596,6 +596,15 @@ public class SceneBuilder {
modifyTileNBT(selection, teType, consumer, false);
}
public <T extends TileEntity> void modifyTileEntity(BlockPos position, Class<T> teType,
Consumer<T> consumer) {
addInstruction(scene -> {
TileEntity tileEntity = scene.world.getTileEntity(position);
if (teType.isInstance(tileEntity))
consumer.accept(teType.cast(tileEntity));
});
}
public void modifyTileNBT(Selection selection, Class<? extends TileEntity> teType,
Consumer<CompoundNBT> consumer, boolean reDrawBlocks) {
addInstruction(new TileEntityDataInstruction(selection, teType, nbt -> {

View file

@ -0,0 +1,198 @@
package com.simibubi.create.foundation.ponder.content;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.SailBlock;
import com.simibubi.create.foundation.ponder.ElementLink;
import com.simibubi.create.foundation.ponder.SceneBuilder;
import com.simibubi.create.foundation.ponder.SceneBuildingUtil;
import com.simibubi.create.foundation.ponder.Selection;
import com.simibubi.create.foundation.ponder.elements.InputWindowElement;
import com.simibubi.create.foundation.ponder.elements.WorldSectionElement;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.Pointing;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public class BearingScenes {
public static void windmillsAsSource(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("windmill_source", "Generating Rotational Force using Windmill Bearings");
scene.world.showSection(util.select.fromTo(1, 0, 1, 5, 0, 5), Direction.UP);
scene.world.setBlock(util.grid.at(2, -1, 0), AllBlocks.SAIL.getDefaultState()
.with(SailBlock.FACING, Direction.NORTH), false);
scene.idle(5);
Selection kinetics = util.select.fromTo(3, 1, 1, 4, 1, 4);
Selection largeCog = util.select.position(3, 2, 2);
BlockPos windmill = util.grid.at(3, 2, 1);
scene.world.showSection(kinetics.add(largeCog), Direction.DOWN);
scene.idle(10);
scene.world.showSection(util.select.position(windmill), Direction.DOWN);
scene.idle(10);
BlockPos anchorPos = windmill.north();
scene.overlay.showSelectionWithText(util.select.position(anchorPos), 60)
.colored(PonderPalette.GREEN)
.pointAt(util.vector.blockSurface(windmill, Direction.WEST))
.placeNearTarget()
.text("Windmill Bearings attach to the block in front of them");
scene.idle(50);
ElementLink<WorldSectionElement> structure =
scene.world.showIndependentSection(util.select.position(anchorPos), Direction.SOUTH);
scene.idle(10);
for (Direction d : Iterate.directions)
if (d.getAxis() != Axis.Z)
scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.offset(d, 1), anchorPos.offset(d, 2)),
d.getOpposite(), structure);
scene.idle(10);
scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.up()
.east(),
anchorPos.up(3)
.east()),
Direction.WEST, structure);
scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.down()
.west(),
anchorPos.down(3)
.west()),
Direction.EAST, structure);
scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.east()
.down(),
anchorPos.east(3)
.down()),
Direction.UP, structure);
scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.west()
.up(),
anchorPos.west(3)
.up()),
Direction.DOWN, structure);
scene.idle(5);
for (Direction d : Iterate.directions)
if (d.getAxis() != Axis.Z)
scene.effects.superGlue(anchorPos.offset(d, 1), d.getOpposite(), false);
scene.idle(10);
scene.overlay.showText(60)
.pointAt(util.vector.blockSurface(anchorPos, Direction.NORTH))
.placeNearTarget()
.text("If enough Sail-like blocks are attached to the block, it can act as a Windmill");
scene.idle(70);
scene.rotateCameraY(-90);
scene.idle(20);
scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
scene.idle(7);
scene.world.rotateBearing(windmill, 360, 200);
scene.world.rotateSection(structure, 0, 0, 360, 200);
scene.world.setKineticSpeed(largeCog, 4);
scene.world.setKineticSpeed(kinetics, -8);
scene.effects.rotationDirectionIndicator(windmill.south());
BlockPos gaugePos = util.grid.at(4, 1, 4);
scene.effects.indicateSuccess(gaugePos);
scene.idle(10);
scene.overlay.showText(60)
.pointAt(util.vector.topOf(windmill))
.placeNearTarget()
.text("Once Activated, the Windmill Bearing will start providing Rotational Force");
scene.idle(70);
scene.overlay.showText(60)
.pointAt(util.vector.blockSurface(gaugePos, Direction.WEST))
.colored(PonderPalette.SLOW)
.placeNearTarget()
.text("The Amount of Sail Blocks determine its Rotation Speed");
scene.idle(90);
Vec3d surface = util.vector.blockSurface(windmill, Direction.WEST);
AxisAlignedBB point = new AxisAlignedBB(surface, surface);
AxisAlignedBB expanded = point.grow(1 / 16f, 1 / 4f, 1 / 4f);
scene.overlay.showControls(new InputWindowElement(surface, Pointing.DOWN).scroll()
.withWrench(), 60);
scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, point, point, 1);
scene.idle(1);
scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, point, expanded, 50);
scene.overlay.showText(60)
.pointAt(surface)
.placeNearTarget()
.text("Use a Wrench to configure its rotation direction");
scene.idle(35);
scene.world.rotateBearing(windmill, -90 - 45, 75);
scene.world.rotateSection(structure, 0, 0, -90 - 45, 75);
scene.world.modifyKineticSpeed(largeCog, f -> -f);
scene.world.modifyKineticSpeed(kinetics, f -> -f);
scene.effects.rotationDirectionIndicator(windmill.south());
scene.idle(69);
scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
scene.idle(7);
scene.world.rotateBearing(windmill, -45, 0);
scene.world.rotateSection(structure, 0, 0, -45, 0);
scene.world.setKineticSpeed(largeCog, 0);
scene.world.setKineticSpeed(kinetics, 0);
scene.idle(10);
scene.overlay.showText(60)
.pointAt(util.vector.topOf(windmill))
.placeNearTarget()
.text("Right-click the Bearing anytime to stop and edit the Structure again");
}
public static void windmillsAnyStructure(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("windmill_structure", "Windmill Contraptions");
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
BlockPos bearingPos = util.grid.at(3, 1, 3);
scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
scene.idle(10);
ElementLink<WorldSectionElement> contraption =
scene.world.showIndependentSection(util.select.position(bearingPos.up()), Direction.DOWN);
scene.idle(10);
scene.world.showSectionAndMerge(util.select.fromTo(3, 2, 2, 3, 3, 1), Direction.SOUTH, contraption);
scene.world.showSectionAndMerge(util.select.fromTo(3, 2, 4, 3, 3, 5), Direction.NORTH, contraption);
scene.idle(5);
scene.world.showSectionAndMerge(util.select.position(3, 1, 5), Direction.NORTH, contraption);
scene.world.showSectionAndMerge(util.select.position(3, 4, 2), Direction.DOWN, contraption);
scene.idle(5);
scene.world.showSectionAndMerge(util.select.position(2, 1, 5), Direction.EAST, contraption);
scene.world.showSectionAndMerge(util.select.position(3, 3, 3), Direction.DOWN, contraption);
scene.idle(5);
scene.effects.superGlue(bearingPos.up(), Direction.SOUTH, true);
scene.effects.superGlue(bearingPos.up(), Direction.NORTH, true);
scene.idle(5);
scene.effects.superGlue(util.grid.at(3, 1, 5), Direction.UP, true);
scene.idle(5);
scene.effects.superGlue(util.grid.at(3, 3, 3), Direction.DOWN, true);
scene.idle(10);
scene.overlay.showOutline(PonderPalette.BLUE, bearingPos, util.select.fromTo(3, 2, 1, 3, 3, 2), 80);
scene.overlay.showSelectionWithText(util.select.fromTo(3, 2, 4, 3, 3, 5), 80)
.colored(PonderPalette.BLUE)
.text("Any Structure can count as a valid Windmill, as long as it contains at least 8 sail-like Blocks.");
scene.idle(90);
scene.overlay.showControls(
new InputWindowElement(util.vector.blockSurface(bearingPos, Direction.WEST), Pointing.LEFT).rightClick(),
40);
scene.idle(7);
scene.world.rotateBearing(bearingPos, -720, 400);
scene.world.rotateSection(contraption, 0, -720, 0, 400);
scene.world.modifyTileEntity(util.grid.at(2, 1, 5), HarvesterTileEntity.class,
hte -> hte.setAnimatedSpeed(-150));
scene.markAsFinished();
scene.idle(400);
scene.world.modifyTileEntity(util.grid.at(2, 1, 5), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(0));
}
}

View file

@ -16,20 +16,22 @@ public class PonderIndex {
// (!) Modifications inside storyboard methods only require re-opening the ui
PonderRegistry.forComponents(AllBlocks.SHAFT)
.addStoryBoard("shaft/relay", KineticsScenes::shaftAsRelay);
.addStoryBoard("shaft/relay", KineticsScenes::shaftAsRelay, PonderTag.KINETIC_RELAYS);
PonderRegistry.forComponents(AllBlocks.SHAFT, AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT)
.addStoryBoard("shaft/encasing", KineticsScenes::shaftsCanBeEncased);
PonderRegistry.forComponents(AllBlocks.COGWHEEL)
.addStoryBoard("cog/small", KineticsScenes::cogAsRelay)
.addStoryBoard("cog/small", KineticsScenes::cogAsRelay, PonderTag.KINETIC_RELAYS)
.addStoryBoard("cog/speedup", KineticsScenes::cogsSpeedUp);
PonderRegistry.forComponents(AllBlocks.LARGE_COGWHEEL)
.addStoryBoard("cog/speedup", KineticsScenes::cogsSpeedUp)
.addStoryBoard("cog/large", KineticsScenes::largeCogAsRelay);
.addStoryBoard("cog/large", KineticsScenes::largeCogAsRelay, PonderTag.KINETIC_RELAYS);
PonderRegistry.forComponents(AllItems.BELT_CONNECTOR)
.addStoryBoard("belt/connect", BeltScenes::beltConnector)
.addStoryBoard("belt/connect", BeltScenes::beltConnector, PonderTag.KINETIC_RELAYS)
.addStoryBoard("belt/directions", BeltScenes::directions)
.addStoryBoard("belt/transport", BeltScenes::transport)
.addStoryBoard("belt/transport", BeltScenes::transport, PonderTag.LOGISTICS)
.addStoryBoard("belt/encasing", BeltScenes::beltsCanBeEncased);
PonderRegistry.forComponents(AllBlocks.ANDESITE_CASING, AllBlocks.BRASS_CASING)
@ -37,40 +39,56 @@ public class PonderIndex {
.addStoryBoard("belt/encasing", BeltScenes::beltsCanBeEncased);
PonderRegistry.forComponents(AllBlocks.GEARBOX, AllItems.VERTICAL_GEARBOX)
.addStoryBoard("gearbox", KineticsScenes::gearbox);
PonderRegistry.addStoryBoard(AllBlocks.CLUTCH, "clutch", KineticsScenes::clutch);
PonderRegistry.addStoryBoard(AllBlocks.GEARSHIFT, "gearshift", KineticsScenes::gearshift);
.addStoryBoard("gearbox", KineticsScenes::gearbox, PonderTag.KINETIC_RELAYS);
PonderRegistry.addStoryBoard(AllBlocks.CLUTCH, "clutch", KineticsScenes::clutch, PonderTag.KINETIC_RELAYS);
PonderRegistry.addStoryBoard(AllBlocks.GEARSHIFT, "gearshift", KineticsScenes::gearshift,
PonderTag.KINETIC_RELAYS);
PonderRegistry.forComponents(AllBlocks.ENCASED_FAN)
.addStoryBoard("fan/direction", FanScenes::direction)
.addStoryBoard("fan/direction", FanScenes::direction, PonderTag.KINETIC_APPLIANCES)
.addStoryBoard("fan/processing", FanScenes::processing)
.addStoryBoard("fan/source", FanScenes::source);
.addStoryBoard("fan/source", FanScenes::source, PonderTag.KINETIC_SOURCES);
PonderRegistry.addStoryBoard(AllBlocks.CREATIVE_MOTOR, "creative_motor", KineticsScenes::creativeMotor);
PonderRegistry.addStoryBoard(AllBlocks.WATER_WHEEL, "water_wheel", KineticsScenes::waterWheel);
PonderRegistry.addStoryBoard(AllBlocks.HAND_CRANK, "hand_crank", KineticsScenes::handCrank);
PonderRegistry.addStoryBoard(AllBlocks.COPPER_VALVE_HANDLE, "valve_handle", KineticsScenes::valveHandle);
PonderRegistry.addStoryBoard(AllBlocks.CREATIVE_MOTOR, "creative_motor", KineticsScenes::creativeMotor,
PonderTag.KINETIC_SOURCES);
PonderRegistry.addStoryBoard(AllBlocks.WATER_WHEEL, "water_wheel", KineticsScenes::waterWheel,
PonderTag.KINETIC_SOURCES);
PonderRegistry.addStoryBoard(AllBlocks.HAND_CRANK, "hand_crank", KineticsScenes::handCrank,
PonderTag.KINETIC_SOURCES);
PonderRegistry.addStoryBoard(AllBlocks.COPPER_VALVE_HANDLE, "valve_handle", KineticsScenes::valveHandle,
PonderTag.KINETIC_SOURCES);
PonderRegistry.forComponents(AllBlocks.DYED_VALVE_HANDLES)
.addStoryBoard("valve_handle", KineticsScenes::valveHandle);
PonderRegistry.addStoryBoard(AllBlocks.ENCASED_CHAIN_DRIVE, "chain_drive/relay",
ChainDriveScenes::chainDriveAsRelay);
ChainDriveScenes::chainDriveAsRelay, PonderTag.KINETIC_RELAYS);
PonderRegistry.forComponents(AllBlocks.ENCASED_CHAIN_DRIVE, AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.addStoryBoard("chain_drive/gearshift", ChainDriveScenes::adjustableChainGearshift);
// Funnels
PonderRegistry.addStoryBoard(AllBlocks.BRASS_FUNNEL, "funnels/brass", FunnelScenes::brass);
PonderRegistry.forComponents(AllBlocks.ANDESITE_FUNNEL, AllBlocks.BRASS_FUNNEL)
.addStoryBoard("funnels/intro", FunnelScenes::intro)
.addStoryBoard("funnels/intro", FunnelScenes::intro, PonderTag.LOGISTICS)
.addStoryBoard("funnels/direction", FunnelScenes::directionality)
.addStoryBoard("funnels/compat", FunnelScenes::compat)
.addStoryBoard("funnels/redstone", FunnelScenes::redstone)
.addStoryBoard("funnels/transposer", FunnelScenes::transposer);
PonderRegistry.addStoryBoard(AllBlocks.ANDESITE_FUNNEL, "funnels/brass", FunnelScenes::brass);
// Windmill Bearing
PonderRegistry.forComponents(AllBlocks.WINDMILL_BEARING)
.addStoryBoard("windmill_bearing/source", BearingScenes::windmillsAsSource, PonderTag.KINETIC_SOURCES)
.addStoryBoard("windmill_bearing/structure", BearingScenes::windmillsAnyStructure,
PonderTag.MOVEMENT_ANCHOR);
// Gantries
PonderRegistry.addStoryBoard(AllBlocks.GANTRY_SHAFT, "gantry/intro", GantryScenes::introForShaft);
PonderRegistry.addStoryBoard(AllBlocks.GANTRY_CARRIAGE, "gantry/intro", GantryScenes::introForPinion);
PonderRegistry.addStoryBoard(AllBlocks.GANTRY_SHAFT, "gantry/intro", GantryScenes::introForShaft,
PonderTag.KINETIC_APPLIANCES, PonderTag.MOVEMENT_ANCHOR);
PonderRegistry.addStoryBoard(AllBlocks.GANTRY_CARRIAGE, "gantry/intro", GantryScenes::introForPinion,
PonderTag.KINETIC_APPLIANCES, PonderTag.MOVEMENT_ANCHOR);
PonderRegistry.forComponents(AllBlocks.GANTRY_SHAFT, AllBlocks.GANTRY_CARRIAGE)
.addStoryBoard("gantry/redstone", GantryScenes::redstone)
.addStoryBoard("gantry/direction", GantryScenes::direction)
@ -78,7 +96,7 @@ public class PonderIndex {
// Movement Actors
PonderRegistry.forComponents(AllBlocks.PORTABLE_STORAGE_INTERFACE)
.addStoryBoard("portable_interface/transfer", MovementActorScenes::psiTransfer)
.addStoryBoard("portable_interface/transfer", MovementActorScenes::psiTransfer, PonderTag.CONTRAPTION_ACTOR)
.addStoryBoard("portable_interface/redstone", MovementActorScenes::psiRedstone);
// Debug scenes, can be found in game via the Brass Hand

View file

@ -82,7 +82,7 @@ public class PonderTagScreen extends AbstractSimiScreen {
if (!PonderRegistry.all.containsKey(i.getRegistryName()))
return;
centerScalingOn(mouseX, mouseY);
ScreenOpener.transitionTo(PonderUI.of(new ItemStack(i)));
ScreenOpener.transitionTo(PonderUI.of(new ItemStack(i), tag));
}).showing(new ItemStack(i));
button.fade(1);
@ -99,7 +99,7 @@ public class PonderTagScreen extends AbstractSimiScreen {
.getRegistryName()))
return;
centerScalingOn(mouseX, mouseY);
ScreenOpener.transitionTo(PonderUI.of(tag.getMainItem()));
ScreenOpener.transitionTo(PonderUI.of(tag.getMainItem(), tag));
}).showing(tag.getMainItem());
button.fade(1);

View file

@ -95,7 +95,7 @@ public class PonderButton extends AbstractSimiWidget {
float flashValue = flash.getValue(partialTicks);
if (flashValue > .1f)
fade *= 3 * flashValue + ((Math.sin(AnimationTickHolder.getTicks() + partialTicks) / 6)) / 1f;
fade *= 3 * flashValue + Math.sin((AnimationTickHolder.getTicks() + partialTicks) / 6);
int backgroundColor = ColorHelper.applyAlpha(0xdd000000, fade);
int borderColorStart = ColorHelper.applyAlpha(isHovered ? 0x70ffffff : 0x40aa9999, fade);

Binary file not shown.