Assembling cogs

- Cogwheels and Large Cogwheels can now be created via sequenced assembly
   - Higher return at lower cost
   - Might want to nerf?
 - Add placement helper for Deployers on belts/depots/etc.
 - Multiple SequencedAssemblyRecipes can now start with the same item
This commit is contained in:
Jozufozu 2021-07-04 23:50:52 -07:00
parent da5aefe588
commit 92bf76761e
31 changed files with 510 additions and 89 deletions

View file

@ -410,21 +410,21 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j
6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
391e1552053f8fbb148b0bdf2e61f74ae4782100 assets/create/lang/en_ud.json
9d41edd2a78d074f0e80fbc95b6eb9f1303ef7f5 assets/create/lang/en_us.json
f05c04c9b1e79c446492af47a9bfcde73cefd138 assets/create/lang/unfinished/de_de.json
3b2ed3f1b4910e5cc03af089bf2ddfc1421cfc1f assets/create/lang/unfinished/es_es.json
e9ad51b0ad0e1088f121fb2444ef2019c11a2e80 assets/create/lang/unfinished/es_mx.json
f6f8a3f4b3bf685e324c9216b5bb0467c68da796 assets/create/lang/unfinished/fr_fr.json
d05b807ead4cc5dbae6444de5e91525a385d9b20 assets/create/lang/unfinished/it_it.json
055d6b4d130fedfe0232c351663bd9a1934d1a46 assets/create/lang/unfinished/ja_jp.json
064c4e1d5923dc5a75b178940cb36c42f764a6ad assets/create/lang/unfinished/ko_kr.json
762c1bdec8a3f2ecb4047fbb5b975ffbc1792374 assets/create/lang/unfinished/nl_nl.json
43c113585d98162f8cbe5ec02af06f6f8ae55cbc assets/create/lang/unfinished/pl_pl.json
3ab83a3d7d925821d73e9ab6064d3b479d7c21e6 assets/create/lang/unfinished/pt_br.json
51c20e7a0c4b2af9242ee31cf0cf1516b9f312a5 assets/create/lang/unfinished/ru_ru.json
95bf20119493721c3067319f165e2542295918c0 assets/create/lang/unfinished/zh_cn.json
9604bfe416e4f747efda84b419ec99f2b38bd544 assets/create/lang/unfinished/zh_tw.json
ec48e6d3d500ae94b910d902eb7ed2c8de652fda assets/create/lang/en_ud.json
95e9847bfc97f2ee8e9e48dbd4be8f988f1d48e9 assets/create/lang/en_us.json
4a1af3b7290cb8bd548033d399496de8f0fc1b93 assets/create/lang/unfinished/de_de.json
0d644f8b37a6986cd6296fb6dc4946a375f8d412 assets/create/lang/unfinished/es_es.json
32514e1e911174add48b7fcbbf392ee92272dde1 assets/create/lang/unfinished/es_mx.json
867cd892814aee14f1cc51e2ae8a0985d2fbb014 assets/create/lang/unfinished/fr_fr.json
4dcb9c9eec28e1b9317b9f1c0b4c3d55399e04e6 assets/create/lang/unfinished/it_it.json
f1a4ac058eadf0124bef710c5e7fc63de69b43ee assets/create/lang/unfinished/ja_jp.json
31501180c743cd9104f028228785da5902b1ad6b assets/create/lang/unfinished/ko_kr.json
84f6f5d577de562c1cfbed4a4e559548518e4a87 assets/create/lang/unfinished/nl_nl.json
471e6c2caf80e6314b928e9f437445facc754bca assets/create/lang/unfinished/pl_pl.json
89fae2843334e2ce8864129fe8aa92b692670879 assets/create/lang/unfinished/pt_br.json
90607465325ebe61298bd694a89e284f2e01ce42 assets/create/lang/unfinished/ru_ru.json
ea755903e75859f53cbe38bd0286f4d4fc69abc5 assets/create/lang/unfinished/zh_cn.json
017a50c4585558f62c296c5e59e6e112a71f51af assets/create/lang/unfinished/zh_tw.json
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
@ -3554,6 +3554,8 @@ a9096822db9d12b6014d6d34e52de5821305c03f data/create/recipes/scoria_cobblestone_
a513468ce4d55fe3b3919bd76ba2bd5b6fac4d4e data/create/recipes/scoria_pillar.json
2e0ecbd3619f080d0fc6fe48307c5a5bcc2e91b4 data/create/recipes/scoria_pillar_from_scoria_stonecutting.json
073b7c585b6733e6b984f34b9658566c47540968 data/create/recipes/sequenced_assembly/clockwork_component.json
fafe9cd8b83fd9449f4040c7c2185341a4066d21 data/create/recipes/sequenced_assembly/cogwheel.json
f12f4d7f11b7ca9cdbc36791bbedbd7f14f75acd data/create/recipes/sequenced_assembly/large_cogwheel.json
4e817b521623966fa24186731a70f0e14c03168e data/create/recipes/smelting/aluminum_ingot_compat_silents_mechanisms.json
ae90f50589bc06b44765ac8cbb9fbdc2b58fdb32 data/create/recipes/smelting/brass_ingot_from_crushed.json
64cbf425effba00ff2e31d95cffc2be2e0191932 data/create/recipes/smelting/bread.json

