From 57608efe94d525beb26cd94b550016a4d5a8e98f Mon Sep 17 00:00:00 2001 From: Halbear Date: Fri, 6 Feb 2026 04:22:36 +0000 Subject: [PATCH] placement checking for multi blocks and tidying up some functions --- .../steampowered/HalsSteampowered.java | 2 +- .../steampowered/Track/Blocks/TrainTrack.java | 148 ++++++++++++------ .../registry/blocks/ModBlocks.java | 29 ++-- .../registry/blocks/TrackClass.java | 2 + .../registry/utility/ServerEventHandler.java | 27 ++-- .../mountain_incline_train_track.json | 43 ++--- 6 files changed, 154 insertions(+), 97 deletions(-) diff --git a/src/main/java/net/halbear/steampowered/HalsSteampowered.java b/src/main/java/net/halbear/steampowered/HalsSteampowered.java index f69618a..b898cb5 100644 --- a/src/main/java/net/halbear/steampowered/HalsSteampowered.java +++ b/src/main/java/net/halbear/steampowered/HalsSteampowered.java @@ -33,7 +33,7 @@ public class HalsSteampowered public HalsSteampowered() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); - ModBlocks.BLOCKS.register(bus); + ModBlocks.TRACKBLOCKS.register(bus); ModItems.ITEMS.register(bus); ModEntities.ENTITIES.register(bus); ModTileEntities.TILE_ENTITIES.register(bus); diff --git a/src/main/java/net/halbear/steampowered/Track/Blocks/TrainTrack.java b/src/main/java/net/halbear/steampowered/Track/Blocks/TrainTrack.java index 9d533ba..2563a1e 100644 --- a/src/main/java/net/halbear/steampowered/Track/Blocks/TrainTrack.java +++ b/src/main/java/net/halbear/steampowered/Track/Blocks/TrainTrack.java @@ -27,6 +27,7 @@ import static net.halbear.steampowered.registry.blocks.TrackClass.*; public class TrainTrack extends DirectionalBlock { public static final DirectionProperty FACING = BlockStateProperties.FACING; public static final BooleanProperty RENDER = BooleanProperty.create("render"); + public static final BooleanProperty VALID_PLACEMENT = BooleanProperty.create("valid_placement"); public static final EnumProperty TRACK_TYPE = EnumProperty.create("track_type", TrackClass.class); private static final EnumProperty ENVIRONMENT = EnumProperty.create("environment", TrackEnvironment.class); private static final EnumProperty BASE = EnumProperty.create("base", TrackBallast.class); @@ -99,7 +100,7 @@ public class TrainTrack extends DirectionalBlock { @Override protected void createBlockStateDefinition (StateContainer.Builder builder){ - builder.add(FACING,ENVIRONMENT,BASE,TRACK_TYPE,RENDER); + builder.add(FACING,ENVIRONMENT,BASE,TRACK_TYPE,RENDER,VALID_PLACEMENT); } private static int[] CreateCurveOffsets(TrackClass trackType,Direction facing){ @@ -126,46 +127,89 @@ public class TrainTrack extends DirectionalBlock { @Override public void onPlace(BlockState state, World world, BlockPos pos, BlockState prevState, boolean isMoving){ - super.onPlace(state, world,pos,prevState,isMoving); + super.onPlace(state, world, pos, prevState, isMoving); + if (!world.isClientSide()) { + boolean valid_place = true; + if (state.getValue(TRACK_TYPE) == MOUNTAININCLINE) { + Direction facing = state.getValue(FACING); + if (world.getBlockState(pos.relative(facing.getOpposite())).is(Objects.requireNonNull(BlockTags.getAllTags().getTag(new ResourceLocation("hals_steampowered", "flattrack")))) + && world.getBlockState(pos.relative(facing)).getMaterial().isReplaceable()) { + world.setBlockAndUpdate(pos.relative(facing), ModBlocks.MOUNTAIN_INCLINE_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, MOUNTAININCLINESTART).setValue(FACING, facing).setValue(RENDER, true)); + world.setBlockAndUpdate(pos, ModBlocks.MOUNTAIN_INCLINE_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, MOUNTAININCLINECHILDBOTTOM).setValue(FACING, facing).setValue(RENDER, false)); + } else if (world.getBlockState(pos.relative(facing).above()).is(Objects.requireNonNull(BlockTags.getAllTags().getTag(new ResourceLocation("hals_steampowered", "flattrack")))) + && world.getBlockState(pos.relative(facing.getOpposite())).getMaterial().isReplaceable()) { + world.setBlockAndUpdate(pos.relative(facing.getOpposite()), ModBlocks.MOUNTAIN_INCLINE_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, MOUNTAININCLINEEND).setValue(FACING, facing).setValue(RENDER, true)); + world.setBlockAndUpdate(pos, ModBlocks.MOUNTAIN_INCLINE_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, MOUNTAININCLINECHILDTOP).setValue(FACING, facing).setValue(RENDER, false)); + } + } + if (state.getValue(TRACK_TYPE) == RIGHTTURNSTART && state.getValue(VALID_PLACEMENT)) { + Direction facing = state.getValue(FACING); + world.setBlockAndUpdate(pos.relative(facing).relative(facing.getClockWise()), ModBlocks.RIGHT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, RIGHTTURN).setValue(FACING, facing).setValue(RENDER, true)); + world.setBlockAndUpdate(pos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise()), ModBlocks.RIGHT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, RIGHTTURNEND).setValue(FACING, facing).setValue(RENDER, false)); + } + if (state.getValue(TRACK_TYPE) == LEFTTURNSTART && state.getValue(VALID_PLACEMENT)) { + Direction facing = state.getValue(FACING); + world.setBlockAndUpdate(pos.relative(facing).relative(facing.getCounterClockWise()), ModBlocks.LEFT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, LEFTTURN).setValue(FACING, facing).setValue(RENDER, true)); + world.setBlockAndUpdate(pos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()), ModBlocks.LEFT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, LEFTTURNEND).setValue(FACING, facing).setValue(RENDER, false)); + + } + if (!state.getValue(VALID_PLACEMENT)) { + System.out.println(state.getBlock() +" " + "Invalid Placement" + "\nBlock Class: " + state.getValue(TRACK_TYPE)); + world.destroyBlock(pos, true); + } + } } @Deprecated public void onRemove(BlockState state, World world, BlockPos pos, BlockState prevState, boolean isMoving) { - if(state.getBlock() == ModBlocks.LEFT_TURN_TRAIN_TRACK.get()){ - Direction facing = state.getBlockState().getValue(FACING); - switch(state.getBlockState().getValue(TRACK_TYPE)){ - case LEFTTURN: - world.removeBlock(pos.relative(facing).relative(facing.getCounterClockWise()),false); - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getClockWise()),false); - break; - case LEFTTURNEND: - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getClockWise()),false); - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getOpposite()).relative(facing.getClockWise()).relative(facing.getClockWise()),false); - break; - case LEFTTURNSTART: - world.removeBlock(pos.relative(facing).relative(facing.getCounterClockWise()),false); - world.removeBlock(pos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()),false); - break; - } - } else if(state.getBlock() == ModBlocks.RIGHT_TURN_TRAIN_TRACK.get()){ - Direction facing = state.getBlockState().getValue(FACING); - switch(state.getBlockState().getValue(TRACK_TYPE)){ - case RIGHTTURN: - world.removeBlock(pos.relative(facing).relative(facing.getClockWise()),false); - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getCounterClockWise()),false); - break; - case RIGHTTURNEND: - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getCounterClockWise()),false); - world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getOpposite()).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()),false); - break; - case RIGHTTURNSTART: - world.removeBlock(pos.relative(facing).relative(facing.getClockWise()),false); - world.removeBlock(pos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise()),false); - break; + if (!world.isClientSide() && state.getValue(VALID_PLACEMENT)) { + if (state.getBlock() == ModBlocks.LEFT_TURN_TRAIN_TRACK.get()) { + Direction facing = state.getBlockState().getValue(FACING); + switch (state.getBlockState().getValue(TRACK_TYPE)) { + case LEFTTURN: + world.removeBlock(pos.relative(facing).relative(facing.getCounterClockWise()), false); + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getClockWise()), false); + break; + case LEFTTURNEND: + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getClockWise()), false); + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getOpposite()).relative(facing.getClockWise()).relative(facing.getClockWise()), false); + break; + case LEFTTURNSTART: + world.removeBlock(pos.relative(facing).relative(facing.getCounterClockWise()), false); + world.removeBlock(pos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()), false); + break; + } + } else if (state.getBlock() == ModBlocks.RIGHT_TURN_TRAIN_TRACK.get()) { + Direction facing = state.getBlockState().getValue(FACING); + switch (state.getBlockState().getValue(TRACK_TYPE)) { + case RIGHTTURN: + world.removeBlock(pos.relative(facing).relative(facing.getClockWise()), false); + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getCounterClockWise()), false); + break; + case RIGHTTURNEND: + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getCounterClockWise()), false); + world.removeBlock(pos.relative(facing.getOpposite()).relative(facing.getOpposite()).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()), false); + break; + case RIGHTTURNSTART: + world.removeBlock(pos.relative(facing).relative(facing.getClockWise()), false); + world.removeBlock(pos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise()), false); + break; + } + } else if (state.getBlock() == ModBlocks.INCLINE_TRAIN_TRACK.get()) { + Direction facing = state.getBlockState().getValue(FACING); + switch (state.getBlockState().getValue(TRACK_TYPE)) { + case MOUNTAININCLINESTART: + case MOUNTAININCLINECHILDTOP: + world.removeBlock(pos.relative(facing.getOpposite()), false); + break; + case MOUNTAININCLINEEND: + case MOUNTAININCLINECHILDBOTTOM: + world.removeBlock(pos.relative(facing), false); + break; + } } } super.onRemove(state,world,pos,prevState,isMoving); - } @Override @@ -185,6 +229,7 @@ public class TrainTrack extends DirectionalBlock { World world = context.getLevel(); Direction facing = context.getHorizontalDirection(); boolean render = true; + boolean valid_place = true; TrackEnvironment Environment; TrackBallast ballast; TrackClass trackType; @@ -248,6 +293,14 @@ public class TrainTrack extends DirectionalBlock { case "mountainincline": trackType = MOUNTAININCLINE; break; + case "mountaininclinechildtop": + render = false; + trackType = MOUNTAININCLINECHILDTOP; + break; + case "mountaininclinechildbottom": + render = false; + trackType = MOUNTAININCLINECHILDBOTTOM; + break; case "diagonal": trackType = DIAGONAL; break; @@ -260,6 +313,18 @@ public class TrainTrack extends DirectionalBlock { default: trackType = STRAIGHT; } + if (trackType == RIGHTTURNSTART) { + if (!world.getBlockState(placementPos.relative(facing).relative(facing.getClockWise())).getMaterial().isReplaceable() || + !world.getBlockState(placementPos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise())).getMaterial().isReplaceable()) { + valid_place = false; + } + } + if (trackType == LEFTTURNSTART) { + if (!world.getBlockState(placementPos.relative(facing).relative(facing.getCounterClockWise())).getMaterial().isReplaceable() || + !world.getBlockState(placementPos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise())).getMaterial().isReplaceable()) { + valid_place = false; + } + } if(trackType == STRAIGHT){ if (world.getBlockState(placementPos.relative(facing)).getBlock() == ModBlocks.STRAIGHT_TRAIN_TRACK.get() && world.getBlockState(placementPos.relative(facing)).getBlockState().getValue(FACING) != facing && @@ -272,18 +337,6 @@ public class TrainTrack extends DirectionalBlock { world.setBlockAndUpdate(placementPos.relative(facing.getOpposite()),ModBlocks.CROSSING_TRAIN_TRACK.get().defaultBlockState()); } } - if (trackType == RIGHTTURNSTART) { - world.setBlockAndUpdate(placementPos.relative(facing).relative(facing.getClockWise()), ModBlocks.RIGHT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, RIGHTTURN).setValue(FACING, facing)); - world.getBlockState(placementPos.relative(facing).relative(facing.getClockWise())).setValue(TRACK_TYPE, RIGHTTURN).setValue(FACING, facing).setValue(RENDER, true); - world.setBlockAndUpdate(placementPos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise()), ModBlocks.RIGHT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, RIGHTTURNEND).setValue(FACING, facing)); - world.getBlockState(placementPos.relative(facing).relative(facing).relative(facing.getClockWise()).relative(facing.getClockWise())).setValue(TRACK_TYPE, RIGHTTURNEND).setValue(FACING, facing).setValue(RENDER, false); - } - if (trackType == LEFTTURNSTART) { - world.setBlockAndUpdate(placementPos.relative(facing).relative(facing.getCounterClockWise()), ModBlocks.LEFT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, LEFTTURN).setValue(FACING, facing)); - world.getBlockState(placementPos.relative(facing).relative(facing.getCounterClockWise())).setValue(TRACK_TYPE, LEFTTURN).setValue(FACING, facing).setValue(RENDER, true); - world.setBlockAndUpdate(placementPos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise()), ModBlocks.LEFT_TURN_TRAIN_TRACK.get().defaultBlockState().setValue(TRACK_TYPE, LEFTTURNEND).setValue(FACING, facing)); - world.getBlockState(placementPos.relative(facing).relative(facing).relative(facing.getCounterClockWise()).relative(facing.getCounterClockWise())).setValue(TRACK_TYPE, LEFTTURNEND).setValue(FACING, facing).setValue(RENDER, false); - } if (trackType == MOUNTAININCLINE){ if(world.getBlockState(placementPos.relative(facing.getOpposite()).relative(facing.getOpposite())).is(Objects.requireNonNull(BlockTags.getAllTags().getTag(new ResourceLocation("hals_steampowered", "flattrack"))))){ trackType = MOUNTAININCLINESTART; @@ -297,6 +350,7 @@ public class TrainTrack extends DirectionalBlock { .setValue(ENVIRONMENT, Environment) .setValue(BASE, ballast) .setValue(TRACK_TYPE, trackType) - .setValue(RENDER, render); + .setValue(RENDER, render) + .setValue(VALID_PLACEMENT, valid_place); } } diff --git a/src/main/java/net/halbear/steampowered/registry/blocks/ModBlocks.java b/src/main/java/net/halbear/steampowered/registry/blocks/ModBlocks.java index aa8602d..3271ad1 100644 --- a/src/main/java/net/halbear/steampowered/registry/blocks/ModBlocks.java +++ b/src/main/java/net/halbear/steampowered/registry/blocks/ModBlocks.java @@ -15,20 +15,18 @@ import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; +import java.util.ArrayList; import java.util.function.Supplier; public class ModBlocks { - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, HalsSteampowered.MODID); + public static final DeferredRegister TRACKBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, HalsSteampowered.MODID); + + public static ArrayList GetTrackItems(){ + ArrayList trackBlocks = new ArrayList(); + TRACKBLOCKS.getEntries().forEach(b -> trackBlocks.add(b.get().asItem())); + return trackBlocks; + } - public static final RegistryObject STRAIGHT_TRAIN_TRACK = - registerBlock("straight_train_track",()-> new TrainTrack(AbstractBlock.Properties - .of(Material.METAL) - .strength(1.0f,1.0f) - .harvestTool(ToolType.PICKAXE) - .sound(SoundType.METAL) - .noOcclusion(), - "straight" - )); public static final RegistryObject CROSSING_TRAIN_TRACK = registerBlock("crossing_train_track",()-> new TrainTrack(AbstractBlock.Properties .of(Material.METAL) @@ -38,6 +36,15 @@ public class ModBlocks { .noOcclusion(), "crossing" )); + public static final RegistryObject STRAIGHT_TRAIN_TRACK = + registerBlock("straight_train_track",()-> new TrainTrack(AbstractBlock.Properties + .of(Material.METAL) + .strength(1.0f,1.0f) + .harvestTool(ToolType.PICKAXE) + .sound(SoundType.METAL) + .noOcclusion(), + "straight" + )); public static final RegistryObject RIGHT_TURN_TRAIN_TRACK = registerBlock("right_turn_train_track",()-> new TrainTrack(AbstractBlock.Properties .of(Material.METAL) @@ -103,7 +110,7 @@ public class ModBlocks { )); private static RegistryObject registerBlock(String name, Supplier block){ - RegistryObject toReturn = ModBlocks.BLOCKS.register(name, block); + RegistryObject toReturn = ModBlocks.TRACKBLOCKS.register(name, block); registerBlockItem(name, toReturn); return toReturn; } diff --git a/src/main/java/net/halbear/steampowered/registry/blocks/TrackClass.java b/src/main/java/net/halbear/steampowered/registry/blocks/TrackClass.java index f7ce156..bb86c6e 100644 --- a/src/main/java/net/halbear/steampowered/registry/blocks/TrackClass.java +++ b/src/main/java/net/halbear/steampowered/registry/blocks/TrackClass.java @@ -7,6 +7,8 @@ public enum TrackClass implements IStringSerializable { CROSSING("crossing"), INCLINE("incline"), MOUNTAININCLINE("mountainincline"), + MOUNTAININCLINECHILDTOP("mountaininclinechildtop"), + MOUNTAININCLINECHILDBOTTOM("mountaininclinechildbottom"), MOUNTAININCLINESTART("mountaininclinestart"), MOUNTAININCLINEEND("mountaininclineend"), YJUNCTION("yjunction"), diff --git a/src/main/java/net/halbear/steampowered/registry/utility/ServerEventHandler.java b/src/main/java/net/halbear/steampowered/registry/utility/ServerEventHandler.java index a4ef1c1..c8ad335 100644 --- a/src/main/java/net/halbear/steampowered/registry/utility/ServerEventHandler.java +++ b/src/main/java/net/halbear/steampowered/registry/utility/ServerEventHandler.java @@ -13,37 +13,28 @@ import net.minecraftforge.fml.common.Mod; import java.util.ArrayList; import java.util.List; +import static net.halbear.steampowered.registry.blocks.ModBlocks.GetTrackItems; + @Mod.EventBusSubscriber(modid = HalsSteampowered.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class ServerEventHandler { @SubscribeEvent public static void CycleTrackItem(PlayerInteractEvent.RightClickItem event){ if(!event.getWorld().isClientSide()){ - ArrayList trackBlocks = new ArrayList(); - trackBlocks.add(ModBlocks.STRAIGHT_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.RIGHT_TURN_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.LEFT_TURN_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.RIGHT_45_DEGREE_TURN_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.LEFT_45_DEGREE_TURN_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.DIAGONAL_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.INCLINE_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.MOUNTAIN_INCLINE_TRAIN_TRACK.get().asItem()); - trackBlocks.add(ModBlocks.CROSSING_TRAIN_TRACK.get().asItem()); + ArrayList trackBlocks = GetTrackItems(); PlayerEntity player = event.getPlayer(); ItemStack itemStack = event.getItemStack(); int ItemCount = itemStack.getCount(); - if(trackBlocks.contains(itemStack.getItem())){ + if(trackBlocks.contains(itemStack.getItem()) && player != null){ int index = trackBlocks.indexOf(itemStack.getItem()); if(index >= trackBlocks.size() - 1){ index = 0; } else index++; - if (player != null){ - player.setItemInHand(event.getHand(), new ItemStack(trackBlocks.get(index))); - if(event.getHand() == Hand.MAIN_HAND){ - player.getMainHandItem().setCount(ItemCount); - } else{ - player.getOffhandItem().setCount(ItemCount); - } + player.setItemInHand(event.getHand(), new ItemStack(trackBlocks.get(index))); + if(event.getHand() == Hand.MAIN_HAND){ + player.getMainHandItem().setCount(ItemCount); + } else{ + player.getOffhandItem().setCount(ItemCount); } } } diff --git a/src/main/resources/assets/hals_steampowered/blockstates/mountain_incline_train_track.json b/src/main/resources/assets/hals_steampowered/blockstates/mountain_incline_train_track.json index 6fa3816..4cd4b16 100644 --- a/src/main/resources/assets/hals_steampowered/blockstates/mountain_incline_train_track.json +++ b/src/main/resources/assets/hals_steampowered/blockstates/mountain_incline_train_track.json @@ -1,77 +1,80 @@ { "multipart": [ { - "when": {"facing":"north","track_type": "mountainincline"}, + "apply": {"model": "hals_steampowered:block/straight_track/modular/traintrack_empty_module","y": 0} + }, + { + "when": {"facing":"north","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope", "y": 0} }, - {"when": {"facing":"south","track_type": "mountainincline"}, + {"when": {"facing":"south","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope","y": 180} }, { - "when": {"facing":"east","track_type": "mountainincline"}, + "when": {"facing":"east","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope","y": 90} }, { - "when": {"facing":"west","track_type": "mountainincline"}, + "when": {"facing":"west","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope","y": 270} }, { - "when": {"facing":"north","track_type": "mountaininclinestart"}, + "when": {"facing":"north","track_type": "mountaininclinestart","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_starttransition", "y": 0} }, - {"when": {"facing":"south","track_type": "mountaininclinestart"}, + {"when": {"facing":"south","track_type": "mountaininclinestart","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_starttransition","y": 180} }, { - "when": {"facing":"east","track_type": "mountaininclinestart"}, + "when": {"facing":"east","track_type": "mountaininclinestart","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_starttransition","y": 90} }, { - "when": {"facing":"west","track_type": "mountaininclinestart"}, + "when": {"facing":"west","track_type": "mountaininclinestart","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_starttransition","y": 270} }, { - "when": {"facing":"north","track_type": "mountaininclineend"}, + "when": {"facing":"north","track_type": "mountaininclineend","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_endtransition", "y": 0} }, - {"when": {"facing":"south","track_type": "mountaininclineend"}, + {"when": {"facing":"south","track_type": "mountaininclineend","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_endtransition","y": 180} }, { - "when": {"facing":"east","track_type": "mountaininclineend"}, + "when": {"facing":"east","track_type": "mountaininclineend","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_endtransition","y": 90} }, { - "when": {"facing":"west","track_type": "mountaininclineend"}, + "when": {"facing":"west","track_type": "mountaininclineend","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_endtransition","y": 270} }, { - "when": {"facing":"north", "base": "ballast","track_type": "mountainincline"}, + "when": {"facing":"north", "base": "ballast","track_type": "mountainincline","render": true}, "apply": {"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_ballast", "y": 0} }, - {"when": {"facing":"south", "base": "ballast","track_type": "mountainincline"}, + {"when": {"facing":"south", "base": "ballast","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_ballast","y": 180} }, { - "when": {"facing":"east", "base": "ballast","track_type": "mountainincline"}, + "when": {"facing":"east", "base": "ballast","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_ballast","y": 90} }, { - "when": {"facing":"west", "base": "ballast","track_type": "mountainincline"}, + "when": {"facing":"west", "base": "ballast","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_ballast","y": 270} }, { - "when": {"facing":"north", "base": "struts","track_type": "mountainincline"}, + "when": {"facing":"north", "base": "struts","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_struts","y": 0} }, - {"when": {"facing":"south", "base": "struts","track_type": "mountainincline"}, + {"when": {"facing":"south", "base": "struts","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_struts","y": 180} }, { - "when": {"facing":"east", "base": "struts","track_type": "mountainincline"}, + "when": {"facing":"east", "base": "struts","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_struts","y": 90} }, { - "when": {"facing":"west", "base": "struts","track_type": "mountainincline"}, + "when": {"facing":"west", "base": "struts","track_type": "mountainincline","render": true}, "apply":{"model": "hals_steampowered:block/mountainincline/traintrackgearedslope_struts","y": 270} } ]