diff --git a/gradle.properties b/gradle.properties index f0424be..f9c318d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ org.gradle.daemon=false mod.id = modernlifepatch mod.group = com.r3944realms.modernlifepatch mod.author = r3944Realms -mod.version = 1.18.2-1.3.7 \ No newline at end of file +mod.version = 1.18.2-1.4.0 \ No newline at end of file diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 796b8b7..ae3bf59 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,2 +1,2 @@ -5911bf3134d77ad26af0548e93e51d75ffae035d assets/modernlifepatch/lang/en_us.json -aae299757d2ae8e58162bdb78d2cb3a00ec92ee1 assets/modernlifepatch/lang/zh_cn.json +38eeb75da0923717638f16acc5c7068aecba156e assets/modernlifepatch/lang/en_us.json +bab598e47751847b120edd8d3418781229ec5fd6 assets/modernlifepatch/lang/zh_cn.json diff --git a/src/generated/resources/assets/modernlifepatch/lang/en_us.json b/src/generated/resources/assets/modernlifepatch/lang/en_us.json index 5c5115b..4fb0bcd 100644 --- a/src/generated/resources/assets/modernlifepatch/lang/en_us.json +++ b/src/generated/resources/assets/modernlifepatch/lang/en_us.json @@ -5,14 +5,19 @@ "gui.tag_filter.modernlifepatch.general": "General", "gui.tag_filter.modernlifepatch.kitchen": "Kitchen", "gui.tag_filter.modernlifepatch.lounge": "Lounge", + "gui.tag_filter.modernlifepatch.m_tool": "Tool", "gui.tag_filter.modernlifepatch.outside": "Outside", "gui.tag_filter.modernlifepatch.seat": "Seat", "gui.tag_filter.modernlifepatch.shelf": "Shelf", "gui.tag_filter.modernlifepatch.table": "Table", - "gui.tag_filter.modernlifepatch.tool": "Tool", "itemGroup.modernlifepatch": "Modern Life Patch", + "modernlifepatch.lang.battery.hover_text.0": "Right click to recharge flashlight (battery will be consumed)", + "modernlifepatch.lang.bicycle.hover_text.0": "Right click to deploy", "modernlifepatch.lang.bookshelf.hover_text.1": "Right click tp place a book on the shelf", "modernlifepatch.lang.bookshelf.hover_text.2": "Shift-right-click with an empty hand to remove a book", + "modernlifepatch.lang.camera.hover_text.1": "%d/%d photos stored in memory card", + "modernlifepatch.lang.camera.hover_text.2": "* Does not break when durability hits 0", + "modernlifepatch.lang.camera.hover_text.3": "* Take to a printer to print your photos", "modernlifepatch.lang.canvas.hover_text.block_size": "%f x %f ", "modernlifepatch.lang.canvas.hover_text.custom_size": "Custom print", "modernlifepatch.lang.canvas.hover_text.desc_completed": "A work of art", @@ -27,6 +32,8 @@ "modernlifepatch.lang.canvas.hover_text.offset": "(%f,%f)", "modernlifepatch.lang.canvas.hover_text.pixels_size": "%d x %d pixels", "modernlifepatch.lang.canvas.hover_text.unique_id": "ID = %d", + "modernlifepatch.lang.chainsaw.hover_text.1": "Right click to use", + "modernlifepatch.lang.chainsaw.hover_text.2": "* Highly effective on trees an leaves", "modernlifepatch.lang.chess.modernlifepatch.bishop": "Bishop", "modernlifepatch.lang.chess.modernlifepatch.king": "King", "modernlifepatch.lang.chess.modernlifepatch.knight": "Knight", @@ -36,10 +43,21 @@ "modernlifepatch.lang.chess_board.hover_text.0": "PLace it down and begin a new game!", "modernlifepatch.lang.easel.hover_text.0": "Place a canvas on it to begin painting", "modernlifepatch.lang.extractor.hover_text.0": "Extracts items from attached chests or from the space in front of it", + "modernlifepatch.lang.flashlight.hover_text.1": "Right click to use", + "modernlifepatch.lang.flashlight.hover_text.2": "* Using it will deplete the battery but it will not break", + "modernlifepatch.lang.flashlight.hover_text.3": "* %s minutes remaining before drained", + "modernlifepatch.lang.flashlight.hover_text.4": "* Lasts %s minutes at full charge", + "modernlifepatch.lang.flashlight.hover_text.5": "* Repair durability by using a battery", "modernlifepatch.lang.gui.button.modernlifepatch.disable_filters": "Disable Filters", "modernlifepatch.lang.gui.button.modernlifepatch.enable_filters": "Enable Filters", "modernlifepatch.lang.gui.button.modernlifepatch.scroll_filter_down": "Scroll down", "modernlifepatch.lang.gui.button.modernlifepatch.scroll_filter_up": "Scroll up", + "modernlifepatch.lang.guitar.hover_text.1": "Right click to use", + "modernlifepatch.lang.guitar.hover_text.2": "* Standard Tuning (EADGBE)", + "modernlifepatch.lang.guitar_amplifier.hover_text.0": "Play a guitar nearby to add a distortion effect", + "modernlifepatch.lang.handgun.hover_text.1": "Left click to fire", + "modernlifepatch.lang.handgun.hover_text.2": "Right click to aim down sights", + "modernlifepatch.lang.handgun.hover_text.3": "* Requires at least one Magazine in order to shoot", "modernlifepatch.lang.menu.kitchen_cabinet": "Kitchen Cabinet", "modernlifepatch.lang.menu.kitchen_drawer_cabinet": "Kitchen Drawer Cabinet", "modernlifepatch.lang.menu.night_stand": "Night Stand", @@ -47,8 +65,13 @@ "modernlifepatch.lang.menu.print_size": "Print Size", "modernlifepatch.lang.menu.printer": "Printer", "modernlifepatch.lang.menu.radiator": "Radiator", + "modernlifepatch.lang.menu.refrigerator": "refrigerator", + "modernlifepatch.lang.menu.seed_spreader": "Seed Spreader", "modernlifepatch.lang.menu.trash_can": "Trash Can", "modernlifepatch.lang.metal_grate.hover_text.0": "Allows water and items to flow through freely", + "modernlifepatch.lang.motorboat.hover_text.1": "Right click to deploy", + "modernlifepatch.lang.motorboat.hover_text.2": "Remaining fuel: %f%%", + "modernlifepatch.lang.motorboat.hover_text.3": "Refuel by using a gas can on the deployed boat", "modernlifepatch.lang.need_rs_power.hover_text.0": "Requires redstone power to operate", "modernlifepatch.lang.paved_road.hover_text.0": "Slightly increases movement speed of vehicles", "modernlifepatch.lang.photocopier.hover_text.1": "Interact with a canvas or photograph to make copies", @@ -57,6 +80,9 @@ "modernlifepatch.lang.power_receiver.hover_text.2": "Right click block to change current channel", "modernlifepatch.lang.power_transmitter.hover_text.1": "Transmits power on the selected channel to all receivers", "modernlifepatch.lang.resource_pack.modernlifepatch.description": "All of textures and models are created by BF_Meow_\uFF0CDo not use for other purposes without permission.", + "modernlifepatch.lang.road_marker.hover_text.1": "* Right click paved road to apply currently selected road marker", + "modernlifepatch.lang.road_marker.hover_text.2": "* Right click elsewhere to toggle between available road markers", + "modernlifepatch.lang.seed_spreader.hover_text.0": "Automatically disperses seeds that are put inside of it", "modernlifepatch.lang.steam_radiator.hover_text.0": "Right click placed radiator to activate", "modernlifepatch.lang.store_18.hover_text.0": "Stores up to 18 items", "modernlifepatch.lang.trash_can.hover_text.0": "Items inserted into the trash slot will be deleted when the trash can is full", diff --git a/src/generated/resources/assets/modernlifepatch/lang/zh_cn.json b/src/generated/resources/assets/modernlifepatch/lang/zh_cn.json index 85d65e8..80c7437 100644 --- a/src/generated/resources/assets/modernlifepatch/lang/zh_cn.json +++ b/src/generated/resources/assets/modernlifepatch/lang/zh_cn.json @@ -5,14 +5,19 @@ "gui.tag_filter.modernlifepatch.general": "\u666E\u901A", "gui.tag_filter.modernlifepatch.kitchen": "\u53A8\u623F", "gui.tag_filter.modernlifepatch.lounge": "\u5BA2\u5385", + "gui.tag_filter.modernlifepatch.m_tool": "\u5DE5\u5177", "gui.tag_filter.modernlifepatch.outside": "\u6237\u5916", "gui.tag_filter.modernlifepatch.seat": "\u5750\u5177", "gui.tag_filter.modernlifepatch.shelf": "\u67B6\u5B50", "gui.tag_filter.modernlifepatch.table": "\u684C\u5B50", - "gui.tag_filter.modernlifepatch.tool": "\u5DE5\u5177", "itemGroup.modernlifepatch": "\u6469\u767B\u751F\u6D3B\u8865\u4E01", + "modernlifepatch.lang.battery.hover_text.0": "\u53F3\u952E\u6D88\u8017\u4E3A\u624B\u7535\u7B52\u66F4\u6362\u7535\u6C60", + "modernlifepatch.lang.bicycle.hover_text.0": "\u53F3\u952E\u653E\u7F6E", "modernlifepatch.lang.bookshelf.hover_text.1": "\u53F3\u952E\u4EE5\u653E\u7F6E\u4E66\u5728\u4E66\u67B6\u4E0A", "modernlifepatch.lang.bookshelf.hover_text.2": "\u7A7A\u624B\u6309\u4F4FShift\u952E+\u53F3\u952E\u5373\u53EF\u53D6\u4E0B\u4E66", + "modernlifepatch.lang.camera.hover_text.1": "\u5185\u5B58\u5361\u91CC\u7167\u7247\u6570: %d/%d", + "modernlifepatch.lang.camera.hover_text.2": "* \u5F53\u8010\u4E45\u6389\u52300\u65F6\uFF0C\u4E5F\u4E0D\u4F1A\u635F\u574F", + "modernlifepatch.lang.camera.hover_text.3": "* \u63D0\u4F9B\u6253\u5370\u673A\u628A\u6240\u62CD\u7167\u51B2\u6D17\u51FA\u6765", "modernlifepatch.lang.canvas.hover_text.block_size": "%f x %f", "modernlifepatch.lang.canvas.hover_text.custom_size": "\u81EA\u5B9A\u4E49\u5C3A\u5BF8\u753B\u4F5C", "modernlifepatch.lang.canvas.hover_text.desc_completed": "\u827A\u672F\u54C1", @@ -27,6 +32,8 @@ "modernlifepatch.lang.canvas.hover_text.offset": "(%f,%f)", "modernlifepatch.lang.canvas.hover_text.pixels_size": "%d x %d \u50CF\u7D20", "modernlifepatch.lang.canvas.hover_text.unique_id": "ID = %d", + "modernlifepatch.lang.chainsaw.hover_text.1": "\u53F3\u952E\u4F7F\u7528", + "modernlifepatch.lang.chainsaw.hover_text.2": "* \u4E00\u79CD\u6781\u5176\u9AD8\u6548\u780D\u6811\u65B9\u6848", "modernlifepatch.lang.chess.modernlifepatch.bishop": "\u8C61", "modernlifepatch.lang.chess.modernlifepatch.king": "\u56FD\u738B", "modernlifepatch.lang.chess.modernlifepatch.knight": "\u9A91\u58EB", @@ -36,10 +43,21 @@ "modernlifepatch.lang.chess_board.hover_text.0": "\u653E\u7F6E\u540E\u4F7F\u7528\u5373\u53EF\u5F00\u59CB\u4E00\u573A\u65B0\u6E38\u620F!", "modernlifepatch.lang.easel.hover_text.0": "\u653E\u7F6E(\u5E06\u5E03)\u753B\u5E03\u5728\u5176\u4E0A\uFF0C\u5373\u53EF\u5F00\u59CB\u7ED8\u753B", "modernlifepatch.lang.extractor.hover_text.0": "\u4ECE\u5176\u5438\u53D6\u7AEF\u5904\u7684\u7BB1\u5B50\u6216\u7A7A\u95F4\u4E2D\u53D6\u51FA\u7269\u54C1", + "modernlifepatch.lang.flashlight.hover_text.1": "\u53F3\u952E\u4F7F\u7528", + "modernlifepatch.lang.flashlight.hover_text.2": "* \u4F7F\u7528\u5B83\u4F1A\u8017\u5C3D\u7535\u6C60\uFF0C\u4F46\u4E0D\u4F1A\u635F\u574F", + "modernlifepatch.lang.flashlight.hover_text.3": "* \u7535\u91CF\u8017\u5C3D\u524D\u5269\u4F59%s\u5206\u949F", + "modernlifepatch.lang.flashlight.hover_text.4": "* \u4E00\u8282\u6EE1\u7535\u7535\u6C60\u53EF\u4EE5\u4E3A\u5176\u63D0\u4F9B\u81F3\u5C11%s\u5206\u949F\u7684\u7167\u4EAE\u65F6\u95F4", + "modernlifepatch.lang.flashlight.hover_text.5": "* \u901A\u8FC7\u7535\u6C60\u6765\u4FEE\u590D\u8010\u4E45", "modernlifepatch.lang.gui.button.modernlifepatch.disable_filters": "\u7981\u7528\u8FC7\u6EE4\u5668", "modernlifepatch.lang.gui.button.modernlifepatch.enable_filters": "\u542F\u7528\u8FC7\u6EE4\u5668", "modernlifepatch.lang.gui.button.modernlifepatch.scroll_filter_down": "\u5411\u4E0B", "modernlifepatch.lang.gui.button.modernlifepatch.scroll_filter_up": "\u5411\u4E0A", + "modernlifepatch.lang.guitar.hover_text.1": "\u53F3\u952E\u4F7F\u7528", + "modernlifepatch.lang.guitar.hover_text.2": "* \u6807\u51C6\u8C03\u8C10\uFF08EADGBE\uFF09", + "modernlifepatch.lang.guitar_amplifier.hover_text.0": "\u5728\u9644\u8FD1\u5F39\u594F\u5409\u4ED6\u4EE5\u589E\u52A0\u5931\u771F\u6548\u679C", + "modernlifepatch.lang.handgun.hover_text.1": "\u5DE6\u952E\u5F00\u706B", + "modernlifepatch.lang.handgun.hover_text.2": "\u53F3\u952E\u805A\u7126\u5BF9\u51C6", + "modernlifepatch.lang.handgun.hover_text.3": "* \u9700\u8981\u81F3\u5C11\u4E00\u4E2A\u5F39\u5323\u6765\u53D1\u5C04", "modernlifepatch.lang.menu.kitchen_cabinet": "\u53A8\u623F\u67DC\u5B50", "modernlifepatch.lang.menu.kitchen_drawer_cabinet": "\u53A8\u623F\u62BD\u5C49\u67DC", "modernlifepatch.lang.menu.night_stand": "\u5E8A\u5934\u67DC", @@ -47,8 +65,13 @@ "modernlifepatch.lang.menu.print_size": "\u6253\u5370\u5C3A\u5BF8", "modernlifepatch.lang.menu.printer": "\u6253\u5370\u673A", "modernlifepatch.lang.menu.radiator": "\u84B8\u6C7D\u6563\u70ED\u5668", + "modernlifepatch.lang.menu.refrigerator": "\u51B0\u7BB1", + "modernlifepatch.lang.menu.seed_spreader": "\u64AD\u79CD\u5668", "modernlifepatch.lang.menu.trash_can": "\u5783\u573E\u6876", "modernlifepatch.lang.metal_grate.hover_text.0": "\u5141\u8BB8\u6C34\u4E0E\u7269\u54C1\u81EA\u7531\u5730\u7A7F\u8FC7", + "modernlifepatch.lang.motorboat.hover_text.1": "\u53F3\u952E\u653E\u7F6E", + "modernlifepatch.lang.motorboat.hover_text.2": "\u71C3\u6599\u5269\u4F59\u91CF: %f%%", + "modernlifepatch.lang.motorboat.hover_text.3": "\u5BF9\u8239\u4F7F\u7528\u6C7D\u6CB9\u7F50\u6765\u52A0\u6CB9", "modernlifepatch.lang.need_rs_power.hover_text.0": "\u9700\u8981\u7EA2\u77F3\u5145\u80FD", "modernlifepatch.lang.paved_road.hover_text.0": "\u8F7D\u5177\u5728\u8BE5\u8DEF\u4E0A\u884C\u9A76\uFF0C\u79FB\u901F\u4F1A\u6709\u6240\u63D0\u5347", "modernlifepatch.lang.photocopier.hover_text.1": "\u53EF\u4EE5\u7528\u4E8E\u7167\u7247\u6216\u753B\u4F5C\u7684\u590D\u5236", @@ -57,6 +80,9 @@ "modernlifepatch.lang.power_receiver.hover_text.2": "\u53F3\u952E\u65B9\u5757\u6253\u5F00\u754C\u9762\uFF0C\u6765\u5207\u6362\u5DE5\u4F5C\u9891\u9053", "modernlifepatch.lang.power_transmitter.hover_text.1": "\u5C06\u7EA2\u77F3\u4FE1\u53F7\u4F20\u8F93\u7ED9\u5BF9\u5E94\u9891\u9053\u7684\u6240\u6709\u80FD\u91CF\u63A5\u6536\u5668", "modernlifepatch.lang.resource_pack.modernlifepatch.description": "\u6240\u6709\u6750\u8D28\u548C\u6A21\u578B\u5747\u7531 \u767D\u5E06\u5C0F\u55B5BF_Meow_ \u7ED8\u5236\u3002\u672A\u7ECF\u5141\u8BB8\uFF0C\u8BF7\u52FF\u7528\u4F5C\u4ED6\u7528\u3002", + "modernlifepatch.lang.road_marker.hover_text.1": "* \u53F3\u952E\u5355\u51FB\u5DF2\u94FA\u8BBE\u7684\u9053\u8DEF\u4EE5\u5E94\u7528\u5F53\u524D\u9009\u5B9A\u7684\u9053\u8DEF\u6807\u8BB0", + "modernlifepatch.lang.road_marker.hover_text.2": "* \u53F3\u952E\u5355\u51FB\u5176\u4ED6\u4F4D\u7F6E\u4EE5\u5728\u53EF\u7528\u9053\u8DEF\u6807\u8BB0\u4E4B\u95F4\u5207\u6362", + "modernlifepatch.lang.seed_spreader.hover_text.0": "\u81EA\u52A8\u64AD\u79CD\u673A\u5668\u91CC\u7684\u79CD\u5B50", "modernlifepatch.lang.steam_radiator.hover_text.0": "\u53F3\u952E\u5DF2\u653E\u7F6E\u7684\u6563\u70ED\u5668\uFF0C\u5373\u53EF\u6FC0\u6D3B", "modernlifepatch.lang.store_18.hover_text.0": "\u53EF\u5B58\u50A818\u7EC4\u7269\u54C1", "modernlifepatch.lang.trash_can.hover_text.0": "\u5F53\u5783\u573E\u6876\u5DF2\u6EE1\u65F6\uFF0C\u8FDB\u5165\u5783\u573E\u6876\u7684\u7269\u54C1\u5C06\u88AB\u5220\u9664", diff --git a/src/main/java/com/r3944realms/modernlifepatch/common/ModTags.java b/src/main/java/com/r3944realms/modernlifepatch/common/ModTags.java index 7495373..f7a0998 100644 --- a/src/main/java/com/r3944realms/modernlifepatch/common/ModTags.java +++ b/src/main/java/com/r3944realms/modernlifepatch/common/ModTags.java @@ -13,8 +13,8 @@ public class ModTags { BATHROOM = tag("bathroom"), LOUNGE = tag("lounge"), KITCHEN = tag("kitchen"), - WEAPON = tag("item/weapon"), - TOOL = tag("tool"), + WEAPON = tag("weapon"), + TOOL = tag("m_tool"), GENERAL = tag("general"), SHELF = tag("shelf"), TABLE = tag("table"), diff --git a/src/main/java/com/r3944realms/modernlifepatch/datagen/lang/ModLangKeyValue.java b/src/main/java/com/r3944realms/modernlifepatch/datagen/lang/ModLangKeyValue.java index 8608151..caf3779 100644 --- a/src/main/java/com/r3944realms/modernlifepatch/datagen/lang/ModLangKeyValue.java +++ b/src/main/java/com/r3944realms/modernlifepatch/datagen/lang/ModLangKeyValue.java @@ -56,7 +56,32 @@ public enum ModLangKeyValue { BOOKSHELF_HOVER_FIRST(getHoverTextKey("bookshelf", "1"), "Right click tp place a book on the shelf", "右键以放置书在书架上"), BOOKSHELF_HOVER_SECOND(getHoverTextKey("bookshelf", "2"), "Shift-right-click with an empty hand to remove a book", "空手按住Shift键+右键即可取下书"), - + //C_TOOL + GUITAR_AMPLIFIER_HOVER(getHoverTextKey("guitar_amplifier"), "Play a guitar nearby to add a distortion effect" ,"在附近弹奏吉他以增加失真效果"), + SEED_SPREADER_HOVER(getHoverTextKey("seed_spreader"), "Automatically disperses seeds that are put inside of it", "自动播种机器里的种子"), + BATTERY_HOVER(getHoverTextKey("battery"), "Right click to recharge flashlight (battery will be consumed)", "右键消耗为手电筒更换电池"), + CHAINSAW_HOVER_FIRST(getHoverTextKey("chainsaw", "1"), "Right click to use", "右键使用"), + CHAINSAW_HOVER_SECOND(getHoverTextKey("chainsaw", "2"), "* Highly effective on trees an leaves", "* 一种极其高效砍树方案"), + HAND_GUN_HOVER_FIRST(getHoverTextKey("handgun", "1"), "Left click to fire", "左键开火"), + HAND_GUN_HOVER_SECOND(getHoverTextKey("handgun", "2"), "Right click to aim down sights", "右键聚焦对准"), + HAND_GUN_HOVER_THIRD(getHoverTextKey("handgun", "3"), "* Requires at least one Magazine in order to shoot", "* 需要至少一个弹匣来发射"), + GUITAR_HOVER_FIRST(getHoverTextKey("guitar", "1"), "Right click to use", "右键使用"), + GUITAR_HOVER_SECOND(getHoverTextKey("guitar", "2"), "* Standard Tuning (EADGBE)", "* 标准调谐(EADGBE)"), + FLASH_LIGHT_HOVER_FIRST(getHoverTextKey("flashlight", "1"), "Right click to use", "右键使用"), + FLASH_LIGHT_HOVER_SECOND(getHoverTextKey("flashlight", "2"), "* Using it will deplete the battery but it will not break", "* 使用它会耗尽电池,但不会损坏"), + FLASH_LIGHT_HOVER_THIRD(getHoverTextKey("flashlight", "3"), "* %s minutes remaining before drained", "* 电量耗尽前剩余%s分钟"), + FLASH_LIGHT_HOVER_FOURTH(getHoverTextKey("flashlight", "4"), "* Lasts %s minutes at full charge", "* 一节满电电池可以为其提供至少%s分钟的照亮时间"), + FLASH_LIGHT_HOVER_FIFTH(getHoverTextKey("flashlight", "5"), "* Repair durability by using a battery", "* 通过电池来修复耐久"), + CAMERA_HOVER_FIRST(getHoverTextKey("camera", "1"), "%d/%d photos stored in memory card", "内存卡里照片数: %d/%d"), + CAMERA_HOVER_SECOND(getHoverTextKey("camera", "2"), "* Does not break when durability hits 0", "* 当耐久掉到0时,也不会损坏"), + CAMERA_HOVER_THIRD(getHoverTextKey("camera", "3"), "* Take to a printer to print your photos", "* 提供打印机把所拍照冲洗出来"), + //TRAN + BICYCLE_HOVER(getHoverTextKey("bicycle"), "Right click to deploy", "右键放置"), + MOTORBOAT_HOVER_FIRST(getHoverTextKey("motorboat", "1"), "Right click to deploy", "右键放置"), + MOTORBOAT_HOVER_SECOND(getHoverTextKey("motorboat", "2"), "Remaining fuel: %f%%","燃料剩余量: %f%%"), + MOTORBOAT_HOVER_THIRD(getHoverTextKey("motorboat", "3"), "Refuel by using a gas can on the deployed boat", "对船使用汽油罐来加油"), + ROAD_MARKER_FIRST(getHoverTextKey("road_marker", "1"), "* Right click paved road to apply currently selected road marker", "* 右键单击已铺设的道路以应用当前选定的道路标记"), + ROAD_MARKER_SECOND(getHoverTextKey("road_marker", "2"), "* Right click elsewhere to toggle between available road markers", "* 右键单击其他位置以在可用道路标记之间切换"), //P NEED_RED_STONE_POWER_HOVER(getHoverTextKey("need_rs_power"), "Requires redstone power to operate", "需要红石充能"), STORE_18_HOVER(getHoverTextKey("store_18"), "Stores up to 18 items", "可存储18组物品"), @@ -72,6 +97,8 @@ public enum ModLangKeyValue { PRINTER_SIZE_MENU_LABEL(getMenuLabelKey("print_size"), "Print Size", "打印尺寸"), NIGHT_STAND_MENU_LABEL(getMenuLabelKey("night_stand"), "Night Stand", "床头柜"), STEAM_RADIATOR_MENU_LABEL(getMenuLabelKey("radiator"), "Radiator" ,"蒸汽散热器"), + SEED_SPREADER_MENU_LABEL(getMenuLabelKey("seed_spreader"), "Seed Spreader", "播种器"), + REFRIGERATOR_MENU_LABEL(getMenuLabelKey("refrigerator"), "refrigerator", "冰箱"), //CANVAS CANVAS_HOVER_DESC_COMPLETED(getHoverTextKey("canvas", "desc_completed"), "A work of art" ,"艺术品"), CANVAS_HOVER_UNIQUE_ID(getHoverTextKey("canvas", "unique_id"), "ID = %d", "ID = %d"), diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinGuitarAmplifier.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinGuitarAmplifier.java new file mode 100644 index 0000000..2383e77 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinGuitarAmplifier.java @@ -0,0 +1,50 @@ +package com.r3944realms.modernlifepatch.mixin.block.common; + +import com.dairymoose.modernlife.blocks.GuitarAmplifierBlock; +import com.dairymoose.modernlife.util.ModernLifeUtil; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; + +@Mixin(GuitarAmplifierBlock.class) +public class MixinGuitarAmplifier { + @Unique + private static final VoxelShape SHAPE_S = Block.box(2, 0, 5, 14, 12, 11), SHAPE_E, SHAPE_N, SHAPE_W; + static { + SHAPE_W = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_S); + SHAPE_N = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_W); + SHAPE_E = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_N); + } + + + @Inject(method = {"getShape"}, at= @At("HEAD"), cancellable = true) + public void getShape(BlockState bs, BlockGetter reader, BlockPos pos, CollisionContext sel, CallbackInfoReturnable cir) { + switch (bs.getValue(GuitarAmplifierBlock.FACING)) { + case SOUTH -> cir.setReturnValue(SHAPE_S); + case EAST -> cir.setReturnValue(SHAPE_E); + case WEST -> cir.setReturnValue(SHAPE_W); + default -> cir.setReturnValue(SHAPE_N); + } + } + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, BlockGetter blockReader, List list, TooltipFlag tooltipFlag, CallbackInfo ci) { + list.add(new TranslatableComponent(ModLangKeyValue.GUITAR_AMPLIFIER_HOVER.getKey())); + ci.cancel(); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinSeedSpreader.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinSeedSpreader.java new file mode 100644 index 0000000..96ae4d5 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/common/MixinSeedSpreader.java @@ -0,0 +1,82 @@ +package com.r3944realms.modernlifepatch.mixin.block.common; + +import com.dairymoose.modernlife.blocks.SeedSpreaderBlock; +import com.dairymoose.modernlife.blocks.WallSocketBlock; +import com.dairymoose.modernlife.tileentities.RefrigeratorBlockEntity; +import com.dairymoose.modernlife.tileentities.SeedSpreaderBlockEntity; +import com.dairymoose.modernlife.util.ModernLifeUtil; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.ChestMenu; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; +import java.util.stream.Stream; + +@Mixin(SeedSpreaderBlock.class) +public class MixinSeedSpreader { + @Unique + private static final VoxelShape SHAPE_N = Stream.of( + Block.box(3, 11, 3, 13, 14, 13), + Block.box(4, 4, 4, 12, 11, 12), + Block.box(5, 4, 5, 11, 8, 11) + ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(); + + @Inject(method = {"getShape"}, at= @At("HEAD"), cancellable = true) + public void getShape(BlockState bs, BlockGetter reader, BlockPos pos, CollisionContext sel, CallbackInfoReturnable cir) { + cir.setReturnValue(SHAPE_N); + } + + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, BlockGetter blockReader, List list, TooltipFlag tooltipFlag, CallbackInfo ci) { + list.add(new TranslatableComponent(ModLangKeyValue.SEED_SPREADER_HOVER.getKey())); + ci.cancel(); + } + + @Inject(method = {"getMenuProvider"}, at = @At("HEAD"), cancellable = true) + public void getMenuProvider(BlockState blockState, Level level, BlockPos blockPos, CallbackInfoReturnable cir) { + cir.setReturnValue(new MenuProvider() { + @Override + public AbstractContainerMenu createMenu(int paramInt, @NotNull Inventory paramInventory, @NotNull Player paramPlayer) { + BlockEntity tileEntity = level.getBlockEntity(blockPos); + if (tileEntity instanceof SeedSpreaderBlockEntity seedSpreaderBlockEntity) { + + return new ChestMenu(MenuType.GENERIC_9x1, paramInt, paramInventory, seedSpreaderBlockEntity, 1); + } else { + return null; + } + } + + @Override + public @NotNull Component getDisplayName() { + return new TranslatableComponent(ModLangKeyValue.SEED_SPREADER_MENU_LABEL.getKey()); + } + }); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/block/kitchen/MixinRefrigerator.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/kitchen/MixinRefrigerator.java new file mode 100644 index 0000000..3da823a --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/block/kitchen/MixinRefrigerator.java @@ -0,0 +1,46 @@ +package com.r3944realms.modernlifepatch.mixin.block.kitchen; + +import com.dairymoose.modernlife.blocks.RefrigeratorBlock; +import com.dairymoose.modernlife.tileentities.RefrigeratorBlockEntity; +import com.dairymoose.modernlife.tileentities.SeedSpreaderBlockEntity; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.ChestMenu; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(RefrigeratorBlock.class) +public class MixinRefrigerator { + @Inject(method = {"getMenuProvider"}, at = @At("HEAD"), cancellable = true) + public void getMenuProvider(BlockState blockState, Level level, BlockPos blockPos, CallbackInfoReturnable cir) { + cir.setReturnValue(new MenuProvider() { + @Override + public AbstractContainerMenu createMenu(int paramInt, @NotNull Inventory paramInventory, @NotNull Player paramPlayer) { + BlockEntity tileEntity = level.getBlockEntity(blockPos); + if (tileEntity instanceof SeedSpreaderBlockEntity seedSpreaderBlockEntity) { + return new ChestMenu(MenuType.GENERIC_9x1, paramInt, paramInventory, seedSpreaderBlockEntity, 1); + } else { + return null; + } + } + + public @NotNull Component getDisplayName() { + return new TranslatableComponent(ModLangKeyValue.REFRIGERATOR_MENU_LABEL.getKey()); + } + }); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBattery.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBattery.java new file mode 100644 index 0000000..22cbb3f --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBattery.java @@ -0,0 +1,24 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.BatteryItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(BatteryItem.class) +public class MixinBattery { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.BATTERY_HOVER.getKey())); + ci.cancel(); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBicycle.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBicycle.java new file mode 100644 index 0000000..df6e1ac --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinBicycle.java @@ -0,0 +1,24 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.BicycleItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(BicycleItem.class) +public class MixinBicycle { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.BICYCLE_HOVER.getKey())); + ci.cancel(); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinCamera.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinCamera.java new file mode 100644 index 0000000..6f155cc --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinCamera.java @@ -0,0 +1,42 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.CameraItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(CameraItem.class) +public class MixinCamera { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + int photoCount = 0; + if (itemStack.getTag() != null && itemStack.getTag().contains("ImageList")) { + Tag imageListTag = itemStack.getTag().get("ImageList"); + ListTag imageList; + if (imageListTag instanceof ListTag) { + imageList = (ListTag)imageListTag; + photoCount = imageList.size(); + } + } + + int maxPhotos = itemStack.getMaxDamage(); + text.add(new TranslatableComponent(ModLangKeyValue.CAMERA_HOVER_FIRST.getKey(),photoCount, maxPhotos)); + text.add(new TextComponent("")); + text.add(new TranslatableComponent(ModLangKeyValue.CAMERA_HOVER_SECOND.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.CAMERA_HOVER_THIRD.getKey())); + ci.cancel(); + } + +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinChainSaw.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinChainSaw.java new file mode 100644 index 0000000..eaecd0e --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinChainSaw.java @@ -0,0 +1,25 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.ChainsawItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(ChainsawItem.class) +public class MixinChainSaw { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.CHAINSAW_HOVER_FIRST.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.CHAINSAW_HOVER_SECOND.getKey())); + ci.cancel(); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinFlashLight.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinFlashLight.java new file mode 100644 index 0000000..3d14e34 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinFlashLight.java @@ -0,0 +1,31 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.FlashlightItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(FlashlightItem.class) +public class MixinFlashLight { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + String currentMinutes = String.valueOf((int)Math.floor((double)(itemStack.getMaxDamage() - itemStack.getDamageValue()) / 1200.0)); + String maxMinutes = String.valueOf(itemStack.getMaxDamage() / 1200); + text.add(new TranslatableComponent(ModLangKeyValue.FLASH_LIGHT_HOVER_FIFTH.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.FLASH_LIGHT_HOVER_SECOND.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.FLASH_LIGHT_HOVER_THIRD.getKey(), currentMinutes)); + text.add(new TranslatableComponent(ModLangKeyValue.FLASH_LIGHT_HOVER_FOURTH.getKey(), maxMinutes)); + text.add(new TranslatableComponent(ModLangKeyValue.FLASH_LIGHT_HOVER_FIFTH.getKey())); + ci.cancel(); + } + +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinGuitar.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinGuitar.java new file mode 100644 index 0000000..34f9097 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinGuitar.java @@ -0,0 +1,26 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.GuitarItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(GuitarItem.class) +public class MixinGuitar { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.GUITAR_HOVER_FIRST.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.GUITAR_HOVER_SECOND.getKey())); + ci.cancel(); + } + +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinHandGun.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinHandGun.java new file mode 100644 index 0000000..de16cc1 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinHandGun.java @@ -0,0 +1,27 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.HandgunItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(HandgunItem.class) +public class MixinHandGun { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.HAND_GUN_HOVER_FIRST.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.HAND_GUN_HOVER_SECOND.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.HAND_GUN_HOVER_THIRD.getKey())); + ci.cancel(); + } + +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinMotorBoat.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinMotorBoat.java new file mode 100644 index 0000000..62a6008 --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinMotorBoat.java @@ -0,0 +1,36 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.MotorboatItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(MotorboatItem.class) +public class MixinMotorBoat extends Item { + public MixinMotorBoat(Properties properties) { + super(properties); + } + + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + float fuelLevel = 1.0F; + if (itemStack.getTag() != null && itemStack.getTag().contains("FuelLevel")) { + fuelLevel = itemStack.getTag().getFloat("FuelLevel"); + } + fuelLevel *= 100.0F; + text.add(new TranslatableComponent(ModLangKeyValue.MOTORBOAT_HOVER_FIRST.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.MOTORBOAT_HOVER_SECOND.getKey(), fuelLevel)); + text.add(new TranslatableComponent(ModLangKeyValue.MOTORBOAT_HOVER_THIRD.getKey())); + ci.cancel(); + } +} diff --git a/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinRoadMarker.java b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinRoadMarker.java new file mode 100644 index 0000000..614068f --- /dev/null +++ b/src/main/java/com/r3944realms/modernlifepatch/mixin/item/MixinRoadMarker.java @@ -0,0 +1,25 @@ +package com.r3944realms.modernlifepatch.mixin.item; + +import com.dairymoose.modernlife.items.RoadMarkerItem; +import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@Mixin(RoadMarkerItem.class) +public class MixinRoadMarker { + @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true) + public void appendHoverText(ItemStack itemStack, Level world, List text, TooltipFlag flag, CallbackInfo ci) { + text.add(new TranslatableComponent(ModLangKeyValue.ROAD_MARKER_FIRST.getKey())); + text.add(new TranslatableComponent(ModLangKeyValue.ROAD_MARKER_SECOND.getKey())); + ci.cancel(); + } +} diff --git a/src/main/resources/data/modernlifepatch/tags/items/tool.json b/src/main/resources/data/modernlifepatch/tags/items/m_tool.json similarity index 100% rename from src/main/resources/data/modernlifepatch/tags/items/tool.json rename to src/main/resources/data/modernlifepatch/tags/items/m_tool.json diff --git a/src/main/resources/modernlifepatch.mixins.json b/src/main/resources/modernlifepatch.mixins.json index 30fadbd..33d8376 100644 --- a/src/main/resources/modernlifepatch.mixins.json +++ b/src/main/resources/modernlifepatch.mixins.json @@ -17,6 +17,7 @@ "block.common.MixinDeck", "block.common.MixinEasel", "block.common.MixinFlatScreenTV", + "block.common.MixinGuitarAmplifier", "block.common.MixinLightBulb", "block.common.MixinMetalDuct", "block.common.MixinMetalGrate", @@ -24,6 +25,7 @@ "block.common.MixinPhotoCopier", "block.common.MixinPrinter", "block.common.MixinRadiator", + "block.common.MixinSeedSpreader", "block.common.MixinTileLight", "block.common.MixinTrashCan", "block.common.MixinWallShelf", @@ -32,13 +34,23 @@ "block.kitchen.MixinKitchenDrawerCabinet", "block.kitchen.MixinKitchenSink", "block.kitchen.MixinMicrowave", + "block.kitchen.MixinRefrigerator", "block.kitchen.MixinStove", "block.lounge.MixinSofa", "block.redstone.MixinExtractor", "block.redstone.MixinPowerReceiver", "block.redstone.MixinPowerTransmitter", "block.redstone.MixinTurntableBlock", - "block.redstone.MixinWinch" + "block.redstone.MixinWinch", + "item.MixinBattery", + "item.MixinBicycle", + "item.MixinCamera", + "item.MixinChainSaw", + "item.MixinFlashLight", + "item.MixinGuitar", + "item.MixinHandGun", + "item.MixinMotorBoat", + "item.MixinRoadMarker" ], "minVersion": "0.8", "client": [ diff --git a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom.json b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom.json index 0e8f2de..e48a4be 100644 --- a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom.json +++ b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom.json @@ -2,7 +2,9 @@ "credit": "Made with Blockbench", "ambientocclusion": false, "textures": { - "1": "modernlife:block/jail_door" + "1": "modernlife:block/jail_door", + "particle": "modernlife:block/jail_door" + }, "elements": [ { diff --git a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom_hinge.json b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom_hinge.json index e1fa9b0..f523609 100644 --- a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom_hinge.json +++ b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_bottom_hinge.json @@ -2,7 +2,8 @@ "credit": "Made with Blockbench", "ambientocclusion": false, "textures": { - "1": "modernlife:block/jail_door" + "1": "modernlife:block/jail_door", + "particle": "modernlife:block/jail_door" }, "elements": [ { diff --git a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top.json b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top.json index bcc16a8..7714d0d 100644 --- a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top.json +++ b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top.json @@ -2,7 +2,8 @@ "credit": "Made with Blockbench", "ambientocclusion": false, "textures": { - "1": "modernlife:block/jail_door" + "1": "modernlife:block/jail_door", + "particle": "modernlife:block/jail_door" }, "elements": [ { diff --git a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top_hinge.json b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top_hinge.json index 1c20635..254bbf1 100644 --- a/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top_hinge.json +++ b/src/main/resources/resourcepacks/modernlifepatch/assets/modernlife/models/block/jail_door_top_hinge.json @@ -2,7 +2,8 @@ "credit": "Made with Blockbench", "ambientocclusion": false, "textures": { - "1": "modernlife:block/jail_door" + "1": "modernlife:block/jail_door", + "particle": "modernlife:block/jail_door" }, "elements": [ {