Reversing the reversed

- Controller rails can now control furnace minecarts
- Controller rails now snap to adjacent rails with the correct facing
- Controller rails no longer get reversed when transitioning to or from a slope in certain orientations
- Controller rails are now craftable
- Fun refactors
- Updated texture
- Recipe adjustments
This commit is contained in:
simibubi 2020-11-30 15:23:37 +01:00
parent a760ff8a79
commit ccae111ec8
22 changed files with 416 additions and 220 deletions

View file

@ -49,7 +49,7 @@ b59324f051f21d8ce1a48a08f4721a61a3c414d6 assets/create/blockstates/chute.json
1f33834c685e3243882acfe20183fe64dfa872be assets/create/blockstates/clutch.json
e5e3757e99c139d67b2a70288466d8a74d818841 assets/create/blockstates/cogwheel.json
36f54136a7756c97f71bc6b47ef4e8e575e72879 assets/create/blockstates/content_observer.json
41b173dd97b3006478796ff356f6ac15f3dfa980 assets/create/blockstates/controller_rail.json
cfea7283f0ebd2432d67e80a523f2a12e24c0bd5 assets/create/blockstates/controller_rail.json
f8eff64c75fc599e9a44a003f54ae9931cd8ce7c assets/create/blockstates/copper_block.json
cabf6b8c59eb0e3d56a0a5a856ca058bb3200882 assets/create/blockstates/copper_casing.json
3355a852cdc717e257ca19b3db836068964733e3 assets/create/blockstates/copper_ore.json
@ -138,7 +138,7 @@ de8a40b7daf1497d5aecee47a43b3e0b1d030b00 assets/create/blockstates/fancy_scoria_
fc9ac0a7e7191b93516719455a17177fa6524ecc assets/create/blockstates/fancy_weathered_limestone_bricks_slab.json
b2a7c321b1795f20e7433f81a55ce4683de081b8 assets/create/blockstates/fancy_weathered_limestone_bricks_stairs.json
6372fe02ba0065acb0758121c45a15a1a8fdc5de assets/create/blockstates/fancy_weathered_limestone_bricks_wall.json
7335a938fa5e80060cad2ed987afa123debb3998 assets/create/blockstates/fluid_pipe.json
fe9169716dd21a81a3710a89f0a9b7ea4dcd4d51 assets/create/blockstates/fluid_pipe.json
f0eaab18e16c4f3f65ebf3b55b08f0dc445720fe assets/create/blockstates/fluid_tank.json
5408d92ab02af86539ac42971d4033545970bb3a assets/create/blockstates/fluid_valve.json
e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json
@ -332,7 +332,7 @@ e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets/create/blockstates/powered_toggl
d06cd9a1101b18d306a786320aab12018b1325d6 assets/create/blockstates/purple_sail.json
92957119abd5fbcca36a113b2a80255fd70fc303 assets/create/blockstates/purple_seat.json
61035f8afe75ff7bbd291da5d8690bcbebe679eb assets/create/blockstates/purple_valve_handle.json
6fa36883e76e9e403bb429c8f86b8c0d3bba0cff assets/create/blockstates/radial_chassis.json
8d7e653bfd9846e684a0d3725595714a19201017 assets/create/blockstates/radial_chassis.json
45877c4d90a7185c2f304edbd67379d800920439 assets/create/blockstates/red_sail.json
da1b08387af7afa0855ee8d040f620c01f20660a assets/create/blockstates/red_seat.json
722fc77bbf387af8a4016e42cbf9501d2b968881 assets/create/blockstates/red_valve_handle.json
@ -1158,7 +1158,7 @@ c1da21be9f1af4f7a2ef4ec9cd92195d65ada316 assets/create/models/item/clockwork_bea
0a2a0f0aafeab0088172f77afd40c1fa2cc1f2b8 assets/create/models/item/clutch.json
dcb09deae110077bcddf090996b51cc66e9a7de3 assets/create/models/item/cogwheel.json
7717e3b21cff39f497f07687c70c1fa40eaa756d assets/create/models/item/content_observer.json
17a8889e54d6e82fd1a6eec9e87c46feba903cb1 assets/create/models/item/controller_rail.json
d6e8de74773f89c228d94d6da8cdd8fb8b8545e4 assets/create/models/item/controller_rail.json
965a90a882d85dba93b30af9bce7ecf8e68ce747 assets/create/models/item/copper_block.json
759bcb5fe7dfdd628716f9b4ff19a5ab00393381 assets/create/models/item/copper_casing.json
c5bcfba46f5824654dedaa2c5d5f42deb29e3baf assets/create/models/item/copper_ingot.json
@ -1591,6 +1591,7 @@ d3ca638ffbca177b4970f046f6c42770e757e33e data/create/advancements/recipes/create
a49a70403523bc9d4eadffdac5507806aca9fd9d data/create/advancements/recipes/create.base/crafting/kinetics/clockwork_bearing.json
403fd0da8ee42a52234e544cf532e454fb80137b data/create/advancements/recipes/create.base/crafting/kinetics/clutch.json
5bbaac432fce5435c8c3df56ec81d31a0b76a4ee data/create/advancements/recipes/create.base/crafting/kinetics/cogwheel.json
b42213bffce4e51618e1bba481959208d247c120 data/create/advancements/recipes/create.base/crafting/kinetics/controller_rail.json
27930edef02aac6e74bfab62128688ecfb575008 data/create/advancements/recipes/create.base/crafting/kinetics/copper_valve_handle.json
512e4d45657f6df3df2639040e8c5e76f9119f17 data/create/advancements/recipes/create.base/crafting/kinetics/copper_valve_handle_from_others.json
7b80f6b25e1e21e9545120592bc1a3561ee49603 data/create/advancements/recipes/create.base/crafting/kinetics/crafter_slot_cover.json
@ -2601,10 +2602,11 @@ c50077a130bc43cd3659faa02ce95789399478b2 data/create/recipes/crafting/kinetics/b
a3c99b38fc8896c9971a5e9dcbae747786ff610d data/create/recipes/crafting/kinetics/brown_seat_from_other_seat.json
43233c87cfb80d57345a561c3dd2646c8d3c0d8a data/create/recipes/crafting/kinetics/brown_valve_handle_from_other_valve_handle.json
860796dce8756c4cd234f18bbe52108f3b2254c2 data/create/recipes/crafting/kinetics/cart_assembler.json
3bc3510b64e576d68b19f4ceb5d9bd6591dbcf6c data/create/recipes/crafting/kinetics/chute.json
abf8a28b4b8ae4ba15beed938736ef3a5a7b27ff data/create/recipes/crafting/kinetics/chute.json
a80e3eabbeba2931d0d58dd9492018a0d78da8b5 data/create/recipes/crafting/kinetics/clockwork_bearing.json
501ad764d087b40ce36f3d4256b0d5ee25b2081e data/create/recipes/crafting/kinetics/clutch.json
e46bcc6778ff5118252fe6371ef817ae1302253a data/create/recipes/crafting/kinetics/cogwheel.json
11fe2ccc11f470e5735c3e848a944f889697ff73 data/create/recipes/crafting/kinetics/controller_rail.json
3093be508f6597eee2f3230cd9072f12d2821a6f data/create/recipes/crafting/kinetics/copper_valve_handle.json
886caa21481e62d44d70fd103f8d29f9bac64d60 data/create/recipes/crafting/kinetics/copper_valve_handle_from_others.json
59db5170cec390fe6c20a27d6154deebe044580c data/create/recipes/crafting/kinetics/crafter_slot_cover.json
@ -2760,6 +2762,7 @@ b83ef0af844ca068e0353330b8273bace5b6a8c3 data/create/recipes/crushing/coal_ore.j
da4ed79975391ec9f263869936b84474f1f727d3 data/create/recipes/crushing/copper_block.json
d49472887067c871943de1b80887b169682eeca9 data/create/recipes/crushing/copper_ore.json
4c482db5575b74b4111800602d7fce22b2e6d32a data/create/recipes/crushing/diamond_horse_armor.json
28ba8cf655bd11bb6c600cd862b98349c812915f data/create/recipes/crushing/diamond_ore.json
e1bb927c62c59f5bf5063bd110da9231de378a1f data/create/recipes/crushing/emerald_ore.json
b26b1f0dccf2ffb194ce12173890a83e93369b39 data/create/recipes/crushing/glowstone.json
50e75cdde6996c47b5dc25f27b84367040249107 data/create/recipes/crushing/gold_ore.json