View file

@ -473,6 +473,8 @@
"item.create.honey_bucket": "\u0287\u01DD\u029E\u0254n\u15FA \u028E\u01DDuoH",
"item.create.honeyed_apple": "\u01DD\u05DFdd\u2C6F p\u01DD\u028E\u01DDuoH",
"item.create.incomplete_clockwork_component": "\u0287u\u01DDuod\u026Fo\u0186 \u029E\u0279o\u028D\u029E\u0254o\u05DF\u0186 \u01DD\u0287\u01DD\u05DFd\u026Fo\u0254uI",
"item.create.incomplete_cogwheel": "\u05DF\u01DD\u01DD\u0265\u028Dbo\u0186 \u01DD\u0287\u01DD\u05DFd\u026Fo\u0254uI",
"item.create.incomplete_large_cogwheel": "\u05DF\u01DD\u01DD\u0265\u028Dbo\u0186 \u01DDb\u0279\u0250\uA780 \u01DD\u0287\u01DD\u05DFd\u026Fo\u0254uI",
"item.create.iron_sheet": "\u0287\u01DD\u01DD\u0265S uo\u0279I",
"item.create.linked_controller": "\u0279\u01DD\u05DF\u05DFo\u0279\u0287uo\u0186 p\u01DD\u029Eu\u0131\uA780",
"item.create.minecart_contraption": "uo\u0131\u0287d\u0250\u0279\u0287uo\u0186 \u0287\u0279\u0250\u0254\u01DDu\u0131W",

View file

@ -479,6 +479,8 @@
"item.create.honey_bucket": "Honey Bucket",
"item.create.honeyed_apple": "Honeyed Apple",
"item.create.incomplete_clockwork_component": "Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "Incomplete Large Cogwheel",
"item.create.iron_sheet": "Iron Sheet",
"item.create.linked_controller": "Linked Controller",
"item.create.minecart_contraption": "Minecart Contraption",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1090",
"_": "Missing Localizations: 1092",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Honigeimer",
"item.create.honeyed_apple": "Honigapfel",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Eisenblech",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Loren Vorrichtung",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 853",
"_": "Missing Localizations: 855",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Cubo de miel",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Lámina de hierro",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Artilugio de vagoneta",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1457",
"_": "Missing Localizations: 1459",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Cubeta de Miel",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Lámina de Hierro",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Artefacto de Vagón",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1342",
"_": "Missing Localizations: 1344",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Seau de miel",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Plaque de Fer",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Engin de wagonnet",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 870",
"_": "Missing Localizations: 872",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Secchio di miele",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Lamiera di ferro",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Contrazione per carrello da miniera",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 236",
"_": "Missing Localizations: 238",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "ハチミツ入りバケツ",
"item.create.honeyed_apple": "リンゴのハチミツかけ",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "鉄板",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "からくり付きトロッコ",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 923",
"_": "Missing Localizations: 925",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "꿀 양동이",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "철 판",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "광산 수레 장치",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1723",
"_": "Missing Localizations: 1725",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "UNLOCALIZED: Honey Bucket",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "IJzeren Platen",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "UNLOCALIZED: Minecart Contraption",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 212",
"_": "Missing Localizations: 214",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Wiadro miodu",
"item.create.honeyed_apple": "Jabłko w miodzie",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Arkusz żelaza",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Maszyna w wagoniku",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1764",
"_": "Missing Localizations: 1766",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "UNLOCALIZED: Honey Bucket",
"item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Placas de Ferro",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "UNLOCALIZED: Minecart Contraption",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 769",
"_": "Missing Localizations: 771",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "Ведро мёда",
"item.create.honeyed_apple": "Яблоко в меду",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "Железный лист",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "Вагонеточная штуковина",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 253",
"_": "Missing Localizations: 255",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "蜂蜜桶",
"item.create.honeyed_apple": "蜜渍苹果",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "铁板",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "装配过的矿车",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 248",
"_": "Missing Localizations: 250",
"_": "->------------------------] Game Elements [------------------------<-",
@ -480,6 +480,8 @@
"item.create.honey_bucket": "蜂蜜桶",
"item.create.honeyed_apple": "蜂蜜蘋果",
"item.create.incomplete_clockwork_component": "UNLOCALIZED: Incomplete Clockwork Component",
"item.create.incomplete_cogwheel": "UNLOCALIZED: Incomplete Cogwheel",
"item.create.incomplete_large_cogwheel": "UNLOCALIZED: Incomplete Large Cogwheel",
"item.create.iron_sheet": "鐵板",
"item.create.linked_controller": "UNLOCALIZED: Linked Controller",
"item.create.minecart_contraption": "裝修過的礦車",

