diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/BlockEntityTypes.java b/fabric/src/main/java/ziyue/tjmetro/mod/BlockEntityTypes.java index b26e6be..96e22b9 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/BlockEntityTypes.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/BlockEntityTypes.java @@ -62,6 +62,7 @@ public interface BlockEntityTypes BlockEntityTypeRegistryObject RAILWAY_SIGN_TIANJIN_BMT_5_EVEN = Registry.registerBlockEntityType("railway_sign_tianjin_bmt_5_even", (pos, state) -> new BlockRailwaySignTianjinBMT.BlockEntity(5, false, pos, state), BlockList.RAILWAY_SIGN_TIANJIN_BMT_5_EVEN::get); BlockEntityTypeRegistryObject RAILWAY_SIGN_TIANJIN_BMT_6_EVEN = Registry.registerBlockEntityType("railway_sign_tianjin_bmt_6_even", (pos, state) -> new BlockRailwaySignTianjinBMT.BlockEntity(6, false, pos, state), BlockList.RAILWAY_SIGN_TIANJIN_BMT_6_EVEN::get); BlockEntityTypeRegistryObject RAILWAY_SIGN_TIANJIN_BMT_7_EVEN = Registry.registerBlockEntityType("railway_sign_tianjin_bmt_7_even", (pos, state) -> new BlockRailwaySignTianjinBMT.BlockEntity(7, false, pos, state), BlockList.RAILWAY_SIGN_TIANJIN_BMT_7_EVEN::get); + BlockEntityTypeRegistryObject APG_DOOR_TIANJIN = Registry.registerBlockEntityType("apg_door_tianjin", BlockAPGDoorTianjin.BlockEntity::new, BlockList.APG_DOOR_TIANJIN::get); static void registerBlockEntities() { // Calling this class to initialize constants diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/BlockList.java b/fabric/src/main/java/ziyue/tjmetro/mod/BlockList.java index 6f375d6..e882a00 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/BlockList.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/BlockList.java @@ -110,6 +110,9 @@ public interface BlockList BlockRegistryObject RAILWAY_SIGN_TIANJIN_BMT_6_EVEN = Registry.registerBlockWithBlockItem("railway_sign_tianjin_bmt_6_even", () -> new Block(new BlockRailwaySignTianjinBMT(6, false)), RAILWAY_SIGNS); BlockRegistryObject RAILWAY_SIGN_TIANJIN_BMT_7_EVEN = Registry.registerBlockWithBlockItem("railway_sign_tianjin_bmt_7_even", () -> new Block(new BlockRailwaySignTianjinBMT(7, false)), RAILWAY_SIGNS); BlockRegistryObject RAILWAY_SIGN_TIANJIN_BMT_MIDDLE = Registry.registerBlock("railway_sign_tianjin_bmt_middle", () -> new Block(new BlockRailwaySignTianjinBMT(0, false))); + BlockRegistryObject APG_DOOR_TIANJIN = Registry.registerBlock("apg_door_tianjin", () -> new Block(new BlockAPGDoorTianjin())); + BlockRegistryObject APG_GLASS_TIANJIN = Registry.registerBlock("apg_glass_tianjin", () -> new Block(new BlockAPGGlassTianjin())); + BlockRegistryObject APG_GLASS_END_TIANJIN = Registry.registerBlock("apg_glass_end_tianjin", () -> new Block(new BlockAPGGlassEndTianjin())); static void registerBlocks() { // Calling this class to initialize constants diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/ItemList.java b/fabric/src/main/java/ziyue/tjmetro/mod/ItemList.java index d22a9df..e52b685 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/ItemList.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/ItemList.java @@ -3,7 +3,7 @@ import org.mtr.mapping.holder.Item; import org.mtr.mapping.mapper.ItemExtension; import org.mtr.mapping.registry.ItemRegistryObject; -import ziyue.tjmetro.mod.item.ItemPSDTianjinBase; +import ziyue.tjmetro.mod.item.ItemPSDAPGTianjinBase; import static ziyue.tjmetro.mod.client.Filters.GATES; import static ziyue.tjmetro.mod.client.Filters.MISCELLANEOUS; @@ -11,9 +11,12 @@ public interface ItemList { ItemRegistryObject WRENCH = Registry.registerItem("wrench", itemSettings -> new Item(new ItemExtension(itemSettings.maxCount(1))), MISCELLANEOUS); - ItemRegistryObject PSD_DOOR_TIANJIN = Registry.registerItem("psd_door_tianjin", itemSettings -> new Item(new ItemPSDTianjinBase(BlockList.PSD_DOOR_TIANJIN, itemSettings)), GATES); - ItemRegistryObject PSD_GLASS_TIANJIN = Registry.registerItem("psd_glass_tianjin", itemSettings -> new Item(new ItemPSDTianjinBase(BlockList.PSD_GLASS_TIANJIN, itemSettings)), GATES); - ItemRegistryObject PSD_GLASS_END_TIANJIN = Registry.registerItem("psd_glass_end_tianjin", itemSettings -> new Item(new ItemPSDTianjinBase(BlockList.PSD_GLASS_END_TIANJIN, itemSettings)), GATES); + ItemRegistryObject PSD_DOOR_TIANJIN = Registry.registerItem("psd_door_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.PSD_DOOR_TIANJIN, itemSettings)), GATES); + ItemRegistryObject PSD_GLASS_TIANJIN = Registry.registerItem("psd_glass_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.PSD_GLASS_TIANJIN, itemSettings)), GATES); + ItemRegistryObject PSD_GLASS_END_TIANJIN = Registry.registerItem("psd_glass_end_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.PSD_GLASS_END_TIANJIN, itemSettings)), GATES); + ItemRegistryObject APG_DOOR_TIANJIN = Registry.registerItem("apg_door_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.APG_DOOR_TIANJIN, itemSettings)), GATES); + ItemRegistryObject APG_GLASS_TIANJIN = Registry.registerItem("apg_glass_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.APG_GLASS_TIANJIN, itemSettings)), GATES); + ItemRegistryObject APG_GLASS_END_TIANJIN = Registry.registerItem("apg_glass_end_tianjin", itemSettings -> new Item(new ItemPSDAPGTianjinBase(BlockList.APG_GLASS_END_TIANJIN, itemSettings)), GATES); static void registerItems() { // Calling this class to initialize constants diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/TianjinMetroClient.java b/fabric/src/main/java/ziyue/tjmetro/mod/TianjinMetroClient.java index f6c14aa..609007a 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/TianjinMetroClient.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/TianjinMetroClient.java @@ -6,6 +6,7 @@ import org.mtr.mapping.mapper.TextHelper; import org.mtr.mod.Blocks; import org.mtr.mod.Items; +import org.mtr.mod.render.RenderAPGGlass; import org.mtr.mod.render.RenderPSDAPGDoor; import ziyue.tjmetro.mod.client.Filters; import ziyue.tjmetro.mod.config.ConfigClient; @@ -29,6 +30,9 @@ public static void init() { RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.PSD_DOOR_TIANJIN); RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.PSD_GLASS_TIANJIN); RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.PSD_GLASS_END_TIANJIN); + RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.APG_DOOR_TIANJIN); + RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.APG_GLASS_TIANJIN); + RegistryClient.registerBlockRenderType(RenderLayer.getCutout(), BlockList.APG_GLASS_END_TIANJIN); RegistryClient.registerBlockRenderType(RenderLayer.getTranslucent(), BlockList.ROLLING); RegistryClient.registerBlockEntityRenderer(BlockEntityTypes.STATION_NAME_SIGN_1, RenderStationNameSign::new); @@ -84,7 +88,7 @@ public static void init() { RegistryClient.registerBlockEntityRenderer(BlockEntityTypes.RAILWAY_SIGN_TIANJIN_BMT_5_EVEN, RenderRailwaySignTianjinBMT::new); RegistryClient.registerBlockEntityRenderer(BlockEntityTypes.RAILWAY_SIGN_TIANJIN_BMT_6_EVEN, RenderRailwaySignTianjinBMT::new); RegistryClient.registerBlockEntityRenderer(BlockEntityTypes.RAILWAY_SIGN_TIANJIN_BMT_7_EVEN, RenderRailwaySignTianjinBMT::new); - + RegistryClient.registerBlockEntityRenderer(BlockEntityTypes.APG_DOOR_TIANJIN, dispatcher -> new RenderPSDAPGDoor<>(dispatcher, 2)); RegistryClient.registerEntityRenderer(EntityTypes.SEAT, RenderSeat::new); diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGDoorTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGDoorTianjin.java new file mode 100644 index 0000000..760aa51 --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGDoorTianjin.java @@ -0,0 +1,37 @@ +package ziyue.tjmetro.mod.block; + +import org.mtr.mapping.holder.BlockPos; +import org.mtr.mapping.holder.BlockState; +import org.mtr.mapping.holder.Item; +import org.mtr.mapping.mapper.BlockEntityExtension; +import org.mtr.mod.block.BlockPSDAPGDoorBase; +import ziyue.tjmetro.mod.BlockEntityTypes; +import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagAPGTianjin; + +import javax.annotation.Nonnull; + +public class BlockAPGDoorTianjin extends BlockPSDAPGDoorBase implements BlockFlagAPGTianjin +{ + @Override + protected boolean isAPG() { + return true; + } + + @Nonnull + @Override + public Item asItem2() { + return ItemList.APG_DOOR_TIANJIN.get(); + } + + @Override + public BlockEntityExtension createBlockEntity(BlockPos blockPos, BlockState blockState) { + return new BlockEntity(blockPos, blockState); + } + + public static class BlockEntity extends BlockPSDAPGDoorBase.BlockEntityBase { + public BlockEntity(BlockPos pos, BlockState state) { + super(BlockEntityTypes.APG_DOOR_TIANJIN.get(), pos, state); + } + } +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassEndTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassEndTianjin.java new file mode 100644 index 0000000..fa57a91 --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassEndTianjin.java @@ -0,0 +1,22 @@ +package ziyue.tjmetro.mod.block; + +import org.mtr.mapping.holder.Item; +import org.mtr.mod.block.BlockAPGGlassEnd; +import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagAPGTianjin; + +import javax.annotation.Nonnull; + +public class BlockAPGGlassEndTianjin extends BlockAPGGlassEnd implements BlockFlagAPGTianjin +{ + @Override + protected boolean isAPG() { + return true; + } + + @Nonnull + @Override + public Item asItem2() { + return ItemList.APG_GLASS_END_TIANJIN.get(); + } +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassTianjin.java new file mode 100644 index 0000000..816fce8 --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockAPGGlassTianjin.java @@ -0,0 +1,30 @@ +package ziyue.tjmetro.mod.block; + +import org.mtr.mapping.holder.BlockPos; +import org.mtr.mapping.holder.BlockState; +import org.mtr.mapping.holder.Item; +import org.mtr.mapping.mapper.BlockEntityExtension; +import org.mtr.mod.block.BlockAPGGlass; +import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagAPGTianjin; + +import javax.annotation.Nonnull; + +public class BlockAPGGlassTianjin extends BlockAPGGlass implements BlockFlagAPGTianjin +{ + @Override + protected boolean isAPG() { + return true; + } + + @Nonnull + @Override + public Item asItem2() { + return ItemList.APG_GLASS_TIANJIN.get(); + } + + @Override + public BlockEntityExtension createBlockEntity(BlockPos blockPos, BlockState blockState) { + return null; + } +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDDoorTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDDoorTianjin.java index 618f331..f266316 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDDoorTianjin.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDDoorTianjin.java @@ -6,12 +6,12 @@ import org.mtr.mapping.mapper.BlockEntityExtension; import org.mtr.mod.block.BlockPSDAPGDoorBase; import ziyue.tjmetro.mod.BlockEntityTypes; -import ziyue.tjmetro.mod.BlockList; import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagPSDTianjin; import javax.annotation.Nonnull; -public class BlockPSDDoorTianjin extends BlockPSDAPGDoorBase +public class BlockPSDDoorTianjin extends BlockPSDAPGDoorBase implements BlockFlagPSDTianjin { @Nonnull @Override diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassEndTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassEndTianjin.java index b23f6cd..c3fad38 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassEndTianjin.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassEndTianjin.java @@ -3,10 +3,11 @@ import org.mtr.mapping.holder.Item; import org.mtr.mod.block.BlockPSDAPGGlassEndBase; import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagPSDTianjin; import javax.annotation.Nonnull; -public class BlockPSDGlassEndTianjin extends BlockPSDAPGGlassEndBase +public class BlockPSDGlassEndTianjin extends BlockPSDAPGGlassEndBase implements BlockFlagPSDTianjin { @Nonnull @Override diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassTianjin.java index dcd58f3..b220e06 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassTianjin.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDGlassTianjin.java @@ -3,10 +3,11 @@ import org.mtr.mapping.holder.Item; import org.mtr.mod.block.BlockPSDAPGGlassBase; import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagPSDTianjin; import javax.annotation.Nonnull; -public class BlockPSDGlassTianjin extends BlockPSDAPGGlassBase +public class BlockPSDGlassTianjin extends BlockPSDAPGGlassBase implements BlockFlagPSDTianjin { @Nonnull @Override diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDTopTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDTopTianjin.java index 6d37cb4..9c1184d 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDTopTianjin.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockPSDTopTianjin.java @@ -9,12 +9,13 @@ import ziyue.tjmetro.mod.BlockEntityTypes; import ziyue.tjmetro.mod.BlockList; import ziyue.tjmetro.mod.ItemList; +import ziyue.tjmetro.mod.block.base.BlockFlagPSDTianjin; import javax.annotation.Nonnull; import java.util.List; import java.util.function.Consumer; -public class BlockPSDTopTianjin extends BlockPSDTop +public class BlockPSDTopTianjin extends BlockPSDTop implements BlockFlagPSDTianjin { public static final EnumProperty STYLE = EnumProperty.of("style", EnumDoorType.class); diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagAPGTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagAPGTianjin.java new file mode 100644 index 0000000..abe6bb2 --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagAPGTianjin.java @@ -0,0 +1,5 @@ +package ziyue.tjmetro.mod.block.base; + +public interface BlockFlagAPGTianjin +{ +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagPSDTianjin.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagPSDTianjin.java new file mode 100644 index 0000000..e20f20c --- /dev/null +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/base/BlockFlagPSDTianjin.java @@ -0,0 +1,5 @@ +package ziyue.tjmetro.mod.block.base; + +public interface BlockFlagPSDTianjin +{ +} diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDTianjinBase.java b/fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDAPGTianjinBase.java similarity index 52% rename from fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDTianjinBase.java rename to fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDAPGTianjinBase.java index 823e040..907ece4 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDTianjinBase.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/item/ItemPSDAPGTianjinBase.java @@ -4,13 +4,9 @@ import org.mtr.mapping.mapper.ItemExtension; import org.mtr.mapping.mapper.TextHelper; import org.mtr.mapping.registry.BlockRegistryObject; -import org.mtr.mod.block.BlockPSDAPGBase; -import org.mtr.mod.block.IBlock; -import ziyue.tjmetro.mod.BlockList; -import ziyue.tjmetro.mod.block.BlockPSDDoorTianjin; -import ziyue.tjmetro.mod.block.BlockPSDGlassEndTianjin; -import ziyue.tjmetro.mod.block.BlockPSDGlassTianjin; -import ziyue.tjmetro.mod.block.BlockPSDTopTianjin; +import org.mtr.mod.block.*; +import ziyue.tjmetro.mod.block.*; +import ziyue.tjmetro.mod.block.base.BlockFlagPSDTianjin; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -19,11 +15,11 @@ import static org.mtr.mod.item.ItemPSDAPGBase.blocksNotReplaceable; import static ziyue.tjmetro.mod.block.BlockPSDTopTianjin.STYLE; -public class ItemPSDTianjinBase extends ItemExtension implements IBlock +public class ItemPSDAPGTianjinBase extends ItemExtension implements IBlock { public final Block block; - public ItemPSDTianjinBase(BlockRegistryObject block, ItemSettings settings) { + public ItemPSDAPGTianjinBase(BlockRegistryObject block, ItemSettings settings) { super(settings); this.block = block.get(); } @@ -31,8 +27,8 @@ public ItemPSDTianjinBase(BlockRegistryObject block, ItemSettings settings) { @Nonnull @Override public ActionResult useOnBlock2(ItemUsageContext context) { - final int horizontalBlocks = block.data instanceof BlockPSDDoorTianjin ? 2 : 1; - if (blocksNotReplaceable(context, horizontalBlocks, 3, getBlockStateFromItem().getBlock())) return ActionResult.FAIL; + final int horizontalBlocks = block.data instanceof BlockPSDAPGDoorBase ? 2 : 1; + if (blocksNotReplaceable(context, horizontalBlocks, 3, this.block)) return ActionResult.FAIL; final World world = context.getWorld(); final Direction playerFacing = context.getPlayerFacing(); @@ -42,46 +38,41 @@ public ActionResult useOnBlock2(ItemUsageContext context) { final BlockPos newPos = pos.offset(playerFacing.rotateYClockwise(), x); for (int y = 0; y < 2; y++) { - final BlockState state = getBlockStateFromItem().with(new Property<>(BlockPSDAPGBase.FACING.data), playerFacing.data).with(new Property<>(HALF.data), y == 1 ? DoubleBlockHalf.UPPER : DoubleBlockHalf.LOWER); - if (block.data instanceof BlockPSDDoorTianjin) { + final BlockState state = this.block.getDefaultState().with(new Property<>(BlockPSDAPGBase.FACING.data), playerFacing.data).with(new Property<>(HALF.data), y == 1 ? DoubleBlockHalf.UPPER : DoubleBlockHalf.LOWER); + if (block.data instanceof BlockPSDAPGDoorBase) { BlockState neighborState = state.with(new Property<>(SIDE.data), x == 0 ? EnumSide.LEFT : EnumSide.RIGHT); world.setBlockState(newPos.up(y), neighborState); } else { world.setBlockState(newPos.up(y), state.with(new Property<>(SIDE_EXTENDED.data), EnumSide.SINGLE)); } } - world.setBlockState(newPos.up(2), BlockPSDTopTianjin.getActualState(WorldAccess.cast(world), newPos.up(2)).with(new Property<>(STYLE.data), BlockPSDTopTianjin.EnumDoorType.STATION_NAME)); + if (this.block.data instanceof BlockFlagPSDTianjin) { + world.setBlockState(newPos.up(2), BlockPSDTopTianjin.getActualState(WorldAccess.cast(world), newPos.up(2)).with(new Property<>(STYLE.data), BlockPSDTopTianjin.EnumDoorType.STATION_NAME)); + } } context.getStack().decrement(1); return ActionResult.SUCCESS; } - protected BlockState getBlockStateFromItem() { - if (this.block.data instanceof BlockPSDDoorTianjin) { - return BlockList.PSD_DOOR_TIANJIN.get().getDefaultState(); - } else if (this.block.data instanceof BlockPSDGlassTianjin) { - return BlockList.PSD_GLASS_TIANJIN.get().getDefaultState(); - } else if (this.block.data instanceof BlockPSDGlassEndTianjin) { - return BlockList.PSD_GLASS_END_TIANJIN.get().getDefaultState(); - } - return null; - } - @Override public void addTooltips(ItemStack stack, @Nullable World world, List tooltip, TooltipContext options) { - if (this.block.data instanceof BlockPSDDoorTianjin) { + if (this.block.data instanceof BlockPSDAPGDoorBase) { tooltip.add(TextHelper.translatable("tooltip.mtr.psd_apg_door").formatted(TextFormatting.GRAY)); - } else if (this.block.data instanceof BlockPSDGlassTianjin) { - tooltip.add(TextHelper.translatable("tooltip.mtr.psd_apg_glass").formatted(TextFormatting.GRAY)); - } else if (this.block.data instanceof BlockPSDGlassEndTianjin) { + } else if (this.block.data instanceof BlockPSDAPGGlassEndBase) { tooltip.add(TextHelper.translatable("tooltip.mtr.psd_apg_glass_end").formatted(TextFormatting.GRAY)); + } else if (this.block.data instanceof BlockPSDAPGGlassBase) { + tooltip.add(TextHelper.translatable("tooltip.mtr.psd_apg_glass").formatted(TextFormatting.GRAY)); } } @Nonnull @Override public String getTranslationKey2() { - return "block.tjmetro.psd_tianjin"; + if (this.block.data instanceof BlockFlagPSDTianjin) { + return "block.tjmetro.psd_tianjin"; + } else { + return "block.tjmetro.apg_tianjin"; + } } } diff --git a/fabric/src/main/resources/assets/tjmetro/blockstates/apg_door_tianjin.json b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_door_tianjin.json new file mode 100644 index 0000000..0ebffa8 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_door_tianjin.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "mtr:block/apg_door" + } + } +} diff --git a/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_end_tianjin.json b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_end_tianjin.json new file mode 100644 index 0000000..03180d8 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_end_tianjin.json @@ -0,0 +1,506 @@ +{ + "multipart": [ + { + "when": { + "side": "left", + "half": "lower", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_left" + } + }, + { + "when": { + "side": "left", + "half": "lower", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 90 + } + }, + { + "when": { + "side": "left", + "half": "lower", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 180 + } + }, + { + "when": { + "side": "left", + "half": "lower", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 270 + } + }, + { + "when": { + "side": "left", + "half": "upper", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_top_left" + } + }, + { + "when": { + "side": "left", + "half": "upper", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_top_left", + "y": 90 + } + }, + { + "when": { + "side": "left", + "half": "upper", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_top_left", + "y": 180 + } + }, + { + "when": { + "side": "left", + "half": "upper", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_top_left", + "y": 270 + } + }, + { + "when": { + "side": "right", + "half": "lower", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_right" + } + }, + { + "when": { + "side": "right", + "half": "lower", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 90 + } + }, + { + "when": { + "side": "right", + "half": "lower", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 180 + } + }, + { + "when": { + "side": "right", + "half": "lower", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 270 + } + }, + { + "when": { + "side": "right", + "half": "upper", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_top_right" + } + }, + { + "when": { + "side": "right", + "half": "upper", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_top_right", + "y": 90 + } + }, + { + "when": { + "side": "right", + "half": "upper", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_top_right", + "y": 180 + } + }, + { + "when": { + "side": "right", + "half": "upper", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_top_right", + "y": 270 + } + }, + { + "when": { + "side": "middle", + "half": "lower", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_middle" + } + }, + { + "when": { + "side": "middle", + "half": "lower", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 90 + } + }, + { + "when": { + "side": "middle", + "half": "lower", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 180 + } + }, + { + "when": { + "side": "middle", + "half": "lower", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 270 + } + }, + { + "when": { + "side": "middle", + "half": "upper", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_top_middle" + } + }, + { + "when": { + "side": "middle", + "half": "upper", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_top_middle", + "y": 90 + } + }, + { + "when": { + "side": "middle", + "half": "upper", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_top_middle", + "y": 180 + } + }, + { + "when": { + "side": "middle", + "half": "upper", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_top_middle", + "y": 270 + } + }, + { + "when": { + "side": "single", + "half": "lower", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_single" + } + }, + { + "when": { + "side": "single", + "half": "lower", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 90 + } + }, + { + "when": { + "side": "single", + "half": "lower", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 180 + } + }, + { + "when": { + "side": "single", + "half": "lower", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 270 + } + }, + { + "when": { + "side": "single", + "half": "upper", + "facing": "west" + }, + "apply": { + "model": "mtr:block/apg_glass_top_single" + } + }, + { + "when": { + "side": "single", + "half": "upper", + "facing": "north" + }, + "apply": { + "model": "mtr:block/apg_glass_top_single", + "y": 90 + } + }, + { + "when": { + "side": "single", + "half": "upper", + "facing": "east" + }, + "apply": { + "model": "mtr:block/apg_glass_top_single", + "y": 180 + } + }, + { + "when": { + "side": "single", + "half": "upper", + "facing": "south" + }, + "apply": { + "model": "mtr:block/apg_glass_top_single", + "y": 270 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "lower", + "facing": "west" + }, + { + "touching_right": "air", + "half": "lower", + "facing": "east" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_bottom" + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "lower", + "facing": "north" + }, + { + "touching_right": "air", + "half": "lower", + "facing": "south" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_bottom", + "y": 90 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "lower", + "facing": "east" + }, + { + "touching_right": "air", + "half": "lower", + "facing": "west" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_bottom", + "y": 180 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "lower", + "facing": "south" + }, + { + "touching_right": "air", + "half": "lower", + "facing": "north" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_bottom", + "y": 270 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "upper", + "facing": "west" + }, + { + "touching_right": "air", + "half": "upper", + "facing": "east" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_top" + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "upper", + "facing": "north" + }, + { + "touching_right": "air", + "half": "upper", + "facing": "south" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_top", + "y": 90 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "upper", + "facing": "east" + }, + { + "touching_right": "air", + "half": "upper", + "facing": "west" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_top", + "y": 180 + } + }, + { + "when": { + "OR": [ + { + "touching_left": "air", + "half": "upper", + "facing": "south" + }, + { + "touching_right": "air", + "half": "upper", + "facing": "north" + } + ] + }, + "apply": { + "model": "mtr:block/apg_glass_end_top", + "y": 270 + } + } + ] +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_tianjin.json b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_tianjin.json new file mode 100644 index 0000000..9075ce4 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/blockstates/apg_glass_tianjin.json @@ -0,0 +1,124 @@ +{ + "variants": { + "facing=west,side=left,half=lower": { + "model": "mtr:block/apg_glass_bottom_left" + }, + "facing=north,side=left,half=lower": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 90 + }, + "facing=east,side=left,half=lower": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 180 + }, + "facing=south,side=left,half=lower": { + "model": "mtr:block/apg_glass_bottom_left", + "y": 270 + }, + "facing=west,side=left,half=upper": { + "model": "mtr:block/apg_glass_top_left" + }, + "facing=north,side=left,half=upper": { + "model": "mtr:block/apg_glass_top_left", + "y": 90 + }, + "facing=east,side=left,half=upper": { + "model": "mtr:block/apg_glass_top_left", + "y": 180 + }, + "facing=south,side=left,half=upper": { + "model": "mtr:block/apg_glass_top_left", + "y": 270 + }, + "facing=west,side=right,half=lower": { + "model": "mtr:block/apg_glass_bottom_right" + }, + "facing=north,side=right,half=lower": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 90 + }, + "facing=east,side=right,half=lower": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 180 + }, + "facing=south,side=right,half=lower": { + "model": "mtr:block/apg_glass_bottom_right", + "y": 270 + }, + "facing=west,side=right,half=upper": { + "model": "mtr:block/apg_glass_top_right" + }, + "facing=north,side=right,half=upper": { + "model": "mtr:block/apg_glass_top_right", + "y": 90 + }, + "facing=east,side=right,half=upper": { + "model": "mtr:block/apg_glass_top_right", + "y": 180 + }, + "facing=south,side=right,half=upper": { + "model": "mtr:block/apg_glass_top_right", + "y": 270 + }, + "facing=west,side=middle,half=lower": { + "model": "mtr:block/apg_glass_bottom_middle" + }, + "facing=north,side=middle,half=lower": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 90 + }, + "facing=east,side=middle,half=lower": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 180 + }, + "facing=south,side=middle,half=lower": { + "model": "mtr:block/apg_glass_bottom_middle", + "y": 270 + }, + "facing=west,side=middle,half=upper": { + "model": "mtr:block/apg_glass_top_middle" + }, + "facing=north,side=middle,half=upper": { + "model": "mtr:block/apg_glass_top_middle", + "y": 90 + }, + "facing=east,side=middle,half=upper": { + "model": "mtr:block/apg_glass_top_middle", + "y": 180 + }, + "facing=south,side=middle,half=upper": { + "model": "mtr:block/apg_glass_top_middle", + "y": 270 + }, + "facing=west,side=single,half=lower": { + "model": "mtr:block/apg_glass_bottom_single" + }, + "facing=north,side=single,half=lower": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 90 + }, + "facing=east,side=single,half=lower": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 180 + }, + "facing=south,side=single,half=lower": { + "model": "mtr:block/apg_glass_bottom_single", + "y": 270 + }, + "facing=west,side=single,half=upper": { + "model": "mtr:block/apg_glass_top_single" + }, + "facing=north,side=single,half=upper": { + "model": "mtr:block/apg_glass_top_single", + "y": 90 + }, + "facing=east,side=single,half=upper": { + "model": "mtr:block/apg_glass_top_single", + "y": 180 + }, + "facing=south,side=single,half=upper": { + "model": "mtr:block/apg_glass_top_single", + "y": 270 + } + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/tjmetro/lang/en_us.json b/fabric/src/main/resources/assets/tjmetro/lang/en_us.json index f2851f7..e8004f9 100644 --- a/fabric/src/main/resources/assets/tjmetro/lang/en_us.json +++ b/fabric/src/main/resources/assets/tjmetro/lang/en_us.json @@ -48,6 +48,7 @@ "block.tjmetro.station_name_entrance_tianjin_bmt": "Station Name (Entrance, Tianjin, Line 9)", "block.tjmetro.station_name_entrance_tianjin_bmt_pinyin": "Station Name (Entrance, Tianjin, Line 9, Pinyin)", "block.tjmetro.station_name_plate": "Station Name Plate (Line 9)", + "block.tjmetro.apg_tianjin": "Automatic Platform Gates (Tianjin)", "gui.tjmetro.service_corridor_sign_cjk": "暖行服务连廊", "gui.tjmetro.contact_station_for_help_cjk": "如需帮助请联系车站", diff --git a/fabric/src/main/resources/assets/tjmetro/models/item/apg_door_tianjin.json b/fabric/src/main/resources/assets/tjmetro/models/item/apg_door_tianjin.json new file mode 100644 index 0000000..62393c1 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/models/item/apg_door_tianjin.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "mtr:item/apg_door" + } +} diff --git a/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_end_tianjin.json b/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_end_tianjin.json new file mode 100644 index 0000000..4f7f3f3 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_end_tianjin.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "mtr:item/apg_glass_end" + } +} diff --git a/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_tianjin.json b/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_tianjin.json new file mode 100644 index 0000000..7ac7467 --- /dev/null +++ b/fabric/src/main/resources/assets/tjmetro/models/item/apg_glass_tianjin.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "mtr:item/apg_glass" + } +}