View file

@ -16,13 +16,13 @@
"y": 90
},
"backwards=false,shape=ascending_east": {
"model": "create:block/controller_rail/block_ascending_north",
"y": 90
},
"backwards=true,shape=ascending_east": {
"model": "create:block/controller_rail/block_ascending_south",
"y": 270
},
"backwards=true,shape=ascending_east": {
"model": "create:block/controller_rail/block_ascending_north",
"y": 90
},
"backwards=false,shape=ascending_west": {
"model": "create:block/controller_rail/block_ascending_north",
"y": 270
@ -39,11 +39,11 @@
"y": 180
},
"backwards=false,shape=ascending_south": {
"model": "create:block/controller_rail/block_ascending_north",
"y": 180
"model": "create:block/controller_rail/block_ascending_south"
},
"backwards=true,shape=ascending_south": {
"model": "create:block/controller_rail/block_ascending_south"
"model": "create:block/controller_rail/block_ascending_north",
"y": 180
}
}
}

View file

@ -303,8 +303,8 @@
{
"when": {
"west": "false",
"down": "false",
"east": "true",
"down": "false",
"up": "true"
},
"apply": {
@ -314,8 +314,8 @@
{
"when": {
"west": "true",
"down": "false",
"east": "false",
"down": "false",
"up": "true"
},
"apply": {
@ -325,8 +325,8 @@
{
"when": {
"west": "false",
"down": "true",
"east": "true",
"down": "true",
"up": "false"
},
"apply": {
@ -336,8 +336,8 @@
{
"when": {
"west": "true",
"down": "true",
"east": "false",
"down": "true",
"up": "false"
},
"apply": {
@ -347,8 +347,8 @@
{
"when": {
"west": "false",
"down": "true",
"east": "false",
"down": "true",
"up": "true"
},
"apply": {
@ -358,8 +358,8 @@
{
"when": {
"west": "false",
"down": "false",
"east": "false",
"down": "false",
"up": "true"
},
"apply": {
@ -369,8 +369,8 @@
{
"when": {
"west": "false",
"down": "true",
"east": "false",
"down": "true",
"up": "false"
},
"apply": {
@ -380,8 +380,8 @@
{
"when": {
"west": "true",
"down": "false",
"east": "true",
"down": "false",
"up": "false"
},
"apply": {
@ -391,8 +391,8 @@
{
"when": {
"west": "false",
"down": "false",
"east": "true",
"down": "false",
"up": "false"
},
"apply": {
@ -402,8 +402,8 @@
{
"when": {
"west": "true",
"down": "false",
"east": "false",
"down": "false",
"up": "false"
},
"apply": {
@ -413,8 +413,8 @@
{
"when": {
"west": "false",
"down": "false",
"east": "false",
"down": "false",
"up": "false"
},
"apply": {

View file

@ -1,6 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:block/controller_rail_analog"
"layer0": "create:block/controller_rail_item"
}
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/kinetics/controller_rail"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "minecraft:powered_rail"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/kinetics/controller_rail"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -13,6 +13,7 @@
}
},
"result": {
"item": "create:chute"
"item": "create:chute",
"count": 4
}
}

View file

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"A A",
"ASA",
"AEA"
],
"key": {
"A": {
"tag": "forge:ingots/gold"
},
"E": {
"item": "create:electron_tube"
},
"S": {
"tag": "forge:rods/wooden"
}
},
"result": {
"item": "create:controller_rail",
"count": 6
}
}

View file

@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "minecraft:diamond_ore"
}
],
"results": [
{
"item": "minecraft:diamond",
"count": 2
},
{
"item": "minecraft:diamond",
"chance": 0.25
},
{
"item": "minecraft:cobblestone",
"chance": 0.125
}
],
"processingTime": 500
}

View file

@ -1,10 +1,29 @@
package com.simibubi.create;
import static com.simibubi.create.AllMovementBehaviours.addMovementBehaviour;
import static com.simibubi.create.AllTags.tagBlockAndItem;
import static com.simibubi.create.content.AllSections.SCHEMATICS;
import static com.simibubi.create.foundation.data.BlockStateGen.axisBlock;
import static com.simibubi.create.foundation.data.BlockStateGen.oxidizedBlockstate;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
import static com.simibubi.create.foundation.data.ModelGen.oxidizedItemModel;
import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.content.AllSections;
import com.simibubi.create.content.contraptions.base.CasingBlock;
import com.simibubi.create.content.contraptions.components.actors.*;
import com.simibubi.create.content.contraptions.components.actors.DrillBlock;
import com.simibubi.create.content.contraptions.components.actors.DrillMovementBehaviour;
import com.simibubi.create.content.contraptions.components.actors.HarvesterBlock;
import com.simibubi.create.content.contraptions.components.actors.HarvesterMovementBehaviour;
import com.simibubi.create.content.contraptions.components.actors.PloughBlock;
import com.simibubi.create.content.contraptions.components.actors.PloughMovementBehaviour;
import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceBlock;
import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceMovement;
import com.simibubi.create.content.contraptions.components.actors.SawMovementBehaviour;
import com.simibubi.create.content.contraptions.components.actors.SeatBlock;
import com.simibubi.create.content.contraptions.components.actors.SeatMovementBehaviour;
import com.simibubi.create.content.contraptions.components.clock.CuckooClockBlock;
import com.simibubi.create.content.contraptions.components.crafter.CrafterCTBehaviour;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterBlock;
@ -27,7 +46,11 @@ import com.simibubi.create.content.contraptions.components.motor.CreativeMotorGe
import com.simibubi.create.content.contraptions.components.press.MechanicalPressBlock;
import com.simibubi.create.content.contraptions.components.saw.SawBlock;
import com.simibubi.create.content.contraptions.components.saw.SawGenerator;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.*;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.ClockworkBearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.SailBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.StabilizedBearingMovementBehaviour;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.WindmillBearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.LinearChassisBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.LinearChassisBlock.ChassisCTBehaviour;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.RadialChassisBlock;
@ -39,6 +62,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pis
import com.simibubi.create.content.contraptions.components.structureMovement.piston.PistonExtensionPoleBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock;
import com.simibubi.create.content.contraptions.components.tracks.ControllerRailBlock;
import com.simibubi.create.content.contraptions.components.tracks.ControllerRailGenerator;
import com.simibubi.create.content.contraptions.components.tracks.ReinforcedRailBlock;
import com.simibubi.create.content.contraptions.components.turntable.TurntableBlock;
import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelBlock;
@ -47,7 +71,15 @@ import com.simibubi.create.content.contraptions.fluids.PumpBlock;
import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyBlock;
import com.simibubi.create.content.contraptions.fluids.actors.ItemDrainBlock;
import com.simibubi.create.content.contraptions.fluids.actors.SpoutBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.*;
import com.simibubi.create.content.contraptions.fluids.pipes.BracketBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.BracketBlockItem;
import com.simibubi.create.content.contraptions.fluids.pipes.BracketGenerator;
import com.simibubi.create.content.contraptions.fluids.pipes.EncasedPipeBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.FluidValveBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.GlassFluidPipeBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeGenerator;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankBlock;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankGenerator;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankItem;
@ -69,7 +101,12 @@ import com.simibubi.create.content.contraptions.relays.elementary.BracketedKinet
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
import com.simibubi.create.content.contraptions.relays.elementary.CogwheelBlockItem;
import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock;
import com.simibubi.create.content.contraptions.relays.encased.*;
import com.simibubi.create.content.contraptions.relays.encased.AdjustablePulleyBlock;
import com.simibubi.create.content.contraptions.relays.encased.ClutchBlock;
import com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock;
import com.simibubi.create.content.contraptions.relays.encased.EncasedBeltGenerator;
import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftBlock;
import com.simibubi.create.content.contraptions.relays.encased.GearshiftBlock;
import com.simibubi.create.content.contraptions.relays.gauge.GaugeBlock;
import com.simibubi.create.content.contraptions.relays.gauge.GaugeGenerator;
import com.simibubi.create.content.contraptions.relays.gearbox.GearboxBlock;
@ -80,22 +117,49 @@ import com.simibubi.create.content.logistics.block.chute.ChuteBlock;
import com.simibubi.create.content.logistics.block.chute.ChuteGenerator;
import com.simibubi.create.content.logistics.block.chute.ChuteItem;
import com.simibubi.create.content.logistics.block.depot.DepotBlock;
import com.simibubi.create.content.logistics.block.diodes.*;
import com.simibubi.create.content.logistics.block.funnel.*;
import com.simibubi.create.content.logistics.block.diodes.AbstractDiodeGenerator;
import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterBlock;
import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterGenerator;
import com.simibubi.create.content.logistics.block.diodes.PoweredLatchBlock;
import com.simibubi.create.content.logistics.block.diodes.PoweredLatchGenerator;
import com.simibubi.create.content.logistics.block.diodes.PulseRepeaterBlock;
import com.simibubi.create.content.logistics.block.diodes.PulseRepeaterGenerator;
import com.simibubi.create.content.logistics.block.diodes.ToggleLatchBlock;
import com.simibubi.create.content.logistics.block.diodes.ToggleLatchGenerator;
import com.simibubi.create.content.logistics.block.funnel.AndesiteBeltFunnelBlock;
import com.simibubi.create.content.logistics.block.funnel.AndesiteFunnelBlock;
import com.simibubi.create.content.logistics.block.funnel.BeltFunnelGenerator;
import com.simibubi.create.content.logistics.block.funnel.BrassBeltFunnelBlock;
import com.simibubi.create.content.logistics.block.funnel.BrassFunnelBlock;
import com.simibubi.create.content.logistics.block.funnel.FunnelMovementBehaviour;
import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateBlock;
import com.simibubi.create.content.logistics.block.inventories.CreativeCrateBlock;
import com.simibubi.create.content.logistics.block.mechanicalArm.ArmBlock;
import com.simibubi.create.content.logistics.block.mechanicalArm.ArmItem;
import com.simibubi.create.content.logistics.block.redstone.*;
import com.simibubi.create.content.logistics.block.redstone.AnalogLeverBlock;
import com.simibubi.create.content.logistics.block.redstone.ContactMovementBehaviour;
import com.simibubi.create.content.logistics.block.redstone.ContentObserverBlock;
import com.simibubi.create.content.logistics.block.redstone.NixieTubeBlock;
import com.simibubi.create.content.logistics.block.redstone.NixieTubeGenerator;
import com.simibubi.create.content.logistics.block.redstone.RedstoneContactBlock;
import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkBlock;
import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkGenerator;
import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchBlock;
import com.simibubi.create.content.palettes.MetalBlock;
import com.simibubi.create.content.schematics.block.SchematicTableBlock;
import com.simibubi.create.content.schematics.block.SchematicannonBlock;
import com.simibubi.create.foundation.config.StressConfigDefaults;
import com.simibubi.create.foundation.data.*;
import com.simibubi.create.foundation.data.AssetLookup;
import com.simibubi.create.foundation.data.BlockStateGen;
import com.simibubi.create.foundation.data.BuilderTransformers;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.ModelGen;
import com.simibubi.create.foundation.data.SharedProperties;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.simibubi.create.foundation.worldgen.OxidizingBlock;
import com.tterrag.registrate.util.entry.BlockEntry;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.SoundType;
@ -112,15 +176,6 @@ import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.common.Tags;
import net.minecraftforge.common.ToolType;
import static com.simibubi.create.AllMovementBehaviours.addMovementBehaviour;
import static com.simibubi.create.AllTags.tagBlockAndItem;
import static com.simibubi.create.content.AllSections.SCHEMATICS;
import static com.simibubi.create.foundation.data.BlockStateGen.axisBlock;
import static com.simibubi.create.foundation.data.BlockStateGen.oxidizedBlockstate;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
import static com.simibubi.create.foundation.data.ModelGen.oxidizedItemModel;
public class AllBlocks {
private static final CreateRegistrate REGISTRATE = Create.registrate()
@ -685,14 +740,13 @@ public class AllBlocks {
public static final BlockEntry<ControllerRailBlock> CONTROLLER_RAIL =
REGISTRATE.block("controller_rail", ControllerRailBlock::new)
.initialProperties(() -> Blocks.POWERED_RAIL)
.blockstate(BlockStateGen.controllerRail())
.blockstate(new ControllerRailGenerator()::generate)
.addLayer(() -> RenderType::getCutoutMipped)
.onRegister(CreateRegistrate.blockColors(() -> AllColorHandlers::getRedstonePower))
//.onRegister(CreateRegistrate.blockColorProperty(ControllerRailBlock.POWER))
.tag(BlockTags.RAILS)
.item()
.model((c, p) -> p.generated(c, Create.asResource("block/controller_rail_analog")))
.build()
.model((c, p) -> p.generated(c, Create.asResource("block/" + c.getName() + "_item")))
.build()
.register();
public static final BlockEntry<MinecartAnchorBlock> MINECART_ANCHOR =

View file

@ -1,19 +1,35 @@
package com.simibubi.create.content.contraptions.components.tracks;
import static net.minecraft.state.properties.RailShape.NORTH_SOUTH;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.VecHelper;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
import net.minecraft.entity.item.minecart.FurnaceMinecartEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext;
import net.minecraft.state.*;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.IProperty;
import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.RailShape;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
@ -23,67 +39,94 @@ import net.minecraft.util.math.Vec3i;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import static net.minecraft.state.properties.RailShape.*;
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@SuppressWarnings("deprecation")
public class ControllerRailBlock extends AbstractRailBlock implements IWrenchable {
public static final EnumProperty<RailShape> SHAPE = BlockStateProperties.RAIL_SHAPE_STRAIGHT;
public static final BooleanProperty BACKWARDS = BooleanProperty.create("backwards");
/*
* SHAPE | BACKWARDS | FACING
* N/S FALSE North
* N/S TRUE South
* E/W FALSE West
* E/W TRUE East
* ASC_X FALSE X
* ASC_X TRUE X.opposite()
* */
public static final IntegerProperty POWER = BlockStateProperties.POWER_0_15;
public ControllerRailBlock(Properties properties) {
super(true, properties);
this.setDefaultState(this.stateContainer.getBaseState().with(POWER, 0).with(BACKWARDS, false).with(SHAPE, NORTH_SOUTH));
this.setDefaultState(this.stateContainer.getBaseState()
.with(POWER, 0)
.with(BACKWARDS, false)
.with(SHAPE, NORTH_SOUTH));
}
private static Vec3i getAccelerationVector(BlockState state) {
Direction pointingTo = getPointingTowards(state);
return (state.get(BACKWARDS) ? pointingTo.getOpposite() : pointingTo).getDirectionVec();
return (isStateBackwards(state) ? pointingTo.getOpposite() : pointingTo).getDirectionVec();
}
private static Direction getPointingTowards(BlockState state) {
switch (state.get(SHAPE)) {
case ASCENDING_WEST:
case EAST_WEST:
return Direction.WEST;
case ASCENDING_EAST:
return Direction.EAST;
case ASCENDING_SOUTH:
return Direction.SOUTH;
default:
return Direction.NORTH;
case ASCENDING_WEST:
case EAST_WEST:
return Direction.WEST;
case ASCENDING_EAST:
return Direction.EAST;
case ASCENDING_SOUTH:
return Direction.SOUTH;
default:
return Direction.NORTH;
}
}
@Override
protected BlockState getUpdatedState(World world, BlockPos pos, BlockState state, boolean p_208489_4_) {
BlockState updatedState = super.getUpdatedState(world, pos, state, p_208489_4_);
if (updatedState.get(SHAPE) == state.get(SHAPE))
return updatedState;
BlockState reversedUpdatedState = updatedState;
// Rails snapping to others at 90 degrees should follow their direction
if (getPointingTowards(state).getAxis() != getPointingTowards(updatedState).getAxis()) {
for (boolean opposite : Iterate.trueAndFalse) {
Direction offset = getPointingTowards(updatedState);
if (opposite)
offset = offset.getOpposite();
for (BlockPos adjPos : Iterate.hereBelowAndAbove(pos.offset(offset))) {
BlockState adjState = world.getBlockState(adjPos);
if (!AllBlocks.CONTROLLER_RAIL.has(adjState))
continue;
if (getPointingTowards(adjState).getAxis() != offset.getAxis())
continue;
if (adjState.get(BACKWARDS) != reversedUpdatedState.get(BACKWARDS))
reversedUpdatedState = reversedUpdatedState.cycle(BACKWARDS);
}
}
}
// Replace if changed
if (reversedUpdatedState != updatedState)
world.setBlockState(pos, reversedUpdatedState);
return reversedUpdatedState;
}
private static void decelerateCart(BlockPos pos, AbstractMinecartEntity cart) {
Vec3d diff = VecHelper.getCenterOf(pos).subtract(cart.getPositionVec());
Vec3d diff = VecHelper.getCenterOf(pos)
.subtract(cart.getPositionVec());
cart.setMotion(diff.x / 16f, 0, diff.z / 16f);
if (cart instanceof FurnaceMinecartEntity) {
FurnaceMinecartEntity fme = (FurnaceMinecartEntity) cart;
fme.pushX = fme.pushZ = 0;
}
}
private static boolean isStableWith(BlockState testState, IBlockReader world, BlockPos pos) {
return hasSolidSideOnTop(world, pos.down()) && (!testState.get(SHAPE).isAscending() || hasSolidSideOnTop(world, pos.offset(getPointingTowards(testState))));
return hasSolidSideOnTop(world, pos.down()) && (!testState.get(SHAPE)
.isAscending() || hasSolidSideOnTop(world, pos.offset(getPointingTowards(testState))));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_) {
Direction direction = p_196258_1_.getPlacementHorizontalFacing();
BlockState base = super.getStateForPlacement(p_196258_1_);
return (base == null ? getDefaultState() : base).with(BACKWARDS, direction == Direction.SOUTH || direction == Direction.EAST);
return (base == null ? getDefaultState() : base).with(BACKWARDS,
direction.getAxisDirection() == AxisDirection.POSITIVE);
}
@Override
@ -101,8 +144,16 @@ public class ControllerRailBlock extends AbstractRailBlock implements IWrenchabl
if (world.isRemote)
return;
Vec3d accelerationVec = new Vec3d(getAccelerationVector(state));
double targetSpeed = cart.getMaxSpeedWithRail() * state.get(POWER) / 15.;
if ((cart.getMotion().dotProduct(accelerationVec) >= 0 || cart.getMotion().lengthSquared() < 0.0001) && targetSpeed > 0)
double targetSpeed = cart.getMaxSpeedWithRail() * state.get(POWER) / 15f;
if (cart instanceof FurnaceMinecartEntity) {
FurnaceMinecartEntity fme = (FurnaceMinecartEntity) cart;
fme.pushX = accelerationVec.x;
fme.pushZ = accelerationVec.z;
}
Vec3d motion = cart.getMotion();
if ((motion.dotProduct(accelerationVec) >= 0 || motion.lengthSquared() < 0.0001) && targetSpeed > 0)
cart.setMotion(accelerationVec.scale(targetSpeed));
else
decelerateCart(pos, cart);
@ -147,105 +198,27 @@ public class ControllerRailBlock extends AbstractRailBlock implements IWrenchabl
if (backwardsPower != 0)
break;
}
if (forwardDistance > 8 && backwardsDistance > 8)
return 0;
else if (backwardsPower == 0 && forwardDistance <= 8)
if (backwardsPower == 0 && forwardDistance <= 8)
return forwardPower;
else if (forwardPower == 0 && backwardsDistance <= 8)
if (forwardPower == 0 && backwardsDistance <= 8)
return backwardsPower;
else if (backwardsPower != 0 && forwardPower != 0)
return MathHelper.ceil((backwardsPower * forwardDistance + forwardPower * backwardsDistance) / (double) (forwardDistance + backwardsDistance));
if (backwardsPower != 0 && forwardPower != 0)
return MathHelper.ceil((backwardsPower * forwardDistance + forwardPower * backwardsDistance)
/ (double) (forwardDistance + backwardsDistance));
return 0;
}
@Override
public BlockState rotate(BlockState p_185499_1_, Rotation p_185499_2_) {
switch (p_185499_2_) {
case CLOCKWISE_180:
switch (p_185499_1_.get(SHAPE)) {
case ASCENDING_EAST:
return p_185499_1_.with(SHAPE, ASCENDING_WEST);
case ASCENDING_WEST:
return p_185499_1_.with(SHAPE, ASCENDING_EAST);
case ASCENDING_NORTH:
return p_185499_1_.with(SHAPE, ASCENDING_SOUTH);
case ASCENDING_SOUTH:
return p_185499_1_.with(SHAPE, ASCENDING_NORTH);
default:
return p_185499_1_.with(BACKWARDS, !p_185499_1_.get(BACKWARDS));
}
case COUNTERCLOCKWISE_90:
switch (p_185499_1_.get(SHAPE)) {
case ASCENDING_EAST:
return p_185499_1_.with(SHAPE, ASCENDING_NORTH);
case ASCENDING_WEST:
return p_185499_1_.with(SHAPE, ASCENDING_SOUTH);
case ASCENDING_NORTH:
return p_185499_1_.with(SHAPE, ASCENDING_WEST);
case ASCENDING_SOUTH:
return p_185499_1_.with(SHAPE, ASCENDING_EAST);
case NORTH_SOUTH:
return p_185499_1_.with(SHAPE, EAST_WEST);
case EAST_WEST:
return p_185499_1_.with(SHAPE, NORTH_SOUTH).with(BACKWARDS, !p_185499_1_.get(BACKWARDS));
}
case CLOCKWISE_90:
switch (p_185499_1_.get(SHAPE)) {
case ASCENDING_EAST:
return p_185499_1_.with(SHAPE, ASCENDING_SOUTH);
case ASCENDING_WEST:
return p_185499_1_.with(SHAPE, ASCENDING_NORTH);
case ASCENDING_NORTH:
return p_185499_1_.with(SHAPE, ASCENDING_EAST);
case ASCENDING_SOUTH:
return p_185499_1_.with(SHAPE, ASCENDING_WEST);
case NORTH_SOUTH:
return p_185499_1_.with(SHAPE, EAST_WEST).with(BACKWARDS, !p_185499_1_.get(BACKWARDS));
case EAST_WEST:
return p_185499_1_.with(SHAPE, NORTH_SOUTH);
}
default:
return p_185499_1_;
}
}
@Override
public BlockState mirror(BlockState p_185471_1_, Mirror p_185471_2_) {
RailShape railshape = p_185471_1_.get(SHAPE);
switch (p_185471_2_) {
case LEFT_RIGHT:
switch (railshape) {
case ASCENDING_NORTH:
return p_185471_1_.with(SHAPE, RailShape.ASCENDING_SOUTH);
case ASCENDING_SOUTH:
return p_185471_1_.with(SHAPE, RailShape.ASCENDING_NORTH);
case NORTH_SOUTH:
return p_185471_1_.with(BACKWARDS, !p_185471_1_.get(BACKWARDS));
default:
return super.mirror(p_185471_1_, p_185471_2_);
}
case FRONT_BACK:
switch (railshape) {
case ASCENDING_EAST:
return p_185471_1_.with(SHAPE, RailShape.ASCENDING_WEST);
case ASCENDING_WEST:
return p_185471_1_.with(SHAPE, RailShape.ASCENDING_EAST);
case EAST_WEST:
return p_185471_1_.with(BACKWARDS, !p_185471_1_.get(BACKWARDS));
default:
break;
}
}
return super.mirror(p_185471_1_, p_185471_2_);
}
@Override
public ActionResultType onWrenched(BlockState state, ItemUseContext context) {
World world = context.getWorld();
if (world.isRemote)
return ActionResultType.SUCCESS;
BlockPos pos = context.getPos();
for (Rotation testRotation : new Rotation[]{Rotation.CLOCKWISE_90, Rotation.CLOCKWISE_180, Rotation.COUNTERCLOCKWISE_90}) {
for (Rotation testRotation : new Rotation[] { Rotation.CLOCKWISE_90, Rotation.CLOCKWISE_180,
Rotation.COUNTERCLOCKWISE_90 }) {
BlockState testState = rotate(state, testRotation);
if (isStableWith(testState, world, pos)) {
placeAndNotify(testState, pos, world);
@ -268,7 +241,8 @@ public class ControllerRailBlock extends AbstractRailBlock implements IWrenchabl
private void placeAndNotify(BlockState state, BlockPos pos, World world) {
world.setBlockState(pos, state, 3);
world.notifyNeighborsOfStateChange(pos.down(), this);
if (state.get(SHAPE).isAscending())
if (state.get(SHAPE)
.isAscending())
world.notifyNeighborsOfStateChange(pos.up(), this);
}
@ -279,11 +253,13 @@ public class ControllerRailBlock extends AbstractRailBlock implements IWrenchabl
return null;
Vec3i accelerationVec = getAccelerationVector(current);
BlockPos baseTestPos = reversed ? from.subtract(accelerationVec) : from.add(accelerationVec);
for (BlockPos testPos : new BlockPos[]{baseTestPos, baseTestPos.down(), baseTestPos.up()}) {
if (testPos.getY() > from.getY() && !current.get(SHAPE).isAscending())
for (BlockPos testPos : Iterate.hereBelowAndAbove(baseTestPos)) {
if (testPos.getY() > from.getY() && !current.get(SHAPE)
.isAscending())
continue;
BlockState testState = world.getBlockState(testPos);
if (testState.getBlock() instanceof ControllerRailBlock && getAccelerationVector(testState).equals(accelerationVec))
if (testState.getBlock() instanceof ControllerRailBlock
&& getAccelerationVector(testState).equals(accelerationVec))
return testPos;
}
return null;
@ -298,4 +274,47 @@ public class ControllerRailBlock extends AbstractRailBlock implements IWrenchabl
public int getComparatorInputOverride(BlockState state, World world, BlockPos pos) {
return state.get(POWER);
}
@Override
public BlockState rotate(BlockState state, Rotation rotation) {
if (rotation == Rotation.NONE)
return state;
RailShape railshape = Blocks.POWERED_RAIL.getDefaultState()
.with(SHAPE, state.get(SHAPE))
.rotate(rotation)
.get(SHAPE);
state = state.with(SHAPE, railshape);
if (rotation == Rotation.CLOCKWISE_180
|| (getPointingTowards(state).getAxis() == Axis.Z) == (rotation == Rotation.COUNTERCLOCKWISE_90))
return state.cycle(BACKWARDS);
return state;
}
@Override
public BlockState mirror(BlockState state, Mirror mirror) {
if (mirror == Mirror.NONE)
return state;
RailShape railshape = Blocks.POWERED_RAIL.getDefaultState()
.with(SHAPE, state.get(SHAPE))
.mirror(mirror)
.get(SHAPE);
state = state.with(SHAPE, railshape);
if ((getPointingTowards(state).getAxis() == Axis.Z) == (mirror == Mirror.LEFT_RIGHT))
return state.cycle(BACKWARDS);
return state;
}
public static boolean isStateBackwards(BlockState state) {
return state.get(BACKWARDS) ^ isReversedSlope(state);
}
public static boolean isReversedSlope(BlockState state) {
return state.get(SHAPE) == RailShape.ASCENDING_SOUTH || state.get(SHAPE) == RailShape.ASCENDING_EAST;
}
}

View file

@ -0,0 +1,55 @@
package com.simibubi.create.content.contraptions.components.tracks;
import com.simibubi.create.foundation.data.AssetLookup;
import com.simibubi.create.foundation.data.SpecialBlockStateGen;
import com.tterrag.registrate.providers.DataGenContext;
import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.state.IProperty;
import net.minecraft.state.properties.RailShape;
import net.minecraftforge.client.model.generators.ModelFile;
public class ControllerRailGenerator extends SpecialBlockStateGen {
@Override
protected IProperty<?>[] getIgnoredProperties() {
return new IProperty<?>[] { ControllerRailBlock.POWER };
}
@Override
protected int getXRotation(BlockState state) {
return 0;
}
@Override
protected int getYRotation(BlockState state) {
RailShape shape = state.get(ControllerRailBlock.SHAPE);
boolean backwards = ControllerRailBlock.isStateBackwards(state);
int rotation = backwards ? 180 : 0;
switch (shape) {
case EAST_WEST:
case ASCENDING_WEST:
return rotation + 270;
case ASCENDING_EAST:
return rotation + 90;
case ASCENDING_SOUTH:
return rotation + 180;
default:
return rotation;
}
}
@Override
public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov,
BlockState state) {
RailShape shape = state.get(ControllerRailBlock.SHAPE);
boolean backwards = ControllerRailBlock.isStateBackwards(state);
String model = shape.isAscending() ? backwards ? "ascending_south" : "ascending_north" : "north_south";
return AssetLookup.partialBaseModel(ctx, prov, model);
}
}

View file

@ -1,6 +1,16 @@
package com.simibubi.create.foundation.data;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.function.BiFunction;
import java.util.function.Function;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock;
@ -8,7 +18,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.cha
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.RadialChassisBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssembleRailType;
import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerBlock;
import com.simibubi.create.content.contraptions.components.tracks.ControllerRailBlock;
import com.simibubi.create.content.contraptions.components.tracks.ReinforcedRailBlock;
import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock;
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock;
@ -21,6 +30,7 @@ import com.tterrag.registrate.providers.DataGenContext;
import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import com.tterrag.registrate.util.nullness.NonNullBiConsumer;
import com.tterrag.registrate.util.nullness.NonNullUnaryOperator;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.state.BooleanProperty;
@ -33,11 +43,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder;
import org.apache.commons.lang3.tuple.Pair;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
public class BlockStateGen {
@ -428,47 +433,4 @@ public class BlockStateGen {
.condition(propertyMap.get(Pointing.DOWN.getCombinedDirection(positiveAxis)), down)
.end();
}
public static NonNullBiConsumer<DataGenContext<Block, ControllerRailBlock>, RegistrateBlockstateProvider> controllerRail() {
return (c, p) -> p.getVariantBuilder(c.get())
.forAllStatesExcept(state -> {
//int power = state.get(ControllerRailBlock.POWER);
boolean backwards = state.get(ControllerRailBlock.BACKWARDS);
//String powerStr = power == 0 ? "off" : (power == 15 ? "on" : "analog");
RailShape shape = state.get(ControllerRailBlock.SHAPE);
String shapeName = shape.isAscending() ? RailShape.ASCENDING_NORTH.getName() : RailShape.NORTH_SOUTH.getName();
int rotation = 0;
switch (shape) {
case EAST_WEST:
rotation += 270;
shapeName = RailShape.NORTH_SOUTH.getName();
break;
case ASCENDING_EAST:
rotation += 90;
break;
case ASCENDING_SOUTH:
rotation += 180;
break;
case ASCENDING_WEST:
rotation += 270;
break;
default:
break;
}
if (backwards) {
rotation += 180;
shapeName = shape.isAscending() ? RailShape.ASCENDING_SOUTH.getName() : RailShape.NORTH_SOUTH.getName();
}
return ConfiguredModel.builder()
.modelFile(p.models()
.getExistingFile(p.modLoc(
"block/" + c.getName() + "/block_" + shapeName)))
.rotationY(rotation % 360)
.build();
}, ControllerRailBlock.POWER);
}
}

View file

@ -5,21 +5,26 @@ import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.state.IProperty;
import net.minecraft.util.Direction;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ModelFile;
public abstract class SpecialBlockStateGen {
protected IProperty<?>[] getIgnoredProperties() {
return new IProperty<?>[0];
}
public final <T extends Block> void generate(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov) {
prov.getVariantBuilder(ctx.getEntry())
.forAllStates(state -> {
.forAllStatesExcept(state -> {
return ConfiguredModel.builder()
.modelFile(getModel(ctx, prov, state))
.rotationX((getXRotation(state) + 360) % 360)
.rotationY((getYRotation(state) + 360) % 360)
.build();
});
}, getIgnoredProperties());
}
protected int horizontalAngle(Direction direction) {

View file

@ -75,6 +75,11 @@ public class CrushingRecipeGen extends ProcessingRecipeGen {
.output(Items.EMERALD, 2)
.output(.25f, Items.EMERALD, 1)
.output(.125f, Blocks.COBBLESTONE)),
DIAMOND_ORE = create(() -> Blocks.DIAMOND_ORE, b -> b.duration(500)
.output(Items.DIAMOND, 2)
.output(.25f, Items.DIAMOND, 1)
.output(.125f, Blocks.COBBLESTONE)),
NETHER_WART_NO_QUARK = create("nether_wart_block_no_quark", b -> b.duration(150)
.require(Blocks.NETHER_WART_BLOCK)

View file

@ -329,6 +329,15 @@ public class StandardRecipeGen extends CreateRecipeProvider {
.patternLine("CRC")
.patternLine("L L")),
CONTROLLER_RAIL = create(AllBlocks.CONTROLLER_RAIL).returns(6)
.unlockedBy(() -> Items.POWERED_RAIL)
.viaShaped(b -> b.key('A', I.gold())
.key('E', I.electronTube())
.key('S', Tags.Items.RODS_WOODEN)
.patternLine("A A")
.patternLine("ASA")
.patternLine("AEA")),
HAND_CRANK = create(AllBlocks.HAND_CRANK).unlockedBy(I::andesite)
.viaShaped(b -> b.key('A', I.andesite())
.key('C', ItemTags.PLANKS)
@ -536,6 +545,7 @@ public class StandardRecipeGen extends CreateRecipeProvider {
.patternLine("AA")),
CHUTE = create(AllBlocks.CHUTE).unlockedBy(I::andesite)
.returns(4)
.viaShaped(b -> b.key('A', I.ironSheet())
.key('I', I.andesite())
.patternLine("II")

View file

@ -38,4 +38,8 @@ public class Iterate {
public static List<BlockPos> hereAndBelow(BlockPos pos) {
return Arrays.asList(pos, pos.down());
}
public static List<BlockPos> hereBelowAndAbove(BlockPos pos) {
return Arrays.asList(pos, pos.down(), pos.up());
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 585 B