View file

@ -0,0 +1,63 @@
{
"type": "create:sequenced_assembly",
"ingredient": {
"item": "create:shaft"
},
"transitionalItem": {
"item": "create:incomplete_cogwheel"
},
"sequence": [
{
"type": "create:deploying",
"ingredients": [
{
"item": "create:incomplete_cogwheel"
},
{
"tag": "minecraft:planks"
}
],
"results": [
{
"item": "create:incomplete_cogwheel"
}
]
},
{
"type": "create:cutting",
"ingredients": [
{
"item": "create:incomplete_cogwheel"
}
],
"results": [
{
"item": "create:incomplete_cogwheel"
}
],
"processingTime": 20
},
{
"type": "create:cutting",
"ingredients": [
{
"item": "create:incomplete_cogwheel"
}
],
"results": [
{
"item": "create:incomplete_cogwheel"
}
],
"processingTime": 40
}
],
"results": [
{
"item": "create:cogwheel",
"count": 12,
"chance": 12.0
}
],
"loops": 4
}

View file

@ -0,0 +1,49 @@
{
"type": "create:sequenced_assembly",
"ingredient": {
"item": "create:andesite_alloy"
},
"transitionalItem": {
"item": "create:incomplete_large_cogwheel"
},
"sequence": [
{
"type": "create:deploying",
"ingredients": [
{
"item": "create:incomplete_large_cogwheel"
},
{
"tag": "minecraft:wooden_slabs"
}
],
"results": [
{
"item": "create:incomplete_large_cogwheel"
}
]
},
{
"type": "create:cutting",
"ingredients": [
{
"item": "create:incomplete_large_cogwheel"
}
],
"results": [
{
"item": "create:incomplete_large_cogwheel"
}
],
"processingTime": 50
}
],
"results": [
{
"item": "create:large_cogwheel",
"count": 3,
"chance": 12.0
}
],
"loops": 8
}

View file

