Skip to content

Commit

Permalink
Start work on salepoint ponder
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 4, 2024
1 parent b7fe93f commit 161bde9
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Numismatics
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package dev.ithundxr.createnumismatics.mixin.client;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import com.simibubi.create.content.kinetics.belt.BeltBlockEntity;
import com.simibubi.create.content.kinetics.belt.BeltRenderer;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.ponder.PonderWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(BeltRenderer.class)
public abstract class MixinBeltRenderer extends SafeBlockEntityRenderer<BeltBlockEntity> {
// TODO - Remove when https://github.com/Creators-of-Create/Create/pull/6898 is merged and released
@ModifyExpressionValue(
method = "renderItems",
at = @At(
value = "INVOKE",
target = "Lcom/simibubi/create/content/kinetics/belt/BeltRenderer;shouldCullItem(Lnet/minecraft/world/phys/Vec3;)Z"
),
require = 0
)
private boolean numismatics$fixBeltsCullingItemsInPonders(boolean original, @Local(argsOnly = true) BeltBlockEntity be) {
return original && !(be.getLevel() instanceof PonderWorld);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Numismatics
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package dev.ithundxr.createnumismatics.ponder;

import com.simibubi.create.foundation.ponder.SceneBuilder;
import com.simibubi.create.foundation.ponder.SceneBuildingUtil;
import com.simibubi.create.foundation.ponder.Selection;
import net.minecraft.core.Direction;

public class SalepointScenes {
public static void item(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("salepoint_item", "Using Salepoints");
scene.configureBasePlate(1, 0, 12);
scene.scaleSceneView(.60f);
scene.setSceneOffsetY(-1);
scene.showBasePlate();
scene.idle(10);

Selection salepoint = util.select.position(11, 3, 4);
Selection portableInterface = util.select.position(7, 2, 4);
Selection funnel = util.select.position(7, 2, 3);

Selection beltIntoFunnel = util.select.fromTo(7, 1, 2, 7, 1, 3);
Selection beltIntoBelt = util.select.fromTo(12, 1, 2, 8, 1, 2);

Selection gearBoxes = util.select.fromTo(8, 1, 3, 9, 1, 3);
Selection smallCog = util.select.position(12, 1, 3);
Selection largeCog = util.select.position(13, 0, 3);

Selection train1 = util.select.fromTo(12, 2, 4, 8, 3, 7);
Selection train2 = util.select.fromTo(7, 2, 4, 4, 3, 7);
Selection train2a = util.select.fromTo(7, 2, 7, 4, 3, 10);

// Show tracks
for (int i = 0; i <= 13; i++) {
scene.world.showSection(util.select.position(i, 1, 6), Direction.DOWN);
scene.idle(1);
}

scene.world.showSection(largeCog, Direction.DOWN);
scene.idle(10);
scene.world.showSection(smallCog, Direction.DOWN);
scene.idle(10);

scene.world.showSection(beltIntoBelt, Direction.DOWN);
scene.idle(10);
scene.world.showSection(gearBoxes, Direction.DOWN);
scene.idle(10);
scene.world.showSection(beltIntoFunnel, Direction.DOWN);
scene.idle(10);

scene.world.showSection(portableInterface, Direction.DOWN);
scene.idle(10);
scene.world.showSection(funnel, Direction.DOWN);
scene.idle(10);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import dev.ithundxr.createnumismatics.Numismatics;
import dev.ithundxr.createnumismatics.ponder.BlazeBankerScene;
import dev.ithundxr.createnumismatics.ponder.DepositorScenes;
import dev.ithundxr.createnumismatics.ponder.SalepointScenes;

public class NumismaticsPonderIndex {
static final PonderRegistrationHelper HELPER = new PonderRegistrationHelper(Numismatics.MOD_ID);
Expand All @@ -31,6 +32,8 @@ public static void register() {
HELPER.forComponents(NumismaticsBlocks.ANDESITE_DEPOSITOR, NumismaticsBlocks.BRASS_DEPOSITOR)
.addStoryBoard("depositor", DepositorScenes::depositor)
.addStoryBoard("depositor_pricing", DepositorScenes::depositorPricing);
HELPER.forComponents(NumismaticsBlocks.SALEPOINT)
.addStoryBoard("salepoint", SalepointScenes::item);
}

// Any ponders that should appear AFTER creates own ponders should go here
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions common/src/main/resources/numismatics-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"MixinAbstractContainerMenu",
"MixinServerPlayer",
"client.AccessorInputWindowElement",
"client.MixinBeltRenderer",
"client.PonderRegistryMixin",
"compat.carryon.MixinPickupHandler"
],
Expand Down

0 comments on commit 161bde9

Please sign in to comment.