@ -40,7 +40,7 @@ import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBloc
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelGenerator;
import com.simibubi.create.content.contraptions.components.flywheel.engine.FurnaceEngineBlock;
import com.simibubi.create.content.contraptions.components.millstone.MillstoneBlock;
import com.simibubi.create.content.contraptions.components.mixer.BasinOperatorBlockItem;
import com.simibubi.create.content.contraptions.components.AssemblyOperatorBlockItem;
import com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerBlock;
import com.simibubi.create.content.contraptions.components.motor.CreativeMotorBlock;
import com.simibubi.create.content.contraptions.components.motor.CreativeMotorGenerator;
@ -457,7 +457,7 @@ public class AllBlocks {
.properties(AbstractBlock.Properties::nonOpaque)
.blockstate(BlockStateGen.horizontalBlockProvider(true))
.transform(StressConfigDefaults.setImpact(8.0))
.item(BasinOperatorBlockItem::new)
.item(AssemblyOperatorBlockItem::new)
.transform(customItemModel())
.register();
@ -468,7 +468,7 @@ public class AllBlocks {
.blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p)))
.addLayer(() -> RenderType::getCutoutMipped)
.transform(StressConfigDefaults.setImpact(4.0))
.item(BasinOperatorBlockItem::new)
.item(AssemblyOperatorBlockItem::new)
.transform(customItemModel())
.register();
@ -693,7 +693,7 @@ public class AllBlocks {
.initialProperties(SharedProperties::softMetal)
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), AssetLookup.partialBaseModel(ctx, prov)))
.addLayer(() -> RenderType::getCutoutMipped)
.item(BasinOperatorBlockItem::new)
.item(AssemblyOperatorBlockItem::new)
.transform(customItemModel())
.register();
@ -923,7 +923,7 @@ public class AllBlocks {
.blockstate(BlockStateGen.directionalAxisBlockProvider())
.transform(StressConfigDefaults.setImpact(4.0))
.onRegister(addMovementBehaviour(new DeployerMovementBehaviour()))
.item()
.item(AssemblyOperatorBlockItem::new)
.transform(customItemModel())
.register();

View file

@ -88,6 +88,16 @@ public class AllItems {
public static final ItemEntry<Item> CLOCKWORK_COMPONENT = ingredient("clockwork_component");
public static final ItemEntry<SequencedAssemblyItem> INCOMPLETE_COGWHEEL =
REGISTRATE.item("incomplete_cogwheel", SequencedAssemblyItem::new)
.model(AssetLookup.existingItemModel())
.register();
public static final ItemEntry<SequencedAssemblyItem> INCOMPLETE_LARGE_COGWHEEL =
REGISTRATE.item("incomplete_large_cogwheel", SequencedAssemblyItem::new)
.model(AssetLookup.existingItemModel())
.register();
public static final ItemEntry<HiddenIngredientItem> BLAZE_CAKE_BASE =
REGISTRATE.item("blaze_cake_base", HiddenIngredientItem::new)
.tag(AllItemTags.UPRIGHT_ON_BELT.tag)

View file

@ -0,0 +1,50 @@
package com.simibubi.create.content.contraptions.components;
import com.simibubi.create.AllBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.vector.Vector3d;
public class AssemblyOperatorBlockItem extends BlockItem {
public AssemblyOperatorBlockItem(Block block, Properties builder) {
super(block, builder);
}
@Override
public ActionResultType tryPlace(BlockItemUseContext context) {
BlockPos placedOnPos = context.getPos()
.offset(context.getFace()
.getOpposite());
BlockState placedOnState = context.getWorld()
.getBlockState(placedOnPos);
if (operatesOn(placedOnState)) {
if (context.getWorld()
.getBlockState(placedOnPos.up(2))
.getMaterial()
.isReplaceable())
context = adjustContext(context, placedOnPos);
else
return ActionResultType.FAIL;
}
return super.tryPlace(context);
}
protected BlockItemUseContext adjustContext(BlockItemUseContext context, BlockPos placedOnPos) {
BlockPos up = placedOnPos.up(2);
return new AssemblyOperatorUseContext(context.getWorld(), context.getPlayer(), context.getHand(), context.getItem(), new BlockRayTraceResult(new Vector3d((double)up.getX() + 0.5D + (double) Direction.UP.getXOffset() * 0.5D, (double)up.getY() + 0.5D + (double) Direction.UP.getYOffset() * 0.5D, (double)up.getZ() + 0.5D + (double) Direction.UP.getZOffset() * 0.5D), Direction.UP, up, false));
}
protected boolean operatesOn(BlockState placedOnState) {
return AllBlocks.BASIN.has(placedOnState) || AllBlocks.BELT.has(placedOnState) || AllBlocks.DEPOT.has(placedOnState) || AllBlocks.WEIGHTED_EJECTOR.has(placedOnState);
}
}

View file

@ -0,0 +1,16 @@
package com.simibubi.create.content.contraptions.components;
import javax.annotation.Nullable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
public class AssemblyOperatorUseContext extends BlockItemUseContext {
public AssemblyOperatorUseContext(World p_i50056_1_, @Nullable PlayerEntity p_i50056_2_, Hand p_i50056_3_, ItemStack p_i50056_4_, BlockRayTraceResult p_i50056_5_) {
super(p_i50056_1_, p_i50056_2_, p_i50056_3_, p_i50056_4_, p_i50056_5_);
}
}

View file

@ -6,6 +6,7 @@ import com.simibubi.create.AllItems;
import com.simibubi.create.AllShapes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock;
import com.simibubi.create.content.contraptions.components.AssemblyOperatorUseContext;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
@ -15,11 +16,13 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
@ -109,22 +112,27 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements ITE<De
public Class<DeployerTileEntity> getTileEntityClass() {
return DeployerTileEntity.class;
}
@Override
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean isMoving) {
super.onBlockAdded(state, world, pos, oldState, isMoving);
withTileEntityDo(world, pos, DeployerTileEntity::redstoneUpdate);
}
@Override
public void neighborChanged(BlockState state, World world, BlockPos pos, Block p_220069_4_,
BlockPos p_220069_5_, boolean p_220069_6_) {
withTileEntityDo(world, pos, DeployerTileEntity::redstoneUpdate);
}
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override
protected Direction getFacingForPlacement(BlockItemUseContext context) {
if (context instanceof AssemblyOperatorUseContext) return Direction.DOWN;
else return super.getFacingForPlacement(context);
}
}

View file

@ -1,40 +0,0 @@
package com.simibubi.create.content.contraptions.components.mixer;
import com.simibubi.create.AllBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
public class BasinOperatorBlockItem extends BlockItem {
public BasinOperatorBlockItem(Block block, Properties builder) {
super(block, builder);
}
@Override
public ActionResultType tryPlace(BlockItemUseContext context) {
BlockPos placedOnPos = context.getPos()
.offset(context.getFace()
.getOpposite());
BlockState placedOnState = context.getWorld()
.getBlockState(placedOnPos);
if (AllBlocks.BASIN.has(placedOnState) || AllBlocks.BELT.has(placedOnState)
|| AllBlocks.DEPOT.has(placedOnState) || AllBlocks.WEIGHTED_EJECTOR.has(placedOnState)) {
if (context.getWorld()
.getBlockState(placedOnPos.up(2))
.getMaterial()
.isReplaceable())
context = BlockItemUseContext.func_221536_a(context, placedOnPos.up(2), Direction.UP);
else
return ActionResultType.FAIL;
}
return super.tryPlace(context);
}
}

View file

@ -5,6 +5,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.Create;
@ -12,6 +13,7 @@ import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.foundation.fluid.FluidIngredient;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.Pair;
import net.minecraft.client.Minecraft;
import net.minecraft.inventory.IInventory;
@ -53,7 +55,9 @@ public class SequencedAssemblyRecipe implements IRecipe<RecipeWrapper> {
public static <C extends IInventory, R extends ProcessingRecipe<C>> Optional<R> getRecipe(World world, C inv,
IRecipeType<R> type, Class<R> recipeClass) {
return getRecipe(world, inv.getStackInSlot(0), type, recipeClass).filter(r -> r.matches(inv, world));
//return getRecipe(world, inv.getStackInSlot(0), type, recipeClass).filter(r -> r.matches(inv, world));
return getRecipes(world, inv.getStackInSlot(0), type, recipeClass).filter(r -> r.matches(inv, world))
.findFirst();
}
public static <R extends ProcessingRecipe<?>> Optional<R> getRecipe(World world, ItemStack item,
@ -73,6 +77,24 @@ public class SequencedAssemblyRecipe implements IRecipe<RecipeWrapper> {
return Optional.empty();
}
public static <R extends ProcessingRecipe<?>> Stream<R> getRecipes(World world, ItemStack item,
IRecipeType<R> type, Class<R> recipeClass) {
List<SequencedAssemblyRecipe> all = world.getRecipeManager()
.<RecipeWrapper, SequencedAssemblyRecipe>listAllOfType(AllRecipeTypes.SEQUENCED_ASSEMBLY.getType());
return all.stream()
.filter(it -> it.appliesTo(item))
.map(it -> Pair.of(it, it.getNextRecipe(item).getRecipe()))
.filter(it -> it.getSecond()
.getType() == type && recipeClass.isInstance(it.getSecond()))
.map(it -> {
it.getSecond()
.enforceNextResult(() -> it.getFirst().advance(item));
return it.getSecond();
})
.map(recipeClass::cast);
}
private ItemStack advance(ItemStack input) {
int step = getStep(input);
if ((step + 1) / sequence.size() >= loops)

View file

@ -44,11 +44,11 @@ public abstract class ProcessingRecipe<T extends IInventory> implements IRecipe<
private IRecipeType<?> type;
private IRecipeSerializer<?> serializer;
private AllRecipeTypes enumType;
private Optional<Supplier<ItemStack>> forcedResult;
private Supplier<ItemStack> forcedResult;
public ProcessingRecipe(AllRecipeTypes recipeType, ProcessingRecipeParams params) {
this.forcedResult = Optional.empty();
this.forcedResult = null;
this.enumType = recipeType;
this.processingDuration = params.processingDuration;
this.fluidIngredients = params.fluidIngredients;
@ -144,7 +144,7 @@ public abstract class ProcessingRecipe<T extends IInventory> implements IRecipe<
}
public void enforceNextResult(Supplier<ItemStack> stack) {
forcedResult = Optional.of(stack);
forcedResult = stack;
}
public List<ItemStack> rollResults() {
@ -152,8 +152,7 @@ public abstract class ProcessingRecipe<T extends IInventory> implements IRecipe<
NonNullList<ProcessingOutput> rollableResults = getRollableResults();
for (int i = 0; i < rollableResults.size(); i++) {
ProcessingOutput output = rollableResults.get(i);
ItemStack stack = i == 0 && forcedResult.isPresent() ? forcedResult.get()
.get() : output.rollOutput();
ItemStack stack = i == 0 && forcedResult != null ? forcedResult.get() : output.rollOutput();
if (!stack.isEmpty())
results.add(stack);
}
@ -226,5 +225,5 @@ public abstract class ProcessingRecipe<T extends IInventory> implements IRecipe<
public AllRecipeTypes getEnumType() {
return enumType;
}
}

View file

@ -66,7 +66,7 @@ public class AssetLookup {
p.withExistingParent(c.getName(), p.modLoc(path));
};
}
public static <I extends Item> NonNullBiConsumer<DataGenContext<Item, I>, RegistrateItemModelProvider> customGenericItemModel(
String... folders) {
return (c, p) -> {
@ -110,6 +110,10 @@ public class AssetLookup {
return (c, p) -> p.getExistingFile(p.modLoc("item/" + c.getName()));
}
public static <T extends Item> NonNullBiConsumer<DataGenContext<Item, T>, RegistrateItemModelProvider> itemModel(String name) {
return (c, p) -> p.getExistingFile(p.modLoc("item/" + name));
}
public static <T extends Item> NonNullBiConsumer<DataGenContext<Item, T>, RegistrateItemModelProvider> itemModelWithPartials() {
return (c, p) -> p.withExistingParent("item/" + c.getName(), p.modLoc("item/" + c.getName() + "/item"));
}

View file

@ -50,11 +50,15 @@ public abstract class CreateRecipeProvider extends RecipeProvider {
static ITag.INamedTag<Item> redstone() {
return Tags.Items.DUSTS_REDSTONE;
}
static ITag.INamedTag<Item> planks() {
return ItemTags.PLANKS;
}
static ITag.INamedTag<Item> woodSlab() {
return ItemTags.WOODEN_SLABS;
}
static ITag.INamedTag<Item> gold() {
return AllTags.forgeItemTag("ingots/gold");
}
@ -78,7 +82,7 @@ public abstract class CreateRecipeProvider extends RecipeProvider {
static IItemProvider cog() {
return AllBlocks.COGWHEEL.get();
}
static IItemProvider largeCog() {
return AllBlocks.LARGE_COGWHEEL.get();
}
@ -98,7 +102,7 @@ public abstract class CreateRecipeProvider extends RecipeProvider {
static ITag.INamedTag<Item> iron() {
return Tags.Items.INGOTS_IRON;
}
static ITag.INamedTag<Item> ironNugget() {
return AllTags.forgeItemTag("nuggets/iron");
}
@ -142,7 +146,7 @@ public abstract class CreateRecipeProvider extends RecipeProvider {
static ITag.INamedTag<Item> copperSheet() {
return AllTags.forgeItemTag("plates/copper");
}
static ITag.INamedTag<Item> copperNugget() {
return AllTags.forgeItemTag("nuggets/copper");
}

View file

@ -6,9 +6,11 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
import com.simibubi.create.content.contraptions.components.saw.CuttingRecipe;
import com.simibubi.create.content.contraptions.itemAssembly.SequencedAssemblyRecipeBuilder;
import net.minecraft.data.DataGenerator;
import net.minecraft.item.ItemStack;
public class SequencedAssemblyRecipeGen extends CreateRecipeProvider {
@ -27,7 +29,7 @@ public class SequencedAssemblyRecipeGen extends CreateRecipeProvider {
// .addStep(CuttingRecipe::new, rb -> rb.averageProcessingDuration())
// .addStep(FillingRecipe::new, rb -> rb.require(Fluids.WATER, 100))
// )
CLOCKWORK_COMPONENT = create("clockwork_component", b -> b.require(I.goldSheet())
.transitionTo(AllItems.INCOMPLETE_CLOCKWORK_COMPONENT.get())
.addOutput(AllItems.CLOCKWORK_COMPONENT.get(), 12)
@ -38,6 +40,23 @@ public class SequencedAssemblyRecipeGen extends CreateRecipeProvider {
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(I.cog()))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(I.largeCog()))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(I.ironNugget()))
),
COGWHEEL = create("cogwheel", b -> b.require(I.shaft())
.transitionTo(AllItems.INCOMPLETE_COGWHEEL.get())
.addOutput(new ItemStack(AllBlocks.COGWHEEL.get(), 12), 12)
.loops(4)
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(I.planks()))
.addStep(CuttingRecipe::new, rb -> rb.duration(20))
.addStep(CuttingRecipe::new, rb -> rb.duration(40))
),
LARGE_COGWHEEL = create("large_cogwheel", b -> b.require(I.andesite())
.transitionTo(AllItems.INCOMPLETE_LARGE_COGWHEEL.get())
.addOutput(new ItemStack(AllBlocks.LARGE_COGWHEEL.get(), 3), 12)
.loops(8)
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(I.woodSlab()))
.addStep(CuttingRecipe::new, rb -> rb.duration(50))
)
;

View file

@ -0,0 +1,66 @@
{
"credit": "Made with Blockbench",
"parent": "create:block/large_wheels",
"texture_size": [32, 32],
"textures": {
"0": "create:block/axis",
"3": "create:block/axis_top",
"1_2": "create:block/cogwheel"
},
"elements": [
{
"name": "Axis",
"from": [6, 0, 6],
"to": [10, 16, 10],
"shade": false,
"faces": {
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
"south": {"uv": [6, 0, 10, 16], "texture": "#0"},
"west": {"uv": [6, 0, 10, 16], "texture": "#0"},
"up": {"uv": [6, 6, 10, 10], "texture": "#3"},
"down": {"uv": [6, 6, 10, 10], "texture": "#3"}
}
},
{
"name": "GearCaseInner",
"from": [2, 7, 2],
"to": [14, 9, 14],
"faces": {
"north": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"east": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"south": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"west": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"up": {"uv": [4, 0, 10, 6], "texture": "#1_2"},
"down": {"uv": [4, 0, 10, 6], "texture": "#1_2"}
}
},
{
"name": "GearCaseInnerDiagonal",
"from": [2, 7.1, 2],
"to": [14, 8.9, 14],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"east": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"south": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"west": {"uv": [0, 6, 6, 7], "texture": "#1_2"},
"up": {"uv": [4, 0, 10, 6], "texture": "#1_2"},
"down": {"uv": [4, 0, 10, 6], "texture": "#1_2"}
}
},
{
"name": "GearCaseOuter",
"from": [4, 6, 4],
"to": [12, 10, 12],
"faces": {
"north": {"uv": [0, 4, 4, 6], "texture": "#1_2"},
"east": {"uv": [0, 4, 4, 6], "texture": "#1_2"},
"south": {"uv": [0, 4, 4, 6], "texture": "#1_2"},
"west": {"uv": [0, 4, 4, 6], "texture": "#1_2"},
"up": {"uv": [0, 0, 4, 4], "texture": "#1_2"},
"down": {"uv": [0, 0, 4, 4], "texture": "#1_2"}
}
}
]
}

View file

@ -0,0 +1,119 @@
{
"credit": "Made with Blockbench",
"parent": "create:block/large_wheels",
"texture_size": [32, 32],
"textures": {
"0": "create:block/axis",
"3": "create:block/axis_top",
"particle": "block/stripped_spruce_log",
"4": "create:block/large_cogwheel"
},
"elements": [
{
"name": "GearCaseInnerRotated",
"from": [-2, 6.9, -2],
"to": [18, 8.9, 18],
"rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 10, 10, 11], "texture": "#4"},
"east": {"uv": [0, 10, 10, 11], "texture": "#4"},
"south": {"uv": [0, 10, 10, 11], "texture": "#4"},
"west": {"uv": [0, 10, 10, 11], "texture": "#4"},
"up": {"uv": [0, 0, 10, 10], "texture": "#4"},
"down": {"uv": [0, 0, 10, 10], "texture": "#4"}
}
},
{
"name": "Axis",
"from": [6, 0, 6],
"to": [10, 16, 10],
"shade": false,
"faces": {
"north": {"uv": [6, 0, 10, 16], "texture": "#0"},
"east": {"uv": [6, 0, 10, 16], "texture": "#0"},
"south": {"uv": [6, 0, 10, 16], "texture": "#0"},
"west": {"uv": [6, 0, 10, 16], "texture": "#0"},
"up": {"uv": [6, 6, 10, 10], "texture": "#3"},
"down": {"uv": [6, 6, 10, 10], "texture": "#3"}
}
},
{
"name": "GearCaseInner",
"from": [-2, 7, -2],
"to": [18, 9, 18],
"faces": {
"north": {"uv": [0, 10, 10, 11], "texture": "#4"},
"east": {"uv": [0, 10, 10, 11], "texture": "#4"},
"south": {"uv": [0, 10, 10, 11], "texture": "#4"},
"west": {"uv": [0, 10, 10, 11], "texture": "#4"},
"up": {"uv": [0, 0, 10, 10], "texture": "#4"},
"down": {"uv": [0, 0, 10, 10], "texture": "#4"}
}
},
{
"name": "GearCaseOuter",
"from": [1, 5.5, 1],
"to": [15, 10.5, 15],
"faces": {
"north": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"east": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"south": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"west": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"up": {"uv": [1.5, 1.5, 8.5, 8.5], "texture": "#4"},
"down": {"uv": [1.5, 1.5, 8.5, 8.5], "texture": "#4"}
}
},
{
"name": "GearCaseOuter",
"from": [-1, 5.5, 1],
"to": [1, 10.5, 15],
"faces": {
"north": {"uv": [10, 0, 12.5, 1], "rotation": 90, "texture": "#4"},
"east": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"south": {"uv": [10, 6, 12.5, 7], "rotation": 90, "texture": "#4"},
"west": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"up": {"uv": [7, 15, 14, 16], "rotation": 90, "texture": "#4"},
"down": {"uv": [7, 15, 14, 16], "rotation": 90, "texture": "#4"}
}
},
{
"name": "GearCaseOuter",
"from": [15, 5.5, 1],
"to": [17, 10.5, 15],
"faces": {
"north": {"uv": [10, 6, 12.5, 7], "rotation": 90, "texture": "#4"},
"east": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"south": {"uv": [10, 0, 12.5, 1], "rotation": 90, "texture": "#4"},
"west": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"up": {"uv": [0, 15, 7, 16], "rotation": 270, "texture": "#4"},
"down": {"uv": [0, 15, 7, 16], "rotation": 270, "texture": "#4"}
}
},
{
"name": "GearCaseOuter",
"from": [1, 5.5, -1],
"to": [15, 10.5, 1],
"faces": {
"north": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"east": {"uv": [10, 0, 12.5, 1], "rotation": 90, "texture": "#4"},
"south": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"west": {"uv": [10, 6, 12.5, 7], "rotation": 90, "texture": "#4"},
"up": {"uv": [7, 14, 14, 15], "rotation": 180, "texture": "#4"},
"down": {"uv": [0, 14, 7, 15], "texture": "#4"}
}
},
{
"name": "GearCaseOuter",
"from": [1, 5.5, 15],
"to": [15, 10.5, 17],
"faces": {
"north": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"east": {"uv": [10, 6, 12.5, 7], "rotation": 90, "texture": "#4"},
"south": {"uv": [10, 0, 12.5, 7], "rotation": 90, "texture": "#4"},
"west": {"uv": [10, 0, 12.5, 1], "rotation": 90, "texture": "#4"},
"up": {"uv": [0, 14, 7, 15], "texture": "#4"},
"down": {"uv": [7, 14, 14, 15], "rotation": 180, "texture": "#4"}
}
}
]
}