From 1ec299deff1bc16862472339b45dcda3a56a6916 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 13 Sep 2021 18:11:04 +0200 Subject: [PATCH 01/22] Post-PR Datagen --- src/generated/resources/.cache/cache | 2 +- .../assets/create/lang/unfinished/zh_cn.json | 446 +++++++++--------- .../actors/FluidManipulationBehaviour.java | 14 +- .../create/foundation/config/CFluids.java | 4 +- 4 files changed, 234 insertions(+), 232 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 3af0320b7..28f03b4a8 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -437,7 +437,7 @@ dbc823d8cb38598e75871a2187b2a58d7f77f86a assets/create/lang/unfinished/nl_nl.jso ac609477c295be1705d3efc07848ffe6779fd397 assets/create/lang/unfinished/pl_pl.json 95e17b968103e0ef62411489e699d39ac7ff0b64 assets/create/lang/unfinished/pt_br.json b37f50f613b0df44032fe5d618a5ce7227be8087 assets/create/lang/unfinished/ru_ru.json -2254cfb88d58f6932451a1548341f10749deb2df assets/create/lang/unfinished/zh_cn.json +fa465cd2c595bcd71449ad432a1908e27897177a assets/create/lang/unfinished/zh_cn.json 6192a7ede669ae6b6f8de6701b8a924d6a756c4a assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 2d31c18df..0d0f8f5bc 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,10 +1,10 @@ { - "_": "Missing Localizations: 5", + "_": "Missing Localizations: 4", "_": "->------------------------] Game Elements [------------------------<-", - "block.create.acacia_window": "金合欢窗户", - "block.create.acacia_window_pane": "金合欢窗户板", + "block.create.acacia_window": "金合欢木窗户", + "block.create.acacia_window_pane": "金合欢木窗户板", "block.create.adjustable_chain_gearshift": "可调节链式传动箱", "block.create.adjustable_crate": "可调节板条箱", "block.create.adjustable_pulse_repeater": "可调节脉冲中继器", @@ -26,8 +26,8 @@ "block.create.andesite_tunnel": "安山岩隧道", "block.create.basin": "工作盆", "block.create.belt": "传送带", - "block.create.birch_window": "白桦窗户", - "block.create.birch_window_pane": "白桦窗户板", + "block.create.birch_window": "白桦木窗户", + "block.create.birch_window_pane": "白桦木窗户板", "block.create.black_nixie_tube": "黑色辉光管", "block.create.black_sail": "黑色风帆", "block.create.black_seat": "黑色坐垫", @@ -56,12 +56,12 @@ "block.create.chiseled_weathered_limestone": "錾制风化石灰岩", "block.create.chocolate": "巧克力", "block.create.chute": "溜槽", - "block.create.clockwork_bearing": "时钟轴承", + "block.create.clockwork_bearing": "发条轴承", "block.create.clutch": "离合器", "block.create.cogwheel": "齿轮", "block.create.content_observer": "物品侦测器", "block.create.controller_rail": "控制铁轨", - "block.create.copper_backtank": "铜制背罐", + "block.create.copper_backtank": "Copper Backtank", "block.create.copper_block": "铜块", "block.create.copper_casing": "铜机壳", "block.create.copper_ore": "铜矿石", @@ -71,8 +71,8 @@ "block.create.creative_crate": "创造板条箱", "block.create.creative_fluid_tank": "创造流体储罐", "block.create.creative_motor": "创造马达", - "block.create.crimson_window": "绯红窗户", - "block.create.crimson_window_pane": "绯红窗户板", + "block.create.crimson_window": "绯红木窗户", + "block.create.crimson_window_pane": "绯红木窗户板", "block.create.crushing_wheel": "粉碎轮", "block.create.crushing_wheel_controller": "粉碎轮控制器", "block.create.cuckoo_clock": "布谷鸟闹钟", @@ -192,14 +192,14 @@ "block.create.green_seat": "绿色坐垫", "block.create.green_valve_handle": "绿色阀门手轮", "block.create.hand_crank": "手摇曲柄", - "block.create.haunted_bell": "怪异钟", + "block.create.haunted_bell": "森魂钟", "block.create.honey": "蜂蜜", "block.create.horizontal_framed_glass": "竖直边框玻璃", "block.create.horizontal_framed_glass_pane": "竖直边框玻璃板", "block.create.hose_pulley": "软管滑轮", "block.create.item_drain": "分液池", - "block.create.jungle_window": "丛林窗户", - "block.create.jungle_window_pane": "丛林窗户板", + "block.create.jungle_window": "丛林木窗户", + "block.create.jungle_window_pane": "丛林木窗户板", "block.create.large_cogwheel": "大齿轮", "block.create.layered_andesite": "层叠安山岩", "block.create.layered_dark_scoria": "层叠深色熔渣", @@ -255,15 +255,15 @@ "block.create.metal_bracket": "金属支架", "block.create.millstone": "石磨", "block.create.minecart_anchor": "矿车锚", - "block.create.mossy_andesite": "生苔安山岩", - "block.create.mossy_dark_scoria": "生苔深色熔渣", - "block.create.mossy_diorite": "生苔闪长岩", - "block.create.mossy_dolomite": "生苔白云岩", - "block.create.mossy_gabbro": "生苔辉长岩", - "block.create.mossy_granite": "生苔花岗岩", - "block.create.mossy_limestone": "生苔石灰岩", - "block.create.mossy_scoria": "生苔熔渣", - "block.create.mossy_weathered_limestone": "生苔风化石灰岩", + "block.create.mossy_andesite": "覆苔安山岩", + "block.create.mossy_dark_scoria": "覆苔深色熔渣", + "block.create.mossy_diorite": "覆苔闪长岩", + "block.create.mossy_dolomite": "覆苔白云岩", + "block.create.mossy_gabbro": "覆苔辉长岩", + "block.create.mossy_granite": "覆苔花岗岩", + "block.create.mossy_limestone": "覆苔石灰岩", + "block.create.mossy_scoria": "覆苔熔渣", + "block.create.mossy_weathered_limestone": "覆苔风化石灰岩", "block.create.mysterious_cuckoo_clock": "布谷鸟闹钟", "block.create.natural_scoria": "天然熔渣", "block.create.nixie_tube": "辉光管", @@ -275,15 +275,15 @@ "block.create.orange_valve_handle": "橙色阀门手轮", "block.create.ornate_iron_window": "华丽铁窗户", "block.create.ornate_iron_window_pane": "华丽铁窗户板", - "block.create.overgrown_andesite": "生草安山岩", - "block.create.overgrown_dark_scoria": "生草深色熔渣", - "block.create.overgrown_diorite": "生草闪长岩", - "block.create.overgrown_dolomite": "生草白云岩", - "block.create.overgrown_gabbro": "生草辉长岩", - "block.create.overgrown_granite": "生草花岗岩", - "block.create.overgrown_limestone": "生草石灰岩", - "block.create.overgrown_scoria": "生草熔渣", - "block.create.overgrown_weathered_limestone": "生草风化石灰岩", + "block.create.overgrown_andesite": "覆草安山岩", + "block.create.overgrown_dark_scoria": "覆草深色熔渣", + "block.create.overgrown_diorite": "覆草闪长岩", + "block.create.overgrown_dolomite": "覆草白云岩", + "block.create.overgrown_gabbro": "覆草辉长岩", + "block.create.overgrown_granite": "覆草花岗岩", + "block.create.overgrown_limestone": "覆草石灰岩", + "block.create.overgrown_scoria": "覆草熔渣", + "block.create.overgrown_weathered_limestone": "覆草风化石灰岩", "block.create.paved_andesite": "安山岩铺路石", "block.create.paved_andesite_slab": "安山岩铺路石台阶", "block.create.paved_andesite_stairs": "安山岩铺路石楼梯", @@ -321,7 +321,7 @@ "block.create.paved_weathered_limestone_stairs": "风化石灰岩铺路石楼梯", "block.create.paved_weathered_limestone_wall": "风化石灰岩铺路石墙", "block.create.peculiar_bell": "奇异钟", - "block.create.pink_nixie_tube": "粉色辉光管", + "block.create.pink_nixie_tube": "粉红色辉光管", "block.create.pink_sail": "粉红色风帆", "block.create.pink_seat": "粉红色坐垫", "block.create.pink_valve_handle": "粉红色阀门手轮", @@ -385,7 +385,7 @@ "block.create.scoria_cobblestone_stairs": "熔渣圆石楼梯", "block.create.scoria_cobblestone_wall": "熔渣圆石墙", "block.create.scoria_pillar": "竖纹熔渣", - "block.create.secondary_linear_chassis": "机壳底盘2号", + "block.create.secondary_linear_chassis": "机壳底盘 2 号", "block.create.sequenced_gearshift": "可编程齿轮箱", "block.create.shadow_steel_casing": "暗影机壳", "block.create.shaft": "传动杆", @@ -393,8 +393,8 @@ "block.create.smart_fluid_pipe": "智能流体管道", "block.create.speedometer": "速度表", "block.create.spout": "注液器", - "block.create.spruce_window": "云杉窗户", - "block.create.spruce_window_pane": "云杉窗户板", + "block.create.spruce_window": "云杉木窗户", + "block.create.spruce_window_pane": "云杉木窗户板", "block.create.sticker": "黏着器", "block.create.sticky_mechanical_piston": "黏性动力活塞", "block.create.stockpile_switch": "存量转换器", @@ -467,7 +467,7 @@ "item.create.copper_sheet": "铜板", "item.create.crafter_slot_cover": "合成器盖板", "item.create.crafting_blueprint": "合成蓝图", - "item.create.creative_blaze_cake": "UNLOCALIZED: Creative Blaze Cake", + "item.create.creative_blaze_cake": "创造模式烈焰蛋糕", "item.create.crushed_aluminum_ore": "粉碎铝矿石", "item.create.crushed_brass": "粉碎黄铜", "item.create.crushed_copper_ore": "粉碎铜矿石", @@ -498,7 +498,7 @@ "item.create.honeyed_apple": "蜜渍苹果", "item.create.incomplete_cogwheel": "齿轮(半成品)", "item.create.incomplete_large_cogwheel": "大齿轮(半成品)", - "item.create.incomplete_precision_mechanism": "精密机构(半成品)", + "item.create.incomplete_precision_mechanism": "精密构件(半成品)", "item.create.iron_sheet": "铁板", "item.create.linked_controller": "无线红石遥控器", "item.create.minecart_contraption": "装配过的矿车", @@ -506,7 +506,7 @@ "item.create.polished_rose_quartz": "磨制玫瑰石英", "item.create.potato_cannon": "土豆加农炮", "item.create.powdered_obsidian": "黑曜石粉末", - "item.create.precision_mechanism": "精密机构", + "item.create.precision_mechanism": "精密构件", "item.create.propeller": "扇叶", "item.create.red_sand_paper": "红沙砂纸", "item.create.refined_radiance": "光辉石", @@ -530,18 +530,18 @@ "_": "->------------------------] Advancements [------------------------<-", "advancement.create.root": "欢迎来到机械动力", - "advancement.create.root.desc": "是时候来制作一些超赞的机械结构了!", - "advancement.create.andesite_alloy": "头韵狂魔(Alliterations Aplenty)", + "advancement.create.root.desc": "是时候来制作一些超赞的机械装置了!", + "advancement.create.andesite_alloy": "头韵狂魔(Alliterations Aplenty)", "advancement.create.andesite_alloy.desc": "机械动力的材料名字都很古怪,安山合金(Andesite Alloy)就是其中之一。", "advancement.create.its_alive": "鲜活的机械生命", - "advancement.create.its_alive.desc": "首次激活齿轮结构的旋转。", + "advancement.create.its_alive.desc": "首次激活动力学组件。", "advancement.create.shifting_gears": "换挡,加速,起飞!", - "advancement.create.shifting_gears.desc": "将大齿轮连接到小齿轮上,可以改变结构的转速。", + "advancement.create.shifting_gears.desc": "将大齿轮连接到小齿轮上,可以改变装置的转速。", "advancement.create.overstressed": "过载", "advancement.create.overstressed.desc": "首次使能量网络过载。", "advancement.create.belt": "海带传动", "advancement.create.belt.desc": "用传送带连接两个传动杆", - "advancement.create.tunnel": "找掩护!", + "advancement.create.tunnel": "躲起来!", "advancement.create.tunnel.desc": "用隧道装饰传送带。", "advancement.create.splitter_tunnel": "分而治之", "advancement.create.splitter_tunnel.desc": "用黄铜隧道设计一个分流器。", @@ -558,7 +558,7 @@ "advancement.create.fan_lava": "地热取暖", "advancement.create.fan_lava.desc": "被熔炼气流烤的酥脆。", "advancement.create.fan_water": "奇妙的洗涤流程", - "advancement.create.fan_water.desc": "被洗涤气流洗了个澡。", + "advancement.create.fan_water.desc": "在洗涤气流里洗了个澡。", "advancement.create.fan_smoke": "动力风箱", "advancement.create.fan_smoke.desc": "被烟熏气流熏得满脸黑。", "advancement.create.wrench": "细节调整", @@ -569,25 +569,25 @@ "advancement.create.speedometer.desc": "放置一个速度表,并且带上工程师护目镜来读取速度数据", "advancement.create.stressometer": "精密的应力控制", "advancement.create.stressometer.desc": "放置一个应力表,并且带上工程师护目镜来读取应力数据", - "advancement.create.aesthetics": "美观,即是一切!", + "advancement.create.aesthetics": "什么叫美学,这就叫美学!", "advancement.create.aesthetics.desc": "将支架放在传动杆,管道和齿轮上。", - "advancement.create.reinforced": "Boom~ 加强!", + "advancement.create.reinforced": "什么叫强化,这就叫强化!", "advancement.create.reinforced.desc": "在传动杆,管道和传送带上使用机壳加固。", - "advancement.create.water_wheel": "治水", + "advancement.create.water_wheel": "掌控水流", "advancement.create.water_wheel.desc": "放置一个水车并且让它开始旋转", - "advancement.create.chocolate_wheel": "味美动力", + "advancement.create.chocolate_wheel": "美味动力", "advancement.create.chocolate_wheel.desc": "用熔融巧克力驱动水车。", "advancement.create.lava_wheel": "风火轮", - "advancement.create.lava_wheel.desc": "它本不应该起作用的......", - "advancement.create.cuckoo": "到点了吗?", - "advancement.create.cuckoo.desc": "目睹布谷鸟钟宣布就寝时间。", + "advancement.create.lava_wheel.desc": "按理说根本不可能运转得起来。", + "advancement.create.cuckoo": "到点儿了吗?", + "advancement.create.cuckoo.desc": "目睹布谷鸟钟提醒你该睡觉觉了。", "advancement.create.millstone": "便携式粉碎机", "advancement.create.millstone.desc": "放置一个石磨并且为其供能", "advancement.create.windmill": "微风吹拂", "advancement.create.windmill.desc": "组装风车。", "advancement.create.maxed_windmill": "强风肆虐", "advancement.create.maxed_windmill.desc": "组装最大强度的风车。", - "advancement.create.andesite_casing": "安山纪元", + "advancement.create.andesite_casing": "安山时代", "advancement.create.andesite_casing.desc": "使用安山合金和木头来合成一个安山机壳", "advancement.create.mechanical_drill": "坚如磐石,势如破竹", "advancement.create.mechanical_drill.desc": "放置一个动力钻头并且为其供能", @@ -609,13 +609,13 @@ "advancement.create.compact.desc": "使用辊压机在工作盆中压缩一些物品", "advancement.create.brass": "真正的合金", "advancement.create.brass.desc": "使用粉碎锌矿石和粉碎铜矿石来制作粉碎黄铜", - "advancement.create.brass_casing": "黄铜纪元", + "advancement.create.brass_casing": "黄铜时代", "advancement.create.brass_casing.desc": "用黄铜和木头制作一个黄铜机壳", - "advancement.create.copper_casing": "铜之纪元", + "advancement.create.copper_casing": "铜器时代", "advancement.create.copper_casing.desc": "使用铜和木头制作一个铜制机壳", "advancement.create.spout": "哗啦啦", "advancement.create.spout.desc": "观察注液器灌满物品。", - "advancement.create.spout_potion": "全球啤酒厂", + "advancement.create.spout_potion": "环球酿造厂", "advancement.create.spout_potion.desc": "观察注液器注入药水到玻璃瓶。", "advancement.create.chocolate": "幻想世界", "advancement.create.chocolate.desc": "获取一桶熔融巧克力。", @@ -631,29 +631,29 @@ "advancement.create.pipe_spill.desc": "观察管道的开口端将流体排放或放置到世界中。", "advancement.create.hose_pulley": "工业泄漏", "advancement.create.hose_pulley.desc": "放下一个软管滑轮,观察它排干或填充一大片液体。", - "advancement.create.infinite_water": "排干海洋", + "advancement.create.infinite_water": "抽干大海", "advancement.create.infinite_water.desc": "从大到足以被认为是无限的水源中抽水。", "advancement.create.infinite_lava": "汲取行星核心", "advancement.create.infinite_lava.desc": "从广阔的熔岩湖中抽出熔岩。", - "advancement.create.infinite_chocolate": "幻想沉溺", + "advancement.create.infinite_chocolate": "美梦不饶人", "advancement.create.infinite_chocolate.desc": "从大到足以被被视为无限的巧克力海中抽取巧克力。", "advancement.create.crafter": "自动化装配", "advancement.create.crafter.desc": "放置一些机械合成台并且为其供能", "advancement.create.clockwork_bearing": "巧械时钟", - "advancement.create.clockwork_bearing.desc": "组装安装在发条轴承上的结构。", + "advancement.create.clockwork_bearing.desc": "组装安装在发条轴承上的装置。", "advancement.create.nixie_tube": "花样符号", "advancement.create.nixie_tube.desc": "获取并放下一对辉光管。", "advancement.create.deployer": "我就指着你了咋地?", "advancement.create.deployer.desc": "放置并且功能一个机械手。这可是你右手的完美复制品", - "advancement.create.speed_controller": "工程师讨厌他!", + "advancement.create.speed_controller": "工程师的眼中钉", "advancement.create.speed_controller.desc": "放置一个转速控制器,这是换档的终极装置。", "advancement.create.flywheel": "工厂之心", "advancement.create.flywheel.desc": "将引擎成功连接到飞轮。", - "advancement.create.overstress_flywheel": "高压", + "advancement.create.overstress_flywheel": "压力山大", "advancement.create.overstress_flywheel.desc": "过载熔炉引擎。", "advancement.create.precision_mechanism": "高新技术", - "advancement.create.precision_mechanism.desc": "装配一个精密机构。", - "advancement.create.mechanical_arm": "忙碌的手!", + "advancement.create.precision_mechanism.desc": "装配一个精密构件。", + "advancement.create.mechanical_arm": "飞转的手!", "advancement.create.mechanical_arm.desc": "制作机械臂,选择输入和输出,放置并给予它动力,然后看着它为你完成所有工作。", "advancement.create.musical_arm": "没人能在我的 BGM 里打败我!", "advancement.create.musical_arm.desc": "使用动力臂播放唱片。", @@ -673,7 +673,7 @@ "advancement.create.shadow_steel.desc": "制作一些暗影钢", "advancement.create.refined_radiance": "明亮而启灵", "advancement.create.refined_radiance.desc": "制作一个光辉石", - "advancement.create.chromatic_age": "异彩纪元", + "advancement.create.chromatic_age": "异彩时代", "advancement.create.chromatic_age.desc": "创造出光与影的机壳。", "advancement.create.wand_of_symmetry": "简单的镜面几何学", "advancement.create.wand_of_symmetry.desc": "制作一个对称之杖", @@ -690,7 +690,7 @@ "_": "->------------------------] UI & Messages [------------------------<-", "itemGroup.create.base": "机械动力", - "itemGroup.create.palettes": "机械动力建筑方块", + "itemGroup.create.palettes": "机械动力丨建筑方块", "death.attack.create.crush": "%1$s被压扁了", "death.attack.create.crush.player": "%1$s被%2$s推进了粉碎机", @@ -728,13 +728,13 @@ "create.recipe.fan_blasting.fan": "在熔岩后放置鼓风机", "create.recipe.pressing": "金属压片", "create.recipe.mixing": "混合搅拌", - "create.recipe.deploying": "自动使用", + "create.recipe.deploying": "使用", "create.recipe.automatic_shapeless": "自动搅拌", "create.recipe.automatic_brewing": "自动酿造", "create.recipe.packing": "压块塑形", "create.recipe.automatic_packing": "自动打包", - "create.recipe.sawing": "板材切割", - "create.recipe.mechanical_crafting": "自动合成", + "create.recipe.sawing": "切割", + "create.recipe.mechanical_crafting": "动力合成", "create.recipe.automatic_shaped": "自动合成", "create.recipe.block_cutting": "方块切割", "create.recipe.wood_cutting": "木材切割", @@ -742,15 +742,15 @@ "create.recipe.mystery_conversion": "神秘转化", "create.recipe.spout_filling": "注液", "create.recipe.draining": "分液", - "create.recipe.sequenced_assembly": "流水线装配", + "create.recipe.sequenced_assembly": "序列组装", "create.recipe.assembly.next": "下一步:%1$s", "create.recipe.assembly.step": "第%1$s步:", "create.recipe.assembly.progress": "组装进度:%1$s/%2$s", - "create.recipe.assembly.pressing": "用辊压机辊压", + "create.recipe.assembly.pressing": "进行辊压", "create.recipe.assembly.spout_filling_fluid": "注入%1$s", "create.recipe.assembly.deploying_item": "安装%1$s", "create.recipe.assembly.cutting": "用动力锯切割", - "create.recipe.assembly.repeat": "该序列需要重复%1$s次", + "create.recipe.assembly.repeat": "该序列需要重复 %1$s 次", "create.recipe.assembly.junk": "随机废料", "create.recipe.processing.chance": "%1$s%%概率", "create.recipe.heat_requirement.none": "无需加热", @@ -788,7 +788,7 @@ "create.gui.scrollInput.scrollToModify": "滚动修改", "create.gui.scrollInput.scrollToAdjustAmount": "滚动修改数量", "create.gui.scrollInput.scrollToSelect": "滚动选择", - "create.gui.scrollInput.shiftScrollsFaster": "按住Shift滚动更快", + "create.gui.scrollInput.shiftScrollsFaster": "按住 Shift 滚动更快", "create.gui.toolmenu.focusKey": "按住 [%1$s] 鼠标滚轮选择", "create.gui.toolmenu.cycle": "[SCROLL] 循环", "create.gui.symmetryWand.mirrorType": "镜子类型", @@ -806,14 +806,14 @@ "create.gui.terrainzapper.title": "手持式环境塑形器", "create.gui.terrainzapper.searchDiagonal": "对角线延伸", - "create.gui.terrainzapper.searchFuzzy": "模糊模式(忽略材料分界)", + "create.gui.terrainzapper.searchFuzzy": "忽略质料分界", "create.gui.terrainzapper.patternSection": "样式", "create.gui.terrainzapper.pattern.solid": "填满", "create.gui.terrainzapper.pattern.checkered": "棋盘格", "create.gui.terrainzapper.pattern.inversecheckered": "反转棋盘格", - "create.gui.terrainzapper.pattern.chance25": "随机填充25%", - "create.gui.terrainzapper.pattern.chance50": "随机填充50%", - "create.gui.terrainzapper.pattern.chance75": "随机填充75%", + "create.gui.terrainzapper.pattern.chance25": "随机填充 25%", + "create.gui.terrainzapper.pattern.chance50": "随机填充 50%", + "create.gui.terrainzapper.pattern.chance75": "随机填充 75%", "create.gui.terrainzapper.placement": "放置模式", "create.gui.terrainzapper.placement.merged": "结合", "create.gui.terrainzapper.placement.attached": "依附", @@ -822,8 +822,8 @@ "create.gui.terrainzapper.brush.cuboid": "矩形体", "create.gui.terrainzapper.brush.sphere": "球体", "create.gui.terrainzapper.brush.cylinder": "圆柱体", - "create.gui.terrainzapper.brush.surface": "连接的面", - "create.gui.terrainzapper.brush.cluster": "连接的立体区域", + "create.gui.terrainzapper.brush.surface": "表面", + "create.gui.terrainzapper.brush.cluster": "簇状", "create.gui.terrainzapper.tool": "填充类型", "create.gui.terrainzapper.tool.fill": "填充", "create.gui.terrainzapper.tool.place": "复写", @@ -832,8 +832,8 @@ "create.gui.terrainzapper.tool.overlay": "覆盖", "create.gui.terrainzapper.tool.flatten": "平整", - "create.terrainzapper.shiftRightClickToSet": "Shift+鼠标右击以设置塑形类型", - "create.terrainzapper.usingBlock": "填充材料:%1$s", + "create.terrainzapper.shiftRightClickToSet": "按住 Shift 右击以设置塑形类型", + "create.terrainzapper.usingBlock": "使用:%1$s", "create.terrainzapper.leftClickToSet": "鼠标左击一个方块以设置填充材料", "create.minecart_coupling.two_couplings_max": "矿车无法被连接两个以上的矿车连轴器", @@ -850,20 +850,20 @@ "create.contraptions.movement_mode.rotate_place_returned": "停止时只在接近初始角度才将装置方块化", "create.contraptions.movement_mode.rotate_never_place": "只有在旋转轴摧毁后才将装置方块化", "create.contraptions.cart_movement_mode": "矿车运动模式", - "create.contraptions.cart_movement_mode.rotate": "装置与矿车保持相同方向", + "create.contraptions.cart_movement_mode.rotate": "始终面朝前进方向", "create.contraptions.cart_movement_mode.rotate_paused": "矿车转向时机器停止工作", - "create.contraptions.cart_movement_mode.rotation_locked": "装置方向保持不变", + "create.contraptions.cart_movement_mode.rotation_locked": "旋转锁定", "create.contraptions.windmill.rotation_direction": "旋转方向", "create.contraptions.clockwork.clock_hands": "钟表指针", "create.contraptions.clockwork.hour_first": "时针优先", "create.contraptions.clockwork.minute_first": "分针优先", - "create.contraptions.clockwork.hour_first_24": "24小时制优先", + "create.contraptions.clockwork.hour_first_24": "24 小时制优先", "create.logistics.filter": "过滤器", "create.logistics.recipe_filter": "配方过滤器", "create.logistics.fluid_filter": "流体过滤器", - "create.logistics.firstFrequency": "频道. #1", - "create.logistics.secondFrequency": "频道. #2", + "create.logistics.firstFrequency": "UNLOCALIZED: Freq. #1", + "create.logistics.secondFrequency": "UNLOCALIZED: Freq. #2", "create.logistics.filter.apply": "已将过滤应用于%1$s。", "create.logistics.filter.apply_click_again": "已将过滤应用于%1$s,再次点击可将手持物品数量复制到过滤器上。", "create.logistics.filter.apply_count": "已将提取数量应用至过滤器。", @@ -874,13 +874,13 @@ "create.gui.goggles.pole_length": "活塞杆长度:", "create.gui.goggles.fluid_container": "流体容器信息:", "create.gui.goggles.fluid_container.capacity": "容量:", - "create.gui.assembly.exception": "无法组装该结构:", + "create.gui.assembly.exception": "无法组装该装置:", "create.gui.assembly.exception.unmovableBlock": "无法移动的方块:(%4$s)位于 [%1$s,%2$s,%3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "位于 [%1$s,%2$s,%3$s] 的方块未处于加载区块", - "create.gui.assembly.exception.structureTooLarge": "结构中的方块数量过多。\n配置中的最大数量限制为:%1$s", - "create.gui.assembly.exception.tooManyPistonPoles": "活塞加装的活塞杆数量过多。\n配置中的最大数量限制为:%1$s", + "create.gui.assembly.exception.chunkNotLoaded": "位于 [%1$s,%2$s,%3$s] 的方块未处于加载区块", + "create.gui.assembly.exception.structureTooLarge": "装置中的方块数量过多。", + "create.gui.assembly.exception.tooManyPistonPoles": "活塞加装的活塞杆数量过多。", "create.gui.assembly.exception.noPistonPoles": "活塞缺失部分活塞杆", - "create.gui.assembly.exception.not_enough_sails": "相接的结构所包含的类风帆方块的数量不足。%1$s\n最低需要 %2$s 个方块", + "create.gui.assembly.exception.not_enough_sails": "相接的结构所包含的类风帆方块的数量不足。%1$s", "create.gui.gauge.info_header": "仪表信息:", "create.gui.speedometer.title": "旋转速度", "create.gui.stressometer.title": "网络应力", @@ -919,7 +919,7 @@ "create.schematicAndQuill.dimensions": "蓝图尺寸:%1$sx%2$sx%3$s", "create.schematicAndQuill.firstPos": "第一个位置。", "create.schematicAndQuill.secondPos": "第二个位置。", - "create.schematicAndQuill.noTarget": "按住Ctrl选择空气方块。", + "create.schematicAndQuill.noTarget": "按住 Ctrl 选择空气方块。", "create.schematicAndQuill.abort": "删除选择。", "create.schematicAndQuill.title": "蓝图名:", "create.schematicAndQuill.convert": "立即保存并部署", @@ -945,18 +945,18 @@ "create.schematic.tool.flip": "翻转", "create.schematic.tool.deploy.description.0": "将结构移到某个位置。", "create.schematic.tool.deploy.description.1": "在地面上单击鼠标右击以放置。", - "create.schematic.tool.deploy.description.2": "按住Ctrl以固定距离选择。", - "create.schematic.tool.deploy.description.3": "按住Ctrl鼠标滚动更改距离。", + "create.schematic.tool.deploy.description.2": "按住 Ctrl 以固定距离选择。", + "create.schematic.tool.deploy.description.3": "按住 Ctrl 鼠标滚动更改距离。", "create.schematic.tool.move.description.0": "水平移动蓝图", - "create.schematic.tool.move.description.1": "选定蓝图,然后按住Ctrl鼠标滚动移动。", + "create.schematic.tool.move.description.1": "选定蓝图,然后按住 Ctrl 鼠标滚动移动。", "create.schematic.tool.move.description.2": "", "create.schematic.tool.move.description.3": "", "create.schematic.tool.movey.description.0": "垂直移动蓝图", - "create.schematic.tool.movey.description.1": "按住Ctrl鼠标滚动上下移动", + "create.schematic.tool.movey.description.1": "按住 Ctrl 鼠标滚动上下移动", "create.schematic.tool.movey.description.2": "", "create.schematic.tool.movey.description.3": "", "create.schematic.tool.rotate.description.0": "围绕蓝图中心旋转蓝图。", - "create.schematic.tool.rotate.description.1": "按住Ctrl鼠标滚动旋转90度", + "create.schematic.tool.rotate.description.1": "按住 Ctrl 鼠标滚动旋转90度", "create.schematic.tool.rotate.description.2": "", "create.schematic.tool.rotate.description.3": "", "create.schematic.tool.print.description.0": "立即将结构放置在世界上", @@ -964,7 +964,7 @@ "create.schematic.tool.print.description.2": "该工具仅适用于创造模式。", "create.schematic.tool.print.description.3": "", "create.schematic.tool.flip.description.0": "沿你选择的面翻转蓝图。", - "create.schematic.tool.flip.description.1": "指向蓝图,然后按住Ctrl鼠标滚动将其翻转。", + "create.schematic.tool.flip.description.1": "指向蓝图,然后按住 Ctrl 鼠标滚动将其翻转。", "create.schematic.tool.flip.description.2": "", "create.schematic.tool.flip.description.3": "", @@ -991,7 +991,7 @@ "create.gui.schematicannon.option.replaceWithSolid": "用固体方块替换工作区域内的方块", "create.gui.schematicannon.option.replaceWithAny": "用任何方块替换工作区域内的方块", "create.gui.schematicannon.option.replaceWithEmpty": "用空气替换工作区域内的方块", - "create.gui.schematicannon.option.skipMissing": "绕过缺少的方块", + "create.gui.schematicannon.option.skipMissing": "跳过缺少的方块", "create.gui.schematicannon.option.skipTileEntities": "保护存储方块", "create.gui.schematicannon.slot.gunpowder": "向蓝图加农炮添加火药以提供动力", "create.gui.schematicannon.slot.listPrinter": "在此处放置书以打印蓝图所需的材料清单", @@ -1003,17 +1003,17 @@ "create.gui.schematicannon.option.replaceWithAny.description": "蓝图加农炮会使用任何所提供的方块来替换工作区域内的固体方块", "create.gui.schematicannon.option.replaceWithEmpty.description": "蓝图加农炮将清理和替换工作区域内所有原本的方块。", - "create.schematicannon.status.idle": "闲置", - "create.schematicannon.status.ready": "准备", - "create.schematicannon.status.running": "运行", - "create.schematicannon.status.finished": "完成", + "create.schematicannon.status.idle": "闲置中", + "create.schematicannon.status.ready": "准备中", + "create.schematicannon.status.running": "运行中", + "create.schematicannon.status.finished": "已完成", "create.schematicannon.status.paused": "已暂停", - "create.schematicannon.status.stopped": "停止", - "create.schematicannon.status.noGunpowder": "火药消耗完毕", - "create.schematicannon.status.targetNotLoaded": "方块未加载", - "create.schematicannon.status.targetOutsideRange": "定位目标太远", - "create.schematicannon.status.searching": "搜索", - "create.schematicannon.status.skipping": "跳过", + "create.schematicannon.status.stopped": "已停止", + "create.schematicannon.status.noGunpowder": "火药已耗尽", + "create.schematicannon.status.targetNotLoaded": "目标未被加载", + "create.schematicannon.status.targetOutsideRange": "目标太远", + "create.schematicannon.status.searching": "正在搜索", + "create.schematicannon.status.skipping": "正在跳过", "create.schematicannon.status.missingBlock": "缺少方块:", "create.schematicannon.status.placing": "建筑中", "create.schematicannon.status.clearing": "清除方块中", @@ -1022,7 +1022,7 @@ "create.schematicannon.status.schematicExpired": "蓝图文件已过期", "create.materialChecklist": "材料清单", - "create.materialChecklist.blocksNotLoaded": "*免责声明* \n\n由于未加载相关区块,材料清单可能不正确。", + "create.materialChecklist.blocksNotLoaded": "*免责声明* ", "create.gui.filter.deny_list": "黑名单", "create.gui.filter.deny_list.description": "只通过不在黑名单中的物品,如果黑名单为空,所有物品都可以通过", @@ -1064,20 +1064,20 @@ "create.item_attributes.in_item_group": "属于%1$s", "create.item_attributes.in_item_group.inverted": "不属于%1$s", "create.item_attributes.added_by": "由%1$s添加", - "create.item_attributes.added_by.inverted": "不是由%1$s添加", + "create.item_attributes.added_by.inverted": "不由%1$s添加", "create.item_attributes.shulker_level": "潜影盒是%1$s的", "create.item_attributes.shulker_level.inverted": "潜影盒不是%1$s的", "create.item_attributes.shulker_level.full": "满", "create.item_attributes.shulker_level.empty": "空", - "create.item_attributes.shulker_level.partial": "半满", + "create.item_attributes.shulker_level.partial": "部分填充", "create.item_attributes.has_enchant": "有附魔效果%1$s", "create.item_attributes.has_enchant.inverted": "没有附魔效果%1$s", "create.item_attributes.color": "染色为%1$s", "create.item_attributes.color.inverted": "未被染成%1$s", - "create.item_attributes.max_enchanted": "已达到最高附魔等", + "create.item_attributes.max_enchanted": "已达到最高附魔等级", "create.item_attributes.max_enchanted.inverted": "并未达到最高附魔等级", - "create.item_attributes.has_fluid": "包含%1$s", - "create.item_attributes.has_fluid.inverted": "不包含%1$s", + "create.item_attributes.has_fluid": "含有%1$s", + "create.item_attributes.has_fluid.inverted": "不含有%1$s", "create.item_attributes.has_name": "有自定义名称%1$s", "create.item_attributes.has_name.inverted": "没有自定义名称%1$s", "create.item_attributes.book_author": "由%1$s编写", @@ -1099,8 +1099,8 @@ "create.item_attributes.astralsorcery_amulet": "璀璨棱镜增强%1$s", "create.item_attributes.astralsorcery_amulet.inverted": "璀璨棱镜未增强%1$s", - "create.gui.attribute_filter.no_selected_attributes": "没有标记任何属性", - "create.gui.attribute_filter.selected_attributes": "已选择的属性:", + "create.gui.attribute_filter.no_selected_attributes": "未选择任何属性", + "create.gui.attribute_filter.selected_attributes": "已选择的属性:", "create.gui.attribute_filter.add_attribute": "向列表中添加属性", "create.gui.attribute_filter.add_inverted_attribute": "向列表中添加相反属性", "create.gui.attribute_filter.allow_list_disjunctive": "任意匹配白名单(任何)", @@ -1132,14 +1132,14 @@ "create.tooltip.analogStrength": "模拟信号强度:%1$s/15", "create.mechanical_arm.extract_from": "从%1$s中拿取物品", - "create.mechanical_arm.deposit_to": "向%1$s存储物品", - "create.mechanical_arm.summary": "动力臂当前有%1$s个输入,%2$s个输出。", + "create.mechanical_arm.deposit_to": "将物品存储至%1$s", + "create.mechanical_arm.summary": "动力臂当前有 %1$s 个输入,%2$s 个输出。", "create.mechanical_arm.points_outside_range": "由于距离限制,选定的交互点%1$s已被移除。", "create.weighted_ejector.target_set": "目标已选取", "create.weighted_ejector.target_not_valid": "弹射至临近方块(目标无效)", "create.weighted_ejector.no_target": "弹射至临近方块(未选择目标)", - "create.weighted_ejector.targeting": "弹射至[%1$s,%2$s,%3$s]", + "create.weighted_ejector.targeting": "弹射至 [%1$s,%2$s,%3$s]", "create.weighted_ejector.stack_size": "弹射物品堆数量", "create.logistics.when_multiple_outputs_available": "当多个输出可用时", @@ -1165,22 +1165,22 @@ "create.tooltip.chute.fans_pull_up": "鼓风机从上方进行吸引", "create.tooltip.chute.fans_pull_down": "鼓风机从下方进行吸引", "create.tooltip.chute.contains": "内含物品:%1$s x%2$s", - "create.tooltip.brass_tunnel.contains": "等待分配的物品:", - "create.tooltip.brass_tunnel.contains_entry": "> %2$s个%1$s", + "create.tooltip.brass_tunnel.contains": "目前分配:", + "create.tooltip.brass_tunnel.contains_entry": "> %1$s x%2$s", "create.tooltip.brass_tunnel.retrieve": "鼠标右击取出", "create.linked_controller.bind_mode": "绑定模式激活", - "create.linked_controller.press_keybind": "按%1$s,%2$s,%3$s,%4$s,%5$s或%6$s选择要将该频率绑定到哪个按键。", + "create.linked_controller.press_keybind": "按下%1$s、%2$s、%3$s、%4$s、%5$s或%6$s,可以将该频率绑定到按下的按键上。", "create.linked_controller.key_bound": "该频率已绑定到%1$s", - "create.linked_controller.frequency_slot_1": "按键:%1$s,频道 #1", - "create.linked_controller.frequency_slot_2": "按键:%1$s,频道 #2", + "create.linked_controller.frequency_slot_1": "UNLOCALIZED: Keybind: %1$s, Freq. #1", + "create.linked_controller.frequency_slot_2": "UNLOCALIZED: Keybind: %1$s, Freq. #2", - "create.crafting_blueprint.crafting_slot": "合成材料格", + "create.crafting_blueprint.crafting_slot": "原料槽", "create.crafting_blueprint.filter_items_viable": "可以使用过滤器", - "create.crafting_blueprint.display_slot": "展示的图标", + "create.crafting_blueprint.display_slot": "展示槽", "create.crafting_blueprint.inferred": "已根据合成配方自动设定", "create.crafting_blueprint.manually_assigned": "手动设定", - "create.crafting_blueprint.secondary_display_slot": "展示的图标角标", + "create.crafting_blueprint.secondary_display_slot": "次要展示槽", "create.crafting_blueprint.optional": "可选", "create.potato_cannon.ammo.attack_damage": "%1$s 攻击伤害", @@ -1192,7 +1192,7 @@ "create.hint.mechanical_arm_no_targets.title": "没有目标", "create.hint.mechanical_arm_no_targets": "看起来这个_动力臂_没有被分配给任何_目标_。在手持机械臂的同时,右击选取传送带、置物台、漏斗或其他设备来设置目标。", "create.hint.empty_bearing.title": "更新轴承", - "create.hint.empty_bearing": "_空手右击_轴承来_激活_你新建造的结构。", + "create.hint.empty_bearing": "_空手右击_轴承,可以将你新建造的结构_接到_轴承上。", "create.hint.full_deployer.title": "机械手物品溢出", "create.hint.full_deployer": "_机械手_包含_过剩的物品,_需要被_提取。你需要_使用_料斗,__漏斗_或其他方法将溢出释放出来。", @@ -1206,15 +1206,15 @@ "create.gui.config.overlay8": "重置到默认位置", "create.command.killTPSCommand": "killtps", - "create.command.killTPSCommand.status.slowed_by.0": "[Create]: 服务器每秒tick速被降低为 %s ms :o", - "create.command.killTPSCommand.status.slowed_by.1": "[Create]: 服务器现在每秒tick速被降低为 >:)", - "create.command.killTPSCommand.status.slowed_by.2": "[Create]: 服务器恢复到正常速度 :D", - "create.command.killTPSCommand.status.usage.0": "[Create]: 用 /killtps stop 来让服务器的TPS速度变回正常", - "create.command.killTPSCommand.status.usage.1": "[Create]: 用 /killtps start 来手动降低服务器TPS速度", + "create.command.killTPSCommand.status.slowed_by.0": "[Create]: 服务器现在的 TPS 速度被降低为 %s ms :o", + "create.command.killTPSCommand.status.slowed_by.1": "[Create]: 服务器现在的 TPS 速度被降低为 >:)", + "create.command.killTPSCommand.status.slowed_by.2": "[Create]: 服务器恢复到正常的 TPS 速度 :D", + "create.command.killTPSCommand.status.usage.0": "[Create]: 用 /killtps stop 来让服务器的 TPS 速度变回正常", + "create.command.killTPSCommand.status.usage.1": "[Create]: 用 /killtps start 来手动降低服务器 TPS 速度", "create.command.killTPSCommand.argument.tickTime": "tickTime", "create.contraption.minecart_contraption_too_big": "这一矿车装置似乎太大了,无法变为拾捡状态", - "create.contraption.minecart_contraption_illegal_pickup": "神秘的力量阻止你拾取这个矿车装置。", + "create.contraption.minecart_contraption_illegal_pickup": "一股神秘的力量将这一装置与世界牢牢绑定在了一起。", "_": "->------------------------] Subtitles [------------------------<-", @@ -1231,12 +1231,12 @@ "create.subtitle.blaze_munch": "烈焰人:咀嚼", "create.subtitle.funnel_flap": "漏斗:垂帘碰撞", "create.subtitle.schematicannon_finish": "蓝图加农炮:叮", - "create.subtitle.haunted_bell_use": "怪异钟:鸣响", + "create.subtitle.haunted_bell_use": "森魂钟:鸣响", "create.subtitle.scroll_value": "拨码输入:咔哒", "create.subtitle.crafter_craft": "动力合成器:合成中", "create.subtitle.controller_put": "遥控器:放进讲台", "create.subtitle.cranking": "手摇曲柄:转动", - "create.subtitle.wrench_remove": "部件:被破坏", + "create.subtitle.wrench_remove": "组件:被破坏", "create.subtitle.cogs": "齿轮:嘎吱作响", "create.subtitle.slime_added": "粘液:挤碎声", "create.subtitle.wrench_rotate": "扳手:拧动", @@ -1276,7 +1276,7 @@ "block.create.seat.tooltip": "坐垫", "block.create.seat.tooltip.summary": "坐下来享受旅程吧!坐垫将会把玩家固定在一个移动装置上。也可以用来作为居家装饰,毕竟他有许多颜色。", "block.create.seat.tooltip.condition1": "右击坐垫", - "block.create.seat.tooltip.behaviour1": "会使得玩家坐在_坐垫_上,L-Shift可离开_坐垫_。", + "block.create.seat.tooltip.behaviour1": "会使得玩家坐在_坐垫_上,按下左 Shift 可离开_坐垫_。", "item.create.blaze_cake.tooltip": "烈焰蛋糕", "item.create.blaze_cake.tooltip.summary": "为辛勤劳作的_烈焰人_精心准备的美味。让他们兴奋起来吧!", @@ -1316,7 +1316,7 @@ "item.create.potato_cannon.tooltip": "土豆加农炮", "item.create.potato_cannon.tooltip.summary": "噗!把你亲手栽培的蔬菜砸向你的敌人。可以使用_铜制背罐_供能。", "item.create.potato_cannon.tooltip.condition1": "当右击时", - "item.create.potato_cannon.tooltip.behaviour1": "_发射_你_物品栏_中任一可做弹药的物品。", + "item.create.potato_cannon.tooltip.behaviour1": "_发射_你_物品栏_中任一可作为弹药的物品。", "item.create.potato_cannon.tooltip.condition2": "当装备铜制背罐时", "item.create.potato_cannon.tooltip.behaviour2": "使用罐中_气压_来_抵消_土豆加农炮的_耐久_损耗。", @@ -1359,8 +1359,8 @@ "block.create.schematicannon.tooltip": "蓝图加农炮", "block.create.schematicannon.tooltip.summary": "发射方块,重新构建已在世界中部署的_蓝图_,会使用相邻箱子中的物品进行填充,_火药_作为燃料。", - "block.create.schematicannon.tooltip.condition1": "当右击时", - "block.create.schematicannon.tooltip.behaviour1": "打开_配置面板_。", + "block.create.schematicannon.tooltip.condition1": "When R-Clicked", + "block.create.schematicannon.tooltip.behaviour1": "Opens the _Interface_", "block.create.schematic_table.tooltip": "蓝图桌", "block.create.schematic_table.tooltip.summary": "将保存的蓝图图写入_空白蓝图_", @@ -1412,10 +1412,10 @@ "block.create.creative_crate.tooltip.condition1": "当标记了物品时", "block.create.creative_crate.tooltip.behaviour1": "任何从容器中_提取_的物品都是_无限量的_,而任何_放置_到容器中的物品都会被_送入虚空_", - "item.create.creative_blaze_cake.tooltip": "UNLOCALIZED: CREATIVE CAKE", - "item.create.creative_blaze_cake.tooltip.summary": "UNLOCALIZED: A very special treat for _Blaze Burners_ that allows _controlling their heat level_. After eating this cake, Blaze Burners will _never run out of fuel_.", - "item.create.creative_blaze_cake.tooltip.condition1": "UNLOCALIZED: R-Click on Blaze Burner", - "item.create.creative_blaze_cake.tooltip.behaviour1": "UNLOCALIZED: _Locks_ the Blaze Burner's heat level. If used again, _cycles_ the Blaze Burner's heat level.", + "item.create.creative_blaze_cake.tooltip": "创造蛋糕", + "item.create.creative_blaze_cake.tooltip.summary": "为_烈焰人燃烧室_特制的小食,可以让你_控制燃烧室的热量等级_。吃下这个蛋糕之后,烈焰人燃烧室将_不再耗尽燃料_。", + "item.create.creative_blaze_cake.tooltip.condition1": "对着烈焰人燃烧室使用", + "item.create.creative_blaze_cake.tooltip.behaviour1": "_锁定_烈焰人燃烧室的热量等级。如果再次使用,会使得燃烧室的热量等级开始_循环_变化。", "block.create.controller_rail.tooltip": "控制铁轨", "block.create.controller_rail.tooltip.summary": "一种_汇流的,受红石信号影响的_铁轨,可以_较好地控制_经过矿车的_移动速度_。", @@ -1428,7 +1428,7 @@ "item.create.sand_paper.tooltip.behaviour1": "打磨_副手_上或者_准心所指_的物品。", "item.create.builders_tea.tooltip": "建造工茶饮", - "item.create.builders_tea.tooltip.summary": "饮下这杯完美茶饮,开启神清气爽的一天。可以回复_饥饿值_并获得_急迫_效果。", + "item.create.builders_tea.tooltip.summary": "饮下这杯完美茶饮,开启神清气爽的一天。可以恢复_饥饿值_并获得_急迫_效果。", "item.create.refined_radiance.tooltip": "光辉石", "item.create.refined_radiance.tooltip.summary": "一种用_光辉_锻造的化合物材料。", @@ -1443,13 +1443,13 @@ "item.create.linked_controller.tooltip": "无线红石遥控器", "item.create.linked_controller.tooltip.summary": "提供_六个_可以绑定_无线红石_频道的按钮,用于_遥控_附近的_无线红石信号终端_。", "item.create.linked_controller.tooltip.condition1": "右击时", - "item.create.linked_controller.tooltip.behaviour1": "_拿起_或_放下_遥控器。拿起遥控器时,_移动_按键将被用来_操作遥控器_而不是移动玩家。", + "item.create.linked_controller.tooltip.behaviour1": "_拿起_或_放下_遥控器。拿起遥控器时,_控制移动_将被用来_操作遥控器_,而不是移动玩家。", "item.create.linked_controller.tooltip.condition2": "潜行右击时", "item.create.linked_controller.tooltip.behaviour2": "打开手动_配置界面_。", "item.create.linked_controller.tooltip.condition3": "右击无线红石信号终端时", - "item.create.linked_controller.tooltip.behaviour3": "启用_配对模式_,按_六个按键_中的一个来配对_无线红石信号终端_的_频率_。", + "item.create.linked_controller.tooltip.behaviour3": "启用_绑定模式_,按下_六个按键_中的一个,即可将此按键与_无线红石信号终端的频率_绑定。", "item.create.linked_controller.tooltip.condition4": "右击讲台时", - "item.create.linked_controller.tooltip.behaviour4": "将遥控器放在讲台上以便使用。(潜行右击来取回遥控器。)", + "item.create.linked_controller.tooltip.behaviour4": "将遥控器放在讲台上以便使用(潜行右击来取回遥控器)。", "item.create.diving_helmet.tooltip": "潜水头盔", "item.create.diving_helmet.tooltip.summary": "与_铜制背罐_配合使用,为穿戴者提供在_水下_行动一段时间所需的_空气_。", @@ -1469,24 +1469,24 @@ "item.create.diving_boots.tooltip.behaviour1": "穿戴者_下沉更快_并_无法游泳_。穿戴者可以在水下_行走_和_跳跃_。穿戴者不会被_传送带_移走。", "item.create.crafting_blueprint.tooltip": "合成蓝图", - "item.create.crafting_blueprint.tooltip.summary": "_放在_墙上。设置特定的_原料排布_以便更快地手搓物品。每个格子都可以设定一个配方。", + "item.create.crafting_blueprint.tooltip.summary": "_放在_墙上,便可用它来设置特定的_原料排布_,以便更快地制作物品。每个格子都可以设定一个配方。", "item.create.crafting_blueprint.condition1": "当右击空的格子时", - "item.create.crafting_blueprint.behaviour1": "打开一个_配方设置界面_,用于_设置_一个_合成配方_以及设置显示的图标。", + "item.create.crafting_blueprint.behaviour1": "打开一个_配方设置界面_,用于_设置_一个_合成配方_以及展示的物品。", "item.create.crafting_blueprint.condition2": "当右击设置好的格子时", - "item.create.crafting_blueprint.behaviour2": "使用_物品栏_中的物品制作_设置的配方_。_潜行_以一次合成_一组_。", + "item.create.crafting_blueprint.behaviour2": "使用_物品栏_中的物品制作_设置的配方_。_潜行_可以一次合成_一组_。", "item.create.minecart_coupling.tooltip": "矿车连轴器", - "item.create.minecart_coupling.tooltip.summary": "将多个_矿车_或运输结构链接在一起,构成雄伟的火车。", + "item.create.minecart_coupling.tooltip.summary": "将多个_矿车_或_连接运输装置_链接在一起,构成雄伟的火车。", "item.create.minecart_coupling.tooltip.condition1": "作用与矿车时", "item.create.minecart_coupling.tooltip.behaviour1": "将两个矿车耦合在一起,在移动时将它们保持_恒定的距离_。", "block.create.peculiar_bell.tooltip": "奇异钟", - "block.create.peculiar_bell.tooltip.summary": "装饰用的_黄铜质钟_。放在_灵魂火_的正上方可能会产生意料之外的后果……", + "block.create.peculiar_bell.tooltip.summary": "装饰用的_黄铜质钟_。放在_灵魂火_的正上方可能会产生意料之外的后果......", - "block.create.haunted_bell.tooltip": "怪异钟", - "block.create.haunted_bell.tooltip.summary": "_被诅咒_的钟,其中充满了来自下界的迷失的灵魂。", + "block.create.haunted_bell.tooltip": "森魂钟", + "block.create.haunted_bell.tooltip.summary": "_被诅咒_的钟,来自下界的迷失的灵魂缠绕于其上。", "block.create.haunted_bell.tooltip.condition1": "当手持或鸣响时", - "block.create.haunted_bell.tooltip.behaviour1": "标识出附近可能生成_敌对生物_的_黑暗_的地方。", + "block.create.haunted_bell.tooltip.behaviour1": "标识出附近可能生成_敌对生物_的_亮度不足_之处。", "_": "->------------------------] Ponder Content [------------------------<-", @@ -1504,10 +1504,10 @@ "create.ponder.think_back": "回想", "create.ponder.slow_text": "舒适阅读", "create.ponder.exit": "退出", - "create.ponder.welcome": "欢迎来到思索项目列表", + "create.ponder.welcome": "欢迎来到思索界面", "create.ponder.categories": "机械动力中包含的条目", "create.ponder.index_description": "点击一个图标来查看相关的物品和方块。", - "create.ponder.index_title": "思索项目列表", + "create.ponder.index_title": "思索索引", "create.ponder.shared.rpm16": "16 RPM", "create.ponder.shared.behaviour_modify_wrench": "可以用扳手调整它的行为。", "create.ponder.shared.storage_on_contraption": "与装置相接的存储空间,会自动将装置遇到的掉落物拾取到空间内。", @@ -1515,12 +1515,12 @@ "create.ponder.shared.rpm8": "8 RPM", "create.ponder.shared.ctrl_and": "Ctrl +", "create.ponder.shared.rpm32": "32 RPM", - "create.ponder.shared.rpm16_source": "动力源:16 R", + "create.ponder.shared.rpm16_source": "动力源:16 RPM", "create.ponder.shared.movement_anchors": "有了底盘和强力胶,移动起大型结构轻轻松松。", "create.ponder.tag.redstone": "逻辑组件", "create.ponder.tag.redstone.description": "这些组件会在红石工程中发挥大用处。", - "create.ponder.tag.contraption_assembly": "方块连接物件", - "create.ponder.tag.contraption_assembly.description": "将各个组件连接以便同时运动的物件", + "create.ponder.tag.contraption_assembly": "方块连接功能", + "create.ponder.tag.contraption_assembly.description": "将各个组件连接以便同时运动的工具以及组件", "create.ponder.tag.fluids": "流体操纵器械", "create.ponder.tag.fluids.description": "这些组件可以用于传递流体,以及利用流体进行工作。", "create.ponder.tag.decoration": "装饰", @@ -1579,7 +1579,7 @@ "create.ponder.basin.text_9": "若是加装过滤,那么你便无需担心会将未被处理的物品抽取出来了", "create.ponder.bearing_modes.header": "动力轴承的运动模式", - "create.ponder.bearing_modes.text_1": "当结构停止时,轴承会控制结构以特定的角度停在最近的与格相对齐之处", + "create.ponder.bearing_modes.text_1": "停止时,轴承会控制结构以特定的角度停在最近的与格相对齐之处", "create.ponder.bearing_modes.text_2": "你可以调整整个结构永不方块化,或者仅在结构的起始位置方块化", "create.ponder.belt_casing.header": "带机壳的传送带", @@ -1642,20 +1642,20 @@ "create.ponder.brass_tunnel_modes.text_8": "“最近优先”会将物品优先送入距离输入口更近的输出口", "create.ponder.brass_tunnel_modes.text_9": "“随机”会随机选择一个输出口,一次性送入所有物品", - "create.ponder.cart_assembler.header": "使用矿车装配站组装运动结构", + "create.ponder.cart_assembler.header": "使用矿车装配站控制结构移动", "create.ponder.cart_assembler.text_1": "矿车装配站会将它所连接的结构安装到矿车上", "create.ponder.cart_assembler.text_2": "若没有通入红石信号,它会将矿车装置解散为方块的形式", "create.ponder.cart_assembler.text_3": "对着矿车使用你的扳手,装置会变为可搬运的形式", - "create.ponder.cart_assembler_dual.header": "组装连接结构", + "create.ponder.cart_assembler_dual.header": "组装连接运输装置", "create.ponder.cart_assembler_dual.text_1": "若两个装配矿车分享了同一个结构", - "create.ponder.cart_assembler_dual.text_2": "给其中的任意一方的矿车装配站通入红石信号,都会创建出连接装置", + "create.ponder.cart_assembler_dual.text_2": "给其中的任意一方的矿车装配站通入红石信号,都会创建出连接运输装置", "create.ponder.cart_assembler_dual.text_3": "两辆矿车的此时行为与用矿车连轴器连接在一起时十分相似", "create.ponder.cart_assembler_modes.header": "矿车装置的方向设定", "create.ponder.cart_assembler_modes.text_1": "矿车装置会随着矿车的运动而发生转向", "create.ponder.cart_assembler_modes.text_2": "矿车装置上的箭头表明了哪一侧是“前面”", - "create.ponder.cart_assembler_modes.text_3": "如果装配结构的方向锁定了,那么结构的方向将不再改变", + "create.ponder.cart_assembler_modes.text_3": "如果装配站的配置为“旋转锁定”,那么装置的方向将不会改变", "create.ponder.cart_assembler_rails.header": "另外几种矿车以及铁轨", "create.ponder.cart_assembler_rails.text_1": "放置在普通轨道上的矿车装配站并不会影响路过矿车装置的运动", @@ -1686,12 +1686,12 @@ "create.ponder.chute_upward.text_2": "佩戴工程师护目镜时,你可以看见物品的移动方向", "create.ponder.chute_upward.text_3": "在溜槽“被挡住的”底端,物品只能从侧边进行提取或输入", - "create.ponder.clockwork_bearing.header": "使用时钟轴承来移动结构", - "create.ponder.clockwork_bearing.text_1": "时钟轴承黏附其正前方的方块", + "create.ponder.clockwork_bearing.header": "使用发条轴承来使结构运动", + "create.ponder.clockwork_bearing.text_1": "发条轴承黏附其正前方的方块", "create.ponder.clockwork_bearing.text_2": "当接受旋转力时,其附着结构会根据游戏内时间来进行旋转", "create.ponder.clockwork_bearing.text_3": "3:00", "create.ponder.clockwork_bearing.text_4": "4:00", - "create.ponder.clockwork_bearing.text_5": "右击可以来激活/停止结构运动", + "create.ponder.clockwork_bearing.text_5": "右击可以激活/停止结构运动", "create.ponder.clockwork_bearing.text_6": "在时针前方可添加第二个结构", "create.ponder.clockwork_bearing.text_7": "请确保这两个结构没有互相被例如强力胶等方式黏附", "create.ponder.clockwork_bearing.text_8": "第二个结构将会作为分针进行旋转", @@ -1710,9 +1710,9 @@ "create.ponder.cogwheel.text_2": "以此方式连接的齿轮,旋转方向相反", "create.ponder.creative_fluid_tank.header": "创造流体储罐", - "create.ponder.creative_fluid_tank.text_1": "创造流体储罐可以提供无限数量的流体", - "create.ponder.creative_fluid_tank.text_2": "使用一个含有流体的容器右击它来设置它提供的流体", - "create.ponder.creative_fluid_tank.text_3": "流体管道可以从中无限提取设置的流体", + "create.ponder.creative_fluid_tank.text_1": "创造流体储罐可以提供无限量的流体", + "create.ponder.creative_fluid_tank.text_2": "使用一个含有流体的容器右击它,即可指定它提供特定的流体", + "create.ponder.creative_fluid_tank.text_3": "流体管道可以从中无限提取指定的流体", "create.ponder.creative_fluid_tank.text_4": "任何被输入创造流体储罐的液体都将被销毁", "create.ponder.creative_motor.header": "使用创造马达发生旋转", @@ -1743,7 +1743,7 @@ "create.ponder.deployer.text_9": "以及攻击生物", "create.ponder.deployer_contraption.header": "在装置上使用机械手", - "create.ponder.deployer_contraption.text_1": "当机械手在移动的结构上时...", + "create.ponder.deployer_contraption.text_1": "当机械手在移动的装置上时...", "create.ponder.deployer_contraption.text_2": "机械手会对每一个经过的方块使用装置中任意容器内的物品", "create.ponder.deployer_contraption.text_3": "可以通过过滤槽来指定其从存储空间中抽取的物品", @@ -1773,12 +1773,12 @@ "create.ponder.empty_blaze_burner.text_2": "或者,也可以通过右击烈焰人刷怪笼来填充激活烈焰人燃烧室", "create.ponder.empty_blaze_burner.text_3": "这样,你便有了一个可供部分机器加工的热源", "create.ponder.empty_blaze_burner.text_4": "如果是为了美观,空的烈焰人燃烧室也可以被打火石点燃", - "create.ponder.empty_blaze_burner.text_5": "使用包含灵魂的物品可以将火焰变为灵魂火", - "create.ponder.empty_blaze_burner.text_6": "但是,这样的热源不足以给机器提加工供足够的热量", + "create.ponder.empty_blaze_burner.text_5": "你可以使用注入了灵魂的物品转化这种火焰", + "create.ponder.empty_blaze_burner.text_6": "但是,没有烈焰人,这样的火焰并不足以用于工业级加热工作", - "create.ponder.encased_fluid_pipe.header": "遮掩流体管道", + "create.ponder.encased_fluid_pipe.header": "流体管道箱", "create.ponder.encased_fluid_pipe.text_1": "铜机壳可以用于装饰流体管道", - "create.ponder.encased_fluid_pipe.text_2": "除了遮掩流体管道之外,装有铜机壳的流体管道将不会改变其连接状态", + "create.ponder.encased_fluid_pipe.text_2": "除了遮掩流体管道之外,装箱的流体管道将不会改变其连接状态", "create.ponder.encased_fluid_pipe.text_3": "它将不会对旁边新增加或移除的管道做出反应", "create.ponder.fan_direction.header": "鼓风机的气流", @@ -1801,31 +1801,31 @@ "create.ponder.fluid_pipe_flow.header": "使用管道运输流体", "create.ponder.fluid_pipe_flow.text_1": "流体管道可以用于连接两个或多个流体容器", - "create.ponder.fluid_pipe_flow.text_2": "使用扳手为直的管道增加观察窗", - "create.ponder.fluid_pipe_flow.text_3": "带有观察窗的管道不会建立侧向连接", - "create.ponder.fluid_pipe_flow.text_4": "通过使用动力泵,流体管道可以传输流体", - "create.ponder.fluid_pipe_flow.text_5": "一开始,流体不会真正被消耗", - "create.ponder.fluid_pipe_flow.text_6": "当管道内的液体流彻底联通之后,流体才会开始逐渐从一个容器中转移到另一个", + "create.ponder.fluid_pipe_flow.text_2": "使用扳手,可以为直管道安装观察窗", + "create.ponder.fluid_pipe_flow.text_3": "带有观察窗的管道不会建立侧向管道连接", + "create.ponder.fluid_pipe_flow.text_4": "使用动力泵,流体管道可以传输流体", + "create.ponder.fluid_pipe_flow.text_5": "一开始,流体不会真正地被抽出", + "create.ponder.fluid_pipe_flow.text_6": "只有当管道内的液体流彻底连通之后,流体才会开始逐渐从一个容器中转移到另一个", "create.ponder.fluid_pipe_flow.text_7": "这意味着流体管道本身并不真正存储任何流体", "create.ponder.fluid_pipe_interaction.header": "抽取和填充流体容器", "create.ponder.fluid_pipe_interaction.text_1": "流体管道的末端可以与许多种容器连接", "create.ponder.fluid_pipe_interaction.text_2": "任何可以容纳流体的容器都可以被填充或从中抽取", - "create.ponder.fluid_pipe_interaction.text_3": "开放的管道口可以吸走流体源块...", + "create.ponder.fluid_pipe_interaction.text_3": "开放的管道口可以吸走流体源方块...", "create.ponder.fluid_pipe_interaction.text_4": "...或者将流体源排放出来", - "create.ponder.fluid_pipe_interaction.text_5": "管道也可以从许多其他方块中直接抽取流体", + "create.ponder.fluid_pipe_interaction.text_5": "管道也可以从许多种其他方块中直接抽取流体", "create.ponder.fluid_tank_sizes.header": "流体储罐的大小", - "create.ponder.fluid_tank_sizes.text_1": "多格流体储罐可以被放置在一起来提供更大的容量", - "create.ponder.fluid_tank_sizes.text_2": "流体储罐最大可以有3x3的横截面...", - "create.ponder.fluid_tank_sizes.text_3": "...并且可以有超过30格高", + "create.ponder.fluid_tank_sizes.text_1": "流体储罐可以多格连接,提供更大的存储量", + "create.ponder.fluid_tank_sizes.text_2": "流体储罐最大横截面为 3x3...", + "create.ponder.fluid_tank_sizes.text_3": "...并且可以超过 30 格高", "create.ponder.fluid_tank_sizes.text_4": "使用扳手可以打开或关闭观察窗", "create.ponder.fluid_tank_storage.header": "使用流体储罐存储流体", "create.ponder.fluid_tank_storage.text_1": "流体储罐可以存储大量的流体", - "create.ponder.fluid_tank_storage.text_2": "流体管道可以从任何一面将流体输入/输出流体储罐", + "create.ponder.fluid_tank_storage.text_2": "流体管道可以在流体储罐的任何一面将流体输入/输出", "create.ponder.fluid_tank_storage.text_3": "使用比较器可以检测储罐中的流体储量", - "create.ponder.fluid_tank_storage.text_4": "在生存模式中,无法直接用容器将流体装入或取出储罐", + "create.ponder.fluid_tank_storage.text_4": "在生存模式中,无法直接用容器向储罐中存入流体,或是取出流体", "create.ponder.fluid_tank_storage.text_5": "要装满/倒空流体容器,可以使用工作盆,分液池或注液器。", "create.ponder.flywheel.header": "使用飞轮来产生旋转力", @@ -1882,8 +1882,8 @@ "create.ponder.gantry_redstone.text_2": "作为替代,杆上的旋转力会传递到取物器的输出杆上", "create.ponder.gantry_shaft.header": "使用起重机杆", - "create.ponder.gantry_shaft.text_1": "起重机杆组成了起重机结构的基础。与其相接的载物器可以沿着杆进行移动。", - "create.ponder.gantry_shaft.text_2": "起重机结构可以移动与其相接的方块。", + "create.ponder.gantry_shaft.text_1": "起重机杆组成了起重机系统的基础。与其相接的载物器可以沿着杆进行移动。", + "create.ponder.gantry_shaft.text_2": "起重机系统可以移动与其相接的方块。", "create.ponder.gearbox.header": "使用十字齿轮箱传递旋转力", "create.ponder.gearbox.text_1": "更改旋转轴,很容易使得整个旋转体系变得臃肿不堪", @@ -1902,32 +1902,32 @@ "create.ponder.hand_crank.text_4": "潜行长按右键可以顺时针旋转它", "create.ponder.hose_pulley.header": "使用软管滑轮抽取或排放流体", - "create.ponder.hose_pulley.text_1": "软管滑轮可以用于方便的抽取或填满一个较大区域中的流体", + "create.ponder.hose_pulley.text_1": "软管滑轮可以用于方便地对一个较大区域进行抽取液体或填满液体的操作", "create.ponder.hose_pulley.text_2": "通过输入动力可以调节软管末端的高度", "create.ponder.hose_pulley.text_3": "翻转动力输入的方向可以收起软管", "create.ponder.hose_pulley.text_4": "管道可以连接在另一侧", - "create.ponder.hose_pulley.text_5": "连接的管道可以将流体输入软管滑轮以在下方放置流体源...", + "create.ponder.hose_pulley.text_5": "连接的管道可以将流体输入到软管滑轮中,软管会在下方排出口处放置流体源...", "create.ponder.hose_pulley.text_6": "...或者提供吸力来抽取世界中的流体", "create.ponder.hose_pulley.text_7": "软管滑轮的抽取/排放速度取决于连接管道中流体的流速", - "create.ponder.hose_pulley_infinite.header": "从大型水体中抽取或向其排放", - "create.ponder.hose_pulley_infinite.text_1": "当软管被放进足够大的水体中时...", + "create.ponder.hose_pulley_infinite.header": "被动抽取或排放从大体量流体中", + "create.ponder.hose_pulley_infinite.text_1": "当软管被放进足够大的流体中时...", "create.ponder.hose_pulley_infinite.text_2": "...它在抽取或排放液体时将不会影响流体源", - "create.ponder.hose_pulley_infinite.text_3": "可以从这些软管滑轮中无限的抽取或向其排放流体", + "create.ponder.hose_pulley_infinite.text_3": "可以从这些软管滑轮中无限量地抽取或向其排放流体", "create.ponder.hose_pulley_level.header": "软管滑轮的排水/抽水机制", "create.ponder.hose_pulley_level.text_1": "当软管彻底收回时,软管滑轮无法工作。", - "create.ponder.hose_pulley_level.text_2": "流体会由上至下被抽取", + "create.ponder.hose_pulley_level.text_2": "抽取流体的顺序为从上到下", "create.ponder.hose_pulley_level.text_3": "流体表面最终将会被抽取到刚好低于软管开口", - "create.ponder.hose_pulley_level.text_4": "流体将会由下至上被填充", + "create.ponder.hose_pulley_level.text_4": "填充流体的顺序为从下到上", "create.ponder.hose_pulley_level.text_5": "流体最多只能被填充至软管开口所在的高度", "create.ponder.item_drain.header": "使用分液池提取物品中的流体", - "create.ponder.item_drain.text_1": "分液池可以提取容器中的流体", - "create.ponder.item_drain.text_2": "右键点击可以将手持的容器中的流体倒入分液池", + "create.ponder.item_drain.text_1": "分液池可以提取物品中的流体", + "create.ponder.item_drain.text_2": "右击可以将手持物品中的流体倒入分液池中", "create.ponder.item_drain.text_3": "当物品从侧面输入时...", - "create.ponder.item_drain.text_4": "...物品将会经过分液池顶部,并在过程中将其包含的液体排入分液池", - "create.ponder.item_drain.text_5": "流体管到可以从分液池中抽取液体", + "create.ponder.item_drain.text_4": "...物品将会经过分液池顶部,并在此过程中将其包含的液体排入分液池内", + "create.ponder.item_drain.text_5": "流体管道可以从分液池中抽取液体", "create.ponder.large_cogwheel.header": "使用大齿轮传递旋转力", "create.ponder.large_cogwheel.text_1": "大齿轮可以以特定的角度相互连接", @@ -2042,29 +2042,29 @@ "create.ponder.mechanical_press.header": "使用动力辊压机处理物品", "create.ponder.mechanical_press.text_1": "动力辊压机可以处理位于其下方的物品", "create.ponder.mechanical_press.text_2": "在其下方丢入物品,或者将物品放在置物台上,都算作有效的物品输入", - "create.ponder.mechanical_press.text_3": "当传送带上的物品经过辊压机下方时....", + "create.ponder.mechanical_press.text_3": "若物品位于传送带上...", "create.ponder.mechanical_press.text_4": "辊压机会使物品停下,然后自动处理这一物品", "create.ponder.mechanical_press_compacting.header": "使用动力辊压机压缩物品", - "create.ponder.mechanical_press_compacting.text_1": "对放置于工作盆内的物品进行辊轧,可以将这些物品压缩在一起", + "create.ponder.mechanical_press_compacting.text_1": "对放置于工作盆内的物品进行辊压,可以将这些物品压缩在一起", "create.ponder.mechanical_press_compacting.text_2": "压缩意指任何同种物品填满了 2x2 或者 3x3 网格的配方,以及一些额外的配方", "create.ponder.mechanical_press_compacting.text_3": "一些配方可能需要烈焰人燃烧室提供热量", "create.ponder.mechanical_press_compacting.text_4": "过滤槽可用于解决两个配方相互冲突的情况", "create.ponder.mechanical_pump_flow.header": "使用动力泵传输流体", - "create.ponder.mechanical_pump_flow.text_1": "动力泵可以控制管道中的液体流向", - "create.ponder.mechanical_pump_flow.text_2": "当接入动力时,其上的箭头指示液体流向", - "create.ponder.mechanical_pump_flow.text_3": "后方的管道中将会产生吸力...", - "create.ponder.mechanical_pump_flow.text_4": "...而液体将被输入前方的管道", - "create.ponder.mechanical_pump_flow.text_5": "反转动力方向将会改变液体流向", + "create.ponder.mechanical_pump_flow.text_1": "动力泵可以控制管道网络中的流体", + "create.ponder.mechanical_pump_flow.text_2": "当接入动力时,其上的箭头指示流体流向", + "create.ponder.mechanical_pump_flow.text_3": "泵后的管道网络正在抽取流体...", + "create.ponder.mechanical_pump_flow.text_4": "...而泵前的网络则把这些液体排到世界当中", + "create.ponder.mechanical_pump_flow.text_5": "反转动力方向将会改变流体流向", "create.ponder.mechanical_pump_flow.text_6": "使用扳手可以手动改变动力泵的朝向", "create.ponder.mechanical_pump_speed.header": "动力泵的传输机制", - "create.ponder.mechanical_pump_speed.text_1": "动力泵的压力最多沿管线传递16格,与输入动力无关", - "create.ponder.mechanical_pump_speed.text_2": "输入动力将会影响压力改变速度...", + "create.ponder.mechanical_pump_speed.text_1": "动力泵的压力最多沿管线传递 16 格,与输入动力无关", + "create.ponder.mechanical_pump_speed.text_2": "提高输入动力,可以加快流的蔓延速度...", "create.ponder.mechanical_pump_speed.text_3": "...以及流体的传输速度", - "create.ponder.mechanical_pump_speed.text_4": "多个并联动力泵的传输量可以叠加", - "create.ponder.mechanical_pump_speed.text_5": "交替摆放动力泵可以方便的控制液体流动", + "create.ponder.mechanical_pump_speed.text_4": "同一管道网络中的多个并联动力泵,它们的传输量可以叠加", + "create.ponder.mechanical_pump_speed.text_5": "使泵的传输方向相互交替,可以方便地控制流体流向", "create.ponder.mechanical_saw_breaker.header": "使用动力锯伐木", "create.ponder.mechanical_saw_breaker.text_1": "向其通入旋转力后,动力锯可以直接砍伐掉它面前的树木", @@ -2077,7 +2077,7 @@ "create.ponder.mechanical_saw_processing.header": "使用动力锯处理物品", "create.ponder.mechanical_saw_processing.text_1": "面向朝上的动力锯可以将物品处理为其变种", "create.ponder.mechanical_saw_processing.text_2": "处理过后的物品的弹出方向始终与通入锯中的旋转转向相反", - "create.ponder.mechanical_saw_processing.text_3": "锯子可以配合其两侧的传送带输入输出", + "create.ponder.mechanical_saw_processing.text_3": "锯子可以与传送带放置在一条直线上,相互配合工作", "create.ponder.mechanical_saw_processing.text_4": "若输入原料有多种可能产物,你可以用动力锯上的过滤槽指定只产出某种产物", "create.ponder.mechanical_saw_processing.text_5": "若没有使用过滤槽,动力锯会在各产物中按顺序循环输出", @@ -2090,8 +2090,8 @@ "create.ponder.nixie_tube.header": "使用辉光管", "create.ponder.nixie_tube.text_1": "通入红石信号后,辉光管会显示出红石信号的强度", - "create.ponder.nixie_tube.text_2": "在其上右键使用更改过名称的命名牌,可以自定义它的显示文本", - "create.ponder.nixie_tube.text_3": "使用染料右键以更改辉光管的显示颜色", + "create.ponder.nixie_tube.text_2": "在着它使用更改过名称的命名牌,可以自定义它的显示文本", + "create.ponder.nixie_tube.text_3": "使用染料右击,便可更改辉光管的显示颜色", "create.ponder.piston_pole.header": "活塞延长杆", "create.ponder.piston_pole.text_1": "若无相接的延长杆,动力活塞无法移动其他方块", @@ -2204,11 +2204,11 @@ "create.ponder.smart_chute.text_3": "使用鼠标滚轮可以指定被过滤的物品数量", "create.ponder.smart_chute.text_4": "通入红石信号,智能溜槽将会完全暂停工作", - "create.ponder.smart_pipe.header": "使用智能流体管道控制液体流动", + "create.ponder.smart_pipe.header": "使用智能流体管道控制流体流动", "create.ponder.smart_pipe.text_1": "智能流体管道可以限制通过它的流体种类", "create.ponder.smart_pipe.text_2": "当紧邻流体源放置时,管道只会抽取设置的流体种类", - "create.ponder.smart_pipe.text_3": "使用任何包含流体的容器右键过滤槽来标记过滤的流体", - "create.ponder.smart_pipe.text_4": "当放在管线中时,只有匹配过滤器的流体才能流入它后方的管道", + "create.ponder.smart_pipe.text_3": "使用任何包含流体的容器右击过滤槽,可以标记过滤的流体", + "create.ponder.smart_pipe.text_4": "当放在管道网络中时,只有匹配过滤器的流体才能通过此管道", "create.ponder.speedometer.header": "使用速度表来监测转速", "create.ponder.speedometer.text_1": "速度表能显示相接组件的转速", @@ -2216,10 +2216,10 @@ "create.ponder.speedometer.text_3": "红石比较器可以根据速度表的数值输出不同强弱的红石信号", "create.ponder.spout_filling.header": "使用注液器填充物品", - "create.ponder.spout_filling.text_1": "注液器可以将流体装入下方经过的,可以接受该流体的物品", + "create.ponder.spout_filling.text_1": "注液器可以将流体装入下方经过且可以接受该流体的物品", "create.ponder.spout_filling.text_2": "注液器的流体存储无法直接手动交互", - "create.ponder.spout_filling.text_3": "使用管线可以将流体输入注液器", - "create.ponder.spout_filling.text_4": "要被处理的物品可以被放置在其下方的置物台上", + "create.ponder.spout_filling.text_3": "使用管道可以将流体输入到注液器内", + "create.ponder.spout_filling.text_4": "输入的物品可以被放置在其下方的置物台上", "create.ponder.spout_filling.text_5": "当传送带上的物品经过注液器下方时...", "create.ponder.spout_filling.text_6": "注液器会使物品停下,然后自动处理这一物品", @@ -2227,7 +2227,7 @@ "create.ponder.stabilized_bearings.text_1": "当动力轴承在结构被带动时...", "create.ponder.stabilized_bearings.text_2": "...它会确保它转盘的垂直朝向不变", "create.ponder.stabilized_bearings.text_3": "跟默认的一样,动力轴承会黏着它前方的方块", - "create.ponder.stabilized_bearings.text_4": "这种情况下,它所黏着的子结构的垂直朝向也不会改变", + "create.ponder.stabilized_bearings.text_4": "这种情况下,它所黏着的子装置的垂直朝向也不会改变", "create.ponder.sticker.header": "使用黏着器来黏附方块", "create.ponder.sticker.text_1": "你可以用红石信号来控制黏着器的行为", @@ -2255,9 +2255,9 @@ "create.ponder.valve_handle.text_5": "可以通过染色来美化阀门手轮", "create.ponder.valve_pipe.header": "使用阀门管道控制液体流", - "create.ponder.valve_pipe.text_1": "阀门管道可以控制管道网中液体的去处", + "create.ponder.valve_pipe.text_1": "阀门管道可以控制管道网络中流体的蔓延", "create.ponder.valve_pipe.text_2": "通过其上的传动杆输入动力可以控制它的开关", - "create.ponder.valve_pipe.text_3": "提供旋转向‘打开’方向的力会打开阀门,使得流体可以通过", + "create.ponder.valve_pipe.text_3": "提供向“打开”方向的旋转力会打开阀门,使得流体可以通过", "create.ponder.valve_pipe.text_4": "提供另一方向的旋转力可以关闭阀门,阻止流体通过", "create.ponder.water_wheel.header": "使用水车产生旋转力", diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java index a417ef747..186aa9589 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java @@ -90,11 +90,11 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { protected int maxBlocks() { return AllConfigs.SERVER.fluids.hosePulleyBlockThreshold.get(); } - + protected boolean fillInfinite() { return AllConfigs.SERVER.fluids.fillInfinite.get(); } - + public void reset() { if (affectedArea != null) scheduleUpdatesInAffectedArea(); @@ -113,7 +113,9 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { protected void scheduleUpdatesInAffectedArea() { World world = getWorld(); - BlockPos.betweenClosedStream(new BlockPos(affectedArea.x0 - 1, affectedArea.y0 - 1, affectedArea.z0 - 1), new BlockPos(affectedArea.x1 + 1, affectedArea.y1 + 1, affectedArea.z1 + 1)) + BlockPos + .betweenClosedStream(new BlockPos(affectedArea.x0 - 1, affectedArea.y0 - 1, affectedArea.z0 - 1), + new BlockPos(affectedArea.x1 + 1, affectedArea.y1 + 1, affectedArea.z1 + 1)) .forEach(pos -> { FluidState nextFluidState = world.getFluidState(pos); if (nextFluidState.isEmpty()) @@ -200,9 +202,9 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { : fluid.getAttributes() .getEmptySound(); if (soundevent == null) - soundevent = fluid.is(FluidTags.LAVA) - ? fillSound ? SoundEvents.BUCKET_FILL_LAVA : SoundEvents.BUCKET_EMPTY_LAVA - : fillSound ? SoundEvents.BUCKET_FILL : SoundEvents.BUCKET_EMPTY; + soundevent = + fluid.is(FluidTags.LAVA) ? fillSound ? SoundEvents.BUCKET_FILL_LAVA : SoundEvents.BUCKET_EMPTY_LAVA + : fillSound ? SoundEvents.BUCKET_FILL : SoundEvents.BUCKET_EMPTY; world.playSound(null, splooshPos, soundevent, SoundCategory.BLOCKS, 0.3F, 1.0F); if (world instanceof ServerWorld) diff --git a/src/main/java/com/simibubi/create/foundation/config/CFluids.java b/src/main/java/com/simibubi/create/foundation/config/CFluids.java index f0c3c251c..2b56185d2 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CFluids.java +++ b/src/main/java/com/simibubi/create/foundation/config/CFluids.java @@ -9,7 +9,7 @@ public class CFluids extends ConfigBase { public ConfigInt hosePulleyBlockThreshold = i(10000, -1, "hosePulleyBlockThreshold", Comments.blocks, Comments.toDisable, Comments.hosePulleyBlockThreshold); - public ConfigBool fillInfinite = b(false, "fillInfinite",Comments.fillInfinite); + public ConfigBool fillInfinite = b(false, "fillInfinite", Comments.fillInfinite); public ConfigInt hosePulleyRange = i(128, 1, "hosePulleyRange", Comments.blocks, Comments.hosePulleyRange); @Override @@ -29,7 +29,7 @@ public class CFluids extends ConfigBase { static String toDisable = "[-1 to disable this behaviour]"; static String hosePulleyBlockThreshold = "The minimum amount of fluid blocks the hose pulley needs to find before deeming it an infinite source."; - static String fillInfinite="Does hose pulley poor fluids to the world even if it is an infinite source?"; + static String fillInfinite = "Whether hose pulleys should continue filling up above-threshold sources"; } } From 896ab016445cbbf38f2945f2e2ad42224ece5fd7 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 16 Sep 2021 04:10:34 +0200 Subject: [PATCH 02/22] Packing Up - Added the Toolbox --- src/generated/resources/.cache/cache | 31 +- .../assets/create/blockstates/toolbox.json | 34 ++ .../resources/assets/create/lang/en_ud.json | 1 + .../resources/assets/create/lang/en_us.json | 6 + .../assets/create/lang/unfinished/de_de.json | 8 +- .../assets/create/lang/unfinished/es_es.json | 8 +- .../assets/create/lang/unfinished/fr_fr.json | 8 +- .../assets/create/lang/unfinished/it_it.json | 8 +- .../assets/create/lang/unfinished/ja_jp.json | 8 +- .../assets/create/lang/unfinished/ko_kr.json | 8 +- .../assets/create/lang/unfinished/nl_nl.json | 8 +- .../assets/create/lang/unfinished/pl_pl.json | 8 +- .../assets/create/lang/unfinished/pt_br.json | 8 +- .../assets/create/lang/unfinished/ru_ru.json | 8 +- .../assets/create/lang/unfinished/zh_cn.json | 8 +- .../assets/create/lang/unfinished/zh_tw.json | 8 +- .../assets/create/models/item/toolbox.json | 3 + .../create/loot_tables/blocks/toolbox.json | 36 +++ .../com/simibubi/create/AllBlockPartials.java | 30 +- .../java/com/simibubi/create/AllBlocks.java | 238 +++++++------- .../simibubi/create/AllContainerTypes.java | 5 + .../java/com/simibubi/create/AllKeys.java | 1 + .../java/com/simibubi/create/AllShapes.java | 7 +- .../com/simibubi/create/AllTileEntities.java | 8 + .../simibubi/create/compat/jei/CreateJEI.java | 2 + .../toolbox/ItemReturnInvWrapper.java | 23 ++ .../toolbox/RadialToolboxMenu.java | 257 ++++++++++++++++ .../curiosities/toolbox/ToolboxBlock.java | 137 +++++++++ .../curiosities/toolbox/ToolboxContainer.java | 162 ++++++++++ .../toolbox/ToolboxEquipPacket.java | 117 +++++++ .../curiosities/toolbox/ToolboxHandler.java | 79 +++++ .../toolbox/ToolboxHandlerClient.java | 123 ++++++++ .../curiosities/toolbox/ToolboxInventory.java | 145 +++++++++ .../curiosities/toolbox/ToolboxRenderer.java | 59 ++++ .../curiosities/toolbox/ToolboxScreen.java | 162 ++++++++++ .../curiosities/toolbox/ToolboxSlot.java | 20 ++ .../toolbox/ToolboxTileEntity.java | 291 ++++++++++++++++++ .../curiosities/tools/BlueprintContainer.java | 3 +- .../AdjustableCrateTileEntity.java | 6 - .../item/filter/AttributeFilterContainer.java | 3 +- .../item/filter/FilterContainer.java | 3 +- .../simibubi/create/events/ClientEvents.java | 3 + .../simibubi/create/events/InputEvents.java | 2 + .../create/foundation/gui/AllGuiTextures.java | 18 +- .../create/foundation/gui/ContainerBase.java | 69 +++++ .../foundation/gui/GhostItemContainer.java | 46 +-- .../foundation/networking/AllPackets.java | 2 + .../networking/ISyncPersistentData.java | 25 +- .../tileEntity/SmartTileEntity.java | 12 +- .../create/foundation/utility/NBTHelper.java | 2 +- .../assets/create/lang/default/messages.json | 4 + .../create/models/block/toolbox/block.json | 24 ++ .../create/models/block/toolbox/drawer.json | 23 ++ .../create/models/block/toolbox/item.json | 132 ++++++++ .../create/models/block/toolbox/lid.json | 59 ++++ .../assets/create/textures/block/toolbox.png | Bin 0 -> 1124 bytes .../assets/create/textures/gui/toolbox.png | Bin 0 -> 1470 bytes .../assets/create/textures/gui/widgets.png | Bin 4222 -> 6635 bytes 58 files changed, 2291 insertions(+), 218 deletions(-) create mode 100644 src/generated/resources/assets/create/blockstates/toolbox.json create mode 100644 src/generated/resources/assets/create/models/item/toolbox.json create mode 100644 src/generated/resources/data/create/loot_tables/blocks/toolbox.json create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ItemReturnInvWrapper.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxRenderer.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java create mode 100644 src/main/java/com/simibubi/create/foundation/gui/ContainerBase.java create mode 100644 src/main/resources/assets/create/models/block/toolbox/block.json create mode 100644 src/main/resources/assets/create/models/block/toolbox/drawer.json create mode 100644 src/main/resources/assets/create/models/block/toolbox/item.json create mode 100644 src/main/resources/assets/create/models/block/toolbox/lid.json create mode 100644 src/main/resources/assets/create/textures/block/toolbox.png create mode 100644 src/main/resources/assets/create/textures/gui/toolbox.png diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 28f03b4a8..9c30843cb 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -396,6 +396,7 @@ f385988cb6fa9c48b5d59a6942ec50ed2b60c8bf assets/create/blockstates/stockpile_swi e815bfd854c2653f10828bb11950f7fb991d7efc assets/create/blockstates/stressometer.json 8b0c2c7ac72529565b3339aa8df7565858100afa assets/create/blockstates/tiled_glass.json a2454400b1cf9889f70aebdc89c52a1be25f543c assets/create/blockstates/tiled_glass_pane.json +a00f2e1bf002bd5c961d3571c67bdb1dab803bc7 assets/create/blockstates/toolbox.json a8094531617e27a545c4815ab2062bf0ffca3633 assets/create/blockstates/turntable.json 69dfe8afaa8eb6105dae9f76ab8b7847bf90b8c6 assets/create/blockstates/vertical_framed_glass.json c4db76b9d36cfb098df0d158cb6f8b82768ebe14 assets/create/blockstates/vertical_framed_glass_pane.json @@ -425,20 +426,20 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json -fb760b12b4bc8114744d3acc6a597b2fad88d988 assets/create/lang/en_ud.json -66e8ae18a98d86c66393c908ab51eae5060b8e04 assets/create/lang/en_us.json -9e94c2420840c516e24dfd7968aaad61da24b5a2 assets/create/lang/unfinished/de_de.json -f1a6ed9a5812c89e7c7152c9abf2b64c133fd27d assets/create/lang/unfinished/es_es.json -23a46ae0bc7b2181f26eeed70801714a254d2587 assets/create/lang/unfinished/fr_fr.json -5e95153e640edc367b963489df8c92c459badcd3 assets/create/lang/unfinished/it_it.json -a951315b2591051dad6c53739fe554fe78595250 assets/create/lang/unfinished/ja_jp.json -419a1fc9af7d7ea0ccd612847df74e0b45380864 assets/create/lang/unfinished/ko_kr.json -dbc823d8cb38598e75871a2187b2a58d7f77f86a assets/create/lang/unfinished/nl_nl.json -ac609477c295be1705d3efc07848ffe6779fd397 assets/create/lang/unfinished/pl_pl.json -95e17b968103e0ef62411489e699d39ac7ff0b64 assets/create/lang/unfinished/pt_br.json -b37f50f613b0df44032fe5d618a5ce7227be8087 assets/create/lang/unfinished/ru_ru.json -fa465cd2c595bcd71449ad432a1908e27897177a assets/create/lang/unfinished/zh_cn.json -6192a7ede669ae6b6f8de6701b8a924d6a756c4a assets/create/lang/unfinished/zh_tw.json +337227971382d97fbaa69170e0b6bcc621bdc494 assets/create/lang/en_ud.json +307e88153d5288781e906e566f73ccd59fbcd945 assets/create/lang/en_us.json +5268c9117961dabecdae27b3190d02a8c0ea1077 assets/create/lang/unfinished/de_de.json +2e2002aefd045f492b7232884bd63c7a68d41480 assets/create/lang/unfinished/es_es.json +78836cc1527a95e7e40bc7f50faa95f8cdf5cd9d assets/create/lang/unfinished/fr_fr.json +b83a58ff24f2eca59c628c9a49e286d2feeece35 assets/create/lang/unfinished/it_it.json +5e3e878fe3fd58ba7911877609bf4f0be5a7c71d assets/create/lang/unfinished/ja_jp.json +ff6560eef8744197ab55334392df0a91898d80b2 assets/create/lang/unfinished/ko_kr.json +d0637cc0fa640b328dcdbaf74ae6967a7e15b980 assets/create/lang/unfinished/nl_nl.json +a23c910164b9d295f7c1f5a5e4d9a08094f1f00c assets/create/lang/unfinished/pl_pl.json +bb56417e9607b45350f329f865d2caa7038ebcec assets/create/lang/unfinished/pt_br.json +b643778faf6706b85ad567066de7176272df73d9 assets/create/lang/unfinished/ru_ru.json +45f4a765689a28da8fa267c2845fcf59135c6034 assets/create/lang/unfinished/zh_cn.json +3ac73d1173b450a4fa4eb5622b903cf4b52fbd0b assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json @@ -1664,6 +1665,7 @@ bab8f78c319b2a79ed55c5d2a94b521ddaa44996 assets/create/models/item/stressometer. 088af343cda8a949f1d950e15e72b51ffca20a1d assets/create/models/item/sweet_roll.json b1d3d00ff05908feacad06a86800da96cc9bc65d assets/create/models/item/tiled_glass.json a7d0b746637897209bd86b1a6501ecbfb46d8270 assets/create/models/item/tiled_glass_pane.json +e3c708122fc5a5455bf7b4f8ac48e9d6c00278a9 assets/create/models/item/toolbox.json f8a4fa1ccecb16a3941cc46db7481ed8e8429a5e assets/create/models/item/tree_fertilizer.json fb24881c4e92bbb7ffa54a71e0af6b1c66d84829 assets/create/models/item/turntable.json 2a6be52ddedd614dc3b8a6b659bfbd7a4be54252 assets/create/models/item/vertical_framed_glass.json @@ -2829,6 +2831,7 @@ ec2889e712702644092197a4b41a682fb953817d data/create/loot_tables/blocks/stockpil 3479775008a256bc35f98b31655975f7d5c836b2 data/create/loot_tables/blocks/stressometer.json 05e843ca6eb5e299bf41de123977a1045c120ad4 data/create/loot_tables/blocks/tiled_glass.json e999969f05d2625e61757aa82092d232b99f6e0a data/create/loot_tables/blocks/tiled_glass_pane.json +ef939c8c30e7f6235290e85ff7afd96478c20408 data/create/loot_tables/blocks/toolbox.json 7b66ad2c48449bafd0cdbd086ac41218cb73a814 data/create/loot_tables/blocks/turntable.json 028e293b5cd694017962f67dc80dba719f904e28 data/create/loot_tables/blocks/vertical_framed_glass.json d0156602dd5f4a274c293df67e19374820c72890 data/create/loot_tables/blocks/vertical_framed_glass_pane.json diff --git a/src/generated/resources/assets/create/blockstates/toolbox.json b/src/generated/resources/assets/create/blockstates/toolbox.json new file mode 100644 index 000000000..37c3e2a2c --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/toolbox.json @@ -0,0 +1,34 @@ +{ + "variants": { + "facing=north,waterlogged=false": { + "model": "create:block/toolbox/block" + }, + "facing=south,waterlogged=false": { + "model": "create:block/toolbox/block", + "y": 180 + }, + "facing=west,waterlogged=false": { + "model": "create:block/toolbox/block", + "y": 270 + }, + "facing=east,waterlogged=false": { + "model": "create:block/toolbox/block", + "y": 90 + }, + "facing=north,waterlogged=true": { + "model": "create:block/toolbox/block" + }, + "facing=south,waterlogged=true": { + "model": "create:block/toolbox/block", + "y": 180 + }, + "facing=west,waterlogged=true": { + "model": "create:block/toolbox/block", + "y": 270 + }, + "facing=east,waterlogged=true": { + "model": "create:block/toolbox/block", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 9bdbea809..8f30bb79b 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -397,6 +397,7 @@ "block.create.stressometer": "\u0279\u01DD\u0287\u01DD\u026Foss\u01DD\u0279\u0287S", "block.create.tiled_glass": "ss\u0250\u05DF\u2141 p\u01DD\u05DF\u0131\u27D8", "block.create.tiled_glass_pane": "\u01DDu\u0250\u0500 ss\u0250\u05DF\u2141 p\u01DD\u05DF\u0131\u27D8", + "block.create.toolbox": "xoq\u05DFoo\u27D8", "block.create.turntable": "\u01DD\u05DFq\u0250\u0287u\u0279n\u27D8", "block.create.vertical_framed_glass": "ss\u0250\u05DF\u2141 p\u01DD\u026F\u0250\u0279\u2132 \u05DF\u0250\u0254\u0131\u0287\u0279\u01DD\u039B", "block.create.vertical_framed_glass_pane": "\u01DDu\u0250\u0500 ss\u0250\u05DF\u2141 p\u01DD\u026F\u0250\u0279\u2132 \u05DF\u0250\u0254\u0131\u0287\u0279\u01DD\u039B", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 268153180..7b6b6dca1 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -400,6 +400,7 @@ "block.create.stressometer": "Stressometer", "block.create.tiled_glass": "Tiled Glass", "block.create.tiled_glass_pane": "Tiled Glass Pane", + "block.create.toolbox": "Toolbox", "block.create.turntable": "Turntable", "block.create.vertical_framed_glass": "Vertical Framed Glass", "block.create.vertical_framed_glass_pane": "Vertical Framed Glass Pane", @@ -790,6 +791,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Shift to Scroll Faster", "create.gui.toolmenu.focusKey": "Hold [%1$s] to Focus", "create.gui.toolmenu.cycle": "[SCROLL] to Cycle", + + "create.toolbox.unequip": "Unequip: %1$s", + "create.toolbox.outOfRange": "Toolbox of held item not in Range", + "create.toolbox.detach": "Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Mirror", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index ce55f9519..5f096580d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1134", + "_": "Missing Localizations: 1138", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Stressometer", "block.create.tiled_glass": "Glasfliesen", "block.create.tiled_glass_pane": "Glasfliesenscheibe", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Drehtisch", "block.create.vertical_framed_glass": "Vertikal Gerahmtes Glas", "block.create.vertical_framed_glass_pane": "Vertikal Gerahmte Glasscheibe", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Shift zum schnelleren Auswählen", "create.gui.toolmenu.focusKey": "Halte [%1$s] zum Fokussieren", "create.gui.toolmenu.cycle": "[Mausrad] zum Wechseln", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Spiegeln", "create.gui.symmetryWand.orientation": "Orientierung", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 79a683627..44d35f9f9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 0", + "_": "Missing Localizations: 4", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Estresómetro", "block.create.tiled_glass": "Vidrio esmaltado", "block.create.tiled_glass_pane": "Panel de vidrio esmaltado", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Plataforma giratoria mecánica", "block.create.vertical_framed_glass": "Vidrio esmaltado vertical", "block.create.vertical_framed_glass_pane": "Panel de vidrio esmaltado vertical", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Mayús izdo para usar la rueda del ratón más rápido", "create.gui.toolmenu.focusKey": "Mantén [%1$s] para enfocar", "create.gui.toolmenu.cycle": "[RUEDA DEL RATÓN] para el ciclo", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Espejado", "create.gui.symmetryWand.orientation": "Orientación", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 2e0c26dd4..78e9c4a2a 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1386", + "_": "Missing Localizations: 1390", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Stressomètre", "block.create.tiled_glass": "Verre carrelé", "block.create.tiled_glass_pane": "Vitre carrelé", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Plaque tournante", "block.create.vertical_framed_glass": "Fenêtre en verre verticale", "block.create.vertical_framed_glass_pane": "Vitre encadrée verticale", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Maj pour défiler plus rapidement", "create.gui.toolmenu.focusKey": "Enfoncez [%1$s] pour focus", "create.gui.toolmenu.cycle": "[SCROLL] pour cycler", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Mirroir", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 8108827f1..e8def88f1 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 914", + "_": "Missing Localizations: 918", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Stressometro", "block.create.tiled_glass": "Vetro piastrellato", "block.create.tiled_glass_pane": "Pannello di vetro piastrellato", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Piatto", "block.create.vertical_framed_glass": "Finestra di vetro verticale", "block.create.vertical_framed_glass_pane": "Pannello di finestra di vetro verticale", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Premi shift per scorrere più velocemente", "create.gui.toolmenu.focusKey": "Premi [%1$s] per aprire il menù", "create.gui.toolmenu.cycle": "[SCORRI] per navigare", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Specchio", "create.gui.symmetryWand.orientation": "Orientamento", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 5650fe7dd..5c6496fab 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 9", + "_": "Missing Localizations: 13", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "応力メーター", "block.create.tiled_glass": "タイルガラス", "block.create.tiled_glass_pane": "タイルガラス板", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "ターンテーブル", "block.create.vertical_framed_glass": "縦型ガラス窓", "block.create.vertical_framed_glass_pane": "縦型ガラス窓板", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "シフトを押してスクロールを加速", "create.gui.toolmenu.focusKey": "[%1$s] 長押しでフォーカスする", "create.gui.toolmenu.cycle": "[スクロール] で循環", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "ミラーの種類", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index b45ee1cfb..987018999 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 24", + "_": "Missing Localizations: 28", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "피로도 계측기", "block.create.tiled_glass": "타일 유리", "block.create.tiled_glass_pane": "타일 유리판", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "돌림판", "block.create.vertical_framed_glass": "수직 유리", "block.create.vertical_framed_glass_pane": "수직 유리판", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "쉬프트-스크롤로 빨리 수정하기", "create.gui.toolmenu.focusKey": "[%1$s]를 눌러 세부정보 보기", "create.gui.toolmenu.cycle": "스크롤로 순환", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "거울의 형태", "create.gui.symmetryWand.orientation": "거울의 방향", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 2a8d48fd3..39010143c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1766", + "_": "Missing Localizations: 1770", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Stressmeter", "block.create.tiled_glass": "Getegeld Glas", "block.create.tiled_glass_pane": "Getegeld Glazen Paneel", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Draaischijf", "block.create.vertical_framed_glass": "UNLOCALIZED: Vertical Framed Glass", "block.create.vertical_framed_glass_pane": "UNLOCALIZED: Vertical Framed Glass Pane", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Shift om sneller te Scrollen", "create.gui.toolmenu.focusKey": "Hou [%1$s] ingedrukt om te Focusen", "create.gui.toolmenu.cycle": "[SCROLL] om te Cycleën", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Spiegelen", "create.gui.symmetryWand.orientation": "Orientatie", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 010fcaa58..45022fd4f 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 256", + "_": "Missing Localizations: 260", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Miernik obciążenia", "block.create.tiled_glass": "Kafelkowane szkło", "block.create.tiled_glass_pane": "Kafelkowana szyba", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Talerz obrotowy", "block.create.vertical_framed_glass": "Pionowe oprawione szkło", "block.create.vertical_framed_glass_pane": "Pionowa oprawiona szyba", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Naciśnij Shift, aby przewijać szybciej", "create.gui.toolmenu.focusKey": "Przytrzymaj [%1$s], aby skupić", "create.gui.toolmenu.cycle": "[SCROLL] przewijać", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Odbicie lustrzane", "create.gui.symmetryWand.orientation": "Orientacja", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 6d34e640a..8538ed5fa 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1807", + "_": "Missing Localizations: 1811", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "UNLOCALIZED: Stressometer", "block.create.tiled_glass": "Vidro Entalhado", "block.create.tiled_glass_pane": "Vidraça Entalhada", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Mesa giratória", "block.create.vertical_framed_glass": "UNLOCALIZED: Vertical Framed Glass", "block.create.vertical_framed_glass_pane": "UNLOCALIZED: Vertical Framed Glass Pane", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "UNLOCALIZED: Shift to Scroll Faster", "create.gui.toolmenu.focusKey": "Segure [%1$s] para Focar", "create.gui.toolmenu.cycle": "[SCROLL] para Circular", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Espelhar", "create.gui.symmetryWand.orientation": "Orientação", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 35b858bb2..8374dffca 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 5", + "_": "Missing Localizations: 9", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "Стрессометр", "block.create.tiled_glass": "Плиточное стекло", "block.create.tiled_glass_pane": "Плиточная стеклянная панель", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "Поворотный стол", "block.create.vertical_framed_glass": "Вертикальное обрамлённое стекло", "block.create.vertical_framed_glass_pane": "Вертикальная обрамлённая стеклянная панель", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "Нажмите Shift для быстрой прокрутки", "create.gui.toolmenu.focusKey": "Удерживайте [%1$s] для смены задач", "create.gui.toolmenu.cycle": "[Прокрутка] для переключения", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "Зеркало", "create.gui.symmetryWand.orientation": "Ориентация", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 0d0f8f5bc..318b583d9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 4", + "_": "Missing Localizations: 8", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "应力表", "block.create.tiled_glass": "十字玻璃窗", "block.create.tiled_glass_pane": "十字玻璃窗户板", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "转盘", "block.create.vertical_framed_glass": "竖直边框玻璃", "block.create.vertical_framed_glass_pane": "竖直边框玻璃板", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "按住 Shift 滚动更快", "create.gui.toolmenu.focusKey": "按住 [%1$s] 鼠标滚轮选择", "create.gui.toolmenu.cycle": "[SCROLL] 循环", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "镜子类型", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 9ec60092a..644d74902 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 19", + "_": "Missing Localizations: 23", "_": "->------------------------] Game Elements [------------------------<-", @@ -401,6 +401,7 @@ "block.create.stressometer": "動能錶", "block.create.tiled_glass": "十字玻璃窗", "block.create.tiled_glass_pane": "十字玻璃窗戶片", + "block.create.toolbox": "UNLOCALIZED: Toolbox", "block.create.turntable": "轉盤", "block.create.vertical_framed_glass": "豎直邊框玻璃", "block.create.vertical_framed_glass_pane": "豎直邊框玻璃片", @@ -791,6 +792,11 @@ "create.gui.scrollInput.shiftScrollsFaster": "按住Shift滾動更快", "create.gui.toolmenu.focusKey": "按住 [%1$s] 滑鼠滾輪選擇", "create.gui.toolmenu.cycle": "[SCROLL] 循環", + + "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", + "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", + "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.gui.symmetryWand.mirrorType": "鏡子類型", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/generated/resources/assets/create/models/item/toolbox.json b/src/generated/resources/assets/create/models/item/toolbox.json new file mode 100644 index 000000000..719de98e9 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/toolbox.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/toolbox/item" +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/toolbox.json b/src/generated/resources/data/create/loot_tables/blocks/toolbox.json new file mode 100644 index 000000000..f25ecaa38 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/toolbox.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_name", + "source": "block_entity" + }, + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Inventory", + "target": "Inventory", + "op": "replace" + } + ] + } + ], + "name": "create:toolbox" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index 8fb10077e..56b2a569e 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -93,27 +93,29 @@ public class AllBlockPartials { SPOUT_TOP = get("spout/top"), SPOUT_MIDDLE = get("spout/middle"), SPOUT_BOTTOM = get("spout/bottom"), - PECULIAR_BELL = get("peculiar_bell"), - HAUNTED_BELL = get("haunted_bell"), + PECULIAR_BELL = get("peculiar_bell"), HAUNTED_BELL = get("haunted_bell"), - SPEED_CONTROLLER_BRACKET = get("rotation_speed_controller/bracket"), + TOOLBOX_LID = get("toolbox/lid"), TOOLBOX_DRAWER = get("toolbox/drawer"), - GOGGLES = get("goggles"), + SPEED_CONTROLLER_BRACKET = get("rotation_speed_controller/bracket"), - EJECTOR_TOP = get("weighted_ejector/top"), + GOGGLES = get("goggles"), - COPPER_BACKTANK_SHAFT = get("copper_backtank/block_shaft_input"), - COPPER_BACKTANK_COGS = get("copper_backtank/block_cogs"), + EJECTOR_TOP = get("weighted_ejector/top"), - CRAFTING_BLUEPRINT_1x1 = getEntity("crafting_blueprint_small"), - CRAFTING_BLUEPRINT_2x2 = getEntity("crafting_blueprint_medium"), - CRAFTING_BLUEPRINT_3x3 = getEntity("crafting_blueprint_large"), + COPPER_BACKTANK_SHAFT = get("copper_backtank/block_shaft_input"), + COPPER_BACKTANK_COGS = get("copper_backtank/block_cogs"), - COUPLING_ATTACHMENT = getEntity("minecart_coupling/attachment"), - COUPLING_RING = getEntity("minecart_coupling/ring"), - COUPLING_CONNECTOR = getEntity("minecart_coupling/connector"); + CRAFTING_BLUEPRINT_1x1 = getEntity("crafting_blueprint_small"), + CRAFTING_BLUEPRINT_2x2 = getEntity("crafting_blueprint_medium"), + CRAFTING_BLUEPRINT_3x3 = getEntity("crafting_blueprint_large"), - public static final Map> PIPE_ATTACHMENTS = new HashMap<>(); + COUPLING_ATTACHMENT = getEntity("minecart_coupling/attachment"), + COUPLING_RING = getEntity("minecart_coupling/ring"), + COUPLING_CONNECTOR = getEntity("minecart_coupling/connector"); + + public static final Map> PIPE_ATTACHMENTS = + new HashMap<>(); public static final Map BLAZES = new HashMap<>(); static { diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index a990a6d10..230e2c0bd 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -118,6 +118,7 @@ import com.simibubi.create.content.curiosities.armor.CopperBacktankBlock; import com.simibubi.create.content.curiosities.bell.HauntedBellBlock; import com.simibubi.create.content.curiosities.bell.HauntedBellMovementBehaviour; import com.simibubi.create.content.curiosities.bell.PeculiarBellBlock; +import com.simibubi.create.content.curiosities.toolbox.ToolboxBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelCTBehaviour; @@ -160,9 +161,9 @@ import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchBlock import com.simibubi.create.content.logistics.item.LecternControllerBlock; import com.simibubi.create.content.schematics.block.SchematicTableBlock; import com.simibubi.create.content.schematics.block.SchematicannonBlock; +import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.block.DyedBlockList; import com.simibubi.create.foundation.block.ItemUseOverrides; -import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.data.AssetLookup; import com.simibubi.create.foundation.data.BlockStateGen; import com.simibubi.create.foundation.data.BuilderTransformers; @@ -208,7 +209,7 @@ import net.minecraftforge.common.ToolType; public class AllBlocks { private static final CreateRegistrate REGISTRATE = Create.registrate() - .itemGroup(() -> Create.BASE_CREATIVE_TAB); + .itemGroup(() -> Create.BASE_CREATIVE_TAB); // Schematics @@ -224,11 +225,12 @@ public class AllBlocks { Builder builder = LootTable.lootTable(); IBuilder survivesExplosion = SurvivesExplosion.survivesExplosion(); lt.add(block, builder.withPool(LootPool.lootPool() - .when(survivesExplosion) - .setRolls(ConstantRange.exactly(1)) - .add(ItemLootEntry.lootTableItem(AllBlocks.SCHEMATICANNON.get().asItem()) - .apply(CopyNbt.copyData(CopyNbt.Source.BLOCK_ENTITY) - .copy("Options", "BlockEntityTag.Options"))))); + .when(survivesExplosion) + .setRolls(ConstantRange.exactly(1)) + .add(ItemLootEntry.lootTableItem(AllBlocks.SCHEMATICANNON.get() + .asItem()) + .apply(CopyNbt.copyData(CopyNbt.Source.BLOCK_ENTITY) + .copy("Options", "BlockEntityTag.Options"))))); }) .item() .transform(customItemModel()) @@ -501,11 +503,13 @@ public class AllBlocks { .addLayer(() -> RenderType::cutoutMipped) .tag(AllBlockTags.FAN_TRANSPARENT.tag, AllBlockTags.FAN_HEATERS.tag) .loot((lt, block) -> lt.dropOther(block, AllItems.EMPTY_BLAZE_BURNER.get())) - .blockstate((c, p) -> p.getVariantBuilder(c.get()).forAllStates(state -> - ConfiguredModel.builder() - .modelFile(p.models().getExistingFile(p.modLoc( - "block/blaze_burner/" + (state.getValue(LitBlazeBurnerBlock.FLAME_TYPE) == LitBlazeBurnerBlock.FlameType.SOUL ? "block_with_soul_fire" : "block_with_fire") - ))) + .blockstate((c, p) -> p.getVariantBuilder(c.get()) + .forAllStates(state -> ConfiguredModel.builder() + .modelFile(p.models() + .getExistingFile(p.modLoc("block/blaze_burner/" + + (state.getValue(LitBlazeBurnerBlock.FLAME_TYPE) == LitBlazeBurnerBlock.FlameType.SOUL + ? "block_with_soul_fire" + : "block_with_fire")))) .build())) .register(); @@ -598,7 +602,8 @@ public class AllBlocks { .initialProperties(SharedProperties::softMetal) .addLayer(() -> RenderType::cutoutMipped) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, s -> p.models() - .getExistingFile(p.modLoc("block/fluid_pipe/window" + (s.getValue(GlassFluidPipeBlock.ALT) ? "_alt" : ""))))) + .getExistingFile( + p.modLoc("block/fluid_pipe/window" + (s.getValue(GlassFluidPipeBlock.ALT) ? "_alt" : ""))))) .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) .loot((p, b) -> p.dropOther(b, FLUID_PIPE.get())) .register(); @@ -626,39 +631,39 @@ public class AllBlocks { .blockstate((c, p) -> BlockStateGen.directionalAxisBlock(c, p, (state, vertical) -> AssetLookup.partialBaseModel(c, p, vertical ? "vertical" : "horizontal", state.getValue(FluidValveBlock.ENABLED) ? "open" : "closed"))) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) - .item() - .transform(customItemModel()) - .register(); + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) + .item() + .transform(customItemModel()) + .register(); public static final BlockEntry COPPER_VALVE_HANDLE = - REGISTRATE.block("copper_valve_handle", ValveHandleBlock::copper) - .transform(BuilderTransformers.valveHandle(null)) - .register(); + REGISTRATE.block("copper_valve_handle", ValveHandleBlock::copper) + .transform(BuilderTransformers.valveHandle(null)) + .register(); public static final DyedBlockList DYED_VALVE_HANDLES = new DyedBlockList<>(colour -> { String colourName = colour.getSerializedName(); return REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed) - .transform(BuilderTransformers.valveHandle(colour)) - .recipe((c, p) -> ShapedRecipeBuilder.shaped(c.get()) - .pattern("#") - .pattern("-") - .define('#', DyeHelper.getTagOfDye(colour)) - .define('-', AllItemTags.VALVE_HANDLES.tag) - .unlockedBy("has_valve", RegistrateRecipeProvider.hasItem(AllItemTags.VALVE_HANDLES.tag)) - .save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_valve_handle"))) - .register(); + .transform(BuilderTransformers.valveHandle(colour)) + .recipe((c, p) -> ShapedRecipeBuilder.shaped(c.get()) + .pattern("#") + .pattern("-") + .define('#', DyeHelper.getTagOfDye(colour)) + .define('-', AllItemTags.VALVE_HANDLES.tag) + .unlockedBy("has_valve", RegistrateRecipeProvider.hasItem(AllItemTags.VALVE_HANDLES.tag)) + .save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_valve_handle"))) + .register(); }); public static final BlockEntry FLUID_TANK = REGISTRATE.block("fluid_tank", FluidTankBlock::regular) - .initialProperties(SharedProperties::softMetal) - .properties(AbstractBlock.Properties::noOcclusion) - .blockstate(new FluidTankGenerator()::generate) - .onRegister(CreateRegistrate.blockModel(() -> FluidTankModel::standard)) - .addLayer(() -> RenderType::cutoutMipped) - .item(FluidTankItem::new) - .model(AssetLookup.customBlockItemModel("_", "block_single_window")) - .build() + .initialProperties(SharedProperties::softMetal) + .properties(AbstractBlock.Properties::noOcclusion) + .blockstate(new FluidTankGenerator()::generate) + .onRegister(CreateRegistrate.blockModel(() -> FluidTankModel::standard)) + .addLayer(() -> RenderType::cutoutMipped) + .item(FluidTankItem::new) + .model(AssetLookup.customBlockItemModel("_", "block_single_window")) + .build() .register(); public static final BlockEntry CREATIVE_FLUID_TANK = @@ -844,11 +849,11 @@ public class AllBlocks { .register(); public static final BlockEntry CONTROLLER_RAIL = - REGISTRATE.block("controller_rail", ControllerRailBlock::new) - .initialProperties(() -> Blocks.POWERED_RAIL) - .blockstate(new ControllerRailGenerator()::generate) - .addLayer(() -> RenderType::cutoutMipped) - .color(() -> ColorHandlers::getRedstonePower) + REGISTRATE.block("controller_rail", ControllerRailBlock::new) + .initialProperties(() -> Blocks.POWERED_RAIL) + .blockstate(new ControllerRailGenerator()::generate) + .addLayer(() -> RenderType::cutoutMipped) + .color(() -> ColorHandlers::getRedstonePower) .tag(BlockTags.RAILS) .item() .model((c, p) -> p.generated(c, Create.asResource("block/" + c.getName()))) @@ -957,68 +962,68 @@ public class AllBlocks { .addLayer(() -> RenderType::cutoutMipped) .item() .transform(customItemModel()) - .register(); + .register(); public static final BlockEntry MECHANICAL_PLOUGH = - REGISTRATE.block("mechanical_plough", PloughBlock::new) - .initialProperties(SharedProperties::stone) - .onRegister(addMovementBehaviour(new PloughMovementBehaviour())) - .blockstate(BlockStateGen.horizontalBlockProvider(false)) - .simpleItem() - .register(); + REGISTRATE.block("mechanical_plough", PloughBlock::new) + .initialProperties(SharedProperties::stone) + .onRegister(addMovementBehaviour(new PloughMovementBehaviour())) + .blockstate(BlockStateGen.horizontalBlockProvider(false)) + .simpleItem() + .register(); public static final DyedBlockList SEATS = new DyedBlockList<>(colour -> { String colourName = colour.getSerializedName(); SeatMovementBehaviour movementBehaviour = new SeatMovementBehaviour(); return REGISTRATE.block(colourName + "_seat", p -> new SeatBlock(p, colour == DyeColor.RED)) - .initialProperties(SharedProperties::wooden) - .onRegister(addMovementBehaviour(movementBehaviour)) - .blockstate((c, p) -> { - p.simpleBlock(c.get(), p.models() - .withExistingParent(colourName + "_seat", p.modLoc("block/seat")) - .texture("1", p.modLoc("block/seat/top_" + colourName)) - .texture("2", p.modLoc("block/seat/side_" + colourName))); - }) - .recipe((c, p) -> { - ShapedRecipeBuilder.shaped(c.get()) - .pattern("#") - .pattern("-") - .define('#', DyeHelper.getWoolOfDye(colour)) - .define('-', ItemTags.WOODEN_SLABS) - .unlockedBy("has_wool", RegistrateRecipeProvider.hasItem(ItemTags.WOOL)) - .save(p, Create.asResource("crafting/kinetics/" + c.getName())); - ShapedRecipeBuilder.shaped(c.get()) - .pattern("#") - .pattern("-") - .define('#', DyeHelper.getTagOfDye(colour)) - .define('-', AllItemTags.SEATS.tag) - .unlockedBy("has_seat", RegistrateRecipeProvider.hasItem(AllItemTags.SEATS.tag)) - .save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_seat")); - }) - .onRegisterAfter(Item.class, v -> TooltipHelper.referTo(v, "block.create.seat")) - .tag(AllBlockTags.SEATS.tag) - .item() - .tag(AllItemTags.SEATS.tag) - .build() - .register(); + .initialProperties(SharedProperties::wooden) + .onRegister(addMovementBehaviour(movementBehaviour)) + .blockstate((c, p) -> { + p.simpleBlock(c.get(), p.models() + .withExistingParent(colourName + "_seat", p.modLoc("block/seat")) + .texture("1", p.modLoc("block/seat/top_" + colourName)) + .texture("2", p.modLoc("block/seat/side_" + colourName))); + }) + .recipe((c, p) -> { + ShapedRecipeBuilder.shaped(c.get()) + .pattern("#") + .pattern("-") + .define('#', DyeHelper.getWoolOfDye(colour)) + .define('-', ItemTags.WOODEN_SLABS) + .unlockedBy("has_wool", RegistrateRecipeProvider.hasItem(ItemTags.WOOL)) + .save(p, Create.asResource("crafting/kinetics/" + c.getName())); + ShapedRecipeBuilder.shaped(c.get()) + .pattern("#") + .pattern("-") + .define('#', DyeHelper.getTagOfDye(colour)) + .define('-', AllItemTags.SEATS.tag) + .unlockedBy("has_seat", RegistrateRecipeProvider.hasItem(AllItemTags.SEATS.tag)) + .save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_seat")); + }) + .onRegisterAfter(Item.class, v -> TooltipHelper.referTo(v, "block.create.seat")) + .tag(AllBlockTags.SEATS.tag) + .item() + .tag(AllItemTags.SEATS.tag) + .build() + .register(); }); public static final BlockEntry SAIL_FRAME = REGISTRATE.block("sail_frame", p -> SailBlock.frame(p)) - .initialProperties(SharedProperties::wooden) - .properties(AbstractBlock.Properties::noOcclusion) - .blockstate(BlockStateGen.directionalBlockProvider(false)) - .tag(AllBlockTags.WINDMILL_SAILS.tag) - .tag(AllBlockTags.FAN_TRANSPARENT.tag) - .simpleItem() - .register(); + .initialProperties(SharedProperties::wooden) + .properties(AbstractBlock.Properties::noOcclusion) + .blockstate(BlockStateGen.directionalBlockProvider(false)) + .tag(AllBlockTags.WINDMILL_SAILS.tag) + .tag(AllBlockTags.FAN_TRANSPARENT.tag) + .simpleItem() + .register(); public static final BlockEntry SAIL = REGISTRATE.block("white_sail", p -> SailBlock.withCanvas(p)) - .initialProperties(SharedProperties::wooden) - .properties(AbstractBlock.Properties::noOcclusion) - .blockstate(BlockStateGen.directionalBlockProvider(false)) - .tag(AllBlockTags.WINDMILL_SAILS.tag) - .simpleItem() - .register(); + .initialProperties(SharedProperties::wooden) + .properties(AbstractBlock.Properties::noOcclusion) + .blockstate(BlockStateGen.directionalBlockProvider(false)) + .tag(AllBlockTags.WINDMILL_SAILS.tag) + .simpleItem() + .register(); public static final DyedBlockList DYED_SAILS = new DyedBlockList<>(colour -> { if (colour == DyeColor.WHITE) { @@ -1026,24 +1031,24 @@ public class AllBlocks { } String colourName = colour.getSerializedName(); return REGISTRATE.block(colourName + "_sail", p -> SailBlock.withCanvas(p)) - .properties(AbstractBlock.Properties::noOcclusion) - .initialProperties(SharedProperties::wooden) - .blockstate((c, p) -> p.directionalBlock(c.get(), p.models() - .withExistingParent(colourName + "_sail", p.modLoc("block/white_sail")) - .texture("0", p.modLoc("block/sail/canvas_" + colourName)))) - .tag(AllBlockTags.WINDMILL_SAILS.tag) - .tag(AllBlockTags.SAILS.tag) - .loot((p, b) -> p.dropOther(b, SAIL.get())) - .register(); + .properties(AbstractBlock.Properties::noOcclusion) + .initialProperties(SharedProperties::wooden) + .blockstate((c, p) -> p.directionalBlock(c.get(), p.models() + .withExistingParent(colourName + "_sail", p.modLoc("block/white_sail")) + .texture("0", p.modLoc("block/sail/canvas_" + colourName)))) + .tag(AllBlockTags.WINDMILL_SAILS.tag) + .tag(AllBlockTags.SAILS.tag) + .loot((p, b) -> p.dropOther(b, SAIL.get())) + .register(); }); public static final BlockEntry ANDESITE_CASING = REGISTRATE.block("andesite_casing", CasingBlock::new) - .transform(BuilderTransformers.casing(AllSpriteShifts.ANDESITE_CASING)) - .register(); + .transform(BuilderTransformers.casing(AllSpriteShifts.ANDESITE_CASING)) + .register(); public static final BlockEntry BRASS_CASING = REGISTRATE.block("brass_casing", CasingBlock::new) - .transform(BuilderTransformers.casing(AllSpriteShifts.BRASS_CASING)) - .register(); + .transform(BuilderTransformers.casing(AllSpriteShifts.BRASS_CASING)) + .register(); public static final BlockEntry COPPER_CASING = REGISTRATE.block("copper_casing", CasingBlock::new) .transform(BuilderTransformers.casing(AllSpriteShifts.COPPER_CASING)) @@ -1301,12 +1306,11 @@ public class AllBlocks { public static final BlockEntry LECTERN_CONTROLLER = REGISTRATE.block("lectern_controller", LecternControllerBlock::new) .initialProperties(() -> Blocks.LECTERN) - .blockstate((c,p) -> p.horizontalBlock(c.get(), p.models() + .blockstate((c, p) -> p.horizontalBlock(c.get(), p.models() .getExistingFile(p.mcLoc("block/lectern")))) .loot((lt, block) -> lt.dropOther(block, Blocks.LECTERN)) .register(); - // Curiosities static { @@ -1346,6 +1350,26 @@ public class AllBlocks { .onRegister(addMovementBehaviour(new HauntedBellMovementBehaviour())) .register(); + public static final BlockEntry TOOLBOX = REGISTRATE.block("toolbox", ToolboxBlock::new) + .blockstate((c, p) -> p.horizontalBlock(c.get(), AssetLookup.partialBaseModel(c, p))) + .initialProperties(SharedProperties::wooden) + .properties(p -> p.sound(SoundType.WOOD)) + .addLayer(() -> RenderType::cutoutMipped) + .loot((lt, block) -> { + Builder builder = LootTable.lootTable(); + IBuilder survivesExplosion = SurvivesExplosion.survivesExplosion(); + lt.add(block, builder.withPool(LootPool.lootPool() + .when(survivesExplosion) + .setRolls(ConstantRange.exactly(1)) + .add(ItemLootEntry.lootTableItem(AllBlocks.TOOLBOX.get()) + .apply(CopyName.copyName(CopyName.Source.BLOCK_ENTITY)) + .apply(CopyNbt.copyData(CopyNbt.Source.BLOCK_ENTITY) + .copy("Inventory", "Inventory"))))); + }) + .item() + .transform(customItemModel()) + .register(); + // Materials static { diff --git a/src/main/java/com/simibubi/create/AllContainerTypes.java b/src/main/java/com/simibubi/create/AllContainerTypes.java index 14d498753..79e5745f3 100644 --- a/src/main/java/com/simibubi/create/AllContainerTypes.java +++ b/src/main/java/com/simibubi/create/AllContainerTypes.java @@ -1,5 +1,7 @@ package com.simibubi.create; +import com.simibubi.create.content.curiosities.toolbox.ToolboxContainer; +import com.simibubi.create.content.curiosities.toolbox.ToolboxScreen; import com.simibubi.create.content.curiosities.tools.BlueprintContainer; import com.simibubi.create.content.curiosities.tools.BlueprintScreen; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateContainer; @@ -45,6 +47,9 @@ public class AllContainerTypes { public static final ContainerEntry LINKED_CONTROLLER = register("linked_controller", LinkedControllerContainer::new, () -> LinkedControllerScreen::new); + + public static final ContainerEntry TOOLBOX = + register("toolbox", ToolboxContainer::new, () -> ToolboxScreen::new); private static > ContainerEntry register(String name, ForgeContainerFactory factory, NonNullSupplier> screenFactory) { return Create.registrate().container(name, factory, screenFactory).register(); diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java index 6253094c1..e323ba47c 100644 --- a/src/main/java/com/simibubi/create/AllKeys.java +++ b/src/main/java/com/simibubi/create/AllKeys.java @@ -11,6 +11,7 @@ public enum AllKeys { TOOL_MENU("toolmenu", GLFW.GLFW_KEY_LEFT_ALT), ACTIVATE_TOOL("", GLFW.GLFW_KEY_LEFT_CONTROL), + TOOLBELT("toolbelt", GLFW.GLFW_KEY_LEFT_ALT), ; diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index 9ba3acccd..09bfd18cc 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -87,6 +87,7 @@ public class AllShapes { .forHorizontal(NORTH), FLUID_VALVE = shape(3, -1, 3, 13, 17, 13).add(2, 2, 2, 14, 14, 14) .forAxis(), + TOOLBOX = shape(1, 0, 4, 15, 9, 12).forHorizontal(NORTH), SMART_FLUID_PIPE_FLOOR = shape(4, 4, 0, 12, 12, 16).add(3, 3, 3, 13, 13, 13) .add(5, 13, 3, 11, 14, 11) .add(5, 14, 4, 11, 15, 10) @@ -110,7 +111,8 @@ public class AllShapes { .forDirectional(Direction.UP), CRUSHING_WHEEL_CONTROLLER_COLLISION = shape(0, 0, 0, 16, 13, 16).forDirectional(Direction.DOWN), - BELL_FLOOR = shape(0, 0, 5, 16, 11, 11).add(3, 1, 3, 13, 13, 13).forHorizontal(SOUTH), + BELL_FLOOR = shape(0, 0, 5, 16, 11, 11).add(3, 1, 3, 13, 13, 13) + .forHorizontal(SOUTH), BELL_WALL = shape(5, 5, 8, 11, 11, 16).add(3, 1, 3, 13, 13, 13) .forHorizontal(SOUTH), BELL_DOUBLE_WALL = shape(5, 5, 0, 11, 11, 16).add(3, 1, 3, 13, 13, 13) @@ -258,8 +260,7 @@ public class AllShapes { } public Builder erase(double x1, double y1, double z1, double x2, double y2, double z2) { - this.shape = - VoxelShapes.join(shape, cuboid(x1, y1, z1, x2, y2, z2), IBooleanFunction.ONLY_FIRST); + this.shape = VoxelShapes.join(shape, cuboid(x1, y1, z1, x2, y2, z2), IBooleanFunction.ONLY_FIRST); return this; } diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index b426c3421..1b5c74d5b 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -123,6 +123,8 @@ import com.simibubi.create.content.curiosities.armor.CopperBacktankTileEntity; import com.simibubi.create.content.curiosities.bell.BellRenderer; import com.simibubi.create.content.curiosities.bell.HauntedBellTileEntity; import com.simibubi.create.content.curiosities.bell.PeculiarBellTileEntity; +import com.simibubi.create.content.curiosities.toolbox.ToolboxRenderer; +import com.simibubi.create.content.curiosities.toolbox.ToolboxTileEntity; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelInstance; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelRenderer; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelTileEntity; @@ -690,6 +692,12 @@ public class AllTileEntities { .validBlocks(AllBlocks.HAUNTED_BELL) .renderer(() -> BellRenderer::new) .register(); + + public static final TileEntityEntry TOOLBOX = Create.registrate() + .tileEntity("toolbox", ToolboxTileEntity::new) + .validBlocks(AllBlocks.TOOLBOX) + .renderer(() -> ToolboxRenderer::new) + .register(); public static void register() {} } diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index 2cf7dcf90..9ab838d65 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -40,6 +40,7 @@ import com.simibubi.create.content.contraptions.components.press.MechanicalPress import com.simibubi.create.content.contraptions.components.saw.SawTileEntity; import com.simibubi.create.content.contraptions.fluids.recipe.PotionMixingRecipeManager; import com.simibubi.create.content.contraptions.processing.BasinRecipe; +import com.simibubi.create.content.curiosities.toolbox.ToolboxScreen; import com.simibubi.create.content.curiosities.tools.BlueprintScreen; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateScreen; import com.simibubi.create.content.logistics.item.LinkedControllerScreen; @@ -254,6 +255,7 @@ public class CreateJEI implements IModPlugin { registration.addGuiContainerHandler(AttributeFilterScreen.class, slotMover); registration.addGuiContainerHandler(BlueprintScreen.class, slotMover); registration.addGuiContainerHandler(LinkedControllerScreen.class, slotMover); + registration.addGuiContainerHandler(ToolboxScreen.class, slotMover); registration.addGhostIngredientHandler(AbstractFilterScreen.class, new GhostIngredientHandler()); registration.addGhostIngredientHandler(BlueprintScreen.class, new GhostIngredientHandler()); diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ItemReturnInvWrapper.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ItemReturnInvWrapper.java new file mode 100644 index 000000000..3b4f24dc3 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ItemReturnInvWrapper.java @@ -0,0 +1,23 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.items.wrapper.InvWrapper; + +/** + * For inserting items into a players' inventory anywhere except the hotbar + */ +public class ItemReturnInvWrapper extends InvWrapper { + + public ItemReturnInvWrapper(IInventory inv) { + super(inv); + } + + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if (slot >= 0 && slot < 9) + return stack; + return super.insertItem(slot, stack, simulate); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java new file mode 100644 index 000000000..d0156fbd7 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java @@ -0,0 +1,257 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.List; + +import com.jozufozu.flywheel.util.transform.MatrixTransformStack; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllKeys; +import com.simibubi.create.foundation.gui.AbstractSimiScreen; +import com.simibubi.create.foundation.gui.AllGuiTextures; +import com.simibubi.create.foundation.gui.AllIcons; +import com.simibubi.create.foundation.gui.GuiGameElement; +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.Lang; + +import net.minecraft.client.MainWindow; +import net.minecraft.client.Minecraft; +import net.minecraft.client.util.InputMappings; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; + +public class RadialToolboxMenu extends AbstractSimiScreen { + + public static enum State { + SELECT_BOX, SELECT_ITEM, SELECT_ITEM_UNEQUIP, DETACH + } + + private State state; + private int ticksOpen; + private int hoveredSlot; + + private List toolboxes; + private ToolboxTileEntity selectedBox; + final int UNEQUIP = -5; + + public RadialToolboxMenu(List toolboxes, State state) { + this.toolboxes = toolboxes; + this.state = state; + hoveredSlot = -1; + + if (state == State.SELECT_ITEM_UNEQUIP || state == State.SELECT_ITEM) + selectedBox = toolboxes.get(0); + } + + @Override + protected void renderWindow(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + float fade = MathHelper.clamp((ticksOpen + AnimationTickHolder.getPartialTicks()) / 10f, 1 / 512f, 1); + + hoveredSlot = -1; + MainWindow window = getMinecraft().getWindow(); + float hoveredX = mouseX - window.getGuiScaledWidth() / 2; + float hoveredY = mouseY - window.getGuiScaledHeight() / 2; + + float distance = hoveredX * hoveredX + hoveredY * hoveredY; + if (distance > 25 && distance < 20000) + hoveredSlot = + (MathHelper.floor((AngleHelper.deg(MathHelper.atan2(hoveredY, hoveredX)) + 360 + 180 - 22.5f)) % 360) + / 45; + boolean renderCenterSlot = state == State.SELECT_ITEM_UNEQUIP; + if (renderCenterSlot && distance <= 150) + hoveredSlot = UNEQUIP; + + ms.pushPose(); + ms.translate(width / 2, height / 2, 0); + ITextComponent tip = null; + + if (state == State.DETACH) { + + tip = Lang.translate("toolbox.outOfRange"); + if (hoveredX > -20 && hoveredX < 20 && hoveredY > -80 && hoveredY < -20) + hoveredSlot = UNEQUIP; + + ms.pushPose(); + AllGuiTextures.TOOLBELT_INACTIVE_SLOT.draw(ms, this, -12, -12); + GuiGameElement.of(AllBlocks.TOOLBOX.asStack()) + .at(-9, -9) + .render(ms); + + ms.translate(0, -40 + (10 * (1 - fade) * (1 - fade)), 0); + AllGuiTextures.TOOLBELT_SLOT.draw(ms, this, -12, -12); + ms.translate(-0.5, 0.5, 0); + AllIcons.I_DISABLE.draw(ms, this, -9, -9); + ms.translate(0.5, -0.5, 0); + if (hoveredSlot == UNEQUIP) { + AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -13, -13); + tip = Lang.translate("toolbox.detach") + .withStyle(TextFormatting.GOLD); + } + ms.popPose(); + + } else { + for (int slot = 0; slot < 8; slot++) { + ms.pushPose(); + MatrixTransformStack.of(ms) + .rotateZ(slot * 45 - 45) + .translate(0, -40 + (10 * (1 - fade) * (1 - fade)), 0) + .rotateZ(-slot * 45 + 45); + ms.translate(-12, -12, 0); + + if (state == State.SELECT_ITEM || state == State.SELECT_ITEM_UNEQUIP) { + ToolboxInventory inv = selectedBox.inventory; + ItemStack stackInSlot = inv.filters.get(slot); + + if (!stackInSlot.isEmpty()) { + boolean empty = inv.getStackInSlot(slot * ToolboxInventory.STACKS_PER_COMPARTMENT) + .isEmpty(); + + (empty ? AllGuiTextures.TOOLBELT_INACTIVE_SLOT : AllGuiTextures.TOOLBELT_SLOT).draw(ms, this, 0, + 0); + GuiGameElement.of(stackInSlot) + .at(3, 3) + .render(ms); + + if (slot == hoveredSlot && !empty) { + AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -1, -1); + tip = stackInSlot.getHoverName(); + } + } else + AllGuiTextures.TOOLBELT_EMPTY_SLOT.draw(ms, this, 0, 0); + + } else if (state == State.SELECT_BOX) { + + if (slot < toolboxes.size()) { + AllGuiTextures.TOOLBELT_SLOT.draw(ms, this, 0, 0); + GuiGameElement.of(AllBlocks.TOOLBOX.asStack()) + .at(3, 3) + .render(ms); + + if (slot == hoveredSlot) { + AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -1, -1); + tip = toolboxes.get(slot) + .getDisplayName(); + } + } else + AllGuiTextures.TOOLBELT_EMPTY_SLOT.draw(ms, this, 0, 0); + + } + + ms.popPose(); + } + + if (renderCenterSlot) { + ms.pushPose(); + AllGuiTextures.TOOLBELT_SLOT.draw(ms, this, -12, -12); + AllIcons.I_TRASH.draw(ms, this, -9, -9); + if (UNEQUIP == hoveredSlot) { + AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -13, -13); + tip = Lang.translate("toolbox.unequip", minecraft.player.getMainHandItem() + .getHoverName()) + .withStyle(TextFormatting.GOLD); + } + ms.popPose(); + } + } + ms.popPose(); + + if (tip != null) { + int i1 = (int) (fade * 255.0F); + if (i1 > 255) + i1 = 255; + + if (i1 > 8) { + ms.pushPose(); + ms.translate((float) (width / 2), (float) (height - 68), 0.0F); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + int k1 = 16777215; + int k = i1 << 24 & -16777216; + int l = font.width(tip); +// this.drawBackdrop(ms, font, -4, l, 16777215 | k); + font.draw(ms, tip, (float) (-l / 2), -4.0F, k1 | k); + RenderSystem.disableBlend(); + ms.popPose(); + } + } + + } + + @Override + public void renderBackground(MatrixStack p_238651_1_, int p_238651_2_) { + int a = ((int) (0x50 * Math.min(1, (ticksOpen + AnimationTickHolder.getPartialTicks()) / 20f))) << 24; + fillGradient(p_238651_1_, 0, 0, this.width, this.height, 0x101010 | a, 0x101010 | a); + } + + @Override + public void tick() { + ticksOpen++; + super.tick(); + } + + @Override + public void removed() { + super.removed(); + + if (state == State.SELECT_BOX) + return; + + if (state == State.DETACH) { + if (hoveredSlot == UNEQUIP) + AllPackets.channel.sendToServer( + new ToolboxEquipPacket(null, hoveredSlot, Minecraft.getInstance().player.inventory.selected)); + return; + } + + if (hoveredSlot == UNEQUIP) + AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), hoveredSlot, + Minecraft.getInstance().player.inventory.selected)); + + if (hoveredSlot < 0) + return; + ToolboxInventory inv = selectedBox.inventory; + ItemStack stackInSlot = inv.filters.get(hoveredSlot); + if (stackInSlot.isEmpty()) + return; + if (inv.getStackInSlot(hoveredSlot * ToolboxInventory.STACKS_PER_COMPARTMENT) + .isEmpty()) + return; + + AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), hoveredSlot, + Minecraft.getInstance().player.inventory.selected)); + } + + @Override + public boolean mouseClicked(double x, double y, int button) { + if (state == State.SELECT_BOX && hoveredSlot >= 0 && hoveredSlot < toolboxes.size()) { + state = State.SELECT_ITEM; + selectedBox = toolboxes.get(hoveredSlot); + return true; + } + + if (state == State.SELECT_ITEM || state == State.SELECT_ITEM_UNEQUIP) { + if (hoveredSlot == UNEQUIP || hoveredSlot >= 0) { + onClose(); + ToolboxHandlerClient.COOLDOWN = 10; + } + } + + return super.mouseClicked(x, y, button); + } + + @Override + public boolean keyReleased(int code, int p_keyPressed_2_, int p_keyPressed_3_) { + InputMappings.Input mouseKey = InputMappings.getKey(code, p_keyPressed_2_); + if (AllKeys.TOOLBELT.getKeybind() + .isActiveAndMatches(mouseKey)) { + this.onClose(); + return true; + } + return super.keyReleased(code, p_keyPressed_2_, p_keyPressed_3_); + } + +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java new file mode 100644 index 000000000..c56351184 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java @@ -0,0 +1,137 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import static net.minecraft.state.properties.BlockStateProperties.WATERLOGGED; + +import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.block.ITE; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.fluid.FluidState; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.fml.network.NetworkHooks; + +public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE { + + public ToolboxBlock(Properties p_i48377_1_) { + super(p_i48377_1_); + registerDefaultState(super.defaultBlockState().setValue(WATERLOGGED, false)); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : Fluids.EMPTY.defaultFluidState(); + } + + @Override + protected void createBlockStateDefinition(Builder builder) { + super.createBlockStateDefinition(builder.add(WATERLOGGED) + .add(FACING)); + } + + @Override + public void setPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) { + super.setPlacedBy(worldIn, pos, state, placer, stack); + if (worldIn.isClientSide) + return; + if (stack == null) + return; + withTileEntityDo(worldIn, pos, te -> { + te.readInventory(stack.getOrCreateTag() + .getCompound("Inventory")); + if (stack.hasCustomHoverName()) + te.setCustomName(stack.getHoverName()); + }); + } + + @Override + public void attack(BlockState state, World world, BlockPos pos, PlayerEntity player) { + if (player instanceof FakePlayer) + return; + if (world.isClientSide) + return; + if (world instanceof ServerWorld) { + for (ItemStack itemStack : Block.getDrops(state, (ServerWorld) world, pos, world.getBlockEntity(pos))) + player.inventory.placeItemBackInInventory(world, itemStack); + world.destroyBlock(pos, false); + } + } + + @Override + public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, IWorld world, + BlockPos pos, BlockPos neighbourPos) { + if (state.getValue(WATERLOGGED)) + world.getLiquidTicks() + .scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world)); + return state; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, + ISelectionContext p_220053_4_) { + return AllShapes.TOOLBOX.get(state.getValue(FACING)); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, + BlockRayTraceResult ray) { + + if (player == null || player.isCrouching()) + return ActionResultType.PASS; + if (player instanceof FakePlayer) + return ActionResultType.PASS; + if (world.isClientSide) + return ActionResultType.SUCCESS; + + withTileEntityDo(world, pos, + toolbox -> NetworkHooks.openGui((ServerPlayerEntity) player, toolbox, toolbox::sendToContainer)); + return ActionResultType.SUCCESS; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.TOOLBOX.create(); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + FluidState ifluidstate = context.getLevel() + .getFluidState(context.getClickedPos()); + return super.getStateForPlacement(context).setValue(FACING, context.getHorizontalDirection() + .getOpposite()) + .setValue(WATERLOGGED, Boolean.valueOf(ifluidstate.getType() == Fluids.WATER)); + } + + @Override + public Class getTileEntityClass() { + return ToolboxTileEntity.class; + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java new file mode 100644 index 000000000..c97fe1fad --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java @@ -0,0 +1,162 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import static com.simibubi.create.content.curiosities.toolbox.ToolboxInventory.STACKS_PER_COMPARTMENT; + +import com.simibubi.create.AllContainerTypes; +import com.simibubi.create.foundation.gui.ContainerBase; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.ClickType; +import net.minecraft.inventory.container.ContainerType; +import net.minecraft.inventory.container.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.SlotItemHandler; + +public class ToolboxContainer extends ContainerBase { + + public static ToolboxContainer create(int id, PlayerInventory inv, ToolboxTileEntity te) { + return new ToolboxContainer(AllContainerTypes.TOOLBOX.get(), id, inv, te); + } + + public ToolboxContainer(ContainerType type, int id, PlayerInventory inv, PacketBuffer extraData) { + super(type, id, inv, extraData); + } + + public ToolboxContainer(ContainerType type, int id, PlayerInventory inv, ToolboxTileEntity te) { + super(type, id, inv, te); + te.startOpen(player); + } + + @Override + protected ToolboxTileEntity createOnClient(PacketBuffer extraData) { + BlockPos readBlockPos = extraData.readBlockPos(); + CompoundNBT readNbt = extraData.readNbt(); + + ClientWorld world = Minecraft.getInstance().level; + TileEntity tileEntity = world.getBlockEntity(readBlockPos); + if (tileEntity instanceof ToolboxTileEntity) { + ToolboxTileEntity toolbox = (ToolboxTileEntity) tileEntity; + toolbox.handleUpdateTag(toolbox.getBlockState(), readNbt); + return toolbox; + } + + return null; + } + + @Override + public ItemStack quickMoveStack(PlayerEntity player, int index) { + Slot clickedSlot = getSlot(index); + if (!clickedSlot.hasItem()) + return ItemStack.EMPTY; + + ItemStack stack = clickedSlot.getItem(); + int size = contentHolder.inventory.getSlots(); + if (index < size) { + moveItemStackTo(stack, size, slots.size(), false); + contentHolder.inventory.onContentsChanged(index); + } else + moveItemStackTo(stack, 0, size - 1, false); + + return ItemStack.EMPTY; + } + + @Override + protected void initAndReadInventory(ToolboxTileEntity contentHolder) { + + } + + @Override + public ItemStack clicked(int index, int flags, ClickType type, PlayerEntity player) { + int size = contentHolder.inventory.getSlots(); + + if (index >= 0 && index < size) { + + ItemStack itemInClickedSlot = getSlot(index).getItem(); + PlayerInventory playerInv = player.inventory; + ItemStack carried = playerInv.getCarried(); + + if (type == ClickType.PICKUP && !carried.isEmpty() && !itemInClickedSlot.isEmpty() + && ItemHandlerHelper.canItemStacksStack(itemInClickedSlot, carried)) { + int subIndex = index % STACKS_PER_COMPARTMENT; + if (subIndex != STACKS_PER_COMPARTMENT - 1) + return clicked(index - subIndex + STACKS_PER_COMPARTMENT - 1, flags, type, player); + } + + if (type == ClickType.PICKUP && !carried.isEmpty() && itemInClickedSlot.isEmpty()) + contentHolder.inventory.filters.set(index / STACKS_PER_COMPARTMENT, carried); + + if (type == ClickType.PICKUP && carried.isEmpty() && itemInClickedSlot.isEmpty()) + if (!player.level.isClientSide) { + contentHolder.inventory.filters.set(index / STACKS_PER_COMPARTMENT, ItemStack.EMPTY); + contentHolder.sendData(); + } + + } + return super.clicked(index, flags, type, player); + } + + @Override + public boolean canDragTo(Slot slot) { + return slot.index > contentHolder.inventory.getSlots() && super.canDragTo(slot); + } + + public ItemStack getFilter(int compartment) { + return contentHolder.inventory.filters.get(compartment); + } + + public int totalCountInCompartment(int compartment) { + int count = 0; + int baseSlot = compartment * STACKS_PER_COMPARTMENT; + for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) + count += getSlot(baseSlot + i).getItem() + .getCount(); + return count; + } + + public boolean renderPass; + + @Override + protected void addSlots() { + ToolboxInventory inventory = contentHolder.inventory; + + int x = 59; + int y = 37; + + int[] xOffsets = { x, x + 33, x + 66, x + 66 + 6, x + 66, x + 33, x, x - 6 }; + int[] yOffsets = { y, y - 6, y, y + 33, y + 66, y + 66 + 6, y + 66, y + 33 }; + + for (int compartment = 0; compartment < 8; compartment++) { + int baseIndex = compartment * STACKS_PER_COMPARTMENT; + + // Representative Slots + addSlot(new ToolboxSlot(this, inventory, baseIndex, xOffsets[compartment], yOffsets[compartment])); + + // Hidden Slots + for (int i = 1; i < STACKS_PER_COMPARTMENT; i++) + addSlot(new SlotItemHandler(inventory, baseIndex + i, -100, -100)); + } + + addPlayerSlots(-12, 166); + } + + @Override + protected void saveData(ToolboxTileEntity contentHolder) { + + } + + @Override + public void removed(PlayerEntity playerIn) { + super.removed(playerIn); + if (!playerIn.level.isClientSide) + contentHolder.stopOpen(playerIn); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java new file mode 100644 index 000000000..078d23ff8 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java @@ -0,0 +1,117 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.function.Supplier; + +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.networking.ISyncPersistentData; +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.network.NetworkEvent.Context; +import net.minecraftforge.fml.network.PacketDistributor; +import net.minecraftforge.items.ItemHandlerHelper; + +public class ToolboxEquipPacket extends SimplePacketBase { + + private BlockPos toolboxPos; + private int slot; + private int hotbarSlot; + + public ToolboxEquipPacket(BlockPos toolboxPos, int slot, int hotbarSlot) { + this.toolboxPos = toolboxPos; + this.slot = slot; + this.hotbarSlot = hotbarSlot; + } + + public ToolboxEquipPacket(PacketBuffer buffer) { + if (buffer.readBoolean()) + toolboxPos = buffer.readBlockPos(); + slot = buffer.readVarInt(); + hotbarSlot = buffer.readVarInt(); + } + + @Override + public void write(PacketBuffer buffer) { + buffer.writeBoolean(toolboxPos != null); + if (toolboxPos != null) + buffer.writeBlockPos(toolboxPos); + buffer.writeVarInt(slot); + buffer.writeVarInt(hotbarSlot); + } + + @Override + public void handle(Supplier context) { + Context ctx = context.get(); + ctx.enqueueWork(() -> { + ServerPlayerEntity player = ctx.getSender(); + World world = player.level; + + if (toolboxPos == null) { + player.getPersistentData() + .getCompound("CreateToolboxData") + .remove(String.valueOf(hotbarSlot)); + sendData(player); + return; + } + + TileEntity blockEntity = world.getBlockEntity(toolboxPos); + + double maxRange = ToolboxHandler.getMaxRange(player); + if (ctx.getSender() + .distanceToSqr(toolboxPos.getX() + 0.5, toolboxPos.getY(), + toolboxPos.getZ() + 0.5) > maxRange * maxRange) + return; + if (!(blockEntity instanceof ToolboxTileEntity)) + return; + + ToolboxHandler.unequip(player, hotbarSlot); + + if (slot < 0 || slot >= 8) { + sendData(player); + return; + } + + ToolboxTileEntity toolboxTileEntity = (ToolboxTileEntity) blockEntity; + + ItemStack playerStack = player.inventory.getItem(hotbarSlot); + if (!playerStack.isEmpty() + && !ItemHandlerHelper.canItemStacksStack(playerStack, toolboxTileEntity.inventory.filters.get(slot))) { + ItemStack remainder = + ItemHandlerHelper.insertItemStacked(toolboxTileEntity.inventory, playerStack, false); + if (!remainder.isEmpty()) + remainder = ItemHandlerHelper.insertItemStacked(new ItemReturnInvWrapper(player.inventory), + remainder, false); + if (remainder.getCount() != playerStack.getCount()) + player.inventory.setItem(hotbarSlot, remainder); + } + + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + String key = String.valueOf(hotbarSlot); + + CompoundNBT data = new CompoundNBT(); + data.putInt("Slot", slot); + data.put("Pos", NBTUtil.writeBlockPos(toolboxPos)); + compound.put(key, data); + + player.getPersistentData() + .put("CreateToolboxData", compound); + sendData(player); + + toolboxTileEntity.connectPlayer(slot, player, hotbarSlot); + }); + ctx.setPacketHandled(true); + } + + private void sendData(ServerPlayerEntity player) { + AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new ISyncPersistentData.Packet(player)); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java new file mode 100644 index 000000000..9daef8f34 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java @@ -0,0 +1,79 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.List; +import java.util.WeakHashMap; +import java.util.stream.Collectors; + +import com.simibubi.create.foundation.utility.WorldAttached; + +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; + +public class ToolboxHandler { + + public static final WorldAttached> toolboxes = + new WorldAttached<>(w -> new WeakHashMap<>()); + + public static void onLoad(ToolboxTileEntity te) { + toolboxes.get(te.getLevel()) + .put(te.getBlockPos(), te); + } + + public static void onUnload(ToolboxTileEntity te) { + toolboxes.get(te.getLevel()) + .remove(te.getBlockPos()); + } + + public static List getNearest(IWorld world, PlayerEntity player, int maxAmount) { + Vector3d location = player.position(); + double maxRange = getMaxRange(player); + return toolboxes.get(world) + .keySet() + .stream() + .filter(p -> distance(location, p) < maxRange * maxRange) + .sorted((p1, p2) -> Double.compare(distance(location, p1), distance(location, p2))) + .limit(maxAmount) + .map(toolboxes.get(world)::get) + .collect(Collectors.toList()); + } + + public static void unequip(PlayerEntity player, int hotbarSlot) { + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + World world = player.level; + String key = String.valueOf(hotbarSlot); + if (!compound.contains(key)) + return; + + CompoundNBT prevData = compound.getCompound(key); + BlockPos prevPos = NBTUtil.readBlockPos(prevData.getCompound("Pos")); + int prevSlot = prevData.getInt("Slot"); + + TileEntity prevBlockEntity = world.getBlockEntity(prevPos); + if (prevBlockEntity instanceof ToolboxTileEntity) + ((ToolboxTileEntity) prevBlockEntity).unequip(prevSlot, player, hotbarSlot); + compound.remove(key); + } + + public static boolean withinRange(PlayerEntity player, ToolboxTileEntity box) { + if (player.level != box.getLevel()) + return false; + double maxRange = getMaxRange(player); + return distance(player.position(), box.getBlockPos()) < maxRange * maxRange; + } + + public static double distance(Vector3d location, BlockPos p) { + return location.distanceToSqr(p.getX() + 0.5f, p.getY(), p.getZ() + 0.5f); + } + + public static double getMaxRange(PlayerEntity player) { + return 10; + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java new file mode 100644 index 000000000..7ac4b05d9 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java @@ -0,0 +1,123 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import static com.simibubi.create.foundation.gui.AllGuiTextures.TOOLBELT_HOTBAR_OFF; +import static com.simibubi.create.foundation.gui.AllGuiTextures.TOOLBELT_HOTBAR_ON; +import static com.simibubi.create.foundation.gui.AllGuiTextures.TOOLBELT_SELECTED_OFF; +import static com.simibubi.create.foundation.gui.AllGuiTextures.TOOLBELT_SELECTED_ON; + +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllKeys; +import com.simibubi.create.foundation.gui.AllGuiTextures; +import com.simibubi.create.foundation.gui.ScreenOpener; + +import net.minecraft.client.MainWindow; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.player.ClientPlayerEntity; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class ToolboxHandlerClient { + + static int COOLDOWN = 0; + + public static void clientTick() { + if (COOLDOWN > 0 && !AllKeys.TOOLBELT.isPressed()) + COOLDOWN--; + } + + public static void onKeyInput(int key, boolean pressed) { + if (key != AllKeys.TOOLBELT.getBoundCode()) + return; + if (COOLDOWN > 0) + return; + ClientPlayerEntity player = Minecraft.getInstance().player; + if (player == null) + return; + World level = player.level; + + List toolboxes = ToolboxHandler.getNearest(player.level, player, 8); + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + + String slotKey = String.valueOf(player.inventory.selected); + boolean equipped = compound.contains(slotKey); + + if (equipped) { + BlockPos pos = NBTUtil.readBlockPos(compound.getCompound(slotKey) + .getCompound("Pos")); + double max = ToolboxHandler.getMaxRange(player); + boolean canReachToolbox = ToolboxHandler.distance(player.position(), pos) < max * max; + + if (canReachToolbox) { + TileEntity blockEntity = level.getBlockEntity(pos); + if (blockEntity instanceof ToolboxTileEntity) { + ScreenOpener.open(new RadialToolboxMenu(ImmutableList.of((ToolboxTileEntity) blockEntity), + RadialToolboxMenu.State.SELECT_ITEM_UNEQUIP)); + return; + } + } + + ScreenOpener.open(new RadialToolboxMenu(ImmutableList.of(), RadialToolboxMenu.State.DETACH)); + return; + } + + if (toolboxes.isEmpty()) + return; + +// ItemStack itemStackFromSlot = player.getItemStackFromSlot(EquipmentSlotType.LEGS); +// if (!AllItems.TOOLBELT.isIn(itemStackFromSlot)) +// return; + + if (toolboxes.size() == 1) + ScreenOpener.open(new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_ITEM)); + else + ScreenOpener.open(new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_BOX)); + } + + public static void renderOverlay(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay, + float partialTicks) { + MainWindow mainWindow = Minecraft.getInstance() + .getWindow(); + int x = mainWindow.getGuiScaledWidth() / 2 - 90; + int y = mainWindow.getGuiScaledHeight() - 23; + RenderSystem.enableDepthTest(); + + PlayerEntity player = Minecraft.getInstance().player; + CompoundNBT persistentData = player.getPersistentData(); + if (!persistentData.contains("CreateToolboxData")) + return; + + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + + if (compound.isEmpty()) + return; + + ms.pushPose(); + for (int slot = 0; slot < 9; slot++) { + String key = String.valueOf(slot); + if (!compound.contains(key)) + continue; + BlockPos pos = NBTUtil.readBlockPos(compound.getCompound(key) + .getCompound("Pos")); + double max = ToolboxHandler.getMaxRange(player); + boolean selected = player.inventory.selected == slot; + int offset = selected ? 1 : 0; + AllGuiTextures texture = ToolboxHandler.distance(player.position(), pos) < max * max + ? selected ? TOOLBELT_SELECTED_ON : TOOLBELT_HOTBAR_ON + : selected ? TOOLBELT_SELECTED_OFF : TOOLBELT_HOTBAR_OFF; + texture.draw(ms, x + 20 * slot - offset, y + offset); + } + ms.popPose(); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java new file mode 100644 index 000000000..741c77eb1 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java @@ -0,0 +1,145 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Nonnull; + +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.ItemStackHandler; + +public class ToolboxInventory extends ItemStackHandler { + + public static final int STACKS_PER_COMPARTMENT = 4; + List filters; + boolean settling; + private ToolboxTileEntity te; + + public ToolboxInventory(ToolboxTileEntity te) { + super(8 * STACKS_PER_COMPARTMENT); + this.te = te; + filters = new ArrayList<>(); + settling = false; + for (int i = 0; i < 8; i++) + filters.add(ItemStack.EMPTY); + } + + public void settle(int compartment) { + int totalCount = 0; + boolean valid = true; + boolean shouldBeEmpty = false; + ItemStack sample = ItemStack.EMPTY; + + for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) { + ItemStack stackInSlot = getStackInSlot(compartment * STACKS_PER_COMPARTMENT + i); + totalCount += stackInSlot.getCount(); + if (!shouldBeEmpty) + shouldBeEmpty = stackInSlot.isEmpty() || stackInSlot.getCount() != stackInSlot.getMaxStackSize(); + else if (!stackInSlot.isEmpty()) { + valid = false; + sample = stackInSlot; + } + } + + if (valid) + return; + + settling = true; + for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) { + ItemStack copy = totalCount <= 0 ? ItemStack.EMPTY + : ItemHandlerHelper.copyStackWithSize(sample, Math.min(totalCount, sample.getMaxStackSize())); + setStackInSlot(compartment * STACKS_PER_COMPARTMENT + i, copy); + totalCount -= copy.getCount(); + } + settling = false; + te.sendData(); + } + + @Override + public boolean isItemValid(int slot, ItemStack stack) { + if (slot < 0 || slot >= getSlots()) + return false; + int compartment = slot / STACKS_PER_COMPARTMENT; + ItemStack filter = filters.get(compartment); + if (!filter.isEmpty() && ItemHandlerHelper.canItemStacksStack(filter, stack)) + return super.isItemValid(slot, stack); + return false; + } + + @Override + public void setStackInSlot(int slot, ItemStack stack) { + super.setStackInSlot(slot, stack); + int compartment = slot / STACKS_PER_COMPARTMENT; + if (!stack.isEmpty() && filters.get(compartment) + .isEmpty()) + filters.set(compartment, ItemHandlerHelper.copyStackWithSize(stack, 1)); + } + + @Override + public CompoundNBT serializeNBT() { + CompoundNBT compound = super.serializeNBT(); + compound.put("Compartments", NBTHelper.writeItemList(filters)); + return compound; + } + + @Override + protected void onContentsChanged(int slot) { + if (!settling && !te.getWorld().isClientSide) + settle(slot / STACKS_PER_COMPARTMENT); + super.onContentsChanged(slot); + } + + @Override + public void deserializeNBT(CompoundNBT nbt) { + filters = NBTHelper.readItemList(nbt.getList("Compartments", NBT.TAG_COMPOUND)); + if (filters.size() != 8) { + filters.clear(); + for (int i = 0; i < 8; i++) + filters.add(ItemStack.EMPTY); + } + super.deserializeNBT(nbt); + } + + public ItemStack distributeToCompartment(@Nonnull ItemStack stack, int compartment, boolean simulate) { + if (stack.isEmpty()) + return stack; + + for (int i = STACKS_PER_COMPARTMENT - 1; i >= 0; i--) { + int slot = compartment * STACKS_PER_COMPARTMENT + i; + stack = insertItem(slot, stack, simulate); + if (stack.isEmpty()) + return ItemStack.EMPTY; + } + + return stack; + } + + public ItemStack takeFromCompartment(int amount, int compartment, boolean simulate) { + if (amount == 0) + return ItemStack.EMPTY; + + int remaining = amount; + ItemStack lastValid = ItemStack.EMPTY; + + for (int i = STACKS_PER_COMPARTMENT - 1; i >= 0; i--) { + int slot = compartment * STACKS_PER_COMPARTMENT + i; + ItemStack extracted = extractItem(slot, amount, simulate); + remaining -= extracted.getCount(); + if (!extracted.isEmpty()) + lastValid = extracted; + if (remaining == 0) + return ItemHandlerHelper.copyStackWithSize(lastValid, amount); + } + + if (remaining == amount) + return ItemStack.EMPTY; + + return ItemHandlerHelper.copyStackWithSize(lastValid, amount - remaining); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxRenderer.java new file mode 100644 index 000000000..bb613206e --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxRenderer.java @@ -0,0 +1,59 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.foundation.render.PartialBufferer; +import com.simibubi.create.foundation.render.SuperByteBuffer; +import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; +import com.simibubi.create.foundation.utility.Iterate; + +import net.minecraft.block.BlockState; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.util.Direction; + +public class ToolboxRenderer extends SmartTileEntityRenderer { + + public ToolboxRenderer(TileEntityRendererDispatcher dispatcher) { + super(dispatcher); + } + + @Override + protected void renderSafe(ToolboxTileEntity tileEntityIn, float partialTicks, MatrixStack ms, + IRenderTypeBuffer buffer, int light, int overlay) { + + BlockState blockState = tileEntityIn.getBlockState(); + Direction facing = blockState.getValue(ToolboxBlock.FACING) + .getOpposite(); + SuperByteBuffer lid = PartialBufferer.get(AllBlockPartials.TOOLBOX_LID, blockState); + SuperByteBuffer drawer = PartialBufferer.get(AllBlockPartials.TOOLBOX_DRAWER, blockState); + + float lidAngle = tileEntityIn.lid.getValue(partialTicks); + float drawerOffset = tileEntityIn.drawers.getValue(partialTicks); + + IVertexBuilder layer = buffer.getBuffer(RenderType.solid()); + lid.matrixStacker() + .centre() + .rotateY(-facing.toYRot()) + .unCentre() + .translate(0, 6/16f, 12/16f) + .rotateX(135 * lidAngle) + .translate(0, -6/16f, -12/16f); + lid.light(light) + .renderInto(ms, layer); + + for (int offset : Iterate.zeroAndOne) { + drawer.matrixStacker() + .centre() + .rotateY(-facing.toYRot()) + .unCentre(); + drawer.translate(0, offset * 1 / 8f, -drawerOffset * .175f * (2 - offset)) + .light(light) + .renderInto(ms, layer); + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java new file mode 100644 index 000000000..986d043ec --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java @@ -0,0 +1,162 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.Collections; +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.jozufozu.flywheel.util.transform.MatrixTransformStack; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen; +import com.simibubi.create.foundation.gui.AllGuiTextures; +import com.simibubi.create.foundation.gui.AllIcons; +import com.simibubi.create.foundation.gui.GuiGameElement; +import com.simibubi.create.foundation.gui.widgets.IconButton; +import com.simibubi.create.foundation.utility.Iterate; + +import net.minecraft.client.renderer.Rectangle2d; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.ITextComponent; + +public class ToolboxScreen extends AbstractSimiContainerScreen { + + AllGuiTextures BG = AllGuiTextures.TOOLBOX; + AllGuiTextures PLAYER = AllGuiTextures.PLAYER_INVENTORY; + protected Slot hoveredToolboxSlot; + private IconButton confirmButton; + + private List extraAreas = Collections.emptyList(); + + public ToolboxScreen(ToolboxContainer container, PlayerInventory inv, ITextComponent title) { + super(container, inv, title); + init(); + } + + @Override + protected void init() { + super.init(); + widgets.clear(); + setWindowSize(BG.width, 256); + confirmButton = new IconButton(getGuiLeft() + BG.width - 23, getGuiTop() + BG.height - 24, AllIcons.I_CONFIRM); + widgets.add(confirmButton); + + extraAreas = ImmutableList.of(new Rectangle2d(118, 155, 80, 100), new Rectangle2d(308, 125, 100, 70)); + } + + @Override + public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { + menu.renderPass = true; + super.render(matrixStack, mouseX, mouseY, partialTicks); + menu.renderPass = false; + } + + @Override + public void setBlitOffset(int p_230926_1_) { + super.setBlitOffset(p_230926_1_); + } + + @Override + protected void renderWindow(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + BG.draw(ms, this, leftPos + 10, topPos); + PLAYER.draw(ms, this, leftPos + (BG.width - PLAYER.width) / 2 - 26, topPos + imageHeight - PLAYER.height); + font.draw(ms, title, leftPos + 24, topPos + 4, 0x442000); + font.draw(ms, inventory.getDisplayName(), leftPos - 13, topPos + 154, 0x404040); + + renderToolbox(ms, mouseX, mouseY, partialTicks); + + hoveredToolboxSlot = null; + for (int compartment = 0; compartment < 8; compartment++) { + int baseIndex = compartment * ToolboxInventory.STACKS_PER_COMPARTMENT; + Slot slot = menu.slots.get(baseIndex); + ItemStack itemstack = slot.getItem(); + int i = slot.x + leftPos; + int j = slot.y + topPos; + + if (itemstack.isEmpty()) + itemstack = menu.getFilter(compartment); + + if (!itemstack.isEmpty()) { + int count = menu.totalCountInCompartment(compartment); + String s = count + ""; + setBlitOffset(100); + itemRenderer.blitOffset = 100.0F; + RenderSystem.enableDepthTest(); + itemRenderer.renderAndDecorateItem(minecraft.player, itemstack, i, j); + itemRenderer.renderGuiItemDecorations(font, itemstack, i, j, s); + setBlitOffset(0); + itemRenderer.blitOffset = 0.0F; + } + + if (isHovering(slot.x, slot.y, 16, 16, mouseX, mouseY)) { + hoveredToolboxSlot = slot; + RenderSystem.disableDepthTest(); + RenderSystem.colorMask(true, true, true, false); + int slotColor = this.getSlotColor(baseIndex); + fillGradient(ms, i, j, i + 16, j + 16, slotColor, slotColor); + RenderSystem.colorMask(true, true, true, true); + RenderSystem.enableDepthTest(); + } + } + } + + private void renderToolbox(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + ms.pushPose(); + ms.translate(397, 190, 100); + MatrixTransformStack.of(ms) + .scale(50) + .rotateX(-22) + .rotateY(-202); + + GuiGameElement.of(AllBlocks.TOOLBOX.getDefaultState()) + .render(ms); + + ms.pushPose(); + MatrixTransformStack.of(ms) + .translate(0, -6 / 16f, 12 / 16f) + .rotateX(-105 * menu.contentHolder.lid.getValue(partialTicks)) + .translate(0, 6 / 16f, -12 / 16f); + GuiGameElement.of(AllBlockPartials.TOOLBOX_LID) + .render(ms); + ms.popPose(); + + for (int offset : Iterate.zeroAndOne) { + ms.pushPose(); + ms.translate(0, -offset * 1 / 8f, menu.contentHolder.drawers.getValue(partialTicks) * -.175f * (2 - offset)); + GuiGameElement.of(AllBlockPartials.TOOLBOX_DRAWER) + .render(ms); + ms.popPose(); + } + ms.popPose(); + } + + @Override + protected void renderWindowForeground(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { + if (hoveredToolboxSlot != null) + hoveredSlot = hoveredToolboxSlot; + super.renderWindowForeground(matrixStack, mouseX, mouseY, partialTicks); + } + + @Override + public boolean mouseClicked(double x, double y, int button) { + boolean mouseClicked = super.mouseClicked(x, y, button); + + if (button == 0) { + if (confirmButton.isHovered()) { + minecraft.player.closeContainer(); + return true; + } + } + + return mouseClicked; + } + + @Override + public List getExtraAreas() { + return extraAreas; + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java new file mode 100644 index 000000000..b14d0573f --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java @@ -0,0 +1,20 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.SlotItemHandler; + +public class ToolboxSlot extends SlotItemHandler { + + private ToolboxContainer toolboxMenu; + + public ToolboxSlot(ToolboxContainer container, IItemHandler itemHandler, int index, int xPosition, int yPosition) { + super(itemHandler, index, xPosition, yPosition); + this.toolboxMenu = container; + } + + @Override + public boolean isActive() { + return !toolboxMenu.renderPass && super.isActive(); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java new file mode 100644 index 000000000..91bdd62d9 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java @@ -0,0 +1,291 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.WeakHashMap; + +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.networking.ISyncPersistentData; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.foundation.utility.animation.LerpedFloat; +import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser; + +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.INameable; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvents; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fml.network.PacketDistributor; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; + +public class ToolboxTileEntity extends SmartTileEntity implements INamedContainerProvider, INameable { + + public LerpedFloat lid = LerpedFloat.linear() + .startWithValue(0); + + public LerpedFloat drawers = LerpedFloat.linear() + .startWithValue(0); + + ToolboxInventory inventory; + LazyOptional inventoryProvider; + protected int openCount; + + Map> connectedPlayers; + + private ITextComponent customName; + + public ToolboxTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + connectedPlayers = new HashMap<>(); + inventory = new ToolboxInventory(this); + inventoryProvider = LazyOptional.of(() -> inventory); + setLazyTickRate(10); + } + + @Override + public void addBehaviours(List behaviours) {} + + @Override + public void initialize() { + super.initialize(); + ToolboxHandler.onLoad(this); + } + + @Override + public void setRemoved() { + super.setRemoved(); + ToolboxHandler.onUnload(this); + } + + @Override + public void tick() { + super.tick(); + + if (level.isClientSide) + tickAudio(); + if (!level.isClientSide) + tickPlayers(); + + lid.chase(openCount > 0 ? 1 : 0, 0.2f, Chaser.LINEAR); + drawers.chase(openCount > 0 ? 1 : 0, 0.2f, Chaser.EXP); + lid.tickChaser(); + drawers.tickChaser(); + } + + private void tickPlayers() { + for (Iterator>> toolboxSlots = connectedPlayers.entrySet() + .iterator(); toolboxSlots.hasNext();) { + + Entry> toolboxSlotEntry = toolboxSlots.next(); + WeakHashMap set = toolboxSlotEntry.getValue(); + int slot = toolboxSlotEntry.getKey(); + + ItemStack referenceItem = inventory.filters.get(slot); + boolean clear = referenceItem.isEmpty(); + + for (Iterator> playerEntries = set.entrySet() + .iterator(); playerEntries.hasNext();) { + Entry playerEntry = playerEntries.next(); + + PlayerEntity player = playerEntry.getKey(); + int hotbarSlot = playerEntry.getValue(); + + if (!clear && !ToolboxHandler.withinRange(player, this)) + continue; + + ItemStack playerStack = player.inventory.getItem(hotbarSlot); + + if (clear + || !playerStack.isEmpty() && !ItemHandlerHelper.canItemStacksStack(playerStack, referenceItem)) { + player.getPersistentData() + .getCompound("CreateToolboxData") + .remove(String.valueOf(hotbarSlot)); + playerEntries.remove(); + if (player instanceof ServerPlayerEntity) + AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), + new ISyncPersistentData.Packet(player)); + continue; + } + + int count = playerStack.getCount(); + int targetAmount = (referenceItem.getMaxStackSize() + 1) / 2; + + if (count < targetAmount) { + int amountToReplenish = targetAmount - count; + ItemStack extracted = inventory.takeFromCompartment(amountToReplenish, slot, false); + if (!extracted.isEmpty()) + player.inventory.setItem(hotbarSlot, + ItemHandlerHelper.copyStackWithSize(extracted, count + extracted.getCount())); + } + + if (count > targetAmount) { + int amountToDeposit = count - targetAmount; + ItemStack toDistribute = ItemHandlerHelper.copyStackWithSize(playerStack, amountToDeposit); + int deposited = amountToDeposit - inventory.distributeToCompartment(toDistribute, slot, false) + .getCount(); + if (deposited > 0) + player.inventory.setItem(hotbarSlot, + ItemHandlerHelper.copyStackWithSize(playerStack, count - deposited)); + } + } + + if (clear) + toolboxSlots.remove(); + } + } + + public void unequip(int slot, PlayerEntity player, int hotbarSlot) { + if (!connectedPlayers.containsKey(slot)) + return; + connectedPlayers.get(slot) + .remove(player); + if (!ToolboxHandler.withinRange(player, this)) + return; + + ItemStack playerStack = player.inventory.getItem(hotbarSlot); + ItemStack remainder = inventory.distributeToCompartment(playerStack, slot, false); + + if (remainder.getCount() != playerStack.getCount()) + player.inventory.setItem(hotbarSlot, remainder); + } + + private void tickAudio() { + Vector3d vec = VecHelper.getCenterOf(worldPosition); + if (lid.settled()) { + if (openCount > 0 && lid.getChaseTarget() == 0) { + level.playLocalSound(vec.x, vec.y, vec.z, SoundEvents.IRON_DOOR_OPEN, SoundCategory.BLOCKS, 0.25F, + level.random.nextFloat() * 0.1F + 1.2F, true); + level.playLocalSound(vec.x, vec.y, vec.z, SoundEvents.CHEST_OPEN, SoundCategory.BLOCKS, 0.1F, + level.random.nextFloat() * 0.1F + 1.1F, true); + } + if (openCount == 0 && lid.getChaseTarget() == 1) + level.playLocalSound(vec.x, vec.y, vec.z, SoundEvents.CHEST_CLOSE, SoundCategory.BLOCKS, 0.1F, + level.random.nextFloat() * 0.1F + 1.1F, true); + + } else if (openCount == 0 && lid.getChaseTarget() == 0 && lid.getValue(0) > 1 / 16f + && lid.getValue(1) < 1 / 16f) + level.playLocalSound(vec.x, vec.y, vec.z, SoundEvents.IRON_DOOR_CLOSE, SoundCategory.BLOCKS, 0.25F, + level.random.nextFloat() * 0.1F + 1.2F, true); + } + + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + if (isItemHandlerCap(cap)) + return inventoryProvider.cast(); + return super.getCapability(cap, side); + } + + @Override + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + inventory.deserializeNBT(compound.getCompound("Inventory")); + super.fromTag(state, compound, clientPacket); + if (compound.contains("CustomName", 8)) + this.customName = ITextComponent.Serializer.fromJson(compound.getString("CustomName")); + if (clientPacket) + openCount = compound.getInt("OpenCount"); + } + + @Override + protected void write(CompoundNBT compound, boolean clientPacket) { + compound.put("Inventory", inventory.serializeNBT()); + if (customName != null) + compound.putString("CustomName", ITextComponent.Serializer.toJson(customName)); + super.write(compound, clientPacket); + if (clientPacket) + compound.putInt("OpenCount", openCount); + } + + @Override + public Container createMenu(int id, PlayerInventory inv, PlayerEntity player) { + return ToolboxContainer.create(id, inv, this); + } + + @Override + public ITextComponent getDisplayName() { + return customName != null ? customName : new TranslationTextComponent("block.create.toolbox"); + } + + @Override + public void lazyTick() { + updateOpenCount(); + // keep re-advertising active TEs + ToolboxHandler.onLoad(this); + super.lazyTick(); + } + + void updateOpenCount() { + if (level.isClientSide) + return; + if (openCount == 0) + return; + + int prevOpenCount = openCount; + openCount = 0; + + for (PlayerEntity playerentity : level.getEntitiesOfClass(PlayerEntity.class, + new AxisAlignedBB(worldPosition).inflate(8))) + if (playerentity.containerMenu instanceof ToolboxContainer + && ((ToolboxContainer) playerentity.containerMenu).contentHolder == this) + openCount++; + + if (prevOpenCount != openCount) + sendData(); + } + + public void startOpen(PlayerEntity player) { + if (player.isSpectator()) + return; + if (openCount < 0) + openCount = 0; + openCount++; + sendData(); + } + + public void stopOpen(PlayerEntity player) { + if (player.isSpectator()) + return; + openCount--; + sendData(); + } + + public void connectPlayer(int slot, PlayerEntity player, int hotbarSlot) { + if (level.isClientSide) + return; + WeakHashMap map = connectedPlayers.computeIfAbsent(slot, WeakHashMap::new); + map.put(player, hotbarSlot); + } + + public void readInventory(CompoundNBT compound) { + inventory.deserializeNBT(compound); + } + + public void setCustomName(ITextComponent customName) { + this.customName = customName; + } + + @Override + public ITextComponent getName() { + return customName; + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java index bf08dde69..966e65579 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java @@ -112,7 +112,8 @@ public class BlueprintContainer extends GhostItemContainer { } @Override - protected void readData(BlueprintSection contentHolder) { + protected void initAndReadInventory(BlueprintSection contentHolder) { + super.initAndReadInventory(contentHolder); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java index 9ec1fbf31..978cac44b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java @@ -11,7 +11,6 @@ import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; @@ -162,11 +161,6 @@ public class AdjustableCrateTileEntity extends CrateTileEntity implements INamed return Lang.translate("gui.adjustable_crate.title"); } - public void sendToContainer(PacketBuffer buffer) { - buffer.writeBlockPos(getBlockPos()); - buffer.writeNbt(getUpdateTag()); - } - @Override public void setRemoved() { super.setRemoved(); diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java index 8d0691975..3902a50a9 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java @@ -126,7 +126,8 @@ public class AttributeFilterContainer extends AbstractFilterContainer { } @Override - protected void readData(ItemStack filterItem) { + protected void initAndReadInventory(ItemStack filterItem) { + super.initAndReadInventory(filterItem); selectedAttributes = new ArrayList<>(); whitelistMode = WhitelistMode.values()[filterItem.getOrCreateTag() .getInt("WhitelistMode")]; diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java index b0b19f5dc..0cc9acc13 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java @@ -52,7 +52,8 @@ public class FilterContainer extends AbstractFilterContainer { } @Override - protected void readData(ItemStack filterItem) { + protected void initAndReadInventory(ItemStack filterItem) { + super.initAndReadInventory(filterItem); CompoundNBT tag = filterItem.getOrCreateTag(); respectNBT = tag.getBoolean("RespectNBT"); blacklist = tag.getBoolean("Blacklist"); diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index c25d99b98..8ea90bf26 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -27,6 +27,7 @@ import com.simibubi.create.content.contraptions.itemAssembly.SequencedAssemblyRe import com.simibubi.create.content.contraptions.relays.belt.BeltSlicer; import com.simibubi.create.content.contraptions.relays.belt.item.BeltConnectorHandler; import com.simibubi.create.content.curiosities.armor.CopperBacktankArmorLayer; +import com.simibubi.create.content.curiosities.toolbox.ToolboxHandlerClient; import com.simibubi.create.content.curiosities.tools.BlueprintOverlayRenderer; import com.simibubi.create.content.curiosities.tools.ExtendoGripRenderHandler; import com.simibubi.create.content.curiosities.zapper.ZapperItem; @@ -145,6 +146,7 @@ public class ClientEvents { CreateClient.GHOST_BLOCKS.tickGhosts(); ContraptionRenderDispatcher.tick(world); BlueprintOverlayRenderer.tick(); + ToolboxHandlerClient.clientTick(); } @SubscribeEvent @@ -225,6 +227,7 @@ public class ClientEvents { LinkedControllerClientHandler.renderOverlay(ms, buffer, light, overlay, partialTicks); BlueprintOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks); GoggleOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks); + ToolboxHandlerClient.renderOverlay(ms, buffer, light, overlay, partialTicks); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/events/InputEvents.java b/src/main/java/com/simibubi/create/events/InputEvents.java index 2b97cb343..f9decbf84 100644 --- a/src/main/java/com/simibubi/create/events/InputEvents.java +++ b/src/main/java/com/simibubi/create/events/InputEvents.java @@ -1,6 +1,7 @@ package com.simibubi.create.events; import com.simibubi.create.CreateClient; +import com.simibubi.create.content.curiosities.toolbox.ToolboxHandlerClient; import com.simibubi.create.content.logistics.item.LinkedControllerClientHandler; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringHandler; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueHandler; @@ -26,6 +27,7 @@ public class InputEvents { return; CreateClient.SCHEMATIC_HANDLER.onKeyInput(key, pressed); + ToolboxHandlerClient.onKeyInput(key, pressed); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 3998c7258..67b52074c 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -52,6 +52,18 @@ public enum AllGuiTextures implements IScreenRenderable { FILTER("filters.png", 214, 97), ATTRIBUTE_FILTER("filters.png", 0, 97, 241, 83), + TOOLBOX("toolbox.png", 188, 171), + TOOLBELT_SLOT("minecraft", "widgets.png", 24, 23, 22, 22), + TOOLBELT_SLOT_HIGHLIGHT("minecraft", "widgets.png", 0, 22, 24, 24), + TOOLBELT_MAIN_SLOT("widgets.png", 0, 97, 24, 24), + TOOLBELT_EMPTY_SLOT("widgets.png", 27, 98, 22, 22), + TOOLBELT_INACTIVE_SLOT("widgets.png", 52, 98, 22, 22), + + TOOLBELT_HOTBAR_OFF("widgets.png", 0, 130, 20, 24), + TOOLBELT_HOTBAR_ON("widgets.png", 20, 130, 20, 24), + TOOLBELT_SELECTED_OFF("widgets.png", 0, 155, 22, 22), + TOOLBELT_SELECTED_ON("widgets.png", 22, 155, 22, 22), + SEQUENCER("sequencer.png", 173, 159), SEQUENCER_INSTRUCTION("sequencer.png", 0, 14, 162, 22), SEQUENCER_DELAY("sequencer.png", 0, 58, 162, 22), @@ -120,7 +132,11 @@ public enum AllGuiTextures implements IScreenRenderable { } private AllGuiTextures(String location, int startX, int startY, int width, int height) { - this.location = new ResourceLocation(Create.ID, "textures/gui/" + location); + this(Create.ID, location, startX, startY, width, height); + } + + private AllGuiTextures(String namespace, String location, int startX, int startY, int width, int height) { + this.location = new ResourceLocation(namespace, "textures/gui/" + location); this.width = width; this.height = height; this.startX = startX; diff --git a/src/main/java/com/simibubi/create/foundation/gui/ContainerBase.java b/src/main/java/com/simibubi/create/foundation/gui/ContainerBase.java new file mode 100644 index 000000000..fff1ae447 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/gui/ContainerBase.java @@ -0,0 +1,69 @@ +package com.simibubi.create.foundation.gui; + +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.ContainerType; +import net.minecraft.inventory.container.Slot; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +public abstract class ContainerBase extends Container { + + public PlayerEntity player; + public PlayerInventory playerInventory; + public T contentHolder; + + protected ContainerBase(ContainerType type, int id, PlayerInventory inv, PacketBuffer extraData) { + super(type, id); + init(inv, createOnClient(extraData)); + } + + protected ContainerBase(ContainerType type, int id, PlayerInventory inv, T contentHolder) { + super(type, id); + init(inv, contentHolder); + } + + protected void init(PlayerInventory inv, T contentHolderIn) { + player = inv.player; + playerInventory = inv; + contentHolder = contentHolderIn; + initAndReadInventory(contentHolder); + addSlots(); + broadcastChanges(); + } + + @OnlyIn(Dist.CLIENT) + protected abstract T createOnClient(PacketBuffer extraData); + + protected abstract void addSlots(); + + protected abstract void initAndReadInventory(T contentHolder); + + protected abstract void saveData(T contentHolder); + + protected void addPlayerSlots(int x, int y) { + for (int hotbarSlot = 0; hotbarSlot < 9; ++hotbarSlot) + this.addSlot(new Slot(playerInventory, hotbarSlot, x + hotbarSlot * 18, y + 58)); + for (int row = 0; row < 3; ++row) + for (int col = 0; col < 9; ++col) + this.addSlot(new Slot(playerInventory, col + row * 9 + 9, x + col * 18, y + row * 18)); + } + + @Override + public void removed(PlayerEntity playerIn) { + super.removed(playerIn); + saveData(contentHolder); + } + + @Override + public boolean stillValid(PlayerEntity player) { + if (contentHolder == null) + return false; + if (contentHolder instanceof IInteractionChecker) + return ((IInteractionChecker) contentHolder).canPlayerUse(player); + return true; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/gui/GhostItemContainer.java b/src/main/java/com/simibubi/create/foundation/gui/GhostItemContainer.java index d2b00bea3..7b7f1903c 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/GhostItemContainer.java +++ b/src/main/java/com/simibubi/create/foundation/gui/GhostItemContainer.java @@ -3,54 +3,32 @@ package com.simibubi.create.foundation.gui; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.ClickType; -import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.ContainerType; import net.minecraft.inventory.container.Slot; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; -public abstract class GhostItemContainer extends Container implements IClearableContainer { +public abstract class GhostItemContainer extends ContainerBase implements IClearableContainer { - public PlayerEntity player; - public PlayerInventory playerInventory; public ItemStackHandler ghostInventory; - public T contentHolder; protected GhostItemContainer(ContainerType type, int id, PlayerInventory inv, PacketBuffer extraData) { - super(type, id); - init(inv, createOnClient(extraData)); + super(type, id, inv, extraData); } protected GhostItemContainer(ContainerType type, int id, PlayerInventory inv, T contentHolder) { - super(type, id); - init(inv, contentHolder); + super(type, id, inv, contentHolder); } - @OnlyIn(Dist.CLIENT) - protected abstract T createOnClient(PacketBuffer extraData); - - protected abstract void addSlots(); - protected abstract ItemStackHandler createGhostInventory(); - protected abstract void readData(T contentHolder); - - protected abstract void saveData(T contentHolder); - protected abstract boolean allowRepeats(); - protected void init(PlayerInventory inv, T contentHolder) { - player = inv.player; - playerInventory = inv; - this.contentHolder = contentHolder; + @Override + protected void initAndReadInventory(T contentHolder) { ghostInventory = createGhostInventory(); - readData(contentHolder); - addSlots(); - broadcastChanges(); } @Override @@ -59,14 +37,6 @@ public abstract class GhostItemContainer extends Container implements ICleara ghostInventory.setStackInSlot(i, ItemStack.EMPTY); } - protected void addPlayerSlots(int x, int y) { - for (int hotbarSlot = 0; hotbarSlot < 9; ++hotbarSlot) - this.addSlot(new Slot(playerInventory, hotbarSlot, x + hotbarSlot * 18, y + 58)); - for (int row = 0; row < 3; ++row) - for (int col = 0; col < 9; ++col) - this.addSlot(new Slot(playerInventory, col + row * 9 + 9, x + col * 18, y + row * 18)); - } - @Override public boolean canTakeItemForPickAll(ItemStack stack, Slot slotIn) { return slotIn.container == playerInventory; @@ -135,10 +105,6 @@ public abstract class GhostItemContainer extends Container implements ICleara return ItemStack.EMPTY; } - @Override - public void removed(PlayerEntity playerIn) { - super.removed(playerIn); - saveData(contentHolder); - } + } diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index 079bc0cbd..e26663161 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -23,6 +23,7 @@ import com.simibubi.create.content.contraptions.fluids.actors.FluidSplashPacket; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.ConfigureSequencedGearshiftPacket; import com.simibubi.create.content.curiosities.bell.SoulPulseEffectPacket; import com.simibubi.create.content.curiosities.symmetry.SymmetryEffectPacket; +import com.simibubi.create.content.curiosities.toolbox.ToolboxEquipPacket; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; import com.simibubi.create.content.curiosities.tools.ExtendoGripInteractionPacket; import com.simibubi.create.content.curiosities.weapons.PotatoCannonPacket; @@ -96,6 +97,7 @@ public enum AllPackets { C_CONFIGURE_CONFIG(CConfigureConfigPacket.class, CConfigureConfigPacket::new, PLAY_TO_SERVER), SUBMIT_GHOST_ITEM(GhostItemSubmitPacket.class, GhostItemSubmitPacket::new, PLAY_TO_SERVER), BLUEPRINT_COMPLETE_RECIPE(BlueprintAssignCompleteRecipePacket.class, BlueprintAssignCompleteRecipePacket::new, PLAY_TO_SERVER), + TOOLBOX_EQUIP(ToolboxEquipPacket.class, ToolboxEquipPacket::new, PLAY_TO_SERVER), // Server to Client SYMMETRY_EFFECT(SymmetryEffectPacket.class, SymmetryEffectPacket::new, PLAY_TO_CLIENT), diff --git a/src/main/java/com/simibubi/create/foundation/networking/ISyncPersistentData.java b/src/main/java/com/simibubi/create/foundation/networking/ISyncPersistentData.java index 77d3ccfde..1226eaabd 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/ISyncPersistentData.java +++ b/src/main/java/com/simibubi/create/foundation/networking/ISyncPersistentData.java @@ -1,6 +1,6 @@ package com.simibubi.create.foundation.networking; -import java.util.Iterator; +import java.util.HashSet; import java.util.function.Supplier; import net.minecraft.client.Minecraft; @@ -43,20 +43,17 @@ public interface ISyncPersistentData { @Override public void handle(Supplier context) { context.get() - .enqueueWork(() -> { - Entity entityByID = Minecraft.getInstance().level.getEntity(entityId); - if (!(entityByID instanceof ISyncPersistentData)) - return; - CompoundNBT data = entityByID.getPersistentData(); - for (Iterator iterator = data.getAllKeys() - .iterator(); iterator.hasNext(); ) { - data.remove(iterator.next()); - } - data.merge(readData); - ((ISyncPersistentData) entityByID).onPersistentDataUpdated(); - }); + .enqueueWork(() -> { + Entity entityByID = Minecraft.getInstance().level.getEntity(entityId); + CompoundNBT data = entityByID.getPersistentData(); + new HashSet<>(data.getAllKeys()).forEach(data::remove); + data.merge(readData); + if (!(entityByID instanceof ISyncPersistentData)) + return; + ((ISyncPersistentData) entityByID).onPersistentDataUpdated(); + }); context.get() - .setPacketHandled(true); + .setPacketHandled(true); } } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java index 2b7541bb4..7d88ca00f 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java @@ -15,6 +15,7 @@ import com.simibubi.create.foundation.utility.IPartialSafeNBT; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.world.World; @@ -214,10 +215,15 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements ITicka @Override public boolean canPlayerUse(PlayerEntity player) { - if (level == null || level.getBlockEntity(worldPosition) != this) { + if (level == null || level.getBlockEntity(worldPosition) != this) return false; - } - return player.distanceToSqr(worldPosition.getX() + 0.5D, worldPosition.getY() + 0.5D, worldPosition.getZ() + 0.5D) <= 64.0D; + return player.distanceToSqr(worldPosition.getX() + 0.5D, worldPosition.getY() + 0.5D, + worldPosition.getZ() + 0.5D) <= 64.0D; + } + + public void sendToContainer(PacketBuffer buffer) { + buffer.writeBlockPos(getBlockPos()); + buffer.writeNbt(getUpdateTag()); } public World getWorld() { diff --git a/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java b/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java index 34d32c713..880f7e4ed 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/NBTHelper.java @@ -53,7 +53,7 @@ public class NBTHelper { listNBT.forEach(inbt -> consumer.accept((CompoundNBT) inbt)); } - public static ListNBT writeItemList(List stacks) { + public static ListNBT writeItemList(Iterable stacks) { return writeCompoundList(stacks, ItemStack::serializeNBT); } diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 1df9899de..24ae8105f 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -104,6 +104,10 @@ "create.gui.toolmenu.focusKey": "Hold [%1$s] to Focus", "create.gui.toolmenu.cycle": "[SCROLL] to Cycle", + + "create.toolbox.unequip": "Unequip: %1$s", + "create.toolbox.outOfRange": "Toolbox of held item not in Range", + "create.toolbox.detach": "Stop tracking and keep item", "create.gui.symmetryWand.mirrorType": "Mirror", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/main/resources/assets/create/models/block/toolbox/block.json b/src/main/resources/assets/create/models/block/toolbox/block.json new file mode 100644 index 000000000..5263d8999 --- /dev/null +++ b/src/main/resources/assets/create/models/block/toolbox/block.json @@ -0,0 +1,24 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "create:block/toolbox", + "particle": "block/dark_oak_planks" + }, + "elements": [ + { + "from": [1, 0, 4], + "to": [15, 6, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 1.5, 7, 4.5], "texture": "#0"}, + "east": {"uv": [6, 6, 10, 9], "texture": "#0"}, + "south": {"uv": [7, 1.5, 14, 4.5], "texture": "#0"}, + "west": {"uv": [6, 6, 10, 9], "texture": "#0"}, + "up": {"uv": [0, 11.5, 7, 15.5], "texture": "#0"}, + "down": {"uv": [7, 11.5, 14, 15.5], "texture": "#0"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/toolbox/drawer.json b/src/main/resources/assets/create/models/block/toolbox/drawer.json new file mode 100644 index 000000000..0cb557f1f --- /dev/null +++ b/src/main/resources/assets/create/models/block/toolbox/drawer.json @@ -0,0 +1,23 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "create:block/toolbox", + "particle": "block/dark_oak_planks" + }, + "elements": [ + { + "from": [2, 1, 4], + "to": [14, 3, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 4.5, 6, 5.5], "texture": "#0"}, + "east": {"uv": [6, 9, 9, 10], "texture": "#0"}, + "west": {"uv": [9, 9, 6, 10], "texture": "#0"}, + "up": {"uv": [0, 5.5, 6, 8.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 8.5, 6, 11.5], "texture": "#0"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/toolbox/item.json b/src/main/resources/assets/create/models/block/toolbox/item.json new file mode 100644 index 000000000..5c2b40a1c --- /dev/null +++ b/src/main/resources/assets/create/models/block/toolbox/item.json @@ -0,0 +1,132 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "create:block/toolbox", + "particle": "block/dark_oak_planks" + }, + "elements": [ + { + "from": [1, 0, 4], + "to": [15, 6, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 1.5, 7, 4.5], "texture": "#0"}, + "east": {"uv": [6, 6, 10, 9], "texture": "#0"}, + "south": {"uv": [7, 1.5, 14, 4.5], "texture": "#0"}, + "west": {"uv": [6, 6, 10, 9], "texture": "#0"}, + "up": {"uv": [0, 11.5, 7, 15.5], "texture": "#0"}, + "down": {"uv": [7, 11.5, 14, 15.5], "texture": "#0"} + } + }, + { + "from": [1, 6, 4], + "to": [15, 9, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 7, 1.5], "texture": "#0"}, + "east": {"uv": [6, 4.5, 10, 6], "texture": "#0"}, + "south": {"uv": [7, 0, 14, 1.5], "texture": "#0"}, + "west": {"uv": [6, 4.5, 10, 6], "texture": "#0"}, + "up": {"uv": [10, 4.5, 14, 11.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [7, 11.5, 14, 15.5], "texture": "#0"} + } + }, + { + "from": [11, 5, 3], + "to": [13, 8, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [9, 9, 10, 10.5], "texture": "#0"}, + "east": {"uv": [9, 9, 9.5, 10.5], "texture": "#0"}, + "south": {"uv": [10, 9, 9, 10.5], "texture": "#0"}, + "west": {"uv": [9.5, 9, 10, 10.5], "texture": "#0"}, + "up": {"uv": [9, 9, 10, 9.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 10, 10, 10.5], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [4, 9, 8], + "to": [12, 11, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [6, 10.5, 10, 11.5], "texture": "#0"}, + "south": {"uv": [6, 10.5, 10, 11.5], "texture": "#0"} + } + }, + { + "from": [1.95, 1.1, 3.7], + "to": [14.05, 3, 9.7], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 4.5, 6, 5.5], "texture": "#0"}, + "east": {"uv": [6, 9, 9, 10], "texture": "#0"}, + "west": {"uv": [9, 9, 6, 10], "texture": "#0"}, + "up": {"uv": [0, 5.5, 6, 8.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 8.5, 6, 11.5], "texture": "#0"} + } + }, + { + "from": [1.95, 3, 3.7], + "to": [14.05, 5.05, 9.7], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 4.5, 6, 5.5], "texture": "#0"}, + "east": {"uv": [6, 9, 9, 10], "texture": "#0"}, + "west": {"uv": [9, 9, 6, 10], "texture": "#0"}, + "up": {"uv": [0, 5.5, 6, 8.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 8.5, 6, 11.5], "texture": "#0"} + } + }, + { + "from": [3, 5, 3], + "to": [5, 8, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [9, 9, 10, 10.5], "texture": "#0"}, + "east": {"uv": [9, 9, 9.5, 10.5], "texture": "#0"}, + "south": {"uv": [10, 9, 9, 10.5], "texture": "#0"}, + "west": {"uv": [9.5, 9, 10, 10.5], "texture": "#0"}, + "up": {"uv": [9, 9, 10, 9.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 10, 10, 10.5], "rotation": 180, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, -77, 2], + "translation": [0, -2.5, -0.75], + "scale": [0.64, 0.64, 0.64] + }, + "thirdperson_lefthand": { + "rotation": [75, -77, 2], + "translation": [0, -2.5, -0.75], + "scale": [0.64, 0.64, 0.64] + }, + "firstperson_righthand": { + "rotation": [-5, 86, 0], + "translation": [1, -1.25, 0], + "scale": [0.88, 0.88, 0.88] + }, + "firstperson_lefthand": { + "rotation": [-5, 86, 0], + "translation": [1, -1.25, 0], + "scale": [0.88, 0.88, 0.88] + }, + "ground": { + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [30, 225, 0], + "translation": [0.25, 2.25, 0], + "scale": [0.79, 0.79, 0.79] + }, + "head": { + "translation": [0, 2.75, 0] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/toolbox/lid.json b/src/main/resources/assets/create/models/block/toolbox/lid.json new file mode 100644 index 000000000..70afceaa4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/toolbox/lid.json @@ -0,0 +1,59 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "create:block/toolbox", + "particle": "block/dark_oak_planks" + }, + "elements": [ + { + "from": [1, 6, 4], + "to": [15, 9, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 7, 1.5], "texture": "#0"}, + "east": {"uv": [6, 4.5, 10, 6], "texture": "#0"}, + "south": {"uv": [7, 0, 14, 1.5], "texture": "#0"}, + "west": {"uv": [6, 4.5, 10, 6], "texture": "#0"}, + "up": {"uv": [10, 4.5, 14, 11.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [7, 11.5, 14, 15.5], "texture": "#0"} + } + }, + { + "from": [11, 5, 3], + "to": [13, 8, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [9, 9, 10, 10.5], "texture": "#0"}, + "east": {"uv": [9, 9, 9.5, 10.5], "texture": "#0"}, + "south": {"uv": [10, 9, 9, 10.5], "texture": "#0"}, + "west": {"uv": [9.5, 9, 10, 10.5], "texture": "#0"}, + "up": {"uv": [9, 9, 10, 9.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 10, 10, 10.5], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [4, 9, 8], + "to": [12, 11, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [6, 10.5, 10, 11.5], "texture": "#0"}, + "south": {"uv": [6, 10.5, 10, 11.5], "texture": "#0"} + } + }, + { + "from": [3, 5, 3], + "to": [5, 8, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [9, 9, 10, 10.5], "texture": "#0"}, + "east": {"uv": [9, 9, 9.5, 10.5], "texture": "#0"}, + "south": {"uv": [10, 9, 9, 10.5], "texture": "#0"}, + "west": {"uv": [9.5, 9, 10, 10.5], "texture": "#0"}, + "up": {"uv": [9, 9, 10, 9.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 10, 10, 10.5], "rotation": 180, "texture": "#0"} + } + } + ], + "display": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/toolbox.png b/src/main/resources/assets/create/textures/block/toolbox.png new file mode 100644 index 0000000000000000000000000000000000000000..62993288720d3c35c2f14b6a5da6b41feb1bebbf GIT binary patch literal 1124 zcmV-q1e^PbP)Px(9!W$&R9J<@mrZC~RTRg6Z|2TRXGR)Q8q=r{QcD+wSa72h7vds=8;h8&3m3Z3 zjf7pQrw9t*Xb5rQ565>KkkRn(l5ftNK3aQK(vC(uOafZHm%zba>xp=vE?tSmg zM~mQpGw0rO&OIOZoO9neuRZ@n1Q5y|!p)%&${r??Jhe9E%)KOExH&@EWA&%M9qZh- z-^G&w0Of80K(7J9Aky??*|lW9y1vNH-6ro|-i-JCv^=2Y-u&=3Nr=A=eZ6QjrNx{O z{ir)(kHdD~v6cwA^2s&;zc;*0y|(n}ggq^nJRd;Joh;F4b+oqtZoZ!-;pS-jUA^CE zb(lUr0l@OrmtlXGTh%`)74vb%j#4hWk=9Xix3}+cXYYaSK%>>+``-?&dl`ibXQm>6 zwNJkV;wv++&4g#jHCmk%-??yRDtc50+A_|}>{PLDPzIFUf?hX0spU#;J{7DGg@>{o zD=8frAKLWnyKM$i%ZP%*@q(b`g=E9oAis-0x?>RME1WZ80(=~O7Wc}*vI zir`Jx6`(fXg?2 zwTjh}oj-p95*bj&lJxxf6Etq5hlw&829chUo(%YM<(}rdc_;P2fsp|P74a~r2+M8( zPX>fRL>NSRU(qWYHLWANku~D=S@o@hOydiuZAYp#pZeB;PNf>ZWw!t>nWK2J?BeDf z{VpWC20&Dn=Bd2%qP@Gn+oz9Ov~tvjtfHegq1M99Ssfs|QEEV04!r%=Ca{^wjA8T4 z=Q|5e7yCt;%t~ernAJZHK3;qVhzk;+zI8xlX&yiiDu^@k(!x^!aV=ywL0p966duGK zvATXgZrRO#?Nn<%3#W@zYjJkMAOaU&dG$%^TL-LckXeA*frr6o8#|dNEmzJ($-Or| z_zviQnq?Lt#F354f|>_kUwR>`EY0iUGz)g^W}W)_KZt^ZCj;vnauCGKbTQR(Sx_mi z)_lHs??VG000038$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBer$kGh%1n0Wo2bzVq#-s`*bjuk&$u#ESGRihBzZe78aHX6DCwtRP5NX z!%9U^Q;Nsj+`OxIdUtpC|Ns9xd!{~m^r)nyq`$xa*s)`wp`mGMX*X`%ym8~k_3PJ{ zELj3H`3>LmR3If^666;Q)Pe^voRusS04n7y@Q5sCVBk9h!i=ICUJXEZ@Aq_Z45^5F zJGZy!vVlMg>y{-`92T0WWM10yKl#yo-$ge%m-bEb`t+ef{F5cJ}Z!Pwz?)Q$X*S8k;RWG0W_~E`k{s-BAJD+{`oH_8^-B9)Ro0>)6%gf_e zUrJiYU|{Xa<-n-Hz}j$bst1_9shO4EdU2GI$A-hH**`u#Sbq3<5Z?GIn-{_59l zhH3V7*FwDO7~;Njy|QO{P`ZABO9RJ&7c!j;f(lG74cBegs=d>c|ND8;suZSa{@cHF zPcJ&jqBFnl{sm*hr;9ibRJm7)G5)LcRAu@kXiz%w{W%UHfj0tylAJSkohVOd;p8am zSkc4cvWEY+awEgB>mFfD25&t!zUD6L&;VLsVCAmlz|z4W_@H$DnlE2jtzD*Y2rx>_ zRR&wm@nM&L*sotrvPxb+H9hA9r#IN2-=5Ok@a6t2w~&)8EZOf^SiFH!HHSP(1q=!& zem}oE_NDA5p$Y%~FhAz(>S37zbcn`csE-;nm?XmA7cVV6?Zoi?=k_gmksJwk4$jqH z8?DA<@X+I9dBJn9*I`zS;rkA>pSM3dyW#2SfYlFIJ@Y;ADb@6X#>1V$4W;u;SS*H&gc z$R%_D8fh_1EBr6tT``F>!REifnn|2LCTPuU;MYVAjP(nCF#6otKUL#f{l2)xz+`vs z;qs|nF8m3xbIgQ|bGLIbYz|(+AmXr-@j-4$`r2EIr!gJazu*4kR`>0`|opD zUU4jl-!IRg+jxlig?QiBc$N(}b8=V;{v-=9WdA){&uP+azxFh*FJr*<_(X;~U&Un){McJ^_xOs}`c@6EgBXCBF`=w$ zPIYzmy49hbG7hbW-iQRwzN*2>V6Hs`@T$WP<^67-P>VaiSprzTF?hQAxvX?O_E8v8`{u|_C6 z4YJF=%-9Wv@%lZ_`~LIZf9@amIp==Py=VEHL%+Nt`(6iZ0)R73kg5+JWB|B`(a}&h z3$!DTqu$z(g4#A@*OZAXJIWPJt+ygY;0#xCG&0PO!>+lRZ$>DvYOgC zVcS!TM1s!b=exA98JdEhOY7#=XTP30>e!z!2B!RCb+yB3j&X~I15%*dd>NKTAxhhQ zx{FGAH+rU3FDtfToWJL8rN55LJw=IXRL}9)$2Trv$#Yy7DB;}75CK^sgrrKN&k;U; z^Z}1nyt_Whvx_Cf+^lIwZ4vnmF3u)+i9sAxLG8AIKv2Q5$p(s^Dg4d}Kkzw^b9(w??L=rT7m1Ts=Ua(y@mpuQu z61-x!G8Pum=J6}TE}nTbY#;ZE3-0_#=UNzwHn|=BG*cvl+!)$h$}*K?!4b!{`IgoT zb7`|q4?#>CH{7(0|F1+2M}U3s+5E$XEA;?Mx?od*4f@ba*>BG?Ir)npHxV@c*Pf z+*erH{8)(PExnr(hrcan^D=@bNmxzF`r@~J$A$p!=I1H2p+Acrvqer)(oUm=u9|&s z(CEL_AJi8l7)J8^6jpS*L6x0UznEhbUh3^{m(Lw}*`~$sJ-(Z~@Pdu@Xp>YMJSQD{ z+0U>K``;NMz4wb-^P{}36kuWTGg$r?BVAm--LJRtuTy1r*pV_^;)qtgc=)NJvXW?X z^NbbS9-WRB+Kz~bD4*gGv$w6HW7u3Pj^kEcP6EWTw+N4^e zPy0Pmo0NH!eLr-x5eEzT6^{D$jAm4VIvuMq>V$g5h^cO?1k557@3YKyDNg!_?5=Kf z=mI~V^&t?5eK!{u5WljxxIUU~CQ&^xVK+21WRWJpvO3u?se;(qp|tp94&@XjOIekb zTb7l(jU@a1yx-l!!4X##Z%&9{XhthJ7+aJwU%J6T{1VaaRde85x$?_Z?IK%$H>?}+ zWNEdu(bnlhp%u~9veD|?uCoQ1-yfyYy|beJtJJbGLsmFG%Ns?-Kj)0}gN%IOBgLU~fcfP+(uyN5@9 z9Ck3Fgb^n)6|&+bgtik+Dy5pEE>=)EIJCATcElmsB+p7**Rl*;(o<+RN)#yg8WlxW zep2uwoCL;RJ}eXTzzi>p{&7DpB;QA}FB2ElP;qZ|9f|z?^@WoO^QOmHD!{?<{J z=N$+$3fP8B)wxKpV8AMP44=v!CYiO*w;_*qXK}wOAb~zcXAK`OpHgb#D2sJ!6w}kc zJ;j2?$%`oOwKDDKq=UliJt|ZirBh+N*#JHO!j$lmgBP6YWMv5XoX|0M#=V_l8ZFrS zAs{bNu>V#-z0J+ICzf8)Ay6rtSl7 z2>5hVgzc$b|`<3AOC)AMqBuPSC8>QKrVRpXExol zV-8h1T(MB?3s80i#ApE4l^P@8Quu3hG zx#*OBbFDawKN3mw37z4$DkO8kXAYa{p~WV7dp!AMgxsX@f7}BR>*l8BDc>425^D6{oE zEMyXQhAGn>WemEs?y$S6cC+edPBk3UY4UpO4BuPC0L1T|-CZjqyve>zw~x5xD^*Y9 z;%>Mo42HfV*FI;Wddsz%2oBFB-S~IM{EFMDaG_L`Dug>m6WkV=85)sNS<8Sag{4?Bj|Yo5I_Cnh+dDMjK^des(Tk? zy8e0l99lHc^?-gB{!v}@YYF6lMw<}@{L&49dgn?JhXJdi(E)oz^HrrmLJeIV7V_te zk>pd?s`zE;1(Rx-~Wk zF4%D*^7ex=C5#(0#Lwy>tl~j5`|ib|MQ1Q0?=(DrPizjN1oO96UXJ}F7F~e1ap-WhM5xUp z(=>{84^Hc6hx^p+Bsaj9TB5n=5}L63=0J+l>K?v+s^ftHS}o5ey{Y@X4P6ftt{Ug+AG|65=9+eo8KpvRl@WG5b5H3b>|W%kSaL2LU8mfK%iEL zAB@A~)9!u2YF`L1?CTkr>&Tou5f5dXN=Hr@lhaKuU1#g`H*@d;u?8{<2SFQ|YifWD z3jGK!3h}6s+zpjcxGnKbY55wL`!TMshe5{g#1++DPLkw_V$}MeowdC$(Em`)u+^Rm za99pya|rG2KGApAoDGhZS9RsT`05E>9Pyj8ahoJ~`dOHD2b8sJqDg%D&t++6lj3{v zn^}w=W)214K-6W47d!cLF`E_lOw0%FjY-O!t20zjlN;z^6Np`IVU$79r>x6MMWI-L z?;_6=JOrWi^7gcI)_ToDEn!~UFy<4hpv*-8?1|Rnf=o1oRJpc2T2fc!*0B&u=Fbg? z4PMJ?B#GZ|ixv2uTC{WhPmbil9}}Y`D@Y z!Cz?a2KfEtd<$zD*4X*S3P5Kx8HW|=*pq_L<mR3*GFxor^NaGbRby{<`XUQ>0t9?zU0|3idVr zdG?QG>JOF+yiXj^Jfusf4N`H;PUHYpkX_$TSgoEku|;t*iCJSyi9mQRa3$9nyO?=J ze!p3~h0i8(1HgPV&ZZfMsnP!SeB};hb=T*?WIAx~R7kFu>+Ac#3ZQoS`?(Ca^6M16 z$8wFsyDKU$ZTLJgf(|2IEXeaU8zw%In@!opQ{U|7m`3K4c7mq2L`7c7kiZ3NXWvml zFq{$Sgu8}gla0fY0Ls{lHu?M#QU8f|LcTUGtlYyhG_Gxd#2fx2(s#M5Ie!`Y9CL62 zGWz9?>jO@|EuCH)P}d;9|E+o4ixJNXgPxaGXHuKFaij$-I3c|{P8>3vYyYr#zdlLQ zVsIWm^YgsDKN1{!8Rgug!TH4D`R|#?rOc~Iv!OOMGX;EYvCq$xF=GM2z$pllzP~`@ z5oVE#2e=Pw5~*K8D1HBy3;=^{w?7DxT2I z$rL$DKJ6-8&Ul$$(RaB4Yk~H(ks-Q>2<9Y9TPF#p}#ru|LXi+dhR5j5Y4mIgjG^9@?yMcl0%{{1GW zPws}xjf}q@?$7_mmq;<;c=j1_GoeX$To2EVse=|;zvFuFV%ulj@1fJ&gIeg;gYp#g zk^8plco*LH>*BYTPgHuxUeiOzV9pXkThX5StC^rWUt?mISWD04i+;+td)-^h0PZ{L z-LX+QL}|X59wt=iqjWtNn*_Jtc9`)#4}&%jXdzWDhXg-5a%{htK`3ALL4v@oEFEPaQeow_Rliy(t2hRBn4$R)E_$ zQugxY8?&2(y8jvEC{XUb;yM@KmmJ<*UeMX1ft3|twUR7vCn+u&`p=&yyCjqGX}^}fN2|JAyRQc?uLHlR7CH>YnPV}*N2CogcOF+;SN2>XKN)Xfr|*`N zdCX<`w^%Me!R4~49PqvuJCIOqk9ieJeuNQM-|5xM^rz2@_8w zGOgnOn#qHkT#1(xnKedt)~DC^UgFH(=>Wm*aaI)8U}JUyFTCm|TmZ#t1PTZ;F3YS^ z;_TF1&G9!GKP|a6{!(>OGNTpj@*YchR_0HWzKORQo-@_Ls_J9U`s)9*8{_BDC_MF+ z+#Epqtijl+>3GHSaHE(*o2KT!9rSp#AmZDgj!TCgv6LPh*6W_CBZe!!ZRP`(ex}xo zqWKz}tbX{gsOiYp9!qVMf-d$JQB0z20Y9tjk225bK@T)S(kJxP0IR>LjJOrRzrEmV zt^H$r42(u(F!rLP&AoiDWw@$Oa}1ClXM0Ju%`?7MMes5;K;!Zn)8TURGt+Ra|=K=9Qn}wivVx&A& zpEt#4Dav+fmkZ){b=W+bo3xkB6lK> zLH??T6bnvNKNSQt+IBJ&Rf9UEbDH8C_QY<41O&fbo@Q;zf2j;S`N27>D;&{G! zfjh@()X9A7@IY4XiqXzyhcuFpT|A|O-TIvmRtN>_0wsl?B-HPw|EQ+-x@1gdr)8EE z&VVZ5dT+*q@rv5s2H?Nh8#iSEM13U&Z#*!Hj0%)kEH@a9zj|tE`)Qruyo)%*f8-_Y z1F66Q8M#IX z+!O>2fPU}EjsL(()}l{0-T1YCy`~uGX7vA+wg2561am|3C_?sC z*(2lU$1hza@ApmD9dz^^L2Lyqsgu$TDmi+nv^q7Q>!nGfc^tZ6IhKON9vnJbj2wMk z`G%2}nnhT%K=|A9vz>C0W|T}dfU-J}C@JvvvRh~3%xtu%|^v5J(57kVL* z2rb4DY(TMp)$(?Y6mc@upAkDt&sUkNxeE1a&;D9_@+hX270-=~PEg>?bLcChpc$zX zWTWY#e@6949^@S!jT2|854v{Oj!2?trHPr*$p8z`KN{<^iyk`m<%nW|C+snPh}l6iRFT4yj$Yv!>50Vz*cvN{ zzTeKL)&l1nt1GRBHnUVke%d<=h--KmeQz#;u>Z~69vtd9dXl>;S=KmGa zBRo-6GBK3x8bm|n40Wl)9@~QKl{q+lL7xWy*}d$ZQ&oX;{kOu3sjpGLoM`E*7aR0%XiRJ2v!^U#*QI6{a%A*G7aJOnkAzEyomK~3yh6-Z7Sl`5blwJ8~ck!%$c zJ9#j!jh$kH4UrXBc5Mf2d|__qKBw#V-+PabhZ&D&&J3NL`G0=k?|nOG?-^;<`d{`w z{}Y`%cdlg}dhWUB?8zseOt$7u=h?Y)XRO)AlC7zez^#%5uoQIdUwST^4Q11Y z&n0`zF8u1+O+l{Go+R3j14}^{w*aDva^I%kNcNhYJAZ#=A~{TzB+}!+QqaW-AbV43 zPXcGoUJ8j}x+J0Fz*5k)3E+d%7bgXI);@pV-N{k2(`P;k``SzUabPLv>dx-T4=z|H z%7l_8f(JgoHaR*~lDPRe(CxZ@wCmmX|JVEUaS}+&7r(GBIeK%FnCdvt&AK)LJpACs zWX7Lz?wtJmvRtJSPhso0StN9@%H|1>!gE9P=m$mYVbn9ExsSxUXxuxdl4 z9+ovP6<@#nj@jTt4~N%G(2r5@lJmTf>+zx;B`^B*Yi8qBvqnWHHS<*~n;qO^w&Gup z`hUg^g{)a#B@ebaxSouo4p3g^? z^JvTGGjS=zOR3k#tzPq@rI&_BTfKfGmw)|j=;@i;Ad?3a99OR4&$ z%VY7f;z3{0y61z`hue?Z`Js5d=$G!%xpKblrR2X-G5Od))q}n4!Cr0nIaK@{)$#b4 zY;BMLu=s=)fNJngD1ltMbjePgIu*8+07|8j4Gau~Wq*Ia_4W0IV^S`cZDeG`Mt?^~ zCzeVAXV0FsgI{{WuKgl@UB+wKl1E#QM_Z4UJ$Wk?^I^T&9JjJpuhmL3EGr&$WsksW zt!cyO&GvrjVLSe__&iw;(*9*;eO~$pJaF&uNLH;~@+{!32!FG+MyobDY&JS#Hheu^ ze&BiWi*FpYLrEf$<=$}U^|DN*lz*|lg8zP=P1G70t5s~c;^*<;AM-NgNk!`)d`tqs z;#{*NaBucn(#{~5eh;lb)Xh_IZBH$eRQzVzBZ=cmx825v;MaqK_*P}gKqvTt?$I9b?PWrHz!UsHcW58rn;g`i8vIKGfBpLP3=9HYNC8gm z4wGRS7JtD1uXJLMwfTJhyr%4)N&E#J8H*x)Nyp9WwOVc5%RTFrUA^1EAeQ>;ItTNnow7 zk_3Q7F7m)09~&EszWUc+318EtVAmIV=nFgaWq%%N&`TQl+NainzV=J+QSC2(@@Ic+ zdtTpbJHGcHN&-wd4lHufz`#K3qst%JUq1a+8~pxj-)+Sd*vaa|y0-$%6N8z)nM>cH zr`(X{hh@w9bNi3K`Soqz{wLe@;%*xn8oH4=04z!w)#yEixEWumlp6!fE6uy^tTxx) zRev8}v9i(Hux`AyX+vaRxUXRA?v8BJZ$@FcdX0tkjecz7`pE9_eJfV12~7+ z#V@n~Qi@yk?{nU#R}hbkh1j-n4|F$u!LRS*mneLVzP|n5U+7CEh;l=Ne#uwjCNv1BaRRMt@Nn`u=VI^Py;_h2fCUt~ z0HdR$VM77l@ZfEFkSp+4_UjAv<0KGkg|EX_cc5LRTDNkoy(Q6k++MhF!M1JNrhiqE z0I)zp3!tyBFWHPWTV8{E*oA(-2lH6nd;Urk)%bWC-x+TkX#cQx6^hwbxJ@Wiv;g#= zk=`|J(eYxj*eaDut=`^V-(@y1FhCLj7Lcm;mIeX8{r6k!hu_`t{Jk5a5ZFVNaqI8V z=$`-YrRGJoe<7FmL{RsxLL8I&w|^&J2+3ma(f7Xb58wKZeQ)avI+QjW^bpbbYp=Z) zUA%ZPB#f(9uZCv`RRpk=x)N&-VeL-y2DPib@FoB%o(I{ON^MxzmS zsJ2&czONY9@EYK2MJ>yF!0UAi^t>kmwFcBR&}%C7T6k}{T)ruIQ?*(x+JCicm%a7Y zTXyKsAv<&Cj2%CI-1hI^Z|}bQt{pyn*xr8o?dFLSCmP3&9jj}fitn?72M^kjBS(@m z0hmvr1#sk-2W`u<|7fqi^!oGnZt!Nk>h+|q9jUZJGAI`ER;ks)U|>oEhV?LBpjtj> zJN6&?#&@3CYA-(j108O!t$#nA6=v|*V~>TdiIU2W9XqtE{d@rCL1+Oe&{nQo>3#T2 z6mIW%s44I>t;mBv3N?ML-UzjQ-0u(XwMKJ1yiT_WYqhuqF%1RpY)bf?@t~fl)>qhN+iHAKu#Z;N9f+&-JNmOWTG4uv73PV8|9|C|U)CzY4=j+7 z05m8!GBV;p9YuwFJ{%}}h2Hci*I=NMf&xG78szg)NDSH@8f#iX$s&nUC6f6-@B<4k zB!E(>WO|G@<4piH^$Yo&m69M=7eIBpA~7BG)7=1d6*L~u*Q4$DVIe&Pq%se}<>FNU z3ne4~-G)m)?;l3`J%0%(`V{28D~?93cqY(3eRwEz0hAe35}F%eY-}vq0%+m=4W z17Pt}z_(6*_)eJMLr?N45s21x3r^d5Xh$FLNuTtaOcRH!>wn)A)-|ud6t@8ZEJ6y> zyS@2;{?EVmSO{1JvuG4v0iRC!m2Rg=KrI3t(+on(moK+ZKKUdhj8|WJU9$mcUcigt zg#Z?J{<^!BA_;33pb405Hn1wW8K9gC2y(=;3*VwEN3*F8H zq-u?%Ka*M>>VJkzH4*92BggD7zWlXajYi|k$u0o5K?xwt3Ov(?byU(;KzoazeO({g zdG^_7)dg7Rn-{{)Hc9{UR9(js5ncf8I#~0A?x73cPLGw&=u(6B9G}sDI{FV5K#?f=^3L`r-Rp$$((^ z_^tU}WyY1VzuQoV1_=4BK5`sOEu6s?b8ruVTnpuIL zc;YKx*MCGFJ9qBXt|=3Mx&SY|{%^K_-+_6Vh4`JH9}nju0RXcX<^)tT--D;)S%K9g zSB-uvntLFffMmXAAx^sl0A?qQ`m2xawQgvAcQPxmR@?jY(@Ccw>-2hhd|C860GPed z0=Rztx@zx8ailCT*I9ved^W+@>GhJ$Fn$1F_J6{hfJy@1bXV+!VC-a8U=7sWN?QA; zI=vo%xeHwY1)U2mfKFxw4#7L|+NrfqK-%f`Wb!is0B&Ds0Zb0sxy}kKGqnJ8t;s># z$t=XWMX6hs0A_FEi$OeaC$fM7ZKN7Uof_n&Y-F|ZD9jS9S%JO64uPn^)vMOrQSj~Y zmVcV&>1PF|qxUIj+s*ZQ>42jKF#*h8=zObI_Cyd8Kqs>T>o%ZnC*Df>VWaeQoz6lm zdIAx^?1co7wgMDjeL3xl#|2d1ULW(mz3=HMAPpI@zj>7*Yup08Pmb=QG00AOxzN&pHt)xL9`6E8-=S8s>%w<+!e|reew$pryS_hgrSj$eYr&)-VyqJm{ zm>UIP>zQYs2{Z6`)4Z0;c|$wIr55cnk%Cget3JGHU2Us2U$tsg*j6x}K7HB-2M1gJ znosou{QQF_E*#tZ_Ti)U;6uL~nt$&~1fq4_*VneX2&&nqd#FfF{&W^%O)kQG0KnWR z(!;F4k3ar+q~KFfYpDPf1*2%RU4gG-YI-YJ74T}x#{-CQ?Y(>VZp{*Ox4-4X@WwVu z0LRZC-K;tMM9D-`e(8LAujpL5MW|X`*GsQ2X;Mg+y1r*7JMiXDNdUkcq&`jX&tz6$ zC4d(O|7EjkY)J?2CQmu8I|T~t$>Rz78I&w^+pm2pawU=05D4veelo7ZD)}= t`mBE+lVKTflW-YflW-X&8K6^U{|D(Y&HW<+OuqmC002ovPDHLkV1hsR(TV^7 From 4dc3629f5dcd8894047ca78cafbad12edd227fe4 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 16 Sep 2021 20:14:38 +0200 Subject: [PATCH 03/22] Packing Up, Part II - Toolboxes keep nbt on pickup - Toolbox radial menu supports mouse wheel - Added Dispose-all buttons - Synced slots detach when moving stacks back into the toolbox - Fixed missing data on client on login --- src/generated/resources/.cache/cache | 26 ++-- .../resources/assets/create/lang/en_us.json | 2 + .../assets/create/lang/unfinished/de_de.json | 4 +- .../assets/create/lang/unfinished/es_es.json | 4 +- .../assets/create/lang/unfinished/fr_fr.json | 4 +- .../assets/create/lang/unfinished/it_it.json | 4 +- .../assets/create/lang/unfinished/ja_jp.json | 4 +- .../assets/create/lang/unfinished/ko_kr.json | 4 +- .../assets/create/lang/unfinished/nl_nl.json | 4 +- .../assets/create/lang/unfinished/pl_pl.json | 4 +- .../assets/create/lang/unfinished/pt_br.json | 4 +- .../assets/create/lang/unfinished/ru_ru.json | 4 +- .../assets/create/lang/unfinished/zh_cn.json | 4 +- .../assets/create/lang/unfinished/zh_tw.json | 4 +- .../toolbox/RadialToolboxMenu.java | 130 ++++++++++++++---- .../curiosities/toolbox/ToolboxBlock.java | 34 ++++- .../curiosities/toolbox/ToolboxContainer.java | 6 +- .../toolbox/ToolboxDisposeAllPacket.java | 81 +++++++++++ .../toolbox/ToolboxEquipPacket.java | 28 ++-- .../curiosities/toolbox/ToolboxHandler.java | 82 ++++++++++- .../toolbox/ToolboxHandlerClient.java | 15 +- .../curiosities/toolbox/ToolboxInventory.java | 68 +++++++-- .../curiosities/toolbox/ToolboxScreen.java | 13 +- .../toolbox/ToolboxTileEntity.java | 113 ++++++++++++--- .../simibubi/create/events/CommonEvents.java | 13 +- .../foundation/config/CCuriosities.java | 3 + .../create/foundation/gui/AllIcons.java | 1 + .../foundation/networking/AllPackets.java | 2 + .../assets/create/lang/default/messages.json | 2 + .../assets/create/textures/gui/icons.png | Bin 4737 -> 4865 bytes 30 files changed, 554 insertions(+), 113 deletions(-) create mode 100644 src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxDisposeAllPacket.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 9c30843cb..68fbd2312 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -427,19 +427,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 337227971382d97fbaa69170e0b6bcc621bdc494 assets/create/lang/en_ud.json -307e88153d5288781e906e566f73ccd59fbcd945 assets/create/lang/en_us.json -5268c9117961dabecdae27b3190d02a8c0ea1077 assets/create/lang/unfinished/de_de.json -2e2002aefd045f492b7232884bd63c7a68d41480 assets/create/lang/unfinished/es_es.json -78836cc1527a95e7e40bc7f50faa95f8cdf5cd9d assets/create/lang/unfinished/fr_fr.json -b83a58ff24f2eca59c628c9a49e286d2feeece35 assets/create/lang/unfinished/it_it.json -5e3e878fe3fd58ba7911877609bf4f0be5a7c71d assets/create/lang/unfinished/ja_jp.json -ff6560eef8744197ab55334392df0a91898d80b2 assets/create/lang/unfinished/ko_kr.json -d0637cc0fa640b328dcdbaf74ae6967a7e15b980 assets/create/lang/unfinished/nl_nl.json -a23c910164b9d295f7c1f5a5e4d9a08094f1f00c assets/create/lang/unfinished/pl_pl.json -bb56417e9607b45350f329f865d2caa7038ebcec assets/create/lang/unfinished/pt_br.json -b643778faf6706b85ad567066de7176272df73d9 assets/create/lang/unfinished/ru_ru.json -45f4a765689a28da8fa267c2845fcf59135c6034 assets/create/lang/unfinished/zh_cn.json -3ac73d1173b450a4fa4eb5622b903cf4b52fbd0b assets/create/lang/unfinished/zh_tw.json +4da832d10fb5bacf10c564bc4f828cdc6592d56c assets/create/lang/en_us.json +31064dd15c813975de6dbe771a94b2fff87d7c84 assets/create/lang/unfinished/de_de.json +785119499208f5a35c4f77a1d189ac78394a133a assets/create/lang/unfinished/es_es.json +7fb3d9f560b08e7d7e4b0e51f7f789ac2eeb3af8 assets/create/lang/unfinished/fr_fr.json +e418df14fbcd15e4b87024dbe4bda97ef1544f47 assets/create/lang/unfinished/it_it.json +95d0baec2d79b914b3aecbfdc6dde970722c552c assets/create/lang/unfinished/ja_jp.json +4fa09f736a742db2d843b0880edc5d607f28d80e assets/create/lang/unfinished/ko_kr.json +757ac709807bdb1322da17f27e0853de552638d1 assets/create/lang/unfinished/nl_nl.json +9b5bc245e4795d86eb27fa35670cd4f261c07576 assets/create/lang/unfinished/pl_pl.json +aaa1e873003b446858fc8bae839db4d0b293472e assets/create/lang/unfinished/pt_br.json +9745c2d6a2e8fc50648399785eb10cc8b125bd1d assets/create/lang/unfinished/ru_ru.json +b04454180b5b4af323009e33c3ba5b163b4e63c1 assets/create/lang/unfinished/zh_cn.json +ce4759ba4aa4ec9e0c24242796ac04b43f4b9a04 assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 7b6b6dca1..627f017ce 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -795,6 +795,8 @@ "create.toolbox.unequip": "Unequip: %1$s", "create.toolbox.outOfRange": "Toolbox of held item not in Range", "create.toolbox.detach": "Stop tracking and keep item", + "create.toolbox.depositAll": "Return items to nearby Toolboxes", + "create.toolbox.depositBox": "Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Mirror", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 5f096580d..64ff7100e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1138", + "_": "Missing Localizations: 1140", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Spiegeln", "create.gui.symmetryWand.orientation": "Orientierung", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 44d35f9f9..827e5c1ba 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 4", + "_": "Missing Localizations: 6", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Espejado", "create.gui.symmetryWand.orientation": "Orientación", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 78e9c4a2a..2b6bcbc93 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1390", + "_": "Missing Localizations: 1392", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Mirroir", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index e8def88f1..dbd9a681f 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 918", + "_": "Missing Localizations: 920", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Specchio", "create.gui.symmetryWand.orientation": "Orientamento", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 5c6496fab..2ae28fc30 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 13", + "_": "Missing Localizations: 15", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "ミラーの種類", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 987018999..363d949ec 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 28", + "_": "Missing Localizations: 30", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "거울의 형태", "create.gui.symmetryWand.orientation": "거울의 방향", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 39010143c..fd3a9ee6f 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1770", + "_": "Missing Localizations: 1772", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Spiegelen", "create.gui.symmetryWand.orientation": "Orientatie", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 45022fd4f..06ba15521 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 260", + "_": "Missing Localizations: 262", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Odbicie lustrzane", "create.gui.symmetryWand.orientation": "Orientacja", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 8538ed5fa..09cbfe400 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1811", + "_": "Missing Localizations: 1813", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Espelhar", "create.gui.symmetryWand.orientation": "Orientação", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 8374dffca..ca208f43b 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 9", + "_": "Missing Localizations: 11", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Зеркало", "create.gui.symmetryWand.orientation": "Ориентация", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 318b583d9..55ef615ae 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 8", + "_": "Missing Localizations: 10", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "镜子类型", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 644d74902..508e4d3b8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 23", + "_": "Missing Localizations: 25", "_": "->------------------------] Game Elements [------------------------<-", @@ -796,6 +796,8 @@ "create.toolbox.unequip": "UNLOCALIZED: Unequip: %1$s", "create.toolbox.outOfRange": "UNLOCALIZED: Toolbox of held item not in Range", "create.toolbox.detach": "UNLOCALIZED: Stop tracking and keep item", + "create.toolbox.depositAll": "UNLOCALIZED: Return items to nearby Toolboxes", + "create.toolbox.depositBox": "UNLOCALIZED: Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "鏡子類型", "create.gui.symmetryWand.orientation": "方向", diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java index d0156fbd7..4a878883d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/RadialToolboxMenu.java @@ -33,10 +33,13 @@ public class RadialToolboxMenu extends AbstractSimiScreen { private State state; private int ticksOpen; private int hoveredSlot; - + private boolean scrollMode; + private int scrollSlot = 0; private List toolboxes; private ToolboxTileEntity selectedBox; - final int UNEQUIP = -5; + + private static final int DEPOSIT = -7; + private static final int UNEQUIP = -5; public RadialToolboxMenu(List toolboxes, State state) { this.toolboxes = toolboxes; @@ -47,6 +50,10 @@ public class RadialToolboxMenu extends AbstractSimiScreen { selectedBox = toolboxes.get(0); } + public void prevSlot(int slot) { + scrollSlot = slot; + } + @Override protected void renderWindow(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { float fade = MathHelper.clamp((ticksOpen + AnimationTickHolder.getPartialTicks()) / 10f, 1 / 512f, 1); @@ -57,11 +64,13 @@ public class RadialToolboxMenu extends AbstractSimiScreen { float hoveredY = mouseY - window.getGuiScaledHeight() / 2; float distance = hoveredX * hoveredX + hoveredY * hoveredY; - if (distance > 25 && distance < 20000) + if (distance > 25 && distance < 10000) hoveredSlot = (MathHelper.floor((AngleHelper.deg(MathHelper.atan2(hoveredY, hoveredX)) + 360 + 180 - 22.5f)) % 360) / 45; boolean renderCenterSlot = state == State.SELECT_ITEM_UNEQUIP; + if (scrollMode && distance > 150) + scrollMode = false; if (renderCenterSlot && distance <= 150) hoveredSlot = UNEQUIP; @@ -86,7 +95,7 @@ public class RadialToolboxMenu extends AbstractSimiScreen { ms.translate(-0.5, 0.5, 0); AllIcons.I_DISABLE.draw(ms, this, -9, -9); ms.translate(0.5, -0.5, 0); - if (hoveredSlot == UNEQUIP) { + if (!scrollMode && hoveredSlot == UNEQUIP) { AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -13, -13); tip = Lang.translate("toolbox.detach") .withStyle(TextFormatting.GOLD); @@ -94,6 +103,23 @@ public class RadialToolboxMenu extends AbstractSimiScreen { ms.popPose(); } else { + + if (hoveredX > 60 && hoveredX < 100 && hoveredY > -20 && hoveredY < 20) + hoveredSlot = DEPOSIT; + + ms.pushPose(); + ms.translate(80 + (-5 * (1 - fade) * (1 - fade)), 0, 0); + AllGuiTextures.TOOLBELT_SLOT.draw(ms, this, -12, -12); + ms.translate(-0.5, 0.5, 0); + AllIcons.I_TOOLBOX.draw(ms, this, -9, -9); + ms.translate(0.5, -0.5, 0); + if (!scrollMode && hoveredSlot == DEPOSIT) { + AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -13, -13); + tip = Lang.translate(state == State.SELECT_BOX ? "toolbox.depositAll" : "toolbox.depositBox") + .withStyle(TextFormatting.GOLD); + } + ms.popPose(); + for (int slot = 0; slot < 8; slot++) { ms.pushPose(); MatrixTransformStack.of(ms) @@ -116,7 +142,7 @@ public class RadialToolboxMenu extends AbstractSimiScreen { .at(3, 3) .render(ms); - if (slot == hoveredSlot && !empty) { + if (slot == (scrollMode ? scrollSlot : hoveredSlot) && !empty) { AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -1, -1); tip = stackInSlot.getHoverName(); } @@ -131,7 +157,7 @@ public class RadialToolboxMenu extends AbstractSimiScreen { .at(3, 3) .render(ms); - if (slot == hoveredSlot) { + if (slot == (scrollMode ? scrollSlot : hoveredSlot)) { AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -1, -1); tip = toolboxes.get(slot) .getDisplayName(); @@ -147,8 +173,8 @@ public class RadialToolboxMenu extends AbstractSimiScreen { if (renderCenterSlot) { ms.pushPose(); AllGuiTextures.TOOLBELT_SLOT.draw(ms, this, -12, -12); - AllIcons.I_TRASH.draw(ms, this, -9, -9); - if (UNEQUIP == hoveredSlot) { + (scrollMode ? AllIcons.I_REFRESH : AllIcons.I_FLIP).draw(ms, this, -9, -9); + if (!scrollMode && UNEQUIP == hoveredSlot) { AllGuiTextures.TOOLBELT_SLOT_HIGHLIGHT.draw(ms, this, -13, -13); tip = Lang.translate("toolbox.unequip", minecraft.player.getMainHandItem() .getHoverName()) @@ -172,7 +198,6 @@ public class RadialToolboxMenu extends AbstractSimiScreen { int k1 = 16777215; int k = i1 << 24 & -16777216; int l = font.width(tip); -// this.drawBackdrop(ms, font, -4, l, 16777215 | k); font.draw(ms, tip, (float) (-l / 2), -4.0F, k1 | k); RenderSystem.disableBlend(); ms.popPose(); @@ -197,46 +222,103 @@ public class RadialToolboxMenu extends AbstractSimiScreen { public void removed() { super.removed(); + int selected = (scrollMode ? scrollSlot : hoveredSlot); + + if (selected == DEPOSIT) { + if (state == State.DETACH) + return; + else if (state == State.SELECT_BOX) + toolboxes.forEach(te -> AllPackets.channel.sendToServer(new ToolboxDisposeAllPacket(te.getBlockPos()))); + else + AllPackets.channel.sendToServer(new ToolboxDisposeAllPacket(selectedBox.getBlockPos())); + return; + } + if (state == State.SELECT_BOX) return; if (state == State.DETACH) { - if (hoveredSlot == UNEQUIP) + if (selected == UNEQUIP) AllPackets.channel.sendToServer( - new ToolboxEquipPacket(null, hoveredSlot, Minecraft.getInstance().player.inventory.selected)); + new ToolboxEquipPacket(null, selected, Minecraft.getInstance().player.inventory.selected)); return; } - if (hoveredSlot == UNEQUIP) - AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), hoveredSlot, + if (selected == UNEQUIP) + AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), selected, Minecraft.getInstance().player.inventory.selected)); - if (hoveredSlot < 0) + if (selected < 0) return; ToolboxInventory inv = selectedBox.inventory; - ItemStack stackInSlot = inv.filters.get(hoveredSlot); + ItemStack stackInSlot = inv.filters.get(selected); if (stackInSlot.isEmpty()) return; - if (inv.getStackInSlot(hoveredSlot * ToolboxInventory.STACKS_PER_COMPARTMENT) + if (inv.getStackInSlot(selected * ToolboxInventory.STACKS_PER_COMPARTMENT) .isEmpty()) return; - AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), hoveredSlot, + AllPackets.channel.sendToServer(new ToolboxEquipPacket(selectedBox.getBlockPos(), selected, Minecraft.getInstance().player.inventory.selected)); } @Override - public boolean mouseClicked(double x, double y, int button) { - if (state == State.SELECT_BOX && hoveredSlot >= 0 && hoveredSlot < toolboxes.size()) { - state = State.SELECT_ITEM; - selectedBox = toolboxes.get(hoveredSlot); + public boolean mouseScrolled(double mouseX, double mouseY, double delta) { + MainWindow window = getMinecraft().getWindow(); + double hoveredX = mouseX - window.getGuiScaledWidth() / 2; + double hoveredY = mouseY - window.getGuiScaledHeight() / 2; + double distance = hoveredX * hoveredX + hoveredY * hoveredY; + if (distance <= 150) { + scrollMode = true; + scrollSlot = (((int) (scrollSlot - delta)) + 8) % 8; + for (int i = 0; i < 10; i++) { + + if (state == State.SELECT_ITEM || state == State.SELECT_ITEM_UNEQUIP) { + ToolboxInventory inv = selectedBox.inventory; + ItemStack stackInSlot = inv.filters.get(scrollSlot); + if (!stackInSlot.isEmpty() + && !inv.getStackInSlot(scrollSlot * ToolboxInventory.STACKS_PER_COMPARTMENT) + .isEmpty()) + break; + } + + if (state == State.SELECT_BOX) + if (scrollSlot < toolboxes.size()) + break; + + if (state == State.DETACH) + break; + + scrollSlot -= MathHelper.sign(delta); + scrollSlot = (scrollSlot + 8) % 8; + } return true; } - if (state == State.SELECT_ITEM || state == State.SELECT_ITEM_UNEQUIP) { - if (hoveredSlot == UNEQUIP || hoveredSlot >= 0) { + return super.mouseScrolled(mouseX, mouseY, delta); + } + + @Override + public boolean mouseClicked(double x, double y, int button) { + int selected = (scrollMode ? scrollSlot : hoveredSlot); + + if (selected == DEPOSIT) { + onClose(); + ToolboxHandlerClient.COOLDOWN = 2; + return true; + } + + if (state == State.SELECT_BOX && selected >= 0 && selected < toolboxes.size()) { + state = State.SELECT_ITEM; + selectedBox = toolboxes.get(selected); + return true; + } + + if (state == State.DETACH || state == State.SELECT_ITEM || state == State.SELECT_ITEM_UNEQUIP) { + if (selected == UNEQUIP || selected >= 0) { onClose(); - ToolboxHandlerClient.COOLDOWN = 10; + ToolboxHandlerClient.COOLDOWN = 2; + return true; } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java index c56351184..37c33a5fc 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java @@ -2,6 +2,9 @@ package com.simibubi.create.content.curiosities.toolbox; import static net.minecraft.state.properties.BlockStateProperties.WATERLOGGED; +import java.util.Optional; + +import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; @@ -17,6 +20,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; @@ -26,6 +30,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.text.ITextComponent; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; @@ -66,19 +71,44 @@ public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE }); } + @Override + public void onRemove(BlockState state, World world, BlockPos pos, BlockState newState, boolean moving) { + if (state.hasTileEntity() && (!state.is(newState.getBlock()) || !newState.hasTileEntity())) + world.removeBlockEntity(pos); + } + @Override public void attack(BlockState state, World world, BlockPos pos, PlayerEntity player) { if (player instanceof FakePlayer) return; if (world.isClientSide) return; + withTileEntityDo(world, pos, ToolboxTileEntity::unequipTracked); if (world instanceof ServerWorld) { - for (ItemStack itemStack : Block.getDrops(state, (ServerWorld) world, pos, world.getBlockEntity(pos))) - player.inventory.placeItemBackInInventory(world, itemStack); + ItemStack cloneItemStack = getCloneItemStack(world, pos, state); world.destroyBlock(pos, false); + if (world.getBlockState(pos) != state) + player.inventory.placeItemBackInInventory(world, cloneItemStack); } } + @Override + public ItemStack getCloneItemStack(IBlockReader world, BlockPos pos, BlockState state) { + ItemStack item = AllBlocks.TOOLBOX.asStack(); + Optional tileEntityOptional = getTileEntityOptional(world, pos); + + CompoundNBT tag = item.getOrCreateTag(); + CompoundNBT inv = tileEntityOptional.map(tb -> tb.inventory.serializeNBT()) + .orElse(new CompoundNBT()); + tag.put("Inventory", inv); + + ITextComponent customName = tileEntityOptional.map(ToolboxTileEntity::getCustomName) + .orElse(null); + if (customName != null) + item.setHoverName(customName); + return item; + } + @Override public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, IWorld world, BlockPos pos, BlockPos neighbourPos) { diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java index c97fe1fad..7856d3bec 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java @@ -17,7 +17,6 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; -import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.SlotItemHandler; public class ToolboxContainer extends ContainerBase { @@ -84,15 +83,12 @@ public class ToolboxContainer extends ContainerBase { ItemStack carried = playerInv.getCarried(); if (type == ClickType.PICKUP && !carried.isEmpty() && !itemInClickedSlot.isEmpty() - && ItemHandlerHelper.canItemStacksStack(itemInClickedSlot, carried)) { + && ToolboxInventory.canItemsShareCompartment(itemInClickedSlot, carried)) { int subIndex = index % STACKS_PER_COMPARTMENT; if (subIndex != STACKS_PER_COMPARTMENT - 1) return clicked(index - subIndex + STACKS_PER_COMPARTMENT - 1, flags, type, player); } - if (type == ClickType.PICKUP && !carried.isEmpty() && itemInClickedSlot.isEmpty()) - contentHolder.inventory.filters.set(index / STACKS_PER_COMPARTMENT, carried); - if (type == ClickType.PICKUP && carried.isEmpty() && itemInClickedSlot.isEmpty()) if (!player.level.isClientSide) { contentHolder.inventory.filters.set(index / STACKS_PER_COMPARTMENT, ItemStack.EMPTY); diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxDisposeAllPacket.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxDisposeAllPacket.java new file mode 100644 index 000000000..071c61df6 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxDisposeAllPacket.java @@ -0,0 +1,81 @@ +package com.simibubi.create.content.curiosities.toolbox; + +import java.util.function.Supplier; + +import org.apache.commons.lang3.mutable.MutableBoolean; + +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.network.NetworkEvent.Context; +import net.minecraftforge.items.ItemHandlerHelper; + +public class ToolboxDisposeAllPacket extends SimplePacketBase { + + private BlockPos toolboxPos; + + public ToolboxDisposeAllPacket(BlockPos toolboxPos) { + this.toolboxPos = toolboxPos; + } + + public ToolboxDisposeAllPacket(PacketBuffer buffer) { + toolboxPos = buffer.readBlockPos(); + } + + @Override + public void write(PacketBuffer buffer) { + buffer.writeBlockPos(toolboxPos); + } + + @Override + public void handle(Supplier context) { + Context ctx = context.get(); + ctx.enqueueWork(() -> { + ServerPlayerEntity player = ctx.getSender(); + World world = player.level; + TileEntity blockEntity = world.getBlockEntity(toolboxPos); + + double maxRange = ToolboxHandler.getMaxRange(player); + if (player.distanceToSqr(toolboxPos.getX() + 0.5, toolboxPos.getY(), toolboxPos.getZ() + 0.5) > maxRange + * maxRange) + return; + if (!(blockEntity instanceof ToolboxTileEntity)) + return; + ToolboxTileEntity toolbox = (ToolboxTileEntity) blockEntity; + + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + MutableBoolean sendData = new MutableBoolean(false); + + toolbox.inventory.inLimitedMode(inventory -> { + for (int i = 0; i < 36; i++) { + String key = String.valueOf(i); + if (compound.contains(key) && NBTUtil.readBlockPos(compound.getCompound(key) + .getCompound("Pos")) + .equals(toolboxPos)) { + ToolboxHandler.unequip(player, i, true); + sendData.setTrue(); + } + + ItemStack itemStack = player.inventory.getItem(i); + ItemStack remainder = ItemHandlerHelper.insertItemStacked(toolbox.inventory, itemStack, false); + if (remainder.getCount() != itemStack.getCount()) + player.inventory.setItem(i, remainder); + } + }); + + if (sendData.booleanValue()) + ToolboxHandler.syncData(player); + + }); + ctx.setPacketHandled(true); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java index 078d23ff8..db63a5daa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxEquipPacket.java @@ -2,8 +2,6 @@ package com.simibubi.create.content.curiosities.toolbox; import java.util.function.Supplier; -import com.simibubi.create.foundation.networking.AllPackets; -import com.simibubi.create.foundation.networking.ISyncPersistentData; import com.simibubi.create.foundation.networking.SimplePacketBase; import net.minecraft.entity.player.ServerPlayerEntity; @@ -15,7 +13,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.network.NetworkEvent.Context; -import net.minecraftforge.fml.network.PacketDistributor; import net.minecraftforge.items.ItemHandlerHelper; public class ToolboxEquipPacket extends SimplePacketBase { @@ -54,35 +51,32 @@ public class ToolboxEquipPacket extends SimplePacketBase { World world = player.level; if (toolboxPos == null) { - player.getPersistentData() - .getCompound("CreateToolboxData") - .remove(String.valueOf(hotbarSlot)); - sendData(player); + ToolboxHandler.unequip(player, hotbarSlot, false); + ToolboxHandler.syncData(player); return; } TileEntity blockEntity = world.getBlockEntity(toolboxPos); double maxRange = ToolboxHandler.getMaxRange(player); - if (ctx.getSender() - .distanceToSqr(toolboxPos.getX() + 0.5, toolboxPos.getY(), - toolboxPos.getZ() + 0.5) > maxRange * maxRange) + if (player.distanceToSqr(toolboxPos.getX() + 0.5, toolboxPos.getY(), toolboxPos.getZ() + 0.5) > maxRange + * maxRange) return; if (!(blockEntity instanceof ToolboxTileEntity)) return; - ToolboxHandler.unequip(player, hotbarSlot); + ToolboxHandler.unequip(player, hotbarSlot, false); if (slot < 0 || slot >= 8) { - sendData(player); + ToolboxHandler.syncData(player); return; } ToolboxTileEntity toolboxTileEntity = (ToolboxTileEntity) blockEntity; ItemStack playerStack = player.inventory.getItem(hotbarSlot); - if (!playerStack.isEmpty() - && !ItemHandlerHelper.canItemStacksStack(playerStack, toolboxTileEntity.inventory.filters.get(slot))) { + if (!playerStack.isEmpty() && !ToolboxInventory.canItemsShareCompartment(playerStack, + toolboxTileEntity.inventory.filters.get(slot))) { ItemStack remainder = ItemHandlerHelper.insertItemStacked(toolboxTileEntity.inventory, playerStack, false); if (!remainder.isEmpty()) @@ -103,15 +97,11 @@ public class ToolboxEquipPacket extends SimplePacketBase { player.getPersistentData() .put("CreateToolboxData", compound); - sendData(player); toolboxTileEntity.connectPlayer(slot, player, hotbarSlot); + ToolboxHandler.syncData(player); }); ctx.setPacketHandled(true); } - private void sendData(ServerPlayerEntity player) { - AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new ISyncPersistentData.Packet(player)); - } - } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java index 9daef8f34..e21a775be 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandler.java @@ -4,9 +4,14 @@ import java.util.List; import java.util.WeakHashMap; import java.util.stream.Collectors; +import com.simibubi.create.foundation.config.AllConfigs; +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.networking.ISyncPersistentData; import com.simibubi.create.foundation.utility.WorldAttached; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.tileentity.TileEntity; @@ -14,6 +19,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.fml.network.PacketDistributor; public class ToolboxHandler { @@ -30,6 +37,70 @@ public class ToolboxHandler { .remove(te.getBlockPos()); } + static int validationTimer = 20; + + public static void entityTick(Entity entity, World world) { + if (world.isClientSide) + return; + if (!(world instanceof ServerWorld)) + return; + if (!(entity instanceof ServerPlayerEntity)) + return; + if (entity.tickCount % validationTimer != 0) + return; + + ServerPlayerEntity player = (ServerPlayerEntity) entity; + if (!player.getPersistentData() + .contains("CreateToolboxData")) + return; + + boolean sendData = false; + CompoundNBT compound = player.getPersistentData() + .getCompound("CreateToolboxData"); + for (int i = 0; i < 9; i++) { + String key = String.valueOf(i); + if (!compound.contains(key)) + continue; + + CompoundNBT data = compound.getCompound(key); + BlockPos pos = NBTUtil.readBlockPos(data.getCompound("Pos")); + int slot = data.getInt("Slot"); + + if (!world.isAreaLoaded(pos, 0)) + continue; + if (!(world.getBlockState(pos) + .getBlock() instanceof ToolboxBlock)) { + compound.remove(key); + sendData = true; + continue; + } + + TileEntity prevBlockEntity = world.getBlockEntity(pos); + if (prevBlockEntity instanceof ToolboxTileEntity) + ((ToolboxTileEntity) prevBlockEntity).connectPlayer(slot, player, i); + } + + if (sendData) + syncData(player); + } + + public static void playerLogin(PlayerEntity player) { + if (!(player instanceof ServerPlayerEntity)) + return; + if (player.getPersistentData() + .contains("CreateToolboxData") + && !player.getPersistentData() + .getCompound("CreateToolboxData") + .isEmpty()) { + syncData(player); + } + } + + public static void syncData(PlayerEntity player) { + AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), + new ISyncPersistentData.Packet(player)); + } + public static List getNearest(IWorld world, PlayerEntity player, int maxAmount) { Vector3d location = player.position(); double maxRange = getMaxRange(player); @@ -43,7 +114,7 @@ public class ToolboxHandler { .collect(Collectors.toList()); } - public static void unequip(PlayerEntity player, int hotbarSlot) { + public static void unequip(PlayerEntity player, int hotbarSlot, boolean keepItems) { CompoundNBT compound = player.getPersistentData() .getCompound("CreateToolboxData"); World world = player.level; @@ -56,8 +127,10 @@ public class ToolboxHandler { int prevSlot = prevData.getInt("Slot"); TileEntity prevBlockEntity = world.getBlockEntity(prevPos); - if (prevBlockEntity instanceof ToolboxTileEntity) - ((ToolboxTileEntity) prevBlockEntity).unequip(prevSlot, player, hotbarSlot); + if (prevBlockEntity instanceof ToolboxTileEntity) { + ToolboxTileEntity toolbox = (ToolboxTileEntity) prevBlockEntity; + toolbox.unequip(prevSlot, player, hotbarSlot, keepItems || !ToolboxHandler.withinRange(player, toolbox)); + } compound.remove(key); } @@ -73,7 +146,8 @@ public class ToolboxHandler { } public static double getMaxRange(PlayerEntity player) { - return 10; + return AllConfigs.SERVER.curiosities.toolboxRange.get() + .doubleValue(); } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java index 7ac4b05d9..1997912d6 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxHandlerClient.java @@ -33,11 +33,11 @@ public class ToolboxHandlerClient { if (COOLDOWN > 0 && !AllKeys.TOOLBELT.isPressed()) COOLDOWN--; } - + public static void onKeyInput(int key, boolean pressed) { if (key != AllKeys.TOOLBELT.getBoundCode()) return; - if (COOLDOWN > 0) + if (COOLDOWN > 0) return; ClientPlayerEntity player = Minecraft.getInstance().player; if (player == null) @@ -60,8 +60,11 @@ public class ToolboxHandlerClient { if (canReachToolbox) { TileEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof ToolboxTileEntity) { - ScreenOpener.open(new RadialToolboxMenu(ImmutableList.of((ToolboxTileEntity) blockEntity), - RadialToolboxMenu.State.SELECT_ITEM_UNEQUIP)); + RadialToolboxMenu screen = new RadialToolboxMenu(ImmutableList.of((ToolboxTileEntity) blockEntity), + RadialToolboxMenu.State.SELECT_ITEM_UNEQUIP); + screen.prevSlot(compound.getCompound(slotKey) + .getInt("Slot")); + ScreenOpener.open(screen); return; } } @@ -73,10 +76,6 @@ public class ToolboxHandlerClient { if (toolboxes.isEmpty()) return; -// ItemStack itemStackFromSlot = player.getItemStackFromSlot(EquipmentSlotType.LEGS); -// if (!AllItems.TOOLBELT.isIn(itemStackFromSlot)) -// return; - if (toolboxes.size() == 1) ScreenOpener.open(new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_ITEM)); else diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java index 741c77eb1..4581bef86 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java @@ -2,9 +2,11 @@ package com.simibubi.create.content.curiosities.toolbox; import java.util.ArrayList; import java.util.List; +import java.util.function.Consumer; import javax.annotation.Nonnull; +import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.item.ItemStack; @@ -19,15 +21,24 @@ public class ToolboxInventory extends ItemStackHandler { List filters; boolean settling; private ToolboxTileEntity te; + + private boolean limitedMode; public ToolboxInventory(ToolboxTileEntity te) { super(8 * STACKS_PER_COMPARTMENT); this.te = te; + limitedMode = false; filters = new ArrayList<>(); settling = false; for (int i = 0; i < 8; i++) filters.add(ItemStack.EMPTY); } + + public void inLimitedMode(Consumer action) { + limitedMode = true; + action.accept(this); + limitedMode = false; + } public void settle(int compartment) { int totalCount = 0; @@ -50,11 +61,26 @@ public class ToolboxInventory extends ItemStackHandler { return; settling = true; - for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) { - ItemStack copy = totalCount <= 0 ? ItemStack.EMPTY - : ItemHandlerHelper.copyStackWithSize(sample, Math.min(totalCount, sample.getMaxStackSize())); - setStackInSlot(compartment * STACKS_PER_COMPARTMENT + i, copy); - totalCount -= copy.getCount(); + if (!sample.isStackable()) { + for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) { + if (!getStackInSlot(compartment * STACKS_PER_COMPARTMENT + i).isEmpty()) + continue; + for (int j = i + 1; j < STACKS_PER_COMPARTMENT; j++) { + ItemStack stackInSlot = getStackInSlot(compartment * STACKS_PER_COMPARTMENT + j); + if (stackInSlot.isEmpty()) + continue; + setStackInSlot(compartment * STACKS_PER_COMPARTMENT + i, stackInSlot); + setStackInSlot(compartment * STACKS_PER_COMPARTMENT + j, ItemStack.EMPTY); + break; + } + } + } else { + for (int i = 0; i < STACKS_PER_COMPARTMENT; i++) { + ItemStack copy = totalCount <= 0 ? ItemStack.EMPTY + : ItemHandlerHelper.copyStackWithSize(sample, Math.min(totalCount, sample.getMaxStackSize())); + setStackInSlot(compartment * STACKS_PER_COMPARTMENT + i, copy); + totalCount -= copy.getCount(); + } } settling = false; te.sendData(); @@ -62,11 +88,15 @@ public class ToolboxInventory extends ItemStackHandler { @Override public boolean isItemValid(int slot, ItemStack stack) { + if (AllBlocks.TOOLBOX.isIn(stack)) + return false; if (slot < 0 || slot >= getSlots()) return false; int compartment = slot / STACKS_PER_COMPARTMENT; ItemStack filter = filters.get(compartment); - if (!filter.isEmpty() && ItemHandlerHelper.canItemStacksStack(filter, stack)) + if (limitedMode && filter.isEmpty()) + return false; + if (filter.isEmpty() || ToolboxInventory.canItemsShareCompartment(filter, stack)) return super.isItemValid(slot, stack); return false; } @@ -76,8 +106,24 @@ public class ToolboxInventory extends ItemStackHandler { super.setStackInSlot(slot, stack); int compartment = slot / STACKS_PER_COMPARTMENT; if (!stack.isEmpty() && filters.get(compartment) - .isEmpty()) + .isEmpty()) { filters.set(compartment, ItemHandlerHelper.copyStackWithSize(stack, 1)); + te.sendData(); + } + } + + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + ItemStack insertItem = super.insertItem(slot, stack, simulate); + if (insertItem.getCount() != stack.getCount()) { + int compartment = slot / STACKS_PER_COMPARTMENT; + if (!stack.isEmpty() && filters.get(compartment) + .isEmpty()) { + filters.set(compartment, ItemHandlerHelper.copyStackWithSize(stack, 1)); + te.sendData(); + } + } + return insertItem; } @Override @@ -128,7 +174,7 @@ public class ToolboxInventory extends ItemStackHandler { for (int i = STACKS_PER_COMPARTMENT - 1; i >= 0; i--) { int slot = compartment * STACKS_PER_COMPARTMENT + i; - ItemStack extracted = extractItem(slot, amount, simulate); + ItemStack extracted = extractItem(slot, remaining, simulate); remaining -= extracted.getCount(); if (!extracted.isEmpty()) lastValid = extracted; @@ -142,4 +188,10 @@ public class ToolboxInventory extends ItemStackHandler { return ItemHandlerHelper.copyStackWithSize(lastValid, amount - remaining); } + public static boolean canItemsShareCompartment(ItemStack stack1, ItemStack stack2) { + if (!stack1.isStackable() && !stack2.isStackable() && stack1.isDamageableItem() && stack2.isDamageableItem()) + return stack1.getItem() == stack2.getItem(); + return ItemHandlerHelper.canItemStacksStack(stack1, stack2); + } + } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java index 986d043ec..7a7d66bcb 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java @@ -14,7 +14,9 @@ import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.gui.GuiGameElement; import com.simibubi.create.foundation.gui.widgets.IconButton; +import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.Lang; import net.minecraft.client.renderer.Rectangle2d; import net.minecraft.entity.player.PlayerInventory; @@ -28,6 +30,7 @@ public class ToolboxScreen extends AbstractSimiContainerScreen AllGuiTextures PLAYER = AllGuiTextures.PLAYER_INVENTORY; protected Slot hoveredToolboxSlot; private IconButton confirmButton; + private IconButton disposeButton; private List extraAreas = Collections.emptyList(); @@ -42,7 +45,10 @@ public class ToolboxScreen extends AbstractSimiContainerScreen widgets.clear(); setWindowSize(BG.width, 256); confirmButton = new IconButton(getGuiLeft() + BG.width - 23, getGuiTop() + BG.height - 24, AllIcons.I_CONFIRM); + disposeButton = new IconButton(getGuiLeft() + 91, getGuiTop() + 69, AllIcons.I_TOOLBOX); + disposeButton.setToolTip(Lang.translate("toolbox.depositBox")); widgets.add(confirmButton); + widgets.add(disposeButton); extraAreas = ImmutableList.of(new Rectangle2d(118, 155, 80, 100), new Rectangle2d(308, 125, 100, 70)); } @@ -125,7 +131,8 @@ public class ToolboxScreen extends AbstractSimiContainerScreen for (int offset : Iterate.zeroAndOne) { ms.pushPose(); - ms.translate(0, -offset * 1 / 8f, menu.contentHolder.drawers.getValue(partialTicks) * -.175f * (2 - offset)); + ms.translate(0, -offset * 1 / 8f, + menu.contentHolder.drawers.getValue(partialTicks) * -.175f * (2 - offset)); GuiGameElement.of(AllBlockPartials.TOOLBOX_DRAWER) .render(ms); ms.popPose(); @@ -149,6 +156,10 @@ public class ToolboxScreen extends AbstractSimiContainerScreen minecraft.player.closeContainer(); return true; } + if (disposeButton.isHovered()) { + AllPackets.channel.sendToServer(new ToolboxDisposeAllPacket(menu.contentHolder.getBlockPos())); + return true; + } } return mouseClicked; diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java index 91bdd62d9..644d34fd2 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java @@ -1,14 +1,14 @@ package com.simibubi.create.content.curiosities.toolbox; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.WeakHashMap; -import com.simibubi.create.foundation.networking.AllPackets; -import com.simibubi.create.foundation.networking.ISyncPersistentData; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.VecHelper; @@ -34,7 +34,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fml.network.PacketDistributor; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; @@ -93,6 +92,8 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine } private void tickPlayers() { + boolean update = false; + for (Iterator>> toolboxSlots = connectedPlayers.entrySet() .iterator(); toolboxSlots.hasNext();) { @@ -115,15 +116,14 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine ItemStack playerStack = player.inventory.getItem(hotbarSlot); - if (clear - || !playerStack.isEmpty() && !ItemHandlerHelper.canItemStacksStack(playerStack, referenceItem)) { + if (clear || !playerStack.isEmpty() + && !ToolboxInventory.canItemsShareCompartment(playerStack, referenceItem)) { player.getPersistentData() .getCompound("CreateToolboxData") .remove(String.valueOf(hotbarSlot)); playerEntries.remove(); if (player instanceof ServerPlayerEntity) - AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), - new ISyncPersistentData.Packet(player)); + ToolboxHandler.syncData(player); continue; } @@ -132,34 +132,99 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine if (count < targetAmount) { int amountToReplenish = targetAmount - count; + + if (isOpenInContainer(player)) { + ItemStack extracted = inventory.takeFromCompartment(amountToReplenish, slot, true); + if (!extracted.isEmpty()) { + ToolboxHandler.unequip(player, hotbarSlot, false); + ToolboxHandler.syncData(player); + continue; + } + } + ItemStack extracted = inventory.takeFromCompartment(amountToReplenish, slot, false); - if (!extracted.isEmpty()) + if (!extracted.isEmpty()) { + update = true; player.inventory.setItem(hotbarSlot, ItemHandlerHelper.copyStackWithSize(extracted, count + extracted.getCount())); + } } if (count > targetAmount) { int amountToDeposit = count - targetAmount; ItemStack toDistribute = ItemHandlerHelper.copyStackWithSize(playerStack, amountToDeposit); + + if (isOpenInContainer(player)) { + int deposited = amountToDeposit - inventory.distributeToCompartment(toDistribute, slot, true) + .getCount(); + if (deposited > 0) { + ToolboxHandler.unequip(player, hotbarSlot, true); + ToolboxHandler.syncData(player); + continue; + } + } + int deposited = amountToDeposit - inventory.distributeToCompartment(toDistribute, slot, false) .getCount(); - if (deposited > 0) + if (deposited > 0) { + update = true; player.inventory.setItem(hotbarSlot, ItemHandlerHelper.copyStackWithSize(playerStack, count - deposited)); + } } } if (clear) toolboxSlots.remove(); } + + if (update) + + sendData(); + } - public void unequip(int slot, PlayerEntity player, int hotbarSlot) { + private boolean isOpenInContainer(PlayerEntity player) { + return player.containerMenu instanceof ToolboxContainer + && ((ToolboxContainer) player.containerMenu).contentHolder == this; + } + + public void unequipTracked() { + if (level.isClientSide) + return; + + Set affected = new HashSet<>(); + + for (Iterator>> toolboxSlots = connectedPlayers.entrySet() + .iterator(); toolboxSlots.hasNext();) { + + Entry> toolboxSlotEntry = toolboxSlots.next(); + WeakHashMap set = toolboxSlotEntry.getValue(); + + for (Iterator> playerEntries = set.entrySet() + .iterator(); playerEntries.hasNext();) { + Entry playerEntry = playerEntries.next(); + + PlayerEntity player = playerEntry.getKey(); + int hotbarSlot = playerEntry.getValue(); + + ToolboxHandler.unequip(player, hotbarSlot, false); + if (player instanceof ServerPlayerEntity) + affected.add((ServerPlayerEntity) player); + } + } + + for (ServerPlayerEntity player : affected) + ToolboxHandler.syncData(player); + connectedPlayers.clear(); + } + + public void unequip(int slot, PlayerEntity player, int hotbarSlot, boolean keepItems) { if (!connectedPlayers.containsKey(slot)) return; connectedPlayers.get(slot) .remove(player); - if (!ToolboxHandler.withinRange(player, this)) + if (keepItems) return; ItemStack playerStack = player.inventory.getItem(hotbarSlot); @@ -220,11 +285,6 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine return ToolboxContainer.create(id, inv, this); } - @Override - public ITextComponent getDisplayName() { - return customName != null ? customName : new TranslationTextComponent("block.create.toolbox"); - } - @Override public void lazyTick() { updateOpenCount(); @@ -272,6 +332,12 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine if (level.isClientSide) return; WeakHashMap map = connectedPlayers.computeIfAbsent(slot, WeakHashMap::new); + Integer previous = map.get(player); + if (previous != null) { + if (previous == hotbarSlot) + return; + ToolboxHandler.unequip(player, previous, false); + } map.put(player, hotbarSlot); } @@ -283,6 +349,21 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine this.customName = customName; } + @Override + public ITextComponent getDisplayName() { + return customName != null ? customName : new TranslationTextComponent("block.create.toolbox"); + } + + @Override + public ITextComponent getCustomName() { + return customName; + } + + @Override + public boolean hasCustomName() { + return customName != null; + } + @Override public ITextComponent getName() { return customName; diff --git a/src/main/java/com/simibubi/create/events/CommonEvents.java b/src/main/java/com/simibubi/create/events/CommonEvents.java index 3631e9b0b..b2d29b6e2 100644 --- a/src/main/java/com/simibubi/create/events/CommonEvents.java +++ b/src/main/java/com/simibubi/create/events/CommonEvents.java @@ -8,6 +8,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra import com.simibubi.create.content.contraptions.fluids.recipe.FluidTransferRecipes; import com.simibubi.create.content.contraptions.fluids.recipe.PotionMixingRecipeManager; import com.simibubi.create.content.contraptions.wrench.WrenchItem; +import com.simibubi.create.content.curiosities.toolbox.ToolboxHandler; import com.simibubi.create.content.curiosities.zapper.ZapperInteractionHandler; import com.simibubi.create.content.curiosities.zapper.ZapperItem; import com.simibubi.create.content.logistics.item.LinkedControllerServerHandler; @@ -21,6 +22,7 @@ import com.simibubi.create.foundation.utility.recipe.RecipeFinder; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemStack; @@ -39,6 +41,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.world.BlockEvent.FluidPlaceBlockEvent; import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; @@ -64,6 +67,12 @@ public class CommonEvents { CapabilityMinecartController.onChunkUnloaded(event); } + @SubscribeEvent + public static void playerLoggedIn(PlayerLoggedInEvent event) { + PlayerEntity player = event.getPlayer(); + ToolboxHandler.playerLogin(player); + } + @SubscribeEvent public static void whenFluidsMeet(FluidPlaceBlockEvent event) { BlockState blockState = event.getOriginalState(); @@ -75,7 +84,8 @@ public class CommonEvents { return; for (Direction direction : Iterate.directions) { - FluidState metFluidState = fluidState.isSource() ? fluidState : world.getFluidState(pos.relative(direction)); + FluidState metFluidState = + fluidState.isSource() ? fluidState : world.getFluidState(pos.relative(direction)); if (!metFluidState.is(FluidTags.WATER)) continue; BlockState lavaInteraction = AllFluids.getLavaInteraction(metFluidState); @@ -104,6 +114,7 @@ public class CommonEvents { if (world == null) return; ContraptionHandler.entitiesWhoJustDismountedGetSentToTheRightLocation(entityLiving, world); + ToolboxHandler.entityTick(entityLiving, world); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/foundation/config/CCuriosities.java b/src/main/java/com/simibubi/create/foundation/config/CCuriosities.java index 2ba15eaea..24f38f7b9 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CCuriosities.java +++ b/src/main/java/com/simibubi/create/foundation/config/CCuriosities.java @@ -4,6 +4,7 @@ public class CCuriosities extends ConfigBase { public ConfigInt maxSymmetryWandRange = i(50, 10, "maxSymmetryWandRange", Comments.symmetryRange); public ConfigInt placementAssistRange = i(12, 3, "placementAssistRange", Comments.placementRange); + public ConfigInt toolboxRange = i(10, 1, "toolboxRange", Comments.toolboxRange); public ConfigInt airInBacktank = i(900, 1, "airInBacktank", Comments.maxAirInBacktank); public ConfigInt enchantedBacktankCapacity = i(300, 1, "enchantedBacktankCapacity", Comments.enchantedBacktankCapacity); @@ -25,6 +26,8 @@ public class CCuriosities extends ConfigBase { "The volume of Air added by each level of the backtanks Capacity Enchantment"; static String placementRange = "The Maximum Distance a Block placed by Create's placement assist will have to its interaction point."; + static String toolboxRange = + "The Maximum Distance at which a Toolbox can interact with Players' Inventories."; static String maxExtendoGripActions = "Amount of free Extendo Grip actions provided by one filled Copper Backtank. Set to 0 makes Extendo Grips unbreakable"; static String maxPotatoCannonShots = diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java index 59799ab63..6a07a5f57 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java @@ -86,6 +86,7 @@ public class AllIcons implements IScreenRenderable { I_TUNNEL_PREFER_NEAREST = next(), I_TUNNEL_RANDOMIZE = next(), I_TUNNEL_SYNCHRONIZE = next(), + I_TOOLBOX = next(), I_TOOL_MOVE_XZ = newRow(), I_TOOL_MOVE_Y = next(), diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index e26663161..20fffe6bb 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -23,6 +23,7 @@ import com.simibubi.create.content.contraptions.fluids.actors.FluidSplashPacket; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.ConfigureSequencedGearshiftPacket; import com.simibubi.create.content.curiosities.bell.SoulPulseEffectPacket; import com.simibubi.create.content.curiosities.symmetry.SymmetryEffectPacket; +import com.simibubi.create.content.curiosities.toolbox.ToolboxDisposeAllPacket; import com.simibubi.create.content.curiosities.toolbox.ToolboxEquipPacket; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; import com.simibubi.create.content.curiosities.tools.ExtendoGripInteractionPacket; @@ -98,6 +99,7 @@ public enum AllPackets { SUBMIT_GHOST_ITEM(GhostItemSubmitPacket.class, GhostItemSubmitPacket::new, PLAY_TO_SERVER), BLUEPRINT_COMPLETE_RECIPE(BlueprintAssignCompleteRecipePacket.class, BlueprintAssignCompleteRecipePacket::new, PLAY_TO_SERVER), TOOLBOX_EQUIP(ToolboxEquipPacket.class, ToolboxEquipPacket::new, PLAY_TO_SERVER), + TOOLBOX_DISPOSE_ALL(ToolboxDisposeAllPacket.class, ToolboxDisposeAllPacket::new, PLAY_TO_SERVER), // Server to Client SYMMETRY_EFFECT(SymmetryEffectPacket.class, SymmetryEffectPacket::new, PLAY_TO_CLIENT), diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 24ae8105f..1d7bd4148 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -108,6 +108,8 @@ "create.toolbox.unequip": "Unequip: %1$s", "create.toolbox.outOfRange": "Toolbox of held item not in Range", "create.toolbox.detach": "Stop tracking and keep item", + "create.toolbox.depositAll": "Return items to nearby Toolboxes", + "create.toolbox.depositBox": "Return items to Toolbox", "create.gui.symmetryWand.mirrorType": "Mirror", "create.gui.symmetryWand.orientation": "Orientation", diff --git a/src/main/resources/assets/create/textures/gui/icons.png b/src/main/resources/assets/create/textures/gui/icons.png index 9c862ea807efd75c7ea0dad2f5d1343ed01d1980..503558349f5ba7de42a0f2f2e849e7f344c36455 100644 GIT binary patch delta 3599 zcmcgvc{mj87N5abMnqXc7>Sf+s?YM-8Eb0nTb8kF24ibPwizMfE5@G49$6Y>&n}eI z*kzw&H%MWov0ZiV{hs^W=l*^Fde8a2=bY!9^PY2_^G1k8h$mj;2i`T+g8^QBI=>14 z02uCQ!ZiVassz>pClFr56=;ipXhg>b#*d-t*}#xwEg%eZazY@lqk&{Px!>dorxJwr zg~OHfQFk#u{`b}X4WC^2ySgixx%vGE1WAr(XvIRH{{g8$|65E2`oApxQ%>9Mu8Tj) z7lZQg{%zx*sHwK@33sBWbfSrN!#Mro)PsDTTs++{5I1jE)eHU?)YWY0_g(@3r?6jd zXlt4WAvUrHg9Q|sqm#waLtb;o_j%cw7&7@1vfplh9-7;32VNA(Y&zU?&pBfIbRK~2 zP1Xp^&fYmBQ5tq&MYC^pY)724>tT%p0$Ke~E5hb-Ro22PjDeb1#8aQT&(4*5g=>J@ zm`%R+cC*%-ze3&lY|A{JEfkt3F=M}pU?!7HrFZy&P2eF^Bco%9^u}bu9`}IshD|m= zfG3TU)UivR$o+zr%?6W-ai!-6oEb{Er>~!-C|rC79$IqcyCxg=1J~Vf+tx&GjqHMd zAu_{qS*Tk2V<;M_1g(9t!-a0qU3Yq?r<($MetGR)QS{Yw+ znBRRUvX@5R88wH8098UDm$_Jxf7P<8Ai$xlefE`MYFb3K#^x6RwLKDpBcB*e&3;%9 zPwxzMZnUVFT=CLjmBw6qaBpg;Gp;|vaD6ua0wkYn!A2+G$!N0#p0?*}Z@+C<4-&2} zmP<-C7Ry9&Ql)W))kRn_7;lDmo(vQw+;D1S7ep*aSGAOu@fz|_to@`q+(3QNV*phb zBgrOUm$N1Koku5+5A=+o_|_x6#@^zm^tpm*ihxPU*HqmN;-SBAh=8}C@23uBtVmYZ zJT$*sqk5BQyOLVB|L*xcgXXO`qO*?>1ty6t_((#5MA^NuR5c@-P)_s*^tlxl>@ti4T}$ zk;2%cZG`8rT0bmMc}E$#%88a&M&m)&nPWF?EX-|tL`OWz^T#2Lq^P>ZO|La%3FMlj zWU>`u!U<5!ec5$W`#9rY{;&hZTUOm z4hP{wy0(0|rdWA76mP=@C$7{&R4G-ehkRZMsYh7JU|{r+Y?vE1%xWm7ft)LptCux$ zNK@VL>TY{>q;y9iNG4<-y>UExckB5{rk(DSfg@7^fpUDB0S4Xk@vXypdT-E&mZ`2+ z-h(6tOErdB;m3){H;eb|DJfzZCaLK-1XFklIiOg9<@8L^obl+D=2bY_bUWpB z0X87)$&O9qMM4yho|3r=sgF+QdP+2DlHPXjHAxMX+_GPhU2hLnR#!bX?XCIjkgqfG zlt$a_XK!`~#&GSZ@;shTk+wO%X8C|4tcc7QT!HVeR^y=DfS#)=#uAN)%w}si3C`+0 zev1vy37znw&wNef2$iscwM?_M@c6iUSj`e_+jH_IToQf0#veu5thKtX1*U#BQ#?DV zI<3P7>4f$D!*JF0si@C)2J@wIeNMdtsg3kS+t?j+b|tPl=Dm4{FD7K=tp{u5Wo&U; zNnO4nM>UpA_b3_q^1M|^o>To=3J3!?v<(UW2G>ff~ryalmG(zpNUWb#G&&;2sGc;!0;?Er?}{A7{TAYzEW_y;KV~ zYh|xn?AhGE9L#J_1a5!3dLx~%fY95=^H8r(Guze*&J^h4S?@XzN>@g<6$9-a+7=0} zkG*JGm{|VNE74%Qo)Fvx3k_sdk0$3$O>X*O>g$E|t=C5@Hv(V+Wmu&_OpagBfhFz2 zr^&AZPrBA>bO<4)t&Nw~)ITbCO(=X`?`hgBfPlW#jVs)ZmWD3!k1OTSpCZ-u0|(eY zOwd!`7T!Ddo!c{N+g=5l&m4=fWILDrwDbMrlQ;0#I-h{y%@4@^0YD1wr;j-?LagXx zF?|xpvf47m>0OEyoY=uY26%vuI^C0n_+ABW;Exu~b4w|$KI1KL41HzxX$4$&w0+rC ztJSI5@usS<+%L9vyTl86^J?xZ#)`;OMsM@2SN9R)oEz0mEf05Qio*elDa-SQD}^tI zj5iFqc;n2>lx?71&upikR8fec#ovWIR*at((;0K5iitZLDPYMGtbSWrN1FK{5Z(|i zf+DQOQ)=383*%nzTO&j&S^Hur)5D!70ed=Lj3G&cP5eQnS_R zhT)fNMZOPcuwa!ZL@@cDTLK_s+}LsVtgixo>ej_%jMo@P4XnTECU~5_MwqT*&KnQ> zP%!;Z;TGjLVNm9VMg6W6zuk4$BGsa^|!wpfOH$;nd+(FE+@mt4_+m%y*7- zDj0hdf;xTsr{FA4;3sO5ehvL8qqeXLodDpS!{yr=};z+sY95x3EYjkBd!F-^Hx+KlXq?EbT5#gV#JKgX1w5l;+t&?)79N`Vw}fpFgbJ94 zYe(_$_RuF##2R9_r5Sx^=ObOLZeV>bT-Z5a33B~A!cYLTrmF+k+h;_?=Hhip@ z>h$qNTF(An5$*N^a}5IzIHcC54c~H&Z1Bv7zCCR5EPh#q4fOJ!Sb&F)rD<8|2KHh( z9Idb$vyV+PRtL&-O{K*nxvih`rgX>9Jw_20DZQJ|v}PDcdblT^Ey`86D2}2(xsV>) zdefU4a~v~_57Z&6!M>vH!Vr8Fow^XZBSORI@bsUqY@_Q}7lDGgutO=!6vc-#tyz8? z2ja-jCMH@uA{^k_(Is%94PvPLPa*QlwpR?Y+StdgjfQ92UD;o3b4(PR76i7rw933O z3M{cgAPluWI7UvKn~5fRcwHnU{s4Tc7RmpY@M6*vHZDOadkyi5tG$Za*tfdBOG85Hq|*P z9uuLMw%rU+Kv5O#lb-J}H{1BC`kPUubWZz^<)j7?P>rL;x;XHOL((7ac8tbqHH8~! z*oEABYSO>ERG^VP-S$&jV*+ex!Di1|=WLD46Kn5H;S+0wag`*e4f_E5EOYad?K?&t zCH>QmuIF-y4A3%$E+Vxd3jrU@I(7%N79`%}Mf=LCjlBDEZSm1k`->-E z#M#t~Zzf%U`5JU^cf6p!<=AJQb}c3w5vVTr46NDeQ@eT6@n){$)3$3Yg^4={GY`ViM+6sI#tw7*m-W2%;}DXxQ``DN&Oj z$`25PdOqJ`K7-}dXW;)M8O`-lO+HxErnUTjtEj#vAVz8=f?6dpOYNriENah|QdOh2QmRW^ zRT_J=Mo<)w-|rd!>-xWZuIIe^p6|KOd2z0Df9?|{7A2Z4lA+}Si<=STsz<3>mKNGKG6)py103}2MW0Rq11(NLYf*MR;Eh;0Qzo2 zT`jASg3ViR?~rO3zrj=@+CQG*tDh`AJHQ(U@YCC}aDMe=QK1bVZ^=yYHKa+W9E{qU z(Y`orqJ$fX>0ue0P#nu z+k(vsiM1@_NLRgD)vS#xvYbl@Cl5T|<%sxZ8nD6Del`;W1R_sd%v-mAuzy;u_sI=+ z*-0fLhl2Rh6L$}Lw58KUVSdRh&T<$^SQFH*A7%U$Og{Ns)gXD660ZejFC^T?l^2`M zRg5q%Y~~1X>y`#wFfb8tzN#qef%kxnT~TZJLRm*u*P9pknDt7d?5(OAe|!D}Um`N^ z*w{jI@}Yb0#iorsF|8dAxX*9VzAkH;+ShVHXpwct&uR6VAEA`=OpDZ5KMQ%~*EN6a zSdp?{oo1$gBTk4&{|@%2u=>Te6T5mt1LGxwhxPefM$;%DNFp*lX+%8G%+?1xgFgh#kbXd=-*My5%OHVZ+|XIP}>L&slMXFv+q9Q7qG~RH; ztHI+zx6dHFX$-Ge?l&)NfQ?%KO%9iPR1w1;>@$@u8N}|(c}5#3NP&svnXT4nH_$eQ zkDnv(B`v)q9eTuBD+4QQlPAna7p%dprD-qHJY<)}qW8CLXYN89d{_PiZ}jrFKQ)MrBeU z2p!PYqHB=hR(raPD$dFoWw}6q6Kwh|&6?XfcgSmHZiti6N~VJM3k}5I)-LI+(o-7j zNp_Wrav+dWOqZ$q41-(OlFBPTl?Rr!bojS1F-KK#76s2OxqZNvNXiHdij^ z6RXv!O#8C>llL3wiBP?Og>?4rF%^jiC^BW`q|5$l{dc^+lJs0pbYU|>LOfGqz(a!zC=lgUHT#YPeUZW)fa~elaHHojQ7t8zppJRN z!ql)v-jnj9B?ql6KqEwToTA{dL*h)M7D1A`g4&KT-w&U3+zB2_`xSMfR-)B(Mq!@3mC;;C~5olPRfC@cm%P9yNdOl_fnDpi#JJ<9;>Y!A%4$S5J zorldl{;6g;c!0ZhWh@<|;i<&RbEYvp@41I{ox)0bF?(1X2gW*1p{1!}GT((LjM{W2 z=3glp1Fo*OsU1ke;2J##-;zKQJscQ*{JFJ#pua)O7{y=yvHinoyTCi+_VX_{N>8x0 zcj0b1weP5_?gDT)wnU?R9zY343rAklFYoJlS#PqZcb;uU$l4L!fKgII+F>UVf@jeY zwFjH|$X2!aM_xhEDn4zGG9p?-d&k9Vii^c?%X>WLIvOdiH!dn=+;kF=<(t6Z$Bemi z7zV*U*7kJ@VnW7e@4k)HJ1fvKo9GrL(lD+6l50kcXg@@I8&TXe@-D4j8+*w!(8GPGS9p~ay!5FKi zS_g4mT3s^#2_nDj;huRz;j@cQXlIz!H0$!KT3wu+k|8Sh!cJv z9PD>L8Q~gIOq(0z6}d%s&rOIN!H(r5drjs8F@b+G`}aO(DsqD4nqVR zVE^DqMxL_70e(RFg5o@y^=}f+Z!V#B!29xSe`Vj)5xVvFA?)(Y$QV8dHm5a3SRwII0@XAZJ#W7i3|nzn@gaJelHA`(G$7_Kq5=@!)hz<@j7 zvNPe&{1;y_zhypR)c|SSwcFNeAq2oq)FTd`{D?6G;<4PX&Q2p$%e6 zk3kWOKLT`__8c63$DZiZtY>#Zz;o-df(05nzn8CdI$!483Oc$*iVc7<@XwR)ME0(d zV&5$f1;Jd}@G!kCg_s(hsxSb6m3(e6YA@ruIX^&1n4P8 zjz&fHy1Fe7GM4FnN?X>32qmx57(&&c>WJ3-DA)4|Hw_7fNO^2=m@ui&c^wYXWD%p1 zg=hO~-1a;jO#0B1KnBW)I53A-t)A@Y@2w+qDh8APkm5=%vUAH~jB2Swe;B2e_Tcar z{09KWVvTE_s2rWLpCS^zrRj|D72)7Ik-DO!Tl=X|Bdm3IaUXeI3DWX%g$Oa02BMGQ ztkF#LB1N3e8?j;_veV0-OCZ8P@j+d(j}XzzP)Ar=U`|MtcG`(7k+2lTY`3u zR4yousM!Uxdw*sclY=0txGEAv^T^Gk$2Bzk-#rjJx0I$qq5XWi8bbrdm3X@VVXz(8_seE}h6 z*GeY%^W8`^SK?*N%5&v!gcW_sC>}`u?!`g%c-Q7N&n0J8f3_z6u<+bXpiQ#|JwjDn zI)L9S^(Xb8Q%Hq#Nc0^UIRKlbs*fi02vz!r-m_l|p1gK+%ysATcro5~A>CjeD=+-~ z=Y~cjUUlYQ!Q1m6Wc|z0bK?Z%j{hUgKN)@NpDF!66I=WRvH$jH(pld^hLjC5^gZBw N80wkoHfSTG{{h{zV_5(I From 173eb6b7ab3a5f01cabf63fc9d4fc0707ad284bc Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Sat, 18 Sep 2021 17:40:57 -0700 Subject: [PATCH 04/22] Add data driven potato cannon projectile types - Allow defining custom potato cannon projectile types through JSON in datapacks - Separate PotatoCannonProjectileTypes into PotatoCannonProjectileType, PotatoProjectileTypeManager, and BuiltinPotatoProjectileTypes - Allow setting a custom render mode when building a projectile type - Prevent the potato cannon itself from being used as ammo --- src/main/java/com/simibubi/create/Create.java | 4 +- ...java => BuiltinPotatoProjectileTypes.java} | 200 +----------- .../curiosities/weapons/PotatoCannonItem.java | 23 +- .../weapons/PotatoCannonProjectileType.java | 295 ++++++++++++++++++ .../weapons/PotatoProjectileEntity.java | 12 +- .../weapons/PotatoProjectileRenderMode.java | 8 +- .../weapons/PotatoProjectileTypeManager.java | 160 ++++++++++ .../simibubi/create/events/CommonEvents.java | 5 +- .../foundation/mixin/PlayerListMixin.java | 25 ++ .../foundation/networking/AllPackets.java | 2 + src/main/resources/create.mixins.json | 1 + 11 files changed, 517 insertions(+), 218 deletions(-) rename src/main/java/com/simibubi/create/content/curiosities/weapons/{PotatoCannonProjectileTypes.java => BuiltinPotatoProjectileTypes.java} (71%) create mode 100644 src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileType.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileTypeManager.java create mode 100644 src/main/java/com/simibubi/create/foundation/mixin/PlayerListMixin.java diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 26dffcdb9..1a4302196 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -11,7 +11,7 @@ import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour; import com.simibubi.create.content.CreateItemGroup; import com.simibubi.create.content.contraptions.TorquePropagator; import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController; -import com.simibubi.create.content.curiosities.weapons.PotatoCannonProjectileTypes; +import com.simibubi.create.content.curiosities.weapons.BuiltinPotatoProjectileTypes; import com.simibubi.create.content.logistics.RedstoneLinkNetworkHandler; import com.simibubi.create.content.palettes.AllPaletteBlocks; import com.simibubi.create.content.palettes.PalettesItemGroup; @@ -121,7 +121,7 @@ public class Create { CapabilityMinecartController.register(); AllPackets.registerPackets(); SchematicInstances.register(); - PotatoCannonProjectileTypes.register(); + BuiltinPotatoProjectileTypes.register(); CHUNK_UTIL.init(); diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/BuiltinPotatoProjectileTypes.java similarity index 71% rename from src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java rename to src/main/java/com/simibubi/create/content/curiosities/weapons/BuiltinPotatoProjectileTypes.java index cb1159fbe..c3856616c 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/BuiltinPotatoProjectileTypes.java @@ -1,8 +1,5 @@ package com.simibubi.create.content.curiosities.weapons; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; import java.util.UUID; import java.util.function.BiPredicate; import java.util.function.Predicate; @@ -23,7 +20,6 @@ import net.minecraft.entity.monster.ZombieVillagerEntity; import net.minecraft.entity.passive.FoxEntity; import net.minecraft.item.Food; import net.minecraft.item.Foods; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.potion.Effect; @@ -31,8 +27,6 @@ import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.util.Direction; import net.minecraft.util.Hand; -import net.minecraft.util.IItemProvider; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvents; @@ -50,16 +44,14 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.living.EntityTeleportEvent; import net.minecraftforge.registries.IRegistryDelegate; -public class PotatoCannonProjectileTypes { +public class BuiltinPotatoProjectileTypes { private static final GameProfile ZOMBIE_CONVERTER_NAME = new GameProfile(UUID.fromString("be12d3dc-27d3-4992-8c97-66be53fd49c5"), "Converter"); private static final WorldAttached ZOMBIE_CONVERTERS = new WorldAttached<>(w -> new FakePlayer((ServerWorld) w, ZOMBIE_CONVERTER_NAME)); - public static final Map ALL = new HashMap<>(); - public static final Map, PotatoCannonProjectileTypes> ITEM_MAP = new HashMap<>(); - public static final PotatoCannonProjectileTypes + public static final PotatoCannonProjectileType FALLBACK = create("fallback").damage(0) .register(), @@ -250,94 +242,11 @@ public class PotatoCannonProjectileTypes { .preEntityHit(setFire(12)) .soundPitch(1.0f) .registerAndAssign(AllItems.BLAZE_CAKE.get()) + ; - public static void registerType(ResourceLocation resLoc, PotatoCannonProjectileTypes type) { - synchronized (ALL) { - ALL.put(resLoc, type); - } - } - - public static void assignType(IRegistryDelegate item, PotatoCannonProjectileTypes type) { - synchronized (ITEM_MAP) { - ITEM_MAP.put(item, type); - } - } - - public static Optional getProjectileTypeOf(ItemStack item) { - if (item.isEmpty()) - return Optional.empty(); - return Optional.ofNullable(ITEM_MAP.get(item.getItem().delegate)); - } - - public static void register() {} - - private static PotatoCannonProjectileTypes.Builder create(String name) { - return new PotatoCannonProjectileTypes.Builder(Create.asResource(name)); - } - - private float gravityMultiplier = 1; - private float velocityMultiplier = 1; - private float drag = 0.99f; - private float knockback = 1; - private int reloadTicks = 10; - private int damage = 1; - private int split = 1; - private float fwoompPitch = 1; - private boolean sticky = false; - private PotatoProjectileRenderMode renderMode = new PotatoProjectileRenderMode.Billboard(); - private Predicate preEntityHit = e -> false; // True if hit should be canceled - private Predicate onEntityHit = e -> false; // True if shouldn't recover projectile - private BiPredicate onBlockHit = (w, ray) -> false; - - public float getGravityMultiplier() { - return gravityMultiplier; - } - - public float getDrag() { - return drag; - } - - public int getSplit() { - return split; - } - - public float getVelocityMultiplier() { - return velocityMultiplier; - } - - public float getKnockback() { - return knockback; - } - - public int getReloadTicks() { - return reloadTicks; - } - - public float getSoundPitch() { - return fwoompPitch; - } - - public PotatoProjectileRenderMode getRenderMode() { - return renderMode; - } - - public int getDamage() { - return damage; - } - - public boolean isSticky() { return sticky; } - - public boolean preEntityHit(EntityRayTraceResult ray) { - return preEntityHit.test(ray); - } - - public boolean onEntityHit(EntityRayTraceResult ray) { - return onEntityHit.test(ray); - } - - public boolean onBlockHit(IWorld world, BlockRayTraceResult ray) { - return onBlockHit.test(world, ray); + private static PotatoCannonProjectileType.Builder create(String name) { + return new PotatoCannonProjectileType.Builder(Create.asResource(name)); } private static Predicate setFire(int seconds) { @@ -477,103 +386,6 @@ public class PotatoCannonProjectileTypes { }; } - public static class Builder { - - protected ResourceLocation loc; - protected PotatoCannonProjectileTypes result; - - public Builder(ResourceLocation loc) { - this.result = new PotatoCannonProjectileTypes(); - this.loc = loc; - } - - public Builder damage(int damage) { - result.damage = damage; - return this; - } - - public Builder gravity(float modifier) { - result.gravityMultiplier = modifier; - return this; - } - - public Builder knockback(float knockback) { - result.knockback = knockback; - return this; - } - - public Builder drag(float drag) { - result.drag = drag; - return this; - } - - public Builder reloadTicks(int reload) { - result.reloadTicks = reload; - return this; - } - - public Builder splitInto(int split) { - result.split = split; - return this; - } - - public Builder soundPitch(float pitch) { - result.fwoompPitch = pitch; - return this; - } - - public Builder velocity(float velocity) { - result.velocityMultiplier = velocity; - return this; - } - - public Builder renderTumbling() { - result.renderMode = new PotatoProjectileRenderMode.Tumble(); - return this; - } - - public Builder renderBillboard() { - result.renderMode = new PotatoProjectileRenderMode.Billboard(); - return this; - } - - public Builder renderTowardMotion(int spriteAngle, float spin) { - result.renderMode = new PotatoProjectileRenderMode.TowardMotion(spriteAngle, spin); - return this; - } - - public Builder sticky() { - result.sticky = true; - return this; - } - - public Builder preEntityHit(Predicate callback) { - result.preEntityHit = callback; - return this; - } - - public Builder onEntityHit(Predicate callback) { - result.onEntityHit = callback; - return this; - } - - public Builder onBlockHit(BiPredicate callback) { - result.onBlockHit = callback; - return this; - } - - public PotatoCannonProjectileTypes register() { - registerType(loc, result); - return result; - } - - public PotatoCannonProjectileTypes registerAndAssign(IItemProvider... items) { - registerType(loc, result); - for (IItemProvider provider : items) - assignType(provider.asItem().delegate, result); - return result; - } - - } + public static void register() {} } diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonItem.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonItem.java index 7c7db65a1..46fb0767d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonItem.java @@ -49,13 +49,12 @@ public class PotatoCannonItem extends ShootableItem { public static ItemStack CLIENT_CURRENT_AMMO = ItemStack.EMPTY; public static final int MAX_DAMAGE = 100; - public PotatoCannonItem(Properties p_i48487_1_) { - super(p_i48487_1_); + public PotatoCannonItem(Properties properties) { + super(properties); } @Override - public boolean canAttackBlock(BlockState p_195938_1_, World p_195938_2_, BlockPos p_195938_3_, - PlayerEntity p_195938_4_) { + public boolean canAttackBlock(BlockState state, World world, BlockPos pos, PlayerEntity player) { return false; } @@ -137,8 +136,8 @@ public class PotatoCannonItem extends ShootableItem { .subtract(player.position() .add(0, player.getEyeHeight(), 0)); - PotatoCannonProjectileTypes projectileType = PotatoCannonProjectileTypes.getProjectileTypeOf(itemStack) - .orElse(PotatoCannonProjectileTypes.FALLBACK); + PotatoCannonProjectileType projectileType = PotatoProjectileTypeManager.getTypeForStack(itemStack) + .orElse(BuiltinPotatoProjectileTypes.FALLBACK); Vector3d lookVec = player.getLookAngle(); Vector3d motion = lookVec.add(correction) .normalize() @@ -181,8 +180,8 @@ public class PotatoCannonItem extends ShootableItem { stack.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(hand)); Integer cooldown = - findAmmoInInventory(world, player, stack).flatMap(PotatoCannonProjectileTypes::getProjectileTypeOf) - .map(PotatoCannonProjectileTypes::getReloadTicks) + findAmmoInInventory(world, player, stack).flatMap(PotatoProjectileTypeManager::getTypeForStack) + .map(PotatoCannonProjectileType::getReloadTicks) .orElse(10); ShootableGadgetItemMethods.applyCooldown(player, stack, hand, this::isCannon, cooldown); @@ -200,7 +199,7 @@ public class PotatoCannonItem extends ShootableItem { private Optional findAmmoInInventory(World world, PlayerEntity player, ItemStack held) { ItemStack findAmmo = player.getProjectile(held); - return PotatoCannonProjectileTypes.getProjectileTypeOf(findAmmo) + return PotatoProjectileTypeManager.getTypeForStack(findAmmo) .map($ -> findAmmo); } @@ -215,7 +214,7 @@ public class PotatoCannonItem extends ShootableItem { if (player == null) return Optional.empty(); ItemStack findAmmo = player.getProjectile(cannon); - Optional found = PotatoCannonProjectileTypes.getProjectileTypeOf(findAmmo) + Optional found = PotatoProjectileTypeManager.getTypeForStack(findAmmo) .map($ -> findAmmo); found.ifPresent(stack -> CLIENT_CURRENT_AMMO = stack); return found; @@ -237,7 +236,7 @@ public class PotatoCannonItem extends ShootableItem { tooltip.add(new StringTextComponent("")); tooltip.add(new TranslationTextComponent(ammo.getDescriptionId()).append(new StringTextComponent(":")) .withStyle(TextFormatting.GRAY)); - PotatoCannonProjectileTypes type = PotatoCannonProjectileTypes.getProjectileTypeOf(ammo) + PotatoCannonProjectileType type = PotatoProjectileTypeManager.getTypeForStack(ammo) .get(); StringTextComponent spacing = new StringTextComponent(" "); TextFormatting green = TextFormatting.GREEN; @@ -269,7 +268,7 @@ public class PotatoCannonItem extends ShootableItem { @Override public Predicate getAllSupportedProjectiles() { - return stack -> PotatoCannonProjectileTypes.getProjectileTypeOf(stack) + return stack -> PotatoProjectileTypeManager.getTypeForStack(stack) .isPresent(); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileType.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileType.java new file mode 100644 index 000000000..303d83f7e --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileType.java @@ -0,0 +1,295 @@ +package com.simibubi.create.content.curiosities.weapons; + +import java.util.HashSet; +import java.util.Set; +import java.util.function.BiPredicate; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + +import net.minecraft.item.Item; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.IItemProvider; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.ResourceLocationException; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.EntityRayTraceResult; +import net.minecraft.world.IWorld; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.IRegistryDelegate; + +public class PotatoCannonProjectileType { + + private Set> items = new HashSet<>(); + + private int reloadTicks = 10; + private int damage = 1; + private int split = 1; + private float knockback = 1; + private float drag = 0.99f; + private float velocityMultiplier = 1; + private float gravityMultiplier = 1; + private float soundPitch = 1; + private boolean sticky = false; + private PotatoProjectileRenderMode renderMode = PotatoProjectileRenderMode.Billboard.INSTANCE; + + private Predicate preEntityHit = e -> false; // True if hit should be canceled + private Predicate onEntityHit = e -> false; // True if shouldn't recover projectile + private BiPredicate onBlockHit = (w, ray) -> false; + + protected PotatoCannonProjectileType() { + } + + public Set> getItems() { + return items; + } + + public int getReloadTicks() { + return reloadTicks; + } + + public int getDamage() { + return damage; + } + + public int getSplit() { + return split; + } + + public float getKnockback() { + return knockback; + } + + public float getDrag() { + return drag; + } + + public float getVelocityMultiplier() { + return velocityMultiplier; + } + + public float getGravityMultiplier() { + return gravityMultiplier; + } + + public float getSoundPitch() { + return soundPitch; + } + + public boolean isSticky() { + return sticky; + } + + public PotatoProjectileRenderMode getRenderMode() { + return renderMode; + } + + public boolean preEntityHit(EntityRayTraceResult ray) { + return preEntityHit.test(ray); + } + + public boolean onEntityHit(EntityRayTraceResult ray) { + return onEntityHit.test(ray); + } + + public boolean onBlockHit(IWorld world, BlockRayTraceResult ray) { + return onBlockHit.test(world, ray); + } + + public static PotatoCannonProjectileType fromJson(JsonObject object) { + PotatoCannonProjectileType type = new PotatoCannonProjectileType(); + try { + JsonElement itemsElement = object.get("items"); + if (itemsElement != null && itemsElement.isJsonArray()) { + for (JsonElement element : itemsElement.getAsJsonArray()) { + if (element.isJsonPrimitive()) { + JsonPrimitive primitive = element.getAsJsonPrimitive(); + if (primitive.isString()) { + try { + Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(primitive.getAsString())); + if (item != null) { + type.items.add(item.delegate); + } + } catch (ResourceLocationException e) { + // + } + } + } + } + } + + parseJsonPrimitive(object, "reload_ticks", JsonPrimitive::isNumber, primitive -> type.reloadTicks = primitive.getAsInt()); + parseJsonPrimitive(object, "damage", JsonPrimitive::isNumber, primitive -> type.damage = primitive.getAsInt()); + parseJsonPrimitive(object, "split", JsonPrimitive::isNumber, primitive -> type.split = primitive.getAsInt()); + parseJsonPrimitive(object, "knockback", JsonPrimitive::isNumber, primitive -> type.knockback = primitive.getAsFloat()); + parseJsonPrimitive(object, "drag", JsonPrimitive::isNumber, primitive -> type.drag = primitive.getAsFloat()); + parseJsonPrimitive(object, "velocity_multiplier", JsonPrimitive::isNumber, primitive -> type.velocityMultiplier = primitive.getAsFloat()); + parseJsonPrimitive(object, "gravity_multiplier", JsonPrimitive::isNumber, primitive -> type.gravityMultiplier = primitive.getAsFloat()); + parseJsonPrimitive(object, "sound_pitch", JsonPrimitive::isNumber, primitive -> type.soundPitch = primitive.getAsFloat()); + parseJsonPrimitive(object, "sticky", JsonPrimitive::isBoolean, primitive -> type.sticky = primitive.getAsBoolean()); + } catch (Exception e) { + // + } + return type; + } + + private static void parseJsonPrimitive(JsonObject object, String key, Predicate predicate, Consumer consumer) { + JsonElement element = object.get(key); + if (element != null && element.isJsonPrimitive()) { + JsonPrimitive primitive = element.getAsJsonPrimitive(); + if (predicate.test(primitive)) { + consumer.accept(primitive); + } + } + } + + public static void toBuffer(PotatoCannonProjectileType type, PacketBuffer buffer) { + buffer.writeVarInt(type.items.size()); + for (IRegistryDelegate delegate : type.items) { + buffer.writeResourceLocation(delegate.name()); + } + buffer.writeInt(type.reloadTicks); + buffer.writeInt(type.damage); + buffer.writeInt(type.split); + buffer.writeFloat(type.knockback); + buffer.writeFloat(type.drag); + buffer.writeFloat(type.velocityMultiplier); + buffer.writeFloat(type.gravityMultiplier); + buffer.writeFloat(type.soundPitch); + buffer.writeBoolean(type.sticky); + } + + public static PotatoCannonProjectileType fromBuffer(PacketBuffer buffer) { + PotatoCannonProjectileType type = new PotatoCannonProjectileType(); + int size = buffer.readVarInt(); + for (int i = 0; i < size; i++) { + Item item = ForgeRegistries.ITEMS.getValue(buffer.readResourceLocation()); + if (item != null) { + type.items.add(item.delegate); + } + } + type.reloadTicks = buffer.readInt(); + type.damage = buffer.readInt(); + type.split = buffer.readInt(); + type.knockback = buffer.readFloat(); + type.drag = buffer.readFloat(); + type.velocityMultiplier = buffer.readFloat(); + type.gravityMultiplier = buffer.readFloat(); + type.soundPitch = buffer.readFloat(); + type.sticky = buffer.readBoolean(); + return type; + } + + public static class Builder { + + protected ResourceLocation id; + protected PotatoCannonProjectileType result; + + public Builder(ResourceLocation id) { + this.id = id; + this.result = new PotatoCannonProjectileType(); + } + + public Builder reloadTicks(int reload) { + result.reloadTicks = reload; + return this; + } + + public Builder damage(int damage) { + result.damage = damage; + return this; + } + + public Builder splitInto(int split) { + result.split = split; + return this; + } + + public Builder knockback(float knockback) { + result.knockback = knockback; + return this; + } + + public Builder drag(float drag) { + result.drag = drag; + return this; + } + + public Builder velocity(float velocity) { + result.velocityMultiplier = velocity; + return this; + } + + public Builder gravity(float modifier) { + result.gravityMultiplier = modifier; + return this; + } + + public Builder soundPitch(float pitch) { + result.soundPitch = pitch; + return this; + } + + public Builder sticky() { + result.sticky = true; + return this; + } + + public Builder renderMode(PotatoProjectileRenderMode renderMode) { + result.renderMode = renderMode; + return this; + } + + public Builder renderBillboard() { + renderMode(PotatoProjectileRenderMode.Billboard.INSTANCE); + return this; + } + + public Builder renderTumbling() { + renderMode(PotatoProjectileRenderMode.Tumble.INSTANCE); + return this; + } + + public Builder renderTowardMotion(int spriteAngle, float spin) { + renderMode(new PotatoProjectileRenderMode.TowardMotion(spriteAngle, spin)); + return this; + } + + public Builder preEntityHit(Predicate callback) { + result.preEntityHit = callback; + return this; + } + + public Builder onEntityHit(Predicate callback) { + result.onEntityHit = callback; + return this; + } + + public Builder onBlockHit(BiPredicate callback) { + result.onBlockHit = callback; + return this; + } + + public Builder addItems(IItemProvider... items) { + for (IItemProvider provider : items) + result.items.add(provider.asItem().delegate); + return this; + } + + public PotatoCannonProjectileType register() { + PotatoProjectileTypeManager.registerBuiltinType(id, result); + return result; + } + + public PotatoCannonProjectileType registerAndAssign(IItemProvider... items) { + addItems(items); + register(); + return result; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java index 0cd481f15..b6e188202 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java @@ -39,7 +39,7 @@ import net.minecraftforge.items.ItemHandlerHelper; public class PotatoProjectileEntity extends DamagingProjectileEntity implements IEntityAdditionalSpawnData { - PotatoCannonProjectileTypes type; + PotatoCannonProjectileType type; ItemStack stack = ItemStack.EMPTY; Entity stuckEntity; @@ -63,10 +63,10 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements this.stack = stack; } - public PotatoCannonProjectileTypes getProjectileType() { + public PotatoCannonProjectileType getProjectileType() { if (type == null) - type = PotatoCannonProjectileTypes.getProjectileTypeOf(stack) - .orElse(PotatoCannonProjectileTypes.FALLBACK); + type = PotatoProjectileTypeManager.getTypeForStack(stack) + .orElse(BuiltinPotatoProjectileTypes.FALLBACK); return type; } @@ -128,7 +128,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements } public void tick() { - PotatoCannonProjectileTypes projectileType = getProjectileType(); + PotatoCannonProjectileType projectileType = getProjectileType(); Entity stuckEntity = getStuckEntity(); if (stuckEntity != null) { @@ -174,7 +174,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements Vector3d hit = ray.getLocation(); Entity target = ray.getEntity(); - PotatoCannonProjectileTypes projectileType = getProjectileType(); + PotatoCannonProjectileType projectileType = getProjectileType(); float damage = projectileType.getDamage() * additionalDamageMult; float knockback = projectileType.getKnockback() + additionalKnockback; Entity owner = this.getOwner(); diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java index 14908086d..799ed35e1 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java @@ -1,7 +1,5 @@ package com.simibubi.create.content.curiosities.weapons; -import static com.simibubi.create.content.curiosities.weapons.PotatoProjectileRenderMode.entityRandom; - import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.utility.AngleHelper; @@ -20,6 +18,8 @@ public interface PotatoProjectileRenderMode { public static class Billboard implements PotatoProjectileRenderMode { + public static final Billboard INSTANCE = new Billboard(); + @Override @OnlyIn(Dist.CLIENT) public void transform(MatrixStack ms, PotatoProjectileEntity entity, float pt) { @@ -35,10 +35,13 @@ public interface PotatoProjectileRenderMode { .rotateX(180 + AngleHelper.deg(MathHelper.atan2(diff.y, -MathHelper.sqrt(diff.x * diff.x + diff.z * diff.z)))); } + } public static class Tumble extends Billboard { + public static final Tumble INSTANCE = new Tumble(); + @Override @OnlyIn(Dist.CLIENT) public void transform(MatrixStack ms, PotatoProjectileEntity entity, float pt) { @@ -47,6 +50,7 @@ public interface PotatoProjectileRenderMode { .rotateZ((entity.tickCount + pt) * 2 * entityRandom(entity, 16)) .rotateX((entity.tickCount + pt) * entityRandom(entity, 32)); } + } public static class TowardMotion implements PotatoProjectileRenderMode { diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileTypeManager.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileTypeManager.java new file mode 100644 index 000000000..86539ef5e --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileTypeManager.java @@ -0,0 +1,160 @@ +package com.simibubi.create.content.curiosities.weapons; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.simibubi.create.AllItems; +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.client.resources.JsonReloadListener; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.profiler.IProfiler; +import net.minecraft.resources.IResourceManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.network.NetworkEvent.Context; +import net.minecraftforge.fml.network.PacketDistributor; +import net.minecraftforge.registries.IRegistryDelegate; + +public class PotatoProjectileTypeManager { + + private static final Map BUILTIN_TYPE_MAP = new HashMap<>(); + private static final Map CUSTOM_TYPE_MAP = new HashMap<>(); + private static final Map, PotatoCannonProjectileType> ITEM_TO_TYPE_MAP = new HashMap<>(); + + public static void registerBuiltinType(ResourceLocation id, PotatoCannonProjectileType type) { + synchronized (BUILTIN_TYPE_MAP) { + BUILTIN_TYPE_MAP.put(id, type); + } + } + + public static PotatoCannonProjectileType getBuiltinType(ResourceLocation id) { + return BUILTIN_TYPE_MAP.get(id); + } + + public static PotatoCannonProjectileType getCustomType(ResourceLocation id) { + return CUSTOM_TYPE_MAP.get(id); + } + + public static PotatoCannonProjectileType getTypeForItem(IRegistryDelegate item) { + return ITEM_TO_TYPE_MAP.get(item); + } + + public static Optional getTypeForStack(ItemStack item) { + if (item.isEmpty()) + return Optional.empty(); + return Optional.ofNullable(getTypeForItem(item.getItem().delegate)); + } + + public static void clear() { + CUSTOM_TYPE_MAP.clear(); + ITEM_TO_TYPE_MAP.clear(); + } + + public static void fillItemMap() { + for (Map.Entry entry : BUILTIN_TYPE_MAP.entrySet()) { + PotatoCannonProjectileType type = entry.getValue(); + for (IRegistryDelegate delegate : type.getItems()) { + ITEM_TO_TYPE_MAP.put(delegate, type); + } + } + for (Map.Entry entry : CUSTOM_TYPE_MAP.entrySet()) { + PotatoCannonProjectileType type = entry.getValue(); + for (IRegistryDelegate delegate : type.getItems()) { + ITEM_TO_TYPE_MAP.put(delegate, type); + } + } + ITEM_TO_TYPE_MAP.remove(AllItems.POTATO_CANNON.get().delegate); + } + + public static void toBuffer(PacketBuffer buffer) { + buffer.writeVarInt(CUSTOM_TYPE_MAP.size()); + for (Map.Entry entry : CUSTOM_TYPE_MAP.entrySet()) { + buffer.writeResourceLocation(entry.getKey()); + PotatoCannonProjectileType.toBuffer(entry.getValue(), buffer); + } + } + + public static void fromBuffer(PacketBuffer buffer) { + clear(); + + int size = buffer.readVarInt(); + for (int i = 0; i < size; i++) { + CUSTOM_TYPE_MAP.put(buffer.readResourceLocation(), PotatoCannonProjectileType.fromBuffer(buffer)); + } + + fillItemMap(); + } + + public static void syncTo(ServerPlayerEntity player) { + AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> player), new SyncPacket()); + } + + public static void syncToAll() { + AllPackets.channel.send(PacketDistributor.ALL.noArg(), new SyncPacket()); + } + + public static class ReloadListener extends JsonReloadListener { + + private static final Gson GSON = new Gson(); + + public static final ReloadListener INSTANCE = new ReloadListener(); + + protected ReloadListener() { + super(GSON, "potato_cannon_projectile_types"); + } + + @Override + protected void apply(Map map, IResourceManager resourceManager, IProfiler profiler) { + clear(); + + for (Map.Entry entry : map.entrySet()) { + JsonElement element = entry.getValue(); + if (element.isJsonObject()) { + ResourceLocation id = entry.getKey(); + JsonObject object = element.getAsJsonObject(); + PotatoCannonProjectileType type = PotatoCannonProjectileType.fromJson(object); + CUSTOM_TYPE_MAP.put(id, type); + } + } + + fillItemMap(); + } + + } + + public static class SyncPacket extends SimplePacketBase { + + private PacketBuffer buffer; + + public SyncPacket() { + } + + public SyncPacket(PacketBuffer buffer) { + this.buffer = buffer; + } + + @Override + public void write(PacketBuffer buffer) { + toBuffer(buffer); + } + + @Override + public void handle(Supplier context) { + context.get().enqueueWork(() -> { + fromBuffer(buffer); + }); + context.get().setPacketHandled(true); + } + + } + +} diff --git a/src/main/java/com/simibubi/create/events/CommonEvents.java b/src/main/java/com/simibubi/create/events/CommonEvents.java index 3631e9b0b..ca6acbd9f 100644 --- a/src/main/java/com/simibubi/create/events/CommonEvents.java +++ b/src/main/java/com/simibubi/create/events/CommonEvents.java @@ -8,6 +8,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra import com.simibubi.create.content.contraptions.fluids.recipe.FluidTransferRecipes; import com.simibubi.create.content.contraptions.fluids.recipe.PotionMixingRecipeManager; import com.simibubi.create.content.contraptions.wrench.WrenchItem; +import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.zapper.ZapperInteractionHandler; import com.simibubi.create.content.curiosities.zapper.ZapperItem; import com.simibubi.create.content.logistics.item.LinkedControllerServerHandler; @@ -42,7 +43,6 @@ import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.BlockEvent.FluidPlaceBlockEvent; import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.server.FMLServerStoppingEvent; @@ -118,7 +118,7 @@ public class CommonEvents { WrenchItem.wrenchInstaKillsMinecarts(event); } - @SubscribeEvent(priority = EventPriority.NORMAL) + @SubscribeEvent public static void registerCommands(RegisterCommandsEvent event) { AllCommands.register(event.getDispatcher()); } @@ -128,6 +128,7 @@ public class CommonEvents { event.addListener(RecipeFinder.LISTENER); event.addListener(PotionMixingRecipeManager.LISTENER); event.addListener(FluidTransferRecipes.LISTENER); + event.addListener(PotatoProjectileTypeManager.ReloadListener.INSTANCE); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/foundation/mixin/PlayerListMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/PlayerListMixin.java new file mode 100644 index 000000000..acc2a16dc --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/mixin/PlayerListMixin.java @@ -0,0 +1,25 @@ +package com.simibubi.create.foundation.mixin; + +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 com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; + +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.network.NetworkManager; +import net.minecraft.server.management.PlayerList; + +@Mixin(PlayerList.class) +public class PlayerListMixin { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/item/crafting/ServerRecipeBook;sendInitialRecipeBook(Lnet/minecraft/entity/player/ServerPlayerEntity;)V", shift = At.Shift.AFTER), method = "placeNewPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/ServerPlayerEntity;)V") + private void afterSendRecipeBookOnPlaceNewPlayer(NetworkManager networkManager, ServerPlayerEntity player, CallbackInfo ci) { + PotatoProjectileTypeManager.syncTo(player); + } + + @Inject(at = @At("TAIL"), method = "reloadResources()V") + private void onReloadResources(CallbackInfo ci) { + PotatoProjectileTypeManager.syncToAll(); + } +} diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index 079bc0cbd..81c9a9a2a 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -25,6 +25,7 @@ import com.simibubi.create.content.curiosities.bell.SoulPulseEffectPacket; import com.simibubi.create.content.curiosities.symmetry.SymmetryEffectPacket; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; import com.simibubi.create.content.curiosities.tools.ExtendoGripInteractionPacket; +import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.weapons.PotatoCannonPacket; import com.simibubi.create.content.curiosities.zapper.ZapperBeamPacket; import com.simibubi.create.content.logistics.block.depot.EjectorElytraPacket; @@ -117,6 +118,7 @@ public enum AllPackets { POTATO_CANNON(PotatoCannonPacket.class, PotatoCannonPacket::new, PLAY_TO_CLIENT), SOUL_PULSE(SoulPulseEffectPacket.class, SoulPulseEffectPacket::new, PLAY_TO_CLIENT), PERSISTENT_DATA(ISyncPersistentData.Packet.class, ISyncPersistentData.Packet::new, PLAY_TO_CLIENT), + SYNC_POTATO_PROJECTILE_TYPES(PotatoProjectileTypeManager.SyncPacket.class, PotatoProjectileTypeManager.SyncPacket::new, PLAY_TO_CLIENT), ; diff --git a/src/main/resources/create.mixins.json b/src/main/resources/create.mixins.json index dc2d36193..19029a55a 100644 --- a/src/main/resources/create.mixins.json +++ b/src/main/resources/create.mixins.json @@ -5,6 +5,7 @@ "compatibilityLevel": "JAVA_8", "refmap": "create.refmap.json", "mixins": [ + "PlayerListMixin" ], "client": [ "BreakProgressMixin", From 994fe290215a77f3cb163ef1e97c2e47d960dd0b Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sun, 26 Sep 2021 20:45:24 +0200 Subject: [PATCH 05/22] Careful Deploying - Added the option to have held items not be consumed in deploying recipes --- src/generated/resources/.cache/cache | 26 +++++----- .../resources/assets/create/lang/en_us.json | 1 + .../assets/create/lang/unfinished/de_de.json | 3 +- .../assets/create/lang/unfinished/es_es.json | 3 +- .../assets/create/lang/unfinished/fr_fr.json | 3 +- .../assets/create/lang/unfinished/it_it.json | 3 +- .../assets/create/lang/unfinished/ja_jp.json | 3 +- .../assets/create/lang/unfinished/ko_kr.json | 3 +- .../assets/create/lang/unfinished/nl_nl.json | 3 +- .../assets/create/lang/unfinished/pl_pl.json | 3 +- .../assets/create/lang/unfinished/pt_br.json | 3 +- .../assets/create/lang/unfinished/ru_ru.json | 3 +- .../assets/create/lang/unfinished/zh_cn.json | 3 +- .../assets/create/lang/unfinished/zh_tw.json | 3 +- .../jei/category/DeployingCategory.java | 15 +++++- .../SequencedAssemblySubCategory.java | 17 +++++++ .../deployer/BeltDeployerCallbacks.java | 11 +++-- .../deployer/DeployerApplicationRecipe.java | 49 ++++++++++++++++--- .../ProcessingRecipeSerializer.java | 16 ++++-- .../assets/create/lang/default/messages.json | 1 + 20 files changed, 131 insertions(+), 41 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 28f03b4a8..a5943c70d 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -426,19 +426,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json fb760b12b4bc8114744d3acc6a597b2fad88d988 assets/create/lang/en_ud.json -66e8ae18a98d86c66393c908ab51eae5060b8e04 assets/create/lang/en_us.json -9e94c2420840c516e24dfd7968aaad61da24b5a2 assets/create/lang/unfinished/de_de.json -f1a6ed9a5812c89e7c7152c9abf2b64c133fd27d assets/create/lang/unfinished/es_es.json -23a46ae0bc7b2181f26eeed70801714a254d2587 assets/create/lang/unfinished/fr_fr.json -5e95153e640edc367b963489df8c92c459badcd3 assets/create/lang/unfinished/it_it.json -a951315b2591051dad6c53739fe554fe78595250 assets/create/lang/unfinished/ja_jp.json -419a1fc9af7d7ea0ccd612847df74e0b45380864 assets/create/lang/unfinished/ko_kr.json -dbc823d8cb38598e75871a2187b2a58d7f77f86a assets/create/lang/unfinished/nl_nl.json -ac609477c295be1705d3efc07848ffe6779fd397 assets/create/lang/unfinished/pl_pl.json -95e17b968103e0ef62411489e699d39ac7ff0b64 assets/create/lang/unfinished/pt_br.json -b37f50f613b0df44032fe5d618a5ce7227be8087 assets/create/lang/unfinished/ru_ru.json -fa465cd2c595bcd71449ad432a1908e27897177a assets/create/lang/unfinished/zh_cn.json -6192a7ede669ae6b6f8de6701b8a924d6a756c4a assets/create/lang/unfinished/zh_tw.json +fcd58b47e3fbe4039ea684dadd08d36bd0beaa7d assets/create/lang/en_us.json +2047ce757fe7b7d279b72c5d4d8d6f111e478b2f assets/create/lang/unfinished/de_de.json +3cb5a941527ad3981a094cb2599a28aa654c15b3 assets/create/lang/unfinished/es_es.json +008a67a90fc7d6d59d98c3ac4f4cd45cb47fbcc2 assets/create/lang/unfinished/fr_fr.json +80091dc7ed4ed81a18bce6e9fa0b5fc870a70c89 assets/create/lang/unfinished/it_it.json +a12b0fabb18a0bc7e50ad4e6760aa0a3f222edaf assets/create/lang/unfinished/ja_jp.json +e49e3d4cfcd43194e3904c94a167bc98179b40ff assets/create/lang/unfinished/ko_kr.json +47fa6e25a19d0f8c86178954da4b50aaec247ef4 assets/create/lang/unfinished/nl_nl.json +64581657991641f49c5888e379157939cb5bdc3c assets/create/lang/unfinished/pl_pl.json +d3f22a7ee26461f1369f100001098b9f165b7cb5 assets/create/lang/unfinished/pt_br.json +c2b821bd4c0b09ba0f255c40bcd379b9ad864f10 assets/create/lang/unfinished/ru_ru.json +c43f76c83bbd9c7ac9cd8ac7f82fa1b98347771b assets/create/lang/unfinished/zh_cn.json +e797c8d5e89b9ecc6bf82858a1c905f8b905da16 assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 268153180..3b240d38c 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -752,6 +752,7 @@ "create.recipe.assembly.repeat": "Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "Random salvage", "create.recipe.processing.chance": "%1$s%% Chance", + "create.recipe.deploying.not_consumed": "Not Consumed", "create.recipe.heat_requirement.none": "No Heating Required", "create.recipe.heat_requirement.heated": "Heated", "create.recipe.heat_requirement.superheated": "Super-Heated", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index ce55f9519..fd2077686 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1134", + "_": "Missing Localizations: 1135", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "Chance: %1$s%%", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "Keine Hitze benötigt", "create.recipe.heat_requirement.heated": "Wenig Hitze benötigt", "create.recipe.heat_requirement.superheated": "Viel Hitze benötigt", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 79a683627..6e7652f4d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 0", + "_": "Missing Localizations: 1", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "Repetir la secuencia %1$s veces", "create.recipe.assembly.junk": "Basura aleatoria", "create.recipe.processing.chance": "%1$s%% Chance", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "No es necesario calentar", "create.recipe.heat_requirement.heated": "Calentado", "create.recipe.heat_requirement.superheated": "Súper-Calentado", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 2e0c26dd4..73fadc258 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1386", + "_": "Missing Localizations: 1387", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "%1$s%% de chance", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "Pas de chauffage requis", "create.recipe.heat_requirement.heated": "Chauffé", "create.recipe.heat_requirement.superheated": "Surchauffé", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 8108827f1..e6df80ea8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 914", + "_": "Missing Localizations: 915", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "%1$s%% di probabilità", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "Nessun riscaldamento", "create.recipe.heat_requirement.heated": "Riscaldamento", "create.recipe.heat_requirement.superheated": "Super riscaldamento", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 5650fe7dd..e6269480a 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 9", + "_": "Missing Localizations: 10", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "%1$s回繰り返す", "create.recipe.assembly.junk": "ランダムな仕損品", "create.recipe.processing.chance": "%1$s%%チャンス", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "加熱不要", "create.recipe.heat_requirement.heated": "加熱が必要", "create.recipe.heat_requirement.superheated": "極度の加熱が必要", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index b45ee1cfb..2cdccc02e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 24", + "_": "Missing Localizations: 25", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "%1$s번 반복하기", "create.recipe.assembly.junk": "조립 실패한 조각들", "create.recipe.processing.chance": "%1$s%% 확률", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "열이 필요하지 않음", "create.recipe.heat_requirement.heated": "가열됨", "create.recipe.heat_requirement.superheated": "초고온 가열됨", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 2a8d48fd3..cb8d8972e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1766", + "_": "Missing Localizations: 1767", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "%1$s%% Kans", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "UNLOCALIZED: No Heating Required", "create.recipe.heat_requirement.heated": "UNLOCALIZED: Heated", "create.recipe.heat_requirement.superheated": "UNLOCALIZED: Super-Heated", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 010fcaa58..727fa23c9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 256", + "_": "Missing Localizations: 257", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "%1$s%% szans", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "Nie wymaga podgrzewania", "create.recipe.heat_requirement.heated": "Podrzewane", "create.recipe.heat_requirement.superheated": "Silnie podgrzewane", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 6d34e640a..13fd43cbc 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1807", + "_": "Missing Localizations: 1808", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "UNLOCALIZED: Repeat Sequence %1$s Times", "create.recipe.assembly.junk": "UNLOCALIZED: Random salvage", "create.recipe.processing.chance": "%1$s%% de chance", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "UNLOCALIZED: No Heating Required", "create.recipe.heat_requirement.heated": "UNLOCALIZED: Heated", "create.recipe.heat_requirement.superheated": "UNLOCALIZED: Super-Heated", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 35b858bb2..b5c391ad7 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 5", + "_": "Missing Localizations: 6", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "Повторите последовательность %1$s раз", "create.recipe.assembly.junk": "Случайный мусор", "create.recipe.processing.chance": "%1$s%% шанса", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "Не требует нагрева", "create.recipe.heat_requirement.heated": "Нагрето", "create.recipe.heat_requirement.superheated": "Перегрето", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 0d0f8f5bc..35a44fa56 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 4", + "_": "Missing Localizations: 5", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "该序列需要重复 %1$s 次", "create.recipe.assembly.junk": "随机废料", "create.recipe.processing.chance": "%1$s%%概率", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "无需加热", "create.recipe.heat_requirement.heated": "加热", "create.recipe.heat_requirement.superheated": "超级加热", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 9ec60092a..28e21eea1 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 19", + "_": "Missing Localizations: 20", "_": "->------------------------] Game Elements [------------------------<-", @@ -753,6 +753,7 @@ "create.recipe.assembly.repeat": "重複 %1$s 次", "create.recipe.assembly.junk": "有機率得到垃圾", "create.recipe.processing.chance": "%1$s%%概率", + "create.recipe.deploying.not_consumed": "UNLOCALIZED: Not Consumed", "create.recipe.heat_requirement.none": "不需要加熱", "create.recipe.heat_requirement.heated": "普通加熱", "create.recipe.heat_requirement.superheated": "超級加熱", diff --git a/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java index f3fc6ee9e..4e88e2ca2 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/DeployingCategory.java @@ -9,11 +9,13 @@ import com.simibubi.create.compat.jei.category.animations.AnimatedDeployer; import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe; import com.simibubi.create.foundation.fluid.FluidIngredient; import com.simibubi.create.foundation.gui.AllGuiTextures; +import com.simibubi.create.foundation.utility.Lang; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; import mezz.jei.api.ingredients.IIngredients; +import net.minecraft.util.text.TextFormatting; public class DeployingCategory extends CreateRecipeCategory { @@ -53,7 +55,18 @@ public class DeployingCategory extends CreateRecipeCategory { + if (!input) + return; + if (slotIndex != 1) + return; + tooltip.add(1, Lang.translate("recipe.deploying.not_consumed") + .withStyle(TextFormatting.GOLD)); + }); + } + addStochasticTooltip(itemStacks, recipe.getRollableResults(), 2); } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/sequencedAssembly/SequencedAssemblySubCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/sequencedAssembly/SequencedAssemblySubCategory.java index 99810a1e1..bf4345225 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/sequencedAssembly/SequencedAssemblySubCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/sequencedAssembly/SequencedAssemblySubCategory.java @@ -10,12 +10,16 @@ import com.simibubi.create.compat.jei.category.animations.AnimatedDeployer; import com.simibubi.create.compat.jei.category.animations.AnimatedPress; import com.simibubi.create.compat.jei.category.animations.AnimatedSaw; import com.simibubi.create.compat.jei.category.animations.AnimatedSpout; +import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe; +import com.simibubi.create.content.contraptions.itemAssembly.IAssemblyRecipe; import com.simibubi.create.content.contraptions.itemAssembly.SequencedRecipe; import com.simibubi.create.foundation.fluid.FluidIngredient; import com.simibubi.create.foundation.gui.AllGuiTextures; +import com.simibubi.create.foundation.utility.Lang; import mezz.jei.api.gui.ingredient.IGuiFluidStackGroup; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; +import net.minecraft.util.text.TextFormatting; public abstract class SequencedAssemblySubCategory { @@ -115,6 +119,19 @@ public abstract class SequencedAssemblySubCategory { .getIngredients() .get(1) .getItems())); + + IAssemblyRecipe contained = recipe.getAsAssemblyRecipe(); + if (contained instanceof DeployerApplicationRecipe && ((DeployerApplicationRecipe) contained).shouldKeepHeldItem()) { + itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> { + if (!input) + return; + if (slotIndex != index) + return; + tooltip.add(1, Lang.translate("recipe.deploying.not_consumed") + .withStyle(TextFormatting.GOLD)); + }); + } + return 1; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java index b0900e2be..dfe84ba54 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java @@ -104,10 +104,13 @@ public class BeltDeployerCallbacks { handler.handleProcessingOnItem(transported, TransportedResult.convertToAndLeaveHeld(collect, left)); ItemStack heldItem = deployerTileEntity.player.getMainHandItem(); - if (heldItem.isDamageableItem()) - heldItem.hurtAndBreak(1, deployerTileEntity.player, s -> s.broadcastBreakEvent(Hand.MAIN_HAND)); - else - heldItem.shrink(1); + if (!(recipe instanceof DeployerApplicationRecipe) + || !((DeployerApplicationRecipe) recipe).shouldKeepHeldItem()) { + if (heldItem.isDamageableItem()) + heldItem.hurtAndBreak(1, deployerTileEntity.player, s -> s.broadcastBreakEvent(Hand.MAIN_HAND)); + else + heldItem.shrink(1); + } BlockPos pos = deployerTileEntity.getBlockPos(); World world = deployerTileEntity.getLevel(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java index 3fb54e05f..aabfa2846 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerApplicationRecipe.java @@ -5,6 +5,7 @@ import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; +import com.google.gson.JsonObject; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.AllTags.AllItemTags; @@ -18,7 +19,9 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; +import net.minecraft.network.PacketBuffer; import net.minecraft.util.IItemProvider; +import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; @@ -30,8 +33,11 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; public class DeployerApplicationRecipe extends ProcessingRecipe implements IAssemblyRecipe { + private boolean keepHeldItem; + public DeployerApplicationRecipe(ProcessingRecipeParams params) { super(AllRecipeTypes.DEPLOYING, params); + keepHeldItem = false; } @Override @@ -52,6 +58,10 @@ public class DeployerApplicationRecipe extends ProcessingRecipe i return 2; } + public boolean shouldKeepHeldItem() { + return keepHeldItem; + } + public Ingredient getRequiredHeldItem() { if (ingredients.isEmpty()) throw new IllegalStateException("Deploying Recipe: " + id.toString() + " has no tool!"); @@ -66,12 +76,14 @@ public class DeployerApplicationRecipe extends ProcessingRecipe i public static List convert(List> sandpaperRecipes) { return sandpaperRecipes.stream() - .map(r -> new ProcessingRecipeBuilder<>(DeployerApplicationRecipe::new, new ResourceLocation(r.getId().getNamespace(), r.getId() - .getPath() + "_using_deployer")).require(r.getIngredients() - .get(0)) - .require(AllItemTags.SANDPAPER.tag) - .output(r.getResultItem()) - .build()) + .map(r -> new ProcessingRecipeBuilder<>(DeployerApplicationRecipe::new, new ResourceLocation(r.getId() + .getNamespace(), + r.getId() + .getPath() + "_using_deployer")).require(r.getIngredients() + .get(0)) + .require(AllItemTags.SANDPAPER.tag) + .output(r.getResultItem()) + .build()) .collect(Collectors.toList()); } @@ -80,6 +92,31 @@ public class DeployerApplicationRecipe extends ProcessingRecipe i list.add(ingredients.get(1)); } + @Override + public void readAdditional(JsonObject json) { + super.readAdditional(json); + keepHeldItem = JSONUtils.getAsBoolean(json, "keepHeldItem", false); + } + + @Override + public void writeAdditional(JsonObject json) { + super.writeAdditional(json); + if (keepHeldItem) + json.addProperty("keepHeldItem", keepHeldItem); + } + + @Override + public void readAdditional(PacketBuffer buffer) { + super.readAdditional(buffer); + keepHeldItem = buffer.readBoolean(); + } + + @Override + public void writeAdditional(PacketBuffer buffer) { + super.writeAdditional(buffer); + buffer.writeBoolean(keepHeldItem); + } + @Override @OnlyIn(Dist.CLIENT) public ITextComponent getDescriptionForAssembly() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java index 9d83395c3..38404346b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java @@ -90,7 +90,9 @@ public class ProcessingRecipeSerializer> extends F if (JSONUtils.isValidNode(json, "heatRequirement")) builder.requiresHeat(HeatCondition.deserialize(JSONUtils.getAsString(json, "heatRequirement"))); - return builder.build(); + T recipe = builder.build(); + recipe.readAdditional(json); + return recipe; } protected void writeToBuffer(PacketBuffer buffer, T recipe) { @@ -112,6 +114,8 @@ public class ProcessingRecipeSerializer> extends F buffer.writeVarInt(recipe.getProcessingDuration()); buffer.writeVarInt(recipe.getRequiredHeat() .ordinal()); + + recipe.writeAdditional(buffer); } protected T readFromBuffer(ResourceLocation recipeId, PacketBuffer buffer) { @@ -123,26 +127,28 @@ public class ProcessingRecipeSerializer> extends F int size = buffer.readVarInt(); for (int i = 0; i < size; i++) ingredients.add(Ingredient.fromNetwork(buffer)); - + size = buffer.readVarInt(); for (int i = 0; i < size; i++) fluidIngredients.add(FluidIngredient.read(buffer)); - + size = buffer.readVarInt(); for (int i = 0; i < size; i++) results.add(ProcessingOutput.read(buffer)); - + size = buffer.readVarInt(); for (int i = 0; i < size; i++) fluidResults.add(FluidStack.readFromPacket(buffer)); - return new ProcessingRecipeBuilder<>(factory, recipeId).withItemIngredients(ingredients) + T recipe = new ProcessingRecipeBuilder<>(factory, recipeId).withItemIngredients(ingredients) .withItemOutputs(results) .withFluidIngredients(fluidIngredients) .withFluidOutputs(fluidResults) .duration(buffer.readVarInt()) .requiresHeat(HeatCondition.values()[buffer.readVarInt()]) .build(); + recipe.readAdditional(buffer); + return recipe; } public final void write(JsonObject json, T recipe) { diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 1df9899de..f67843698 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -65,6 +65,7 @@ "create.recipe.assembly.junk": "Random salvage", "create.recipe.processing.chance": "%1$s%% Chance", + "create.recipe.deploying.not_consumed": "Not Consumed", "create.recipe.heat_requirement.none": "No Heating Required", "create.recipe.heat_requirement.heated": "Heated", "create.recipe.heat_requirement.superheated": "Super-Heated", From fa7039a04a224385a6e7a0e49a95eb5b7585697d Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 27 Sep 2021 12:49:45 +0200 Subject: [PATCH 06/22] Patient Stalling - Items on belts now stall under empty-handed Deployers targeting them --- .../deployer/BeltDeployerCallbacks.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java index dfe84ba54..6499eaf02 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/BeltDeployerCallbacks.java @@ -45,6 +45,11 @@ public class BeltDeployerCallbacks { if (deployerTileEntity.redstoneLocked) return ProcessingResult.PASS; + DeployerFakePlayer player = deployerTileEntity.getPlayer(); + ItemStack held = player == null ? ItemStack.EMPTY : player.getMainHandItem(); + + if (held.isEmpty()) + return ProcessingResult.HOLD; if (deployerTileEntity.getRecipe(s.stack) == null) return ProcessingResult.PASS; @@ -60,6 +65,12 @@ public class BeltDeployerCallbacks { BlockState blockState = deployerTileEntity.getBlockState(); if (!blockState.hasProperty(FACING) || blockState.getValue(FACING) != Direction.DOWN) return ProcessingResult.PASS; + + DeployerFakePlayer player = deployerTileEntity.getPlayer(); + ItemStack held = player == null ? ItemStack.EMPTY : player.getMainHandItem(); + if (held.isEmpty()) + return ProcessingResult.HOLD; + IRecipe recipe = deployerTileEntity.getRecipe(s.stack); if (recipe == null) return ProcessingResult.PASS; @@ -68,10 +79,10 @@ public class BeltDeployerCallbacks { activate(s, i, deployerTileEntity, recipe); return ProcessingResult.HOLD; } - + if (deployerTileEntity.state == State.WAITING) { if (deployerTileEntity.redstoneLocked) - return ProcessingResult.PASS; + return ProcessingResult.PASS; deployerTileEntity.start(); } @@ -92,6 +103,10 @@ public class BeltDeployerCallbacks { copy.angle = centered ? 180 : Create.RANDOM.nextInt(360); return copy; }) + .map(t -> { + t.locked = false; + return t; + }) .collect(Collectors.toList()); TransportedItemStack left = transported.copy(); From 34d430989c1eb67f1918f7b21082395b9052251f Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:43:59 +0200 Subject: [PATCH 07/22] Belt Shadow Legends - Fixed a lighting issue for the belt item renderer --- .../content/contraptions/relays/belt/BeltTileEntity.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index a9a3d4c98..940b54a14 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -227,10 +227,7 @@ public class BeltTileEntity extends KineticTileEntity implements ILightUpdateLis int length = compound.getInt("Length"); if (beltLength != length) { beltLength = length; - if (level != null) - initializeLight(); - else - light = null; + light = null; } } @@ -523,7 +520,7 @@ public class BeltTileEntity extends KineticTileEntity implements ILightUpdateLis return getController().equals(((BeltTileEntity) target).getController()) ? 1 : 0; return 0; } - + public void invalidateItemHandler() { itemHandler.invalidate(); } @@ -535,7 +532,7 @@ public class BeltTileEntity extends KineticTileEntity implements ILightUpdateLis BlockState state = getBlockState(); return state != null && state.hasProperty(BeltBlock.PART) && state.getValue(BeltBlock.PART) == BeltPart.START; } - + @Override public boolean onLightUpdate(IBlockDisplayReader world, LightType type, GridAlignedBB changed) { if (this.remove) { From 4d819b6c9dbb880471b46bc0b19260f7f90a6f52 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 30 Sep 2021 21:31:35 +0200 Subject: [PATCH 08/22] Structure Assist - Schematic and Quill now creates Air entries in place of any "Structure Void" block --- .../relays/belt/BeltTileEntity.java | 5 +++-- .../schematics/ServerSchematicLoader.java | 2 ++ .../client/SchematicAndQuillHandler.java | 7 +++++-- .../schematics/item/SchematicAndQuillItem.java | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index 940b54a14..d5ac0c37d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -535,9 +535,10 @@ public class BeltTileEntity extends KineticTileEntity implements ILightUpdateLis @Override public boolean onLightUpdate(IBlockDisplayReader world, LightType type, GridAlignedBB changed) { - if (this.remove) { + if (this.remove) return true; - } + if (this.level == null || this.light == null) + return false; GridAlignedBB beltVolume = getBeltVolume(); diff --git a/src/main/java/com/simibubi/create/content/schematics/ServerSchematicLoader.java b/src/main/java/com/simibubi/create/content/schematics/ServerSchematicLoader.java index 9c1b40ea1..e63010098 100644 --- a/src/main/java/com/simibubi/create/content/schematics/ServerSchematicLoader.java +++ b/src/main/java/com/simibubi/create/content/schematics/ServerSchematicLoader.java @@ -17,6 +17,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.Create; import com.simibubi.create.content.schematics.block.SchematicTableTileEntity; +import com.simibubi.create.content.schematics.item.SchematicAndQuillItem; import com.simibubi.create.content.schematics.item.SchematicItem; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.CSchematics; @@ -319,6 +320,7 @@ public class ServerSchematicLoader { try (OutputStream outputStream = Files.newOutputStream(path)) { CompoundNBT nbttagcompound = t.save(new CompoundNBT()); + SchematicAndQuillItem.replaceStructureVoidWithAir(nbttagcompound); CompressedStreamTools.writeCompressed(nbttagcompound, outputStream); player.setItemInHand(Hand.MAIN_HAND, SchematicItem.create(schematic, player.getGameProfile().getName())); diff --git a/src/main/java/com/simibubi/create/content/schematics/client/SchematicAndQuillHandler.java b/src/main/java/com/simibubi/create/content/schematics/client/SchematicAndQuillHandler.java index 02243a42d..7cf0cda24 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/SchematicAndQuillHandler.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/SchematicAndQuillHandler.java @@ -15,6 +15,7 @@ import com.simibubi.create.AllSpecialTextures; import com.simibubi.create.Create; import com.simibubi.create.CreateClient; import com.simibubi.create.content.schematics.ClientSchematicLoader; +import com.simibubi.create.content.schematics.item.SchematicAndQuillItem; import com.simibubi.create.content.schematics.packet.InstantSchematicPacket; import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.networking.AllPackets; @@ -126,7 +127,7 @@ public class SchematicAndQuillHandler { firstPos = selectedPos; Lang.sendStatus(player, "schematicAndQuill.firstPos"); } - + public void discard() { ClientPlayerEntity player = Minecraft.getInstance().player; firstPos = null; @@ -213,7 +214,8 @@ public class SchematicAndQuillHandler { t.fillFromWorld(Minecraft.getInstance().level, origin, bounds, true, Blocks.AIR); if (string.isEmpty()) - string = Lang.translate("schematicAndQuill.fallbackName").getString(); + string = Lang.translate("schematicAndQuill.fallbackName") + .getString(); String folderPath = "schematics"; FilesHelper.createFolderIfMissing(folderPath); @@ -225,6 +227,7 @@ public class SchematicAndQuillHandler { try { outputStream = Files.newOutputStream(path, StandardOpenOption.CREATE); CompoundNBT nbttagcompound = t.save(new CompoundNBT()); + SchematicAndQuillItem.replaceStructureVoidWithAir(nbttagcompound); CompressedStreamTools.writeCompressed(nbttagcompound, outputStream); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/com/simibubi/create/content/schematics/item/SchematicAndQuillItem.java b/src/main/java/com/simibubi/create/content/schematics/item/SchematicAndQuillItem.java index 30e330076..591208f2d 100644 --- a/src/main/java/com/simibubi/create/content/schematics/item/SchematicAndQuillItem.java +++ b/src/main/java/com/simibubi/create/content/schematics/item/SchematicAndQuillItem.java @@ -1,6 +1,10 @@ package com.simibubi.create.content.schematics.item; +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.block.Blocks; import net.minecraft.item.Item; +import net.minecraft.nbt.CompoundNBT; public class SchematicAndQuillItem extends Item { @@ -8,4 +12,18 @@ public class SchematicAndQuillItem extends Item { super(properties); } + public static void replaceStructureVoidWithAir(CompoundNBT nbt) { + String air = Blocks.AIR.getRegistryName() + .toString(); + String structureVoid = Blocks.STRUCTURE_VOID.getRegistryName() + .toString(); + + NBTHelper.iterateCompoundList(nbt.getList("palette", 10), c -> { + if (c.contains("Name") && c.getString("Name") + .equals(structureVoid)) { + c.putString("Name", air); + } + }); + } + } From d72f343fdfa4bba1b88b42e424feb5bb97906b61 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Sat, 2 Oct 2021 13:02:27 -0700 Subject: [PATCH 09/22] Various cleanup - Remove Create namespace restriction in CTSpriteShifter - Add method to register ponder chapter lang - Clean up palette block code; Closes #386 - Clean up tag code - Use Create.asResource in as many places as possible - Organize imports --- src/generated/resources/.cache/cache | 1 + .../data/forge/tags/blocks/cobblestone.json | 14 ++ .../java/com/simibubi/create/AllBlocks.java | 2 +- .../java/com/simibubi/create/AllItems.java | 8 +- .../simibubi/create/AllSpecialTextures.java | 2 +- .../com/simibubi/create/AllSpriteShifts.java | 2 +- .../java/com/simibubi/create/AllTags.java | 194 ++++++++++-------- .../simibubi/create/compat/jei/CreateJEI.java | 2 +- .../jei/category/CreateRecipeCategory.java | 2 +- .../base/CutoutRotatingInstance.java | 1 - .../base/KineticTileInstance.java | 2 +- .../components/flywheel/FlyWheelInstance.java | 2 +- .../flywheel/engine/EngineInstance.java | 2 +- .../BlockMovementChecks.java | 2 +- .../chassis/StickerInstance.java | 2 +- .../structureMovement/glue/GlueInstance.java | 8 +- .../glue/SuperGlueRenderer.java | 2 +- .../render/ContraptionInstanceManager.java | 2 +- .../render/ContraptionRenderDispatcher.java | 1 - .../render/LightVolumeDebugger.java | 6 - .../relays/encased/SplitShaftInstance.java | 2 +- .../relays/gearbox/GearboxInstance.java | 2 +- .../curiosities/armor/CopperArmorItem.java | 6 +- .../weapons/PotatoProjectileEntity.java | 18 +- .../weapons/PotatoProjectileRenderMode.java | 2 + .../weapons/ProperProjectileEntity.java | 40 ---- .../content/logistics/block/FlapData.java | 1 - .../belts/tunnel/BeltTunnelInstance.java | 2 +- .../block/funnel/FunnelInstance.java | 2 +- .../content/palettes/AllPaletteBlocks.java | 18 +- .../content/palettes/PaletteBlockPattern.java | 29 ++- .../palettes/PaletteStoneVariants.java | 8 +- .../palettes/PalettesVariantEntry.java | 41 ++-- .../block/SchematicannonInstance.java | 2 +- .../simibubi/create/events/ClientEvents.java | 6 +- .../advancement/CriterionTriggerBase.java | 6 +- .../block/connected/CTSpriteShiftEntry.java | 2 +- .../block/connected/CTSpriteShifter.java | 38 ++-- .../block/render/SpriteShifter.java | 21 +- .../foundation/data/BuilderTransformers.java | 2 +- .../create/foundation/data/ModelGen.java | 2 +- .../create/foundation/data/WindowGen.java | 2 +- .../create/foundation/gui/AllGuiTextures.java | 2 +- .../foundation/item/ItemDescription.java | 1 - .../foundation/networking/AllPackets.java | 6 +- .../foundation/ponder/PonderLocalization.java | 4 + .../create/foundation/ponder/PonderScene.java | 4 +- .../foundation/render/AllMaterialSpecs.java | 8 +- .../foundation/render/AllProgramSpecs.java | 17 +- .../render/RainbowDebugStateProvider.java | 2 +- .../tileEntity/TileEntityBehaviour.java | 4 +- .../foundation/utility/WorldAttached.java | 2 - 52 files changed, 292 insertions(+), 267 deletions(-) create mode 100644 src/generated/resources/data/forge/tags/blocks/cobblestone.json delete mode 100644 src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index a5943c70d..fb2fc5102 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -3757,6 +3757,7 @@ bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json 6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/items/seats.json 2f4044c2989b9a8aa394c88617d67a6a310e6b1b data/create/tags/items/upright_on_belt.json 50936b211d94167a35ec78c89954082a336b6269 data/create/tags/items/valve_handles.json +05ca51cdc60a5e109b5a0e3b782de13d34ebcb24 data/forge/tags/blocks/cobblestone.json 16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data/forge/tags/blocks/glass/colorless.json 81d3eb40b048160fcc2d6bb7ff12b49276297efd data/forge/tags/blocks/glass_panes.json 4b700ee8aa748c2ec70c29ef1589844879c0deae data/forge/tags/blocks/ores.json diff --git a/src/generated/resources/data/forge/tags/blocks/cobblestone.json b/src/generated/resources/data/forge/tags/blocks/cobblestone.json new file mode 100644 index 000000000..4a5c2c1fb --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/cobblestone.json @@ -0,0 +1,14 @@ +{ + "replace": false, + "values": [ + "create:granite_cobblestone", + "create:diorite_cobblestone", + "create:andesite_cobblestone", + "create:limestone_cobblestone", + "create:weathered_limestone_cobblestone", + "create:dolomite_cobblestone", + "create:gabbro_cobblestone", + "create:scoria_cobblestone", + "create:dark_scoria_cobblestone" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index a990a6d10..aec652b71 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -160,9 +160,9 @@ import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchBlock import com.simibubi.create.content.logistics.item.LecternControllerBlock; import com.simibubi.create.content.schematics.block.SchematicTableBlock; import com.simibubi.create.content.schematics.block.SchematicannonBlock; +import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.block.DyedBlockList; import com.simibubi.create.foundation.block.ItemUseOverrides; -import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.data.AssetLookup; import com.simibubi.create.foundation.data.BlockStateGen; import com.simibubi.create.foundation.data.BuilderTransformers; diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 36885956c..5afe68f88 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -3,7 +3,6 @@ package com.simibubi.create; import static com.simibubi.create.AllTags.forgeItemTag; import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS; import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_ORES; -import static com.simibubi.create.AllTags.AllItemTags.NUGGETS; import static com.simibubi.create.AllTags.AllItemTags.PLATES; import static com.simibubi.create.content.AllSections.CURIOSITIES; import static com.simibubi.create.content.AllSections.KINETICS; @@ -64,6 +63,7 @@ import net.minecraft.item.Rarity; import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; public class AllItems { @@ -167,9 +167,9 @@ public class AllItems { .register(); public static final ItemEntry COPPER_NUGGET = - taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), NUGGETS.tag), - ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), NUGGETS.tag), - BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), NUGGETS.tag), + taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), Tags.Items.NUGGETS), + ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), Tags.Items.NUGGETS), + BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), Tags.Items.NUGGETS), COPPER_SHEET = taggedIngredient("copper_sheet", forgeItemTag("plates/copper"), PLATES.tag), BRASS_SHEET = taggedIngredient("brass_sheet", forgeItemTag("plates/brass"), PLATES.tag), diff --git a/src/main/java/com/simibubi/create/AllSpecialTextures.java b/src/main/java/com/simibubi/create/AllSpecialTextures.java index 3f0826421..4a0117b8f 100644 --- a/src/main/java/com/simibubi/create/AllSpecialTextures.java +++ b/src/main/java/com/simibubi/create/AllSpecialTextures.java @@ -18,7 +18,7 @@ public enum AllSpecialTextures { private ResourceLocation location; private AllSpecialTextures(String filename) { - location = new ResourceLocation(Create.ID, ASSET_PATH + filename); + location = Create.asResource(ASSET_PATH + filename); } public void bind() { diff --git a/src/main/java/com/simibubi/create/AllSpriteShifts.java b/src/main/java/com/simibubi/create/AllSpriteShifts.java index 94ba43b41..dfae3fdd4 100644 --- a/src/main/java/com/simibubi/create/AllSpriteShifts.java +++ b/src/main/java/com/simibubi/create/AllSpriteShifts.java @@ -78,7 +78,7 @@ public class AllSpriteShifts { // private static void populateMaps() { - WoodType[] supportedWoodTypes = new WoodType[]{ + WoodType[] supportedWoodTypes = new WoodType[] { WoodType.OAK, WoodType.SPRUCE, WoodType.BIRCH, WoodType.ACACIA, WoodType.JUNGLE, WoodType.DARK_OAK, WoodType.CRIMSON, WoodType.WARPED }; diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 0e1668c51..19e148d20 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -27,9 +27,11 @@ import net.minecraft.tags.FluidTags; import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; import net.minecraftforge.fml.ModList; public class AllTags { + private static final CreateRegistrate REGISTRATE = Create.registrate() .itemGroup(() -> Create.BASE_CREATIVE_TAB); @@ -61,105 +63,38 @@ public class AllTags { return wrapperFactory.apply(new ResourceLocation(domain, name).toString()); } - public static enum NameSpace { + public enum NameSpace { - MOD(Create.ID), FORGE("forge"), MC("minecraft"), TIC("tconstruct") + MOD(Create.ID), FORGE("forge"), TIC("tconstruct") ; - String id; + public final String id; private NameSpace(String id) { this.id = id; } + } - public static enum AllItemTags { - CRUSHED_ORES(MOD), - SEATS(MOD), - VALVE_HANDLES(MOD), - UPRIGHT_ON_BELT(MOD), - SANDPAPER(MOD), - CREATE_INGOTS(MOD), - BEACON_PAYMENT(FORGE), - INGOTS(FORGE), - NUGGETS(FORGE), - PLATES(FORGE), - COBBLESTONE(FORGE) + public enum AllBlockTags { - ; - - public ITag.INamedTag tag; - - private AllItemTags(NameSpace namespace) { - this(namespace, ""); - } - - private AllItemTags(NameSpace namespace, String path) { - tag = ItemTags.bind( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())).toString()); - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); - } - - public boolean matches(ItemStack stack) { - return tag.contains(stack.getItem()); - } - - public void add(Item... values) { - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag) - .add(values)); - } - - public void includeIn(AllItemTags parent) { - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent.tag) - .addTag(tag)); - } - } - - public static enum AllFluidTags { - NO_INFINITE_DRAINING, - HONEY(FORGE) - - ; - - public ITag.INamedTag tag; - - private AllFluidTags() { - this(MOD, ""); - } - - private AllFluidTags(NameSpace namespace) { - this(namespace, ""); - } - - private AllFluidTags(NameSpace namespace, String path) { - tag = FluidTags.createOptional( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name()))); - } - - public boolean matches(Fluid fluid) { - return fluid != null && fluid.is(tag); - } - - static void loadClass() {} - } - - public static enum AllBlockTags { - WINDMILL_SAILS, - FAN_HEATERS, - WINDOWABLE, BRITTLE, - SEATS, - SAILS, - VALVE_HANDLES, + FAN_HEATERS, FAN_TRANSPARENT, SAFE_NBT, - SLIMY_LOGS(TIC), + SAILS, + SEATS, + VALVE_HANDLES, + WINDMILL_SAILS, + WINDOWABLE, WRENCH_PICKUP, + SLIMY_LOGS(TIC), + ; - public ITag.INamedTag tag; + public final ITag.INamedTag tag; private AllBlockTags() { this(MOD, ""); @@ -186,25 +121,111 @@ public class AllTags { return tag.contains(block.getBlock()); } - public void includeIn(AllBlockTags parent) { - REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent.tag) + public void add(Block... values) { + REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) + .add(values)); + } + + public void includeIn(ITag.INamedTag parent) { + REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent) .addTag(tag)); } + public void includeIn(AllBlockTags parent) { + includeIn(parent.tag); + } + public void includeAll(ITag.INamedTag child) { REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) .addTag(child)); } - public void add(Block... values) { - REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) + } + + public enum AllItemTags { + + CREATE_INGOTS(), + CRUSHED_ORES(), + SANDPAPER(), + SEATS(), + UPRIGHT_ON_BELT(), + VALVE_HANDLES(), + + BEACON_PAYMENT(FORGE), + PLATES(FORGE) + + ; + + public final ITag.INamedTag tag; + + private AllItemTags() { + this(MOD, ""); + } + + private AllItemTags(NameSpace namespace) { + this(namespace, ""); + } + + private AllItemTags(NameSpace namespace, String path) { + tag = ItemTags.bind( + new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())).toString()); + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); + } + + public boolean matches(ItemStack stack) { + return tag.contains(stack.getItem()); + } + + public void add(Item... values) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag) .add(values)); } + + public void includeIn(ITag.INamedTag parent) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent) + .addTag(tag)); + } + + public void includeIn(AllItemTags parent) { + includeIn(parent.tag); + } + + } + + public enum AllFluidTags { + + NO_INFINITE_DRAINING, + + HONEY(FORGE) + + ; + + public final ITag.INamedTag tag; + + private AllFluidTags() { + this(MOD, ""); + } + + private AllFluidTags(NameSpace namespace) { + this(namespace, ""); + } + + private AllFluidTags(NameSpace namespace, String path) { + tag = FluidTags.createOptional( + new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name()))); + } + + public boolean matches(Fluid fluid) { + return fluid != null && fluid.is(tag); + } + + private static void loadClass() {} + } public static void register() { AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT); - AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.INGOTS); + AllItemTags.CREATE_INGOTS.includeIn(Tags.Items.INGOTS); AllItemTags.UPRIGHT_ON_BELT.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION, Items.HONEY_BOTTLE, Items.CAKE); @@ -231,4 +252,5 @@ public class AllTags { AllFluidTags.loadClass(); } + } diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index 2cf7dcf90..3f00139d7 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -78,7 +78,7 @@ import net.minecraftforge.fml.ModList; @SuppressWarnings("unused") public class CreateJEI implements IModPlugin { - private static final ResourceLocation ID = new ResourceLocation(Create.ID, "jei_plugin"); + private static final ResourceLocation ID = Create.asResource("jei_plugin"); public IIngredientManager ingredientManager; private final List> allCategories = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 359c4ee06..a309a6955 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -45,7 +45,7 @@ public abstract class CreateRecipeCategory> implements IRec } public void setCategoryId(String name) { - this.uid = new ResourceLocation(Create.ID, name); + this.uid = Create.asResource(name); this.name = name; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java index c8f3d4335..65b164208 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java @@ -1,6 +1,5 @@ package com.simibubi.create.content.contraptions.base; -import com.jozufozu.flywheel.backend.instancing.Instancer; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.foundation.render.AllMaterialSpecs; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java index c845b8a48..9a2f61bd9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.contraptions.base; +import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel; import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java index ea35ee0e3..5c20fe6db 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java @@ -8,8 +8,8 @@ import java.util.List; import com.google.common.collect.Lists; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java index 230960d90..cb02e4da7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.components.flywheel.engine; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java index c1b5b796b..3635706fa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java @@ -74,7 +74,7 @@ public class BlockMovementChecks { private static final List BRITTLE_CHECKS = new ArrayList<>(); private static final List ATTACHED_CHECKS = new ArrayList<>(); private static final List NOT_SUPPORTIVE_CHECKS = new ArrayList<>(); - public static final ResourceLocation NON_MOVABLE = new ResourceLocation(Create.ID, "non_movable"); + public static final ResourceLocation NON_MOVABLE = Create.asResource("non_movable"); // Registration // Add new checks to the front instead of the end diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java index 050fbc56d..250f73941 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement.chassis; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java index 751fe2236..c4c560fb9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java @@ -4,16 +4,12 @@ import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.backend.instancing.ITickableInstance; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; import com.jozufozu.flywheel.backend.material.MaterialGroup; -import com.jozufozu.flywheel.backend.model.BufferedModel; -import com.jozufozu.flywheel.backend.model.ElementBuffer; -import com.jozufozu.flywheel.backend.model.IndexedModel; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.state.TextureRenderState; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.QuadConverter; import com.jozufozu.flywheel.core.instancing.ConditionalInstance; import com.jozufozu.flywheel.core.materials.OrientedData; import com.jozufozu.flywheel.core.model.IModel; @@ -36,7 +32,7 @@ import net.minecraft.world.LightType; public class GlueInstance extends EntityInstance implements ITickableInstance { private static final boolean USE_ATLAS = false; - private static final ResourceLocation TEXTURE = new ResourceLocation(Create.ID, "textures/entity/super_glue/slime.png"); + private static final ResourceLocation TEXTURE = Create.asResource("textures/entity/super_glue/slime.png"); private final Quaternion rotation; protected ConditionalInstance model; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java index 10b91afec..9c2ad5ef3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java @@ -30,7 +30,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class SuperGlueRenderer extends EntityRenderer { - private ResourceLocation regular = new ResourceLocation(Create.ID, "textures/entity/super_glue/slime.png"); + private ResourceLocation regular = Create.asResource("textures/entity/super_glue/slime.png"); private float[] insideQuad; private float[] outsideQuad; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java index 47cd9258a..261aca5d5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java @@ -7,8 +7,8 @@ import javax.annotation.Nullable; import org.apache.commons.lang3.tuple.Pair; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllMovementBehaviours; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java index 98e5e9fbb..bb906a32f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java @@ -18,7 +18,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Abs import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.Compartment; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.TileEntityRenderHelper; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java index 82f6e64e6..c495e0dbe 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java @@ -1,13 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.render; -import java.util.ArrayList; - -import com.jozufozu.flywheel.light.GridAlignedBB; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; -import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.Pair; -import com.simibubi.create.foundation.utility.outliner.AABBOutline; public class LightVolumeDebugger { public static void render(MatrixStack ms, SuperRenderTypeBuffer buffer) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java index 73ed999ca..dc5193c81 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java @@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.relays.encased; import java.util.ArrayList; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java index 0b86084aa..da4b1f8f6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java @@ -4,8 +4,8 @@ import java.util.EnumMap; import java.util.Map; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileInstance; diff --git a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java index 5aa6098db..d036b562e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java @@ -7,9 +7,13 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; public class CopperArmorItem extends ArmorItem { + public static final ResourceLocation TEXTURE = Create.asResource("textures/models/armor/copper.png"); + private static final String TEXTURE_STRING = TEXTURE.toString(); + public CopperArmorItem(EquipmentSlotType p_i48534_2_, Properties p_i48534_3_) { super(AllArmorMaterials.COPPER, p_i48534_2_, p_i48534_3_.stacksTo(1)); } @@ -23,7 +27,7 @@ public class CopperArmorItem extends ArmorItem { @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { - return String.format("%s:textures/models/armor/copper.png", Create.ID); + return TEXTURE_STRING; } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java index b6e188202..73c5d924d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java @@ -39,17 +39,17 @@ import net.minecraftforge.items.ItemHandlerHelper; public class PotatoProjectileEntity extends DamagingProjectileEntity implements IEntityAdditionalSpawnData { - PotatoCannonProjectileType type; - ItemStack stack = ItemStack.EMPTY; + protected PotatoCannonProjectileType type; + protected ItemStack stack = ItemStack.EMPTY; - Entity stuckEntity; - Vector3d stuckOffset; - PotatoProjectileRenderMode stuckRenderer; - double stuckFallSpeed; + protected Entity stuckEntity; + protected Vector3d stuckOffset; + protected PotatoProjectileRenderMode stuckRenderer; + protected double stuckFallSpeed; - float additionalDamageMult = 1; - float additionalKnockback = 0; - float recoveryChance = 0; + protected float additionalDamageMult = 1; + protected float additionalKnockback = 0; + protected float recoveryChance = 0; public PotatoProjectileEntity(EntityType type, World world) { super(type, world); diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java index 799ed35e1..aa8111556 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java @@ -1,5 +1,7 @@ package com.simibubi.create.content.curiosities.weapons; +import static com.simibubi.create.content.curiosities.weapons.PotatoProjectileRenderMode.entityRandom; + import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.utility.AngleHelper; diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java deleted file mode 100644 index e8271d2f4..000000000 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.simibubi.create.content.curiosities.weapons; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.network.IPacket; -import net.minecraft.world.World; - -public abstract class ProperProjectileEntity extends Entity { - - public ProperProjectileEntity(EntityType p_i48580_1_, World p_i48580_2_) { - super(p_i48580_1_, p_i48580_2_); - // TODO Auto-generated constructor stub - } - - @Override - protected void defineSynchedData() { - // TODO Auto-generated method stub - - } - - @Override - protected void readAdditionalSaveData(CompoundNBT p_70037_1_) { - // TODO Auto-generated method stub - - } - - @Override - protected void addAdditionalSaveData(CompoundNBT p_213281_1_) { - // TODO Auto-generated method stub - - } - - @Override - public IPacket getAddEntityPacket() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java b/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java index 5dfe87e95..9ce6469a3 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java @@ -7,7 +7,6 @@ import com.jozufozu.flywheel.core.materials.IFlatLight; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3f; -import net.minecraft.util.math.vector.Vector3i; public class FlapData extends InstanceData implements IFlatLight { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java index 05b4a1f78..3ad030006 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java @@ -8,8 +8,8 @@ import java.util.Map; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.logistics.block.FlapData; import com.simibubi.create.foundation.gui.widgets.InterpolatedValue; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java index 470e56bda..3be5421f1 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.PartialModel; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.logistics.block.FlapData; diff --git a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java index 0e8bae19e..8dcea9a50 100644 --- a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java +++ b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java @@ -96,13 +96,13 @@ public class AllPaletteBlocks { // Vanilla stone variant patterns public static final PalettesVariantEntry GRANITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.GRANITE, PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.GRANITE); + new PalettesVariantEntry(PaletteStoneVariants.GRANITE, PaletteBlockPattern.VANILLA_RANGE); public static final PalettesVariantEntry DIORITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DIORITE, PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.DIORITE); + new PalettesVariantEntry(PaletteStoneVariants.DIORITE, PaletteBlockPattern.VANILLA_RANGE); public static final PalettesVariantEntry ANDESITE_VARIANTS = new PalettesVariantEntry(PaletteStoneVariants.ANDESITE, - PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.ANDESITE); + PaletteBlockPattern.VANILLA_RANGE); // Create stone variants @@ -119,7 +119,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry LIMESTONE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.LIMESTONE, PaletteBlockPattern.STANDARD_RANGE, LIMESTONE); + new PalettesVariantEntry(PaletteStoneVariants.LIMESTONE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry WEATHERED_LIMESTONE = REGISTRATE.baseBlock("weathered_limestone", Block::new, () -> Blocks.SANDSTONE, true) @@ -128,7 +128,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry WEATHERED_LIMESTONE_VARIANTS = new PalettesVariantEntry( - PaletteStoneVariants.WEATHERED_LIMESTONE, PaletteBlockPattern.STANDARD_RANGE, WEATHERED_LIMESTONE); + PaletteStoneVariants.WEATHERED_LIMESTONE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry DOLOMITE = REGISTRATE.baseBlock("dolomite", Block::new, () -> Blocks.QUARTZ_BLOCK, true) @@ -137,7 +137,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry DOLOMITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DOLOMITE, PaletteBlockPattern.STANDARD_RANGE, DOLOMITE); + new PalettesVariantEntry(PaletteStoneVariants.DOLOMITE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry GABBRO = REGISTRATE.baseBlock("gabbro", Block::new, () -> Blocks.ANDESITE, true) @@ -146,7 +146,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry GABBRO_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.GABBRO, PaletteBlockPattern.STANDARD_RANGE, GABBRO); + new PalettesVariantEntry(PaletteStoneVariants.GABBRO, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry SCORIA = REGISTRATE.baseBlock("scoria", Block::new, () -> Blocks.ANDESITE, true) @@ -163,7 +163,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry SCORIA_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.SCORIA, PaletteBlockPattern.STANDARD_RANGE, SCORIA); + new PalettesVariantEntry(PaletteStoneVariants.SCORIA, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry DARK_SCORIA = REGISTRATE.baseBlock("dark_scoria", Block::new, () -> Blocks.ANDESITE, false) @@ -171,7 +171,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry DARK_SCORIA_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DARK_SCORIA, PaletteBlockPattern.STANDARD_RANGE, DARK_SCORIA); + new PalettesVariantEntry(PaletteStoneVariants.DARK_SCORIA, PaletteBlockPattern.STANDARD_RANGE); private static NonNullBiConsumer cobblestoneLoot(PaletteStoneVariants variant) { return (loot, block) -> loot.add(block, RegistrateBlockLootTables.droppingWithSilkTouch(block, diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java index 91819c83d..72f3b6b56 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java @@ -30,16 +30,21 @@ import net.minecraft.block.RotatedPillarBlock; import net.minecraft.client.renderer.RenderType; import net.minecraft.data.CookingRecipeBuilder; import net.minecraft.data.ShapedRecipeBuilder; +import net.minecraft.item.Item; +import net.minecraft.tags.ITag; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.common.Tags; public class PaletteBlockPattern { public static final PaletteBlockPattern COBBLESTONE = create("cobblestone", SUFFIX, ALL_PARTIALS) + .blockTags(Tags.Blocks.COBBLESTONE) + .itemTags(Tags.Items.COBBLESTONE) .addRecipes(v -> (c, p) -> { DataIngredient ingredient = DataIngredient.items(c.get()); Block result = v.getBaseBlock().get(); @@ -111,6 +116,8 @@ public class PaletteBlockPattern { private String id; private boolean isTranslucent; private boolean hasFoliage; + private ITag.INamedTag[] blockTags; + private ITag.INamedTag[] itemTags; private Optional> ctBehaviour; private IPatternBlockStateGenerator blockStateGenerator; @@ -149,6 +156,14 @@ public class PaletteBlockPattern { return hasFoliage; } + public ITag.INamedTag[] getBlockTags() { + return blockTags; + } + + public ITag.INamedTag[] getItemTags() { + return itemTags; + } + public NonNullFunction getBlockFactory() { return blockFactory; } @@ -198,6 +213,18 @@ public class PaletteBlockPattern { return this; } + @SafeVarargs + private final PaletteBlockPattern blockTags(ITag.INamedTag... tags) { + blockTags = tags; + return this; + } + + @SafeVarargs + private final PaletteBlockPattern itemTags(ITag.INamedTag... tags) { + itemTags = tags; + return this; + } + private PaletteBlockPattern connectedTextures(Function factory) { this.ctBehaviour = Optional.of(factory); return this; @@ -300,7 +327,7 @@ public class PaletteBlockPattern { // Textures with connectability, used by Spriteshifter - public static enum CTs { + public enum CTs { POLISHED(CTType.OMNIDIRECTIONAL), LAYERED(CTType.HORIZONTAL) diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java b/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java index f15d019f3..e7933fcf1 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java @@ -2,6 +2,8 @@ package com.simibubi.create.content.palettes; import java.util.function.Supplier; +import com.tterrag.registrate.util.nullness.NonNullSupplier; + import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -19,15 +21,15 @@ public enum PaletteStoneVariants { ; - private Supplier> baseBlock; + private NonNullSupplier> baseBlock; private Supplier variants; - private PaletteStoneVariants(Supplier> baseBlock, Supplier variants) { + private PaletteStoneVariants(NonNullSupplier> baseBlock, Supplier variants) { this.baseBlock = baseBlock; this.variants = variants; } - public Supplier getBaseBlock() { + public NonNullSupplier getBaseBlock() { return baseBlock.get(); } diff --git a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java index cecd78294..62a91346a 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java +++ b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java @@ -3,32 +3,35 @@ package com.simibubi.create.content.palettes; import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures; import com.google.common.collect.ImmutableList; -import com.simibubi.create.AllTags; import com.simibubi.create.Create; import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.utility.ColorHandlers; import com.simibubi.create.foundation.utility.Lang; import com.tterrag.registrate.builders.BlockBuilder; +import com.tterrag.registrate.builders.ItemBuilder; import com.tterrag.registrate.util.DataIngredient; import com.tterrag.registrate.util.entry.BlockEntry; import com.tterrag.registrate.util.nullness.NonNullSupplier; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderType; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.tags.ITag; public class PalettesVariantEntry { - public ImmutableList> registeredBlocks; - public ImmutableList> registeredPartials; + public final ImmutableList> registeredBlocks; + public final ImmutableList> registeredPartials; - public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns, - NonNullSupplier initialProperties) { + public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns) { String name = Lang.asId(variant.name()); + NonNullSupplier initialProperties = variant.getBaseBlock(); ImmutableList.Builder> registeredBlocks = ImmutableList.builder(); ImmutableList.Builder> registeredPartials = ImmutableList.builder(); + CreateRegistrate registrate = Create.registrate(); for (PaletteBlockPattern pattern : patterns) { - CreateRegistrate registrate = Create.registrate(); BlockBuilder builder = registrate.block(pattern.createName(name), pattern.getBlockFactory()) .initialProperties(initialProperties) @@ -36,12 +39,24 @@ public class PalettesVariantEntry { .apply(pattern) .apply(name)::accept); + ItemBuilder> itemBuilder = + builder.item(); + + ITag.INamedTag[] blockTags = pattern.getBlockTags(); + if (blockTags != null) { + builder.tag(blockTags); + } + ITag.INamedTag[] itemTags = pattern.getItemTags(); + if (itemTags != null) { + itemBuilder.tag(itemTags); + } + if (pattern.isTranslucent()) builder.addLayer(() -> RenderType::translucent); - if (pattern == PaletteBlockPattern.COBBLESTONE) - builder.item().tag(AllTags.AllItemTags.COBBLESTONE.tag); - if (pattern.hasFoliage()) + if (pattern.hasFoliage()) { builder.color(() -> ColorHandlers::getGrassyBlock); + itemBuilder.color(() -> ColorHandlers::getGrassyItem); + } pattern.createCTBehaviour(variant) .ifPresent(b -> builder.onRegister(connectedTextures(b))); @@ -51,13 +66,7 @@ public class PalettesVariantEntry { pattern.addRecipes(variant, c, p); }); - if (pattern.hasFoliage()) - builder.item() - .color(() -> ColorHandlers::getGrassyItem) - .build(); - else - builder.simpleItem(); - + itemBuilder.register(); BlockEntry block = builder.register(); registeredBlocks.add(block); diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java index 3d64468c1..0d9e73822 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java @@ -1,9 +1,9 @@ package com.simibubi.create.content.schematics.block; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; +import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index c25d99b98..41edcf514 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -92,8 +92,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; @EventBusSubscriber(value = Dist.CLIENT) public class ClientEvents { - private static final String itemPrefix = "item." + Create.ID; - private static final String blockPrefix = "block." + Create.ID; + private static final String ITEM_PREFIX = "item." + Create.ID; + private static final String BLOCK_PREFIX = "block." + Create.ID; @SubscribeEvent public static void onTick(ClientTickEvent event) { @@ -243,7 +243,7 @@ public class ClientEvents { String translationKey = stack.getItem() .getDescriptionId(stack); - if (translationKey.startsWith(itemPrefix) || translationKey.startsWith(blockPrefix)) + if (translationKey.startsWith(ITEM_PREFIX) || translationKey.startsWith(BLOCK_PREFIX)) if (TooltipHelper.hasTooltip(stack, event.getPlayer())) { List itemTooltip = event.getToolTip(); List toolTip = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java index c6389a6cb..e3ab6d356 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java @@ -26,10 +26,10 @@ import net.minecraft.util.ResourceLocation; public abstract class CriterionTriggerBase implements ICriterionTrigger { public CriterionTriggerBase(String id) { - this.ID = new ResourceLocation(Create.ID, id); + this.id = Create.asResource(id); } - private final ResourceLocation ID; + private final ResourceLocation id; protected final Map>> listeners = Maps.newHashMap(); @Override @@ -57,7 +57,7 @@ public abstract class CriterionTriggerBase> suppliers) { diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java index 40d6bf434..c1cf56332 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java @@ -7,7 +7,7 @@ import com.simibubi.create.foundation.render.SuperByteBuffer; public abstract class CTSpriteShiftEntry extends SpriteShiftEntry { - int textureSheetSize; + protected int textureSheetSize; public CTSpriteShiftEntry(int sheetSize) { this.textureSheetSize = sheetSize; diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java index 2b09a995a..588656377 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java @@ -7,33 +7,25 @@ import net.minecraft.util.ResourceLocation; public class CTSpriteShifter extends SpriteShifter { - public enum CTType { - OMNIDIRECTIONAL, HORIZONTAL, VERTICAL, CROSS; + public static CTSpriteShiftEntry getCT(CTType type, ResourceLocation blockTexture, ResourceLocation connectedTexture) { + String key = type.name() + ":" + blockTexture + "->" + connectedTexture; + if (ENTRY_CACHE.containsKey(key)) + return (CTSpriteShiftEntry) ENTRY_CACHE.get(key); + + CTSpriteShiftEntry entry = create(type); + entry.set(blockTexture, connectedTexture); + ENTRY_CACHE.put(key, entry); + return entry; + } + + public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName, String connectedTextureName) { + return getCT(type, Create.asResource("block/" + blockTextureName), Create.asResource("block/" + connectedTextureName + "_connected")); } public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName) { return getCT(type, blockTextureName, blockTextureName); } - public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName, String connectedTextureName) { - return getCT(type, new ResourceLocation(Create.ID, "block/" + blockTextureName), connectedTextureName); - } - - public static CTSpriteShiftEntry getCT(CTType type, ResourceLocation blockTexture, String connectedTextureName) { - String targetLocation = "block/" + connectedTextureName + "_connected"; - String key = - type.name() + ":" + blockTexture.getNamespace() + ":" + blockTexture.getPath() + "->" + targetLocation; - if (textures.containsKey(key)) - return (CTSpriteShiftEntry) textures.get(key); - - CTSpriteShiftEntry entry = create(type); - ResourceLocation targetTextureLocation = new ResourceLocation(Create.ID, targetLocation); - entry.set(blockTexture, targetTextureLocation); - - textures.put(key, entry); - return entry; - } - private static CTSpriteShiftEntry create(CTType type) { switch (type) { case HORIZONTAL: @@ -49,4 +41,8 @@ public class CTSpriteShifter extends SpriteShifter { } } + public enum CTType { + OMNIDIRECTIONAL, HORIZONTAL, VERTICAL, CROSS; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java b/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java index a4f0d19c4..d1e88676e 100644 --- a/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java +++ b/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java @@ -11,26 +11,29 @@ import net.minecraft.util.ResourceLocation; public class SpriteShifter { - protected static Map textures = new HashMap<>(); + protected static final Map ENTRY_CACHE = new HashMap<>(); - public static SpriteShiftEntry get(String originalLocation, String targetLocation) { + public static SpriteShiftEntry get(ResourceLocation originalLocation, ResourceLocation targetLocation) { String key = originalLocation + "->" + targetLocation; - if (textures.containsKey(key)) - return textures.get(key); + if (ENTRY_CACHE.containsKey(key)) + return ENTRY_CACHE.get(key); SpriteShiftEntry entry = new SpriteShiftEntry(); - entry.originalTextureLocation = new ResourceLocation(Create.ID, originalLocation); - entry.targetTextureLocation = new ResourceLocation(Create.ID, targetLocation); - textures.put(key, entry); + entry.set(originalLocation, targetLocation); + ENTRY_CACHE.put(key, entry); return entry; } + public static SpriteShiftEntry get(String originalLocation, String targetLocation) { + return get(Create.asResource(originalLocation), Create.asResource(targetLocation)); + } + public static void reloadUVs() { - textures.values().forEach(SpriteShiftEntry::loadTextures); + ENTRY_CACHE.values().forEach(SpriteShiftEntry::loadTextures); } public static List getAllTargetSprites() { - return textures.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList()); + return ENTRY_CACHE.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList()); } } diff --git a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java index be2439fb0..7f837a738 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java +++ b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java @@ -22,8 +22,8 @@ import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelItem; import com.simibubi.create.content.logistics.block.inventories.CrateBlock; -import com.simibubi.create.foundation.block.ItemUseOverrides; import com.simibubi.create.foundation.block.BlockStressDefaults; +import com.simibubi.create.foundation.block.ItemUseOverrides; import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry; import com.tterrag.registrate.builders.BlockBuilder; import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; diff --git a/src/main/java/com/simibubi/create/foundation/data/ModelGen.java b/src/main/java/com/simibubi/create/foundation/data/ModelGen.java index ff8cf6679..b99a63bb1 100644 --- a/src/main/java/com/simibubi/create/foundation/data/ModelGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/ModelGen.java @@ -21,7 +21,7 @@ public class ModelGen { public static ModelFile createOvergrown(DataGenContext ctx, BlockStateProvider prov, ResourceLocation side, ResourceLocation top, ResourceLocation bottom, ResourceLocation overlay) { return prov.models() - .withExistingParent(ctx.getName(), new ResourceLocation(Create.ID, "block/overgrown")) + .withExistingParent(ctx.getName(), Create.asResource("block/overgrown")) .texture("particle", side) .texture("side", side) .texture("top", top) diff --git a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java index 8139a6f9b..2e3c6dbc6 100644 --- a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java @@ -213,7 +213,7 @@ public class WindowGen { .loot((t, g) -> t.dropWhenSilkTouch(g)) .item() .tag(Tags.Items.GLASS_PANES) - .model((c, p) -> p.withExistingParent(c.getName(), new ResourceLocation(Create.ID, "item/pane")) + .model((c, p) -> p.withExistingParent(c.getName(), Create.asResource("item/pane")) .texture("pane", sideTexture) .texture("edge", topTexture)) .build() diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 3998c7258..9ff757fdf 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -120,7 +120,7 @@ public enum AllGuiTextures implements IScreenRenderable { } private AllGuiTextures(String location, int startX, int startY, int width, int height) { - this.location = new ResourceLocation(Create.ID, "textures/gui/" + location); + this.location = Create.asResource("textures/gui/" + location); this.width = width; this.height = height; this.startX = startX; diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index 571838583..2b8bac433 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate.SpeedLevel; diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index 81c9a9a2a..06add7c5e 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -25,8 +25,8 @@ import com.simibubi.create.content.curiosities.bell.SoulPulseEffectPacket; import com.simibubi.create.content.curiosities.symmetry.SymmetryEffectPacket; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; import com.simibubi.create.content.curiosities.tools.ExtendoGripInteractionPacket; -import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.weapons.PotatoCannonPacket; +import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.zapper.ZapperBeamPacket; import com.simibubi.create.content.logistics.block.depot.EjectorElytraPacket; import com.simibubi.create.content.logistics.block.depot.EjectorPlacementPacket; @@ -122,8 +122,8 @@ public enum AllPackets { ; - public static final ResourceLocation CHANNEL_NAME = new ResourceLocation(Create.ID, "network"); - public static final String NETWORK_VERSION = new ResourceLocation(Create.ID, "1").toString(); + public static final ResourceLocation CHANNEL_NAME = Create.asResource("network"); + public static final String NETWORK_VERSION = Create.asResource("1").toString(); public static SimpleChannel channel; private LoadedPacket packet; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java index 8b5bb3d97..9201555e2 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java @@ -34,6 +34,10 @@ public class PonderLocalization { TAG.put(key, Couple.create(enUS, description)); } + public static void registerChapter(ResourceLocation key, String enUS) { + CHAPTER.put(key, enUS); + } + public static void registerSpecific(ResourceLocation sceneId, String key, String enUS) { SPECIFIC.computeIfAbsent(sceneId, $ -> new HashMap<>()) .put(key, enUS); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java index b91839fd8..c6a644f22 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java @@ -13,6 +13,8 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import javax.annotation.Nullable; + import org.apache.commons.lang3.mutable.MutableDouble; import org.apache.commons.lang3.mutable.MutableObject; @@ -52,8 +54,6 @@ import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; import net.minecraft.util.math.vector.Vector4f; -import javax.annotation.Nullable; - public class PonderScene { public static final String TITLE_KEY = "header"; diff --git a/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java index 82e1a5928..4017777fc 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java @@ -32,9 +32,9 @@ public class AllMaterialSpecs { } public static class Locations { - public static final ResourceLocation ROTATING = new ResourceLocation(Create.ID, "rotating"); - public static final ResourceLocation BELTS = new ResourceLocation(Create.ID, "belts"); - public static final ResourceLocation ACTORS = new ResourceLocation(Create.ID, "actors"); - public static final ResourceLocation FLAPS = new ResourceLocation(Create.ID, "flaps"); + public static final ResourceLocation ROTATING = Create.asResource("rotating"); + public static final ResourceLocation BELTS = Create.asResource("belts"); + public static final ResourceLocation ACTORS = Create.asResource("actors"); + public static final ResourceLocation FLAPS = Create.asResource("flaps"); } } diff --git a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java index 6df22f622..5dd47e831 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java @@ -1,19 +1,16 @@ package com.simibubi.create.foundation.render; -import com.simibubi.create.Create; +import static com.simibubi.create.Create.asResource; import net.minecraft.util.ResourceLocation; public class AllProgramSpecs { - public static final ResourceLocation ROTATING = loc("rotating"); - public static final ResourceLocation CHROMATIC = loc("chromatic"); - public static final ResourceLocation BELT = loc("belt"); - public static final ResourceLocation FLAPS = loc("flap"); - public static final ResourceLocation STRUCTURE = loc("contraption_structure"); - public static final ResourceLocation ACTOR = loc("contraption_actor"); + public static final ResourceLocation ROTATING = asResource("rotating"); + public static final ResourceLocation CHROMATIC = asResource("chromatic"); + public static final ResourceLocation BELT = asResource("belt"); + public static final ResourceLocation FLAPS = asResource("flap"); + public static final ResourceLocation STRUCTURE = asResource("contraption_structure"); + public static final ResourceLocation ACTOR = asResource("contraption_actor"); - private static ResourceLocation loc(String name) { - return new ResourceLocation(Create.ID, name); - } } diff --git a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java index 59aa3eb15..9c925cd74 100644 --- a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java +++ b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation; public class RainbowDebugStateProvider implements IBooleanStateProvider { public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider(); - public static final ResourceLocation NAME = new ResourceLocation(Create.ID, "rainbow_debug"); + public static final ResourceLocation NAME = Create.asResource("rainbow_debug"); protected RainbowDebugStateProvider() { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java index 0483e85e5..7eb8241ac 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java @@ -1,5 +1,7 @@ package com.simibubi.create.foundation.tileEntity; +import java.util.ConcurrentModificationException; + import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; @@ -10,8 +12,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -import java.util.ConcurrentModificationException; - public abstract class TileEntityBehaviour { public SmartTileEntity tileEntity; diff --git a/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java b/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java index 04c4645e6..20555bdb3 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java +++ b/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java @@ -4,10 +4,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import net.minecraft.world.IWorld; import net.minecraftforge.common.util.NonNullFunction; From 8e1a93124cd7bd7f3b4137711585a8079ec3a07b Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Sun, 3 Oct 2021 12:01:22 -0400 Subject: [PATCH 10/22] Add create honey bucket to a forge tag Me and a few other bee mods are trying to standardize where honey buckets should go for better mod compat. Hence this pr to put create's honey bucket into forge:buckets/honey item tag. The Bumblezone and Productive Bee's are going to have their honey buckets in that same place too very soon --- src/main/resources/data/forge/tags/items/buckets/honey.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/main/resources/data/forge/tags/items/buckets/honey.json diff --git a/src/main/resources/data/forge/tags/items/buckets/honey.json b/src/main/resources/data/forge/tags/items/buckets/honey.json new file mode 100644 index 000000000..47f91b376 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/buckets/honey.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:honey_bucket" + ] +} From 1abc3a8bf9e63ab22823fe78bfa3c6d2f370b19b Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Thu, 7 Oct 2021 00:05:35 -0700 Subject: [PATCH 11/22] Safe networking and more tag datagen - Remove NbtPacket and add safe packets for configuring symmetry wand and worldshaper separately - Expand internal functionality of AllTags and use optional tags in most cases - Datagen tags forge:stone, forge:wg_stone, and forge:buckets/honey - Fix attribute filter screen being shifted by one pixel - Add translations for "fluid_container" and "renamed" item attributes --- src/generated/resources/.cache/cache | 32 +-- .../resources/assets/create/lang/en_us.json | 50 +++-- .../assets/create/lang/unfinished/de_de.json | 52 +++-- .../assets/create/lang/unfinished/es_es.json | 52 +++-- .../assets/create/lang/unfinished/fr_fr.json | 52 +++-- .../assets/create/lang/unfinished/it_it.json | 52 +++-- .../assets/create/lang/unfinished/ja_jp.json | 52 +++-- .../assets/create/lang/unfinished/ko_kr.json | 52 +++-- .../assets/create/lang/unfinished/nl_nl.json | 52 +++-- .../assets/create/lang/unfinished/pl_pl.json | 52 +++-- .../assets/create/lang/unfinished/pt_br.json | 52 +++-- .../assets/create/lang/unfinished/ru_ru.json | 52 +++-- .../assets/create/lang/unfinished/zh_cn.json | 52 +++-- .../assets/create/lang/unfinished/zh_tw.json | 52 +++-- .../data/create/advancements/aesthetics.json | 4 +- .../data/forge/tags/blocks}/stone.json | 4 +- .../data/forge/tags/blocks/wg_stone.json | 2 +- .../data/forge/tags/items/buckets/honey.json | 2 +- .../data/forge/tags/items}/stone.json | 4 +- .../java/com/simibubi/create/AllFluids.java | 3 + .../java/com/simibubi/create/AllTags.java | 208 ++++++++++++------ .../symmetry/ConfigureSymmetryWandPacket.java | 50 +++++ .../symmetry/SymmetryWandItem.java | 7 +- .../symmetry/SymmetryWandScreen.java | 16 +- .../zapper/ConfigureZapperPacket.java | 51 +++++ .../curiosities/zapper/PlacementPatterns.java | 4 +- .../curiosities/zapper/ZapperItem.java | 12 +- .../curiosities/zapper/ZapperScreen.java | 49 ++--- .../ConfigureWorldshaperPacket.java | 55 +++++ .../zapper/terrainzapper/WorldshaperItem.java | 14 +- .../terrainzapper/WorldshaperScreen.java | 202 ++++++++--------- .../item/filter/AttributeFilterScreen.java | 2 +- .../logistics/item/filter/ItemAttribute.java | 6 +- .../content/palettes/AllPaletteBlocks.java | 21 +- .../content/palettes/PaletteBlockPattern.java | 2 + .../content/palettes/ScoriaVertexColor.java | 2 + .../palettes/StandardFoliageColorHandler.java | 20 -- .../foundation/data/CreateRegistrate.java | 25 ++- .../foundation/networking/AllPackets.java | 5 +- .../foundation/networking/NbtPacket.java | 73 ------ .../foundation/utility/EmptyNamedTag.java | 40 ---- .../create/foundation/utility/NBTHelper.java | 15 +- .../assets/create/lang/default/messages.json | 56 ++--- 43 files changed, 928 insertions(+), 732 deletions(-) rename src/{main/resources/data/forge/tags/items => generated/resources/data/forge/tags/blocks}/stone.json (100%) rename src/{main => generated}/resources/data/forge/tags/blocks/wg_stone.json (100%) rename src/{main => generated}/resources/data/forge/tags/items/buckets/honey.json (97%) rename src/{main/resources/data/forge/tags/blocks => generated/resources/data/forge/tags/items}/stone.json (100%) create mode 100644 src/main/java/com/simibubi/create/content/curiosities/symmetry/ConfigureSymmetryWandPacket.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/zapper/ConfigureZapperPacket.java create mode 100644 src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/ConfigureWorldshaperPacket.java delete mode 100644 src/main/java/com/simibubi/create/content/palettes/StandardFoliageColorHandler.java delete mode 100644 src/main/java/com/simibubi/create/foundation/networking/NbtPacket.java delete mode 100644 src/main/java/com/simibubi/create/foundation/utility/EmptyNamedTag.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index fb2fc5102..05cc63bbb 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -426,19 +426,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json fb760b12b4bc8114744d3acc6a597b2fad88d988 assets/create/lang/en_ud.json -fcd58b47e3fbe4039ea684dadd08d36bd0beaa7d assets/create/lang/en_us.json -2047ce757fe7b7d279b72c5d4d8d6f111e478b2f assets/create/lang/unfinished/de_de.json -3cb5a941527ad3981a094cb2599a28aa654c15b3 assets/create/lang/unfinished/es_es.json -008a67a90fc7d6d59d98c3ac4f4cd45cb47fbcc2 assets/create/lang/unfinished/fr_fr.json -80091dc7ed4ed81a18bce6e9fa0b5fc870a70c89 assets/create/lang/unfinished/it_it.json -a12b0fabb18a0bc7e50ad4e6760aa0a3f222edaf assets/create/lang/unfinished/ja_jp.json -e49e3d4cfcd43194e3904c94a167bc98179b40ff assets/create/lang/unfinished/ko_kr.json -47fa6e25a19d0f8c86178954da4b50aaec247ef4 assets/create/lang/unfinished/nl_nl.json -64581657991641f49c5888e379157939cb5bdc3c assets/create/lang/unfinished/pl_pl.json -d3f22a7ee26461f1369f100001098b9f165b7cb5 assets/create/lang/unfinished/pt_br.json -c2b821bd4c0b09ba0f255c40bcd379b9ad864f10 assets/create/lang/unfinished/ru_ru.json -c43f76c83bbd9c7ac9cd8ac7f82fa1b98347771b assets/create/lang/unfinished/zh_cn.json -e797c8d5e89b9ecc6bf82858a1c905f8b905da16 assets/create/lang/unfinished/zh_tw.json +c34c047c7d8f62efe3f9d92cdbd0b0c385ac77b8 assets/create/lang/en_us.json +26247b4e7fed5a2ec981bf5b1a42e6b338b9471c assets/create/lang/unfinished/de_de.json +57e52ca3bc790adc4e9137c3af355fe8c94cf597 assets/create/lang/unfinished/es_es.json +327f1b4f91eb83cad038c80f6dbedaba27bd9135 assets/create/lang/unfinished/fr_fr.json +ffd5ddcc1be89e5bb1ee2314791bd537a5940ef0 assets/create/lang/unfinished/it_it.json +9a7add1a53719d02edf1a2287047e88c336ece9b assets/create/lang/unfinished/ja_jp.json +a0791d3c782354a6cd8efce2e89fe0cc0fa9ffba assets/create/lang/unfinished/ko_kr.json +2d541c648e723b0749cc54d987ed6606343ce90d assets/create/lang/unfinished/nl_nl.json +d9a9dca70e96099fb3fdb2a68b9e75a63b7adb7c assets/create/lang/unfinished/pl_pl.json +1e1e951a23dbc3fab963b84b25a35b2dd1f3f1eb assets/create/lang/unfinished/pt_br.json +3ed90c03bd5e2c7f38e1939ab53a935901378431 assets/create/lang/unfinished/ru_ru.json +111ded42981e258ddc6462404eda1338c67c3aa4 assets/create/lang/unfinished/zh_cn.json +75b898e606bc74d7801b300b7e4c25a2c351be27 assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json @@ -1699,7 +1699,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json 58880e397902f8ca5b3b59ed4423e626109ddc4c assets/create/sounds.json -0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json +5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json @@ -3763,14 +3763,17 @@ bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json 4b700ee8aa748c2ec70c29ef1589844879c0deae data/forge/tags/blocks/ores.json 4a0b13a9835106de9a1dd0a71a02372abb48e7b6 data/forge/tags/blocks/ores/copper.json d5ea262a0f5fb210612d22521818e26cf08e591a data/forge/tags/blocks/ores/zinc.json +55196ee770ad20602211e26864dd62a58b2e985c data/forge/tags/blocks/stone.json 508730d3822c54d355329bf6a33d58071653afad data/forge/tags/blocks/storage_blocks.json ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/blocks/storage_blocks/brass.json f6c8f34ceb475546dba5cc6ff288863ea795d20b data/forge/tags/blocks/storage_blocks/copper.json 7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/blocks/storage_blocks/zinc.json +2072c51afc5bbc6c9d64fd086803193d8a3c40de data/forge/tags/blocks/wg_stone.json 6b73c57912934d09233ad2966110968a6109f2c9 data/forge/tags/fluids/chocolate.json 391c9b2be5740aea943a8a5fe27eb327e2d973b0 data/forge/tags/fluids/honey.json d6a4e4fe1204b718010543a28a9b9ec4e0977bd7 data/forge/tags/fluids/tea.json d9ffc62a496946fc4848934e7c0a6e917337f8be data/forge/tags/items/beacon_payment.json +5af3164b14c92d2d6e235b5d4eebd93cbee37c0a data/forge/tags/items/buckets/honey.json 05ca51cdc60a5e109b5a0e3b782de13d34ebcb24 data/forge/tags/items/cobblestone.json 16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data/forge/tags/items/glass/colorless.json 81d3eb40b048160fcc2d6bb7ff12b49276297efd data/forge/tags/items/glass_panes.json @@ -3790,6 +3793,7 @@ d5ea262a0f5fb210612d22521818e26cf08e591a data/forge/tags/items/ores/zinc.json c3dab5fe379bc1b7b10d4a0ba7009eee1b75a27c data/forge/tags/items/plates/copper.json fb9bfb4c84ed9cf2da8c4b2fbc4cd4d9f37d3016 data/forge/tags/items/plates/gold.json 04d947ed7a5066f3cfe75a8dc564fe2dca8a9c93 data/forge/tags/items/plates/iron.json +55196ee770ad20602211e26864dd62a58b2e985c data/forge/tags/items/stone.json 508730d3822c54d355329bf6a33d58071653afad data/forge/tags/items/storage_blocks.json ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/brass.json f6c8f34ceb475546dba5cc6ff288863ea795d20b data/forge/tags/items/storage_blocks/copper.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 3b240d38c..44d3f3877 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1037,18 +1037,14 @@ "create.item_attributes.placeable.inverted": "is not placeable", "create.item_attributes.consumable": "can be eaten", "create.item_attributes.consumable.inverted": "cannot be eaten", - "create.item_attributes.smeltable": "can be Smelted", - "create.item_attributes.smeltable.inverted": "cannot be Smelted", - "create.item_attributes.washable": "can be Washed", - "create.item_attributes.washable.inverted": "cannot be Washed", - "create.item_attributes.smokable": "can be Smoked", - "create.item_attributes.smokable.inverted": "cannot be Smoked", - "create.item_attributes.crushable": "can be Crushed", - "create.item_attributes.crushable.inverted": "cannot be Crushed", - "create.item_attributes.blastable": "is smeltable in Blast Furnace", - "create.item_attributes.blastable.inverted": "is not smeltable in Blast Furnace", + "create.item_attributes.fluid_container": "can store fluids", + "create.item_attributes.fluid_container.inverted": "cannot store fluids", "create.item_attributes.enchanted": "is enchanted", "create.item_attributes.enchanted.inverted": "is unenchanted", + "create.item_attributes.max_enchanted": "is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "is not enchanted at max level", + "create.item_attributes.renamed": "has a custom name", + "create.item_attributes.renamed.inverted": "does not have a custom name", "create.item_attributes.damaged": "is damaged", "create.item_attributes.damaged.inverted": "is not damaged", "create.item_attributes.badly_damaged": "is heavily damaged", @@ -1059,23 +1055,31 @@ "create.item_attributes.equipable.inverted": "cannot be equipped", "create.item_attributes.furnace_fuel": "is furnace fuel", "create.item_attributes.furnace_fuel.inverted": "is not furnace fuel", + "create.item_attributes.washable": "can be Washed", + "create.item_attributes.washable.inverted": "cannot be Washed", + "create.item_attributes.crushable": "can be Crushed", + "create.item_attributes.crushable.inverted": "cannot be Crushed", + "create.item_attributes.smeltable": "can be Smelted", + "create.item_attributes.smeltable.inverted": "cannot be Smelted", + "create.item_attributes.smokable": "can be Smoked", + "create.item_attributes.smokable.inverted": "cannot be Smoked", + "create.item_attributes.blastable": "is smeltable in Blast Furnace", + "create.item_attributes.blastable.inverted": "is not smeltable in Blast Furnace", + "create.item_attributes.shulker_level": "is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "is shulker not %1$s", + "create.item_attributes.shulker_level.full": "full", + "create.item_attributes.shulker_level.empty": "empty", + "create.item_attributes.shulker_level.partial": "partially filled", "create.item_attributes.in_tag": "is tagged %1$s", "create.item_attributes.in_tag.inverted": "is not tagged %1$s", "create.item_attributes.in_item_group": "is in group '%1$s'", "create.item_attributes.in_item_group.inverted": "is not in group '%1$s'", "create.item_attributes.added_by": "was added by %1$s", "create.item_attributes.added_by.inverted": "was not added by %1$s", - "create.item_attributes.shulker_level": "is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "is shulker not %1$s", - "create.item_attributes.shulker_level.full": "full", - "create.item_attributes.shulker_level.empty": "empty", - "create.item_attributes.shulker_level.partial": "partially filled", "create.item_attributes.has_enchant": "is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "is not enchanted with %1$s", "create.item_attributes.color": "is dyed %1$s", "create.item_attributes.color.inverted": "is not dyed %1$s", - "create.item_attributes.max_enchanted": "is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "is not enchanted at max level", "create.item_attributes.has_fluid": "contains %1$s", "create.item_attributes.has_fluid.inverted": "does not contain %1$s", "create.item_attributes.has_name": "has the custom name %1$s", @@ -1090,14 +1094,14 @@ "create.item_attributes.book_copy_second.inverted": "is not a second-generation copy", "create.item_attributes.book_copy_tattered": "is a tattered mess", "create.item_attributes.book_copy_tattered.inverted": "is not a tattered mess", - "create.item_attributes.astralsorcery_crystal": "has crystal attribute %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "does not have crystal attribute %1$s", - "create.item_attributes.astralsorcery_constellation": "is attuned to %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "is not attuned to %1$s", - "create.item_attributes.astralsorcery_perk_gem": "has perk attribute %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "does not have perk attribute %1$s", "create.item_attributes.astralsorcery_amulet": "improves %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "does not improve %1$s", + "create.item_attributes.astralsorcery_constellation": "is attuned to %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "is not attuned to %1$s", + "create.item_attributes.astralsorcery_crystal": "has crystal attribute %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "does not have crystal attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem": "has perk attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "does not have perk attribute %1$s", "create.gui.attribute_filter.no_selected_attributes": "No attributes selected", "create.gui.attribute_filter.selected_attributes": "Selected attributes:", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index fd2077686..8e97e08aa 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1135", + "_": "Missing Localizations: 1139", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "UNLOCALIZED: is not placeable", "create.item_attributes.consumable": "UNLOCALIZED: can be eaten", "create.item_attributes.consumable.inverted": "UNLOCALIZED: cannot be eaten", - "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", - "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", - "create.item_attributes.washable": "UNLOCALIZED: can be Washed", - "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", - "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", - "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", - "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", - "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", - "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", - "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "UNLOCALIZED: is enchanted", "create.item_attributes.enchanted.inverted": "UNLOCALIZED: is unenchanted", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "UNLOCALIZED: is damaged", "create.item_attributes.damaged.inverted": "UNLOCALIZED: is not damaged", "create.item_attributes.badly_damaged": "UNLOCALIZED: is heavily damaged", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "UNLOCALIZED: cannot be equipped", "create.item_attributes.furnace_fuel": "UNLOCALIZED: is furnace fuel", "create.item_attributes.furnace_fuel.inverted": "UNLOCALIZED: is not furnace fuel", + "create.item_attributes.washable": "UNLOCALIZED: can be Washed", + "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", + "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", + "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", + "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", + "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", + "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", + "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", + "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", + "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "UNLOCALIZED: is tagged %1$s", "create.item_attributes.in_tag.inverted": "UNLOCALIZED: is not tagged %1$s", "create.item_attributes.in_item_group": "UNLOCALIZED: is in group '%1$s'", "create.item_attributes.in_item_group.inverted": "UNLOCALIZED: is not in group '%1$s'", "create.item_attributes.added_by": "UNLOCALIZED: was added by %1$s", "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", - "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "UNLOCALIZED: is not a second-generation copy", "create.item_attributes.book_copy_tattered": "UNLOCALIZED: is a tattered mess", "create.item_attributes.book_copy_tattered.inverted": "UNLOCALIZED: is not a tattered mess", - "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", - "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", - "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.item_attributes.astralsorcery_amulet": "UNLOCALIZED: improves %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "UNLOCALIZED: does not improve %1$s", + "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", + "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.gui.attribute_filter.no_selected_attributes": "Keine Attribute ausgewählt", "create.gui.attribute_filter.selected_attributes": "Ausgewählte Attribute:", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 6e7652f4d..f7fa9d802 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1", + "_": "Missing Localizations: 5", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "no se puede colocar", "create.item_attributes.consumable": "se puede comer", "create.item_attributes.consumable.inverted": "no se puede comer", - "create.item_attributes.smeltable": "se puede fundir", - "create.item_attributes.smeltable.inverted": "no se puede fundir", - "create.item_attributes.washable": "se puede lavar", - "create.item_attributes.washable.inverted": "no se puede lavar", - "create.item_attributes.smokable": "puede ser ahumado", - "create.item_attributes.smokable.inverted": "no puede ser ahumado", - "create.item_attributes.crushable": "puede ser molido", - "create.item_attributes.crushable.inverted": "no puede ser molido", - "create.item_attributes.blastable": "es fundible en el alto horno", - "create.item_attributes.blastable.inverted": "no es fundible en el alto horno", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "está encantado", "create.item_attributes.enchanted.inverted": "no está encantado", + "create.item_attributes.max_enchanted": "está encantado en el nivel máximo", + "create.item_attributes.max_enchanted.inverted": "no está encantado en el nivel máximo", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "está dañado", "create.item_attributes.damaged.inverted": "no está dañado", "create.item_attributes.badly_damaged": "está muy dañado", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "no se puede equipar", "create.item_attributes.furnace_fuel": "es combustible para hornos", "create.item_attributes.furnace_fuel.inverted": "no es combustible para hornos", + "create.item_attributes.washable": "se puede lavar", + "create.item_attributes.washable.inverted": "no se puede lavar", + "create.item_attributes.crushable": "puede ser molido", + "create.item_attributes.crushable.inverted": "no puede ser molido", + "create.item_attributes.smeltable": "se puede fundir", + "create.item_attributes.smeltable.inverted": "no se puede fundir", + "create.item_attributes.smokable": "puede ser ahumado", + "create.item_attributes.smokable.inverted": "no puede ser ahumado", + "create.item_attributes.blastable": "es fundible en el alto horno", + "create.item_attributes.blastable.inverted": "no es fundible en el alto horno", + "create.item_attributes.shulker_level": "es shulker %1$s", + "create.item_attributes.shulker_level.inverted": "no es shulker %1$s", + "create.item_attributes.shulker_level.full": "lleno", + "create.item_attributes.shulker_level.empty": "vacío", + "create.item_attributes.shulker_level.partial": "parcialmente lleno", "create.item_attributes.in_tag": "está etiquetado %1$s", "create.item_attributes.in_tag.inverted": "no está etiquetado %1$s", "create.item_attributes.in_item_group": "está en el grupo '%1$s'", "create.item_attributes.in_item_group.inverted": "no está en el grupo '%1$s'", "create.item_attributes.added_by": "fue añadido por %1$s", "create.item_attributes.added_by.inverted": "no fue añadida por %1$s", - "create.item_attributes.shulker_level": "es shulker %1$s", - "create.item_attributes.shulker_level.inverted": "no es shulker %1$s", - "create.item_attributes.shulker_level.full": "lleno", - "create.item_attributes.shulker_level.empty": "vacío", - "create.item_attributes.shulker_level.partial": "parcialmente lleno", "create.item_attributes.has_enchant": "está encantado con %1$s", "create.item_attributes.has_enchant.inverted": "no está encantado con %1$s", "create.item_attributes.color": "Está teñido %1$s", "create.item_attributes.color.inverted": "No está teñido %1$s", - "create.item_attributes.max_enchanted": "está encantado en el nivel máximo", - "create.item_attributes.max_enchanted.inverted": "no está encantado en el nivel máximo", "create.item_attributes.has_fluid": "contiene %1$s", "create.item_attributes.has_fluid.inverted": "no contiene %1$s", "create.item_attributes.has_name": "tiene el nombre personalizado %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "no es una copia de segunda generación", "create.item_attributes.book_copy_tattered": "es un desordenado desastre", "create.item_attributes.book_copy_tattered.inverted": "no es un desordenado desastre", - "create.item_attributes.astralsorcery_crystal": "tiene el atributo de cristal %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "no tiene atributo de cristal %1$s", - "create.item_attributes.astralsorcery_constellation": "está en sintonía con %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "no está en sintonía con %1$s", - "create.item_attributes.astralsorcery_perk_gem": "tiene el atributo ventaja %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "no tiene el atributo ventaja %1$s", "create.item_attributes.astralsorcery_amulet": "mejora %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "no mejora %1$s", + "create.item_attributes.astralsorcery_constellation": "está en sintonía con %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "no está en sintonía con %1$s", + "create.item_attributes.astralsorcery_crystal": "tiene el atributo de cristal %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "no tiene atributo de cristal %1$s", + "create.item_attributes.astralsorcery_perk_gem": "tiene el atributo ventaja %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "no tiene el atributo ventaja %1$s", "create.gui.attribute_filter.no_selected_attributes": "No hay atributos seleccionados", "create.gui.attribute_filter.selected_attributes": "Atributos seleccionados:", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 73fadc258..f84752e78 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1387", + "_": "Missing Localizations: 1391", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "n'est pas plaçable", "create.item_attributes.consumable": "peut être mangé", "create.item_attributes.consumable.inverted": "ne peut pas être mangé", - "create.item_attributes.smeltable": "peut être fondu", - "create.item_attributes.smeltable.inverted": "ne peut pas être fondu", - "create.item_attributes.washable": "peut être lavé", - "create.item_attributes.washable.inverted": "ne peut pas être lavé", - "create.item_attributes.smokable": "peut être fumé", - "create.item_attributes.smokable.inverted": "ne peut pas être fumé", - "create.item_attributes.crushable": "peut être concassé", - "create.item_attributes.crushable.inverted": "ne peut pas être concassé", - "create.item_attributes.blastable": "est fondable dans un Haut fourneau", - "create.item_attributes.blastable.inverted": "n'est pas fondable dans un Haut fourneau", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "est enchanté", "create.item_attributes.enchanted.inverted": "n'est pas enchanté", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "est endommagé", "create.item_attributes.damaged.inverted": "n'est pas endomagé", "create.item_attributes.badly_damaged": "est fortement damaged", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "ne peut pas être équipé", "create.item_attributes.furnace_fuel": "est du combustible", "create.item_attributes.furnace_fuel.inverted": "n'est pas un combustible", + "create.item_attributes.washable": "peut être lavé", + "create.item_attributes.washable.inverted": "ne peut pas être lavé", + "create.item_attributes.crushable": "peut être concassé", + "create.item_attributes.crushable.inverted": "ne peut pas être concassé", + "create.item_attributes.smeltable": "peut être fondu", + "create.item_attributes.smeltable.inverted": "ne peut pas être fondu", + "create.item_attributes.smokable": "peut être fumé", + "create.item_attributes.smokable.inverted": "ne peut pas être fumé", + "create.item_attributes.blastable": "est fondable dans un Haut fourneau", + "create.item_attributes.blastable.inverted": "n'est pas fondable dans un Haut fourneau", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "est étiqueté %1$s", "create.item_attributes.in_tag.inverted": "n'est pas étiqueté", "create.item_attributes.in_item_group": "appartient à %1$s", "create.item_attributes.in_item_group.inverted": "n'appartient pas à %1$s'", "create.item_attributes.added_by": "a été ajouté par %1$s", "create.item_attributes.added_by.inverted": "n'a pas été ajouté par %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "est enchanté %1$s", "create.item_attributes.has_enchant.inverted": "n'est pas enchenté %1$s", "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", - "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "contient %1$s", "create.item_attributes.has_fluid.inverted": "ne contient pas %1$s", "create.item_attributes.has_name": "est renommé %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "UNLOCALIZED: is not a second-generation copy", "create.item_attributes.book_copy_tattered": "UNLOCALIZED: is a tattered mess", "create.item_attributes.book_copy_tattered.inverted": "UNLOCALIZED: is not a tattered mess", - "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", - "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", - "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.item_attributes.astralsorcery_amulet": "UNLOCALIZED: improves %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "UNLOCALIZED: does not improve %1$s", + "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", + "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.gui.attribute_filter.no_selected_attributes": "Aucun attribut sélectionné", "create.gui.attribute_filter.selected_attributes": "Attributs sélectionnés:", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index e6df80ea8..efebfb7f9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 915", + "_": "Missing Localizations: 919", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "non è posizionabile", "create.item_attributes.consumable": "è commestibile", "create.item_attributes.consumable.inverted": "non è commestibile", - "create.item_attributes.smeltable": "può essere fuso", - "create.item_attributes.smeltable.inverted": "non può essere fuso", - "create.item_attributes.washable": "può essere lavato", - "create.item_attributes.washable.inverted": "non può essere lavato", - "create.item_attributes.smokable": "può essere affumicato", - "create.item_attributes.smokable.inverted": "non può essere affumicato", - "create.item_attributes.crushable": "può essere frantumato", - "create.item_attributes.crushable.inverted": "non può essere frantumato", - "create.item_attributes.blastable": "è fondibile in un forno fusorio", - "create.item_attributes.blastable.inverted": "non è fondibile in un forno fusorio", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "è incantato", "create.item_attributes.enchanted.inverted": "non è incantato", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "è danneggiato", "create.item_attributes.damaged.inverted": "non è danneggiato", "create.item_attributes.badly_damaged": "è gravemente danneggiato", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "non può essere equipaggiato", "create.item_attributes.furnace_fuel": "è un combustibile per fornace", "create.item_attributes.furnace_fuel.inverted": "non è un combustibile per fornace", + "create.item_attributes.washable": "può essere lavato", + "create.item_attributes.washable.inverted": "non può essere lavato", + "create.item_attributes.crushable": "può essere frantumato", + "create.item_attributes.crushable.inverted": "non può essere frantumato", + "create.item_attributes.smeltable": "può essere fuso", + "create.item_attributes.smeltable.inverted": "non può essere fuso", + "create.item_attributes.smokable": "può essere affumicato", + "create.item_attributes.smokable.inverted": "non può essere affumicato", + "create.item_attributes.blastable": "è fondibile in un forno fusorio", + "create.item_attributes.blastable.inverted": "non è fondibile in un forno fusorio", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "è etichettato %1$s", "create.item_attributes.in_tag.inverted": "non è etichettato %1$s", "create.item_attributes.in_item_group": "appartiene a %1$s", "create.item_attributes.in_item_group.inverted": "non appartiene a '%1$s'", "create.item_attributes.added_by": "è stato aggiunto da %1$s", "create.item_attributes.added_by.inverted": "non è stato aggiunto da %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "è stato incantato con %1$s", "create.item_attributes.has_enchant.inverted": "non è stato incantato con %1$s", "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", - "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "contiene %1$s", "create.item_attributes.has_fluid.inverted": "non contiene %1$s", "create.item_attributes.has_name": "è stato rinominato in %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "non è una copia di seconda generazione", "create.item_attributes.book_copy_tattered": "è in condizioni precarie", "create.item_attributes.book_copy_tattered.inverted": "non è in condizioni precarie", - "create.item_attributes.astralsorcery_crystal": "ha l'attributo del cristallo %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "non ha l'attributo del cristallo %1$s", - "create.item_attributes.astralsorcery_constellation": "è in sintonia con %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "non è in sintonia con %1$s", - "create.item_attributes.astralsorcery_perk_gem": "ha l'attributo benefico %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "non ha l'attributo benefico %1$s", "create.item_attributes.astralsorcery_amulet": "migliora %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "non migliora %1$s", + "create.item_attributes.astralsorcery_constellation": "è in sintonia con %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "non è in sintonia con %1$s", + "create.item_attributes.astralsorcery_crystal": "ha l'attributo del cristallo %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "non ha l'attributo del cristallo %1$s", + "create.item_attributes.astralsorcery_perk_gem": "ha l'attributo benefico %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "non ha l'attributo benefico %1$s", "create.gui.attribute_filter.no_selected_attributes": "Nessun attributo selezionato", "create.gui.attribute_filter.selected_attributes": "Attributi selezionati:", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index e6269480a..f118de69e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 10", + "_": "Missing Localizations: 14", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "設置不可能か", "create.item_attributes.consumable": "食べられるか", "create.item_attributes.consumable.inverted": "食べられないか", - "create.item_attributes.smeltable": "精錬可能か", - "create.item_attributes.smeltable.inverted": "精錬不可能か", - "create.item_attributes.washable": "洗浄可能か", - "create.item_attributes.washable.inverted": "洗浄不可能か", - "create.item_attributes.smokable": "燻製器で調理可能か", - "create.item_attributes.smokable.inverted": "燻製器で調理不可能か", - "create.item_attributes.crushable": "粉砕可能か", - "create.item_attributes.crushable.inverted": "粉砕不可能か", - "create.item_attributes.blastable": "溶鉱炉で精錬可能か", - "create.item_attributes.blastable.inverted": "溶鉱炉で精錬不可能か", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "エンチャント済みか", "create.item_attributes.enchanted.inverted": "エンチャントなしか", + "create.item_attributes.max_enchanted": "最大レベルのエンチャントがされているか", + "create.item_attributes.max_enchanted.inverted": "最大レベルのエンチャントがされていないか", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "破損してるか", "create.item_attributes.damaged.inverted": "破損していないか", "create.item_attributes.badly_damaged": "ひどく損傷してるか", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "装備不可能か", "create.item_attributes.furnace_fuel": "かまどの燃料か", "create.item_attributes.furnace_fuel.inverted": "かまどの燃料でないか", + "create.item_attributes.washable": "洗浄可能か", + "create.item_attributes.washable.inverted": "洗浄不可能か", + "create.item_attributes.crushable": "粉砕可能か", + "create.item_attributes.crushable.inverted": "粉砕不可能か", + "create.item_attributes.smeltable": "精錬可能か", + "create.item_attributes.smeltable.inverted": "精錬不可能か", + "create.item_attributes.smokable": "燻製器で調理可能か", + "create.item_attributes.smokable.inverted": "燻製器で調理不可能か", + "create.item_attributes.blastable": "溶鉱炉で精錬可能か", + "create.item_attributes.blastable.inverted": "溶鉱炉で精錬不可能か", + "create.item_attributes.shulker_level": "%1$sシュルカーか", + "create.item_attributes.shulker_level.inverted": "%1$sシュルカーでないか", + "create.item_attributes.shulker_level.full": "満杯の", + "create.item_attributes.shulker_level.empty": "空の", + "create.item_attributes.shulker_level.partial": "一部埋まっている", "create.item_attributes.in_tag": "%1$sのタグが付けられてるか", "create.item_attributes.in_tag.inverted": "%1$sのタグがついていないか", "create.item_attributes.in_item_group": "%1$sに属してるか", "create.item_attributes.in_item_group.inverted": "%1$sに属していないか", "create.item_attributes.added_by": "%1$sによって追加されたか", "create.item_attributes.added_by.inverted": "%1$sによって追加されていないか", - "create.item_attributes.shulker_level": "%1$sシュルカーか", - "create.item_attributes.shulker_level.inverted": "%1$sシュルカーでないか", - "create.item_attributes.shulker_level.full": "満杯の", - "create.item_attributes.shulker_level.empty": "空の", - "create.item_attributes.shulker_level.partial": "一部埋まっている", "create.item_attributes.has_enchant": "エンチャントされているか%1$s", "create.item_attributes.has_enchant.inverted": "エンチャントがされていないか", "create.item_attributes.color": "%1$sで染められているか", "create.item_attributes.color.inverted": "%1$sで染められていないか", - "create.item_attributes.max_enchanted": "最大レベルのエンチャントがされているか", - "create.item_attributes.max_enchanted.inverted": "最大レベルのエンチャントがされていないか", "create.item_attributes.has_fluid": "%1$sを含んでいるか", "create.item_attributes.has_fluid.inverted": "%1$sを含んでいないか", "create.item_attributes.has_name": "%1$sの名前が付けられているか", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "コピーのコピーでないか", "create.item_attributes.book_copy_tattered": "ボロボロか", "create.item_attributes.book_copy_tattered.inverted": "ボロボロでないか", - "create.item_attributes.astralsorcery_crystal": "%1$s クリスタル属性を持つ", - "create.item_attributes.astralsorcery_crystal.inverted": "%1$s クリスタル属性を持たない", - "create.item_attributes.astralsorcery_constellation": "%1$s に同調している", - "create.item_attributes.astralsorcery_constellation.inverted": "%1$s に同調していない", - "create.item_attributes.astralsorcery_perk_gem": "%1$s 特典属性がある", - "create.item_attributes.astralsorcery_perk_gem.inverted": "%1$s 特典属性がない", "create.item_attributes.astralsorcery_amulet": "%1$s 改善", "create.item_attributes.astralsorcery_amulet.inverted": "%1$s 改善されない", + "create.item_attributes.astralsorcery_constellation": "%1$s に同調している", + "create.item_attributes.astralsorcery_constellation.inverted": "%1$s に同調していない", + "create.item_attributes.astralsorcery_crystal": "%1$s クリスタル属性を持つ", + "create.item_attributes.astralsorcery_crystal.inverted": "%1$s クリスタル属性を持たない", + "create.item_attributes.astralsorcery_perk_gem": "%1$s 特典属性がある", + "create.item_attributes.astralsorcery_perk_gem.inverted": "%1$s 特典属性がない", "create.gui.attribute_filter.no_selected_attributes": "属性が選択されていません", "create.gui.attribute_filter.selected_attributes": "選択された属性:", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 2cdccc02e..769273a78 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 25", + "_": "Missing Localizations: 29", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "설치할 수 없음", "create.item_attributes.consumable": "먹을 수 있음", "create.item_attributes.consumable.inverted": "먹을 수 없음", - "create.item_attributes.smeltable": "구워질 수 있음", - "create.item_attributes.smeltable.inverted": "구워질 수 없음", - "create.item_attributes.washable": "세척될 수 있음", - "create.item_attributes.washable.inverted": "세척될 수 없음", - "create.item_attributes.smokable": "훈연될 수 있음", - "create.item_attributes.smokable.inverted": "훈연될 수 없음", - "create.item_attributes.crushable": "분쇄될 수 있음", - "create.item_attributes.crushable.inverted": "분쇄될 수 없음", - "create.item_attributes.blastable": "용광로에 녹일 수 있음", - "create.item_attributes.blastable.inverted": "용광로에 녹일 수 없음", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "마법부여됨", "create.item_attributes.enchanted.inverted": "마법부여되지 않음", + "create.item_attributes.max_enchanted": "마법부여가 최고 레벨임", + "create.item_attributes.max_enchanted.inverted": "마법부여가 최고 레벨이 아님", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "내구도가 닮", "create.item_attributes.damaged.inverted": "내구도가 닳지 않음", "create.item_attributes.badly_damaged": "심각하게 내구도가 닮", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "장착할 수 없음", "create.item_attributes.furnace_fuel": "화로 연료로 쓸 수 있음", "create.item_attributes.furnace_fuel.inverted": "화로 연료로 쓸 수 없음", + "create.item_attributes.washable": "세척될 수 있음", + "create.item_attributes.washable.inverted": "세척될 수 없음", + "create.item_attributes.crushable": "분쇄될 수 있음", + "create.item_attributes.crushable.inverted": "분쇄될 수 없음", + "create.item_attributes.smeltable": "구워질 수 있음", + "create.item_attributes.smeltable.inverted": "구워질 수 없음", + "create.item_attributes.smokable": "훈연될 수 있음", + "create.item_attributes.smokable.inverted": "훈연될 수 없음", + "create.item_attributes.blastable": "용광로에 녹일 수 있음", + "create.item_attributes.blastable.inverted": "용광로에 녹일 수 없음", + "create.item_attributes.shulker_level": "셜커가 %1$s있음", + "create.item_attributes.shulker_level.inverted": "셜커가 %1$s있지 않음", + "create.item_attributes.shulker_level.full": "가득 차", + "create.item_attributes.shulker_level.empty": "비어", + "create.item_attributes.shulker_level.partial": "조금 차", "create.item_attributes.in_tag": "%1$s로 등록됨", "create.item_attributes.in_tag.inverted": "%1$s로 등록되지 않음", "create.item_attributes.in_item_group": "%1$s탭에 속함", "create.item_attributes.in_item_group.inverted": "%1$s탭에 속함", "create.item_attributes.added_by": "%1$s모드가 추가함", "create.item_attributes.added_by.inverted": "%1$s모드가 추가하지 않음", - "create.item_attributes.shulker_level": "셜커가 %1$s있음", - "create.item_attributes.shulker_level.inverted": "셜커가 %1$s있지 않음", - "create.item_attributes.shulker_level.full": "가득 차", - "create.item_attributes.shulker_level.empty": "비어", - "create.item_attributes.shulker_level.partial": "조금 차", "create.item_attributes.has_enchant": "%1$s 마법부여를 가지고 있음", "create.item_attributes.has_enchant.inverted": "%1$s 마법부여를 가지고 있지 않음", "create.item_attributes.color": "염색됨", "create.item_attributes.color.inverted": "염색되지 않음", - "create.item_attributes.max_enchanted": "마법부여가 최고 레벨임", - "create.item_attributes.max_enchanted.inverted": "마법부여가 최고 레벨이 아님", "create.item_attributes.has_fluid": "%1$s을(를) 담고 있음", "create.item_attributes.has_fluid.inverted": "%1$s을(를) 담고 있지 않음", "create.item_attributes.has_name": "%1$s이라는 이름을 갖고 있음", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "복사본의 복사본이 아님", "create.item_attributes.book_copy_tattered": "낡고 헐었음", "create.item_attributes.book_copy_tattered.inverted": "낡고 헐지 않음", - "create.item_attributes.astralsorcery_crystal": "%1$s 수정 속성을 가짐", - "create.item_attributes.astralsorcery_crystal.inverted": "%1$s 수정 속성을 가지고 있지 않음", - "create.item_attributes.astralsorcery_constellation": "%1$s에 조율됨", - "create.item_attributes.astralsorcery_constellation.inverted": "%1$s에 조율되지 않음", - "create.item_attributes.astralsorcery_perk_gem": "%1$s 퍽 속성을 가짐", - "create.item_attributes.astralsorcery_perk_gem.inverted": "%1$s 퍽 속성을 가지고 있지 않음", "create.item_attributes.astralsorcery_amulet": "%1$s이(가) 향상됨", "create.item_attributes.astralsorcery_amulet.inverted": "%1$s이(가) 향상되지 않음", + "create.item_attributes.astralsorcery_constellation": "%1$s에 조율됨", + "create.item_attributes.astralsorcery_constellation.inverted": "%1$s에 조율되지 않음", + "create.item_attributes.astralsorcery_crystal": "%1$s 수정 속성을 가짐", + "create.item_attributes.astralsorcery_crystal.inverted": "%1$s 수정 속성을 가지고 있지 않음", + "create.item_attributes.astralsorcery_perk_gem": "%1$s 퍽 속성을 가짐", + "create.item_attributes.astralsorcery_perk_gem.inverted": "%1$s 퍽 속성을 가지고 있지 않음", "create.gui.attribute_filter.no_selected_attributes": "속성이 선택되지 않음", "create.gui.attribute_filter.selected_attributes": "선택된 속성:", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index cb8d8972e..80c246620 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1767", + "_": "Missing Localizations: 1771", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "UNLOCALIZED: is not placeable", "create.item_attributes.consumable": "UNLOCALIZED: can be eaten", "create.item_attributes.consumable.inverted": "UNLOCALIZED: cannot be eaten", - "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", - "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", - "create.item_attributes.washable": "UNLOCALIZED: can be Washed", - "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", - "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", - "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", - "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", - "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", - "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", - "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "UNLOCALIZED: is enchanted", "create.item_attributes.enchanted.inverted": "UNLOCALIZED: is unenchanted", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "UNLOCALIZED: is damaged", "create.item_attributes.damaged.inverted": "UNLOCALIZED: is not damaged", "create.item_attributes.badly_damaged": "UNLOCALIZED: is heavily damaged", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "UNLOCALIZED: cannot be equipped", "create.item_attributes.furnace_fuel": "UNLOCALIZED: is furnace fuel", "create.item_attributes.furnace_fuel.inverted": "UNLOCALIZED: is not furnace fuel", + "create.item_attributes.washable": "UNLOCALIZED: can be Washed", + "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", + "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", + "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", + "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", + "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", + "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", + "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", + "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", + "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "UNLOCALIZED: is tagged %1$s", "create.item_attributes.in_tag.inverted": "UNLOCALIZED: is not tagged %1$s", "create.item_attributes.in_item_group": "UNLOCALIZED: is in group '%1$s'", "create.item_attributes.in_item_group.inverted": "UNLOCALIZED: is not in group '%1$s'", "create.item_attributes.added_by": "UNLOCALIZED: was added by %1$s", "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", - "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "UNLOCALIZED: is not a second-generation copy", "create.item_attributes.book_copy_tattered": "UNLOCALIZED: is a tattered mess", "create.item_attributes.book_copy_tattered.inverted": "UNLOCALIZED: is not a tattered mess", - "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", - "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", - "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.item_attributes.astralsorcery_amulet": "UNLOCALIZED: improves %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "UNLOCALIZED: does not improve %1$s", + "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", + "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.gui.attribute_filter.no_selected_attributes": "UNLOCALIZED: No attributes selected", "create.gui.attribute_filter.selected_attributes": "UNLOCALIZED: Selected attributes:", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 727fa23c9..6d480af80 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 257", + "_": "Missing Localizations: 261", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "nie jest stawialny", "create.item_attributes.consumable": "jadalny", "create.item_attributes.consumable.inverted": "niejadalny", - "create.item_attributes.smeltable": "może zostać przepalony", - "create.item_attributes.smeltable.inverted": "nie może zostać przepalony", - "create.item_attributes.washable": "może zostać opłukany", - "create.item_attributes.washable.inverted": "nie może zostać opłukany", - "create.item_attributes.smokable": "może być wędzony", - "create.item_attributes.smokable.inverted": "nie może być wędzony", - "create.item_attributes.crushable": "może być rozkruszony", - "create.item_attributes.crushable.inverted": "nie może być rozkruszony", - "create.item_attributes.blastable": "może być stopiony w piecu hutniczym", - "create.item_attributes.blastable.inverted": "nie może być stopiony w piecu hutniczym", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "jest zaklęty", "create.item_attributes.enchanted.inverted": "nie jest zaklęty", + "create.item_attributes.max_enchanted": "jest zaklęte na maksymalny poziom", + "create.item_attributes.max_enchanted.inverted": "nie jest zaklęte na maksymalny poziom", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "jest uszkodzony", "create.item_attributes.damaged.inverted": "nie jest uszkodzony", "create.item_attributes.badly_damaged": "jest silnie uszkodzony", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "nie może zostać założony", "create.item_attributes.furnace_fuel": "jest paliwem dla pieca", "create.item_attributes.furnace_fuel.inverted": "nie jest paliwem dla pieca", + "create.item_attributes.washable": "może zostać opłukany", + "create.item_attributes.washable.inverted": "nie może zostać opłukany", + "create.item_attributes.crushable": "może być rozkruszony", + "create.item_attributes.crushable.inverted": "nie może być rozkruszony", + "create.item_attributes.smeltable": "może zostać przepalony", + "create.item_attributes.smeltable.inverted": "nie może zostać przepalony", + "create.item_attributes.smokable": "może być wędzony", + "create.item_attributes.smokable.inverted": "nie może być wędzony", + "create.item_attributes.blastable": "może być stopiony w piecu hutniczym", + "create.item_attributes.blastable.inverted": "nie może być stopiony w piecu hutniczym", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "posiada znacznik %1$s", "create.item_attributes.in_tag.inverted": "nie posiada znacznika %1$s", "create.item_attributes.in_item_group": "jest w grupie \"%1$s\"", "create.item_attributes.in_item_group.inverted": "nie jest w grupie \"%1$s\"", "create.item_attributes.added_by": "dodany przez %1$s", "create.item_attributes.added_by.inverted": "niedodany przez %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "posiada zaklęcie %1$s", "create.item_attributes.has_enchant.inverted": "nie posiada zaklęcia %1$s", "create.item_attributes.color": "jest zafarbowane, kolor %1$s", "create.item_attributes.color.inverted": "nie jest zafarbowane, kolor %1$s", - "create.item_attributes.max_enchanted": "jest zaklęte na maksymalny poziom", - "create.item_attributes.max_enchanted.inverted": "nie jest zaklęte na maksymalny poziom", "create.item_attributes.has_fluid": "zawiera %1$s", "create.item_attributes.has_fluid.inverted": "nie zawiera %1$s", "create.item_attributes.has_name": "posiada nazwę %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "nie jest kopią kopii", "create.item_attributes.book_copy_tattered": "jest postrzępiona", "create.item_attributes.book_copy_tattered.inverted": "nie jest postrzępiona", - "create.item_attributes.astralsorcery_crystal": "posiada właściwości kryształu %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "nie posiada właściwości kryształu %1$s", - "create.item_attributes.astralsorcery_constellation": "jest dopasowany do %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "nie jest dopasowany do %1$s", - "create.item_attributes.astralsorcery_perk_gem": "posiada dodatkową właściwość %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "nie posiada dodatkowej właściwości %1$s", "create.item_attributes.astralsorcery_amulet": "ulepsza %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "nie ulepsza %1$s", + "create.item_attributes.astralsorcery_constellation": "jest dopasowany do %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "nie jest dopasowany do %1$s", + "create.item_attributes.astralsorcery_crystal": "posiada właściwości kryształu %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "nie posiada właściwości kryształu %1$s", + "create.item_attributes.astralsorcery_perk_gem": "posiada dodatkową właściwość %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "nie posiada dodatkowej właściwości %1$s", "create.gui.attribute_filter.no_selected_attributes": "Brak wybranych właściwości", "create.gui.attribute_filter.selected_attributes": "Wybrane właściwości:", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 13fd43cbc..e018f33f6 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1808", + "_": "Missing Localizations: 1812", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "UNLOCALIZED: is not placeable", "create.item_attributes.consumable": "UNLOCALIZED: can be eaten", "create.item_attributes.consumable.inverted": "UNLOCALIZED: cannot be eaten", - "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", - "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", - "create.item_attributes.washable": "UNLOCALIZED: can be Washed", - "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", - "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", - "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", - "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", - "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", - "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", - "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "UNLOCALIZED: is enchanted", "create.item_attributes.enchanted.inverted": "UNLOCALIZED: is unenchanted", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "UNLOCALIZED: is damaged", "create.item_attributes.damaged.inverted": "UNLOCALIZED: is not damaged", "create.item_attributes.badly_damaged": "UNLOCALIZED: is heavily damaged", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "UNLOCALIZED: cannot be equipped", "create.item_attributes.furnace_fuel": "UNLOCALIZED: is furnace fuel", "create.item_attributes.furnace_fuel.inverted": "UNLOCALIZED: is not furnace fuel", + "create.item_attributes.washable": "UNLOCALIZED: can be Washed", + "create.item_attributes.washable.inverted": "UNLOCALIZED: cannot be Washed", + "create.item_attributes.crushable": "UNLOCALIZED: can be Crushed", + "create.item_attributes.crushable.inverted": "UNLOCALIZED: cannot be Crushed", + "create.item_attributes.smeltable": "UNLOCALIZED: can be Smelted", + "create.item_attributes.smeltable.inverted": "UNLOCALIZED: cannot be Smelted", + "create.item_attributes.smokable": "UNLOCALIZED: can be Smoked", + "create.item_attributes.smokable.inverted": "UNLOCALIZED: cannot be Smoked", + "create.item_attributes.blastable": "UNLOCALIZED: is smeltable in Blast Furnace", + "create.item_attributes.blastable.inverted": "UNLOCALIZED: is not smeltable in Blast Furnace", + "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", + "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", + "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", + "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", + "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.in_tag": "UNLOCALIZED: is tagged %1$s", "create.item_attributes.in_tag.inverted": "UNLOCALIZED: is not tagged %1$s", "create.item_attributes.in_item_group": "UNLOCALIZED: is in group '%1$s'", "create.item_attributes.in_item_group.inverted": "UNLOCALIZED: is not in group '%1$s'", "create.item_attributes.added_by": "UNLOCALIZED: was added by %1$s", "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", - "create.item_attributes.shulker_level": "UNLOCALIZED: is shulker %1$s", - "create.item_attributes.shulker_level.inverted": "UNLOCALIZED: is shulker not %1$s", - "create.item_attributes.shulker_level.full": "UNLOCALIZED: full", - "create.item_attributes.shulker_level.empty": "UNLOCALIZED: empty", - "create.item_attributes.shulker_level.partial": "UNLOCALIZED: partially filled", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", - "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", - "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "UNLOCALIZED: is not a second-generation copy", "create.item_attributes.book_copy_tattered": "UNLOCALIZED: is a tattered mess", "create.item_attributes.book_copy_tattered.inverted": "UNLOCALIZED: is not a tattered mess", - "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", - "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", - "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.item_attributes.astralsorcery_amulet": "UNLOCALIZED: improves %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "UNLOCALIZED: does not improve %1$s", + "create.item_attributes.astralsorcery_constellation": "UNLOCALIZED: is attuned to %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "UNLOCALIZED: is not attuned to %1$s", + "create.item_attributes.astralsorcery_crystal": "UNLOCALIZED: has crystal attribute %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "UNLOCALIZED: does not have crystal attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem": "UNLOCALIZED: has perk attribute %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "UNLOCALIZED: does not have perk attribute %1$s", "create.gui.attribute_filter.no_selected_attributes": "UNLOCALIZED: No attributes selected", "create.gui.attribute_filter.selected_attributes": "UNLOCALIZED: Selected attributes:", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index b5c391ad7..3bda0b160 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 6", + "_": "Missing Localizations: 10", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "нельзя разместить", "create.item_attributes.consumable": "можно съесть", "create.item_attributes.consumable.inverted": "нельзя съесть", - "create.item_attributes.smeltable": "можно расплавить", - "create.item_attributes.smeltable.inverted": "нельзя расплавить", - "create.item_attributes.washable": "можно промыть", - "create.item_attributes.washable.inverted": "нельзя промыть", - "create.item_attributes.smokable": "можно прокоптить", - "create.item_attributes.smokable.inverted": "нельзя прокоптить", - "create.item_attributes.crushable": "можно измельчить", - "create.item_attributes.crushable.inverted": "нельзя разместить", - "create.item_attributes.blastable": "плавится в доменной печи", - "create.item_attributes.blastable.inverted": "не плавится в доменной печи", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "зачарован", "create.item_attributes.enchanted.inverted": "не зачарован", + "create.item_attributes.max_enchanted": "Зачаровано за максимальный уровень", + "create.item_attributes.max_enchanted.inverted": "Не зачаровано за максимальный уровень", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "повреждён", "create.item_attributes.damaged.inverted": "не повреждён", "create.item_attributes.badly_damaged": "сильно повреждён", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "не может быть надет", "create.item_attributes.furnace_fuel": "является топливом", "create.item_attributes.furnace_fuel.inverted": "не является топливом", + "create.item_attributes.washable": "можно промыть", + "create.item_attributes.washable.inverted": "нельзя промыть", + "create.item_attributes.crushable": "можно измельчить", + "create.item_attributes.crushable.inverted": "нельзя разместить", + "create.item_attributes.smeltable": "можно расплавить", + "create.item_attributes.smeltable.inverted": "нельзя расплавить", + "create.item_attributes.smokable": "можно прокоптить", + "create.item_attributes.smokable.inverted": "нельзя прокоптить", + "create.item_attributes.blastable": "плавится в доменной печи", + "create.item_attributes.blastable.inverted": "не плавится в доменной печи", + "create.item_attributes.shulker_level": "шалкер %1$s", + "create.item_attributes.shulker_level.inverted": "шалкер не %1$s", + "create.item_attributes.shulker_level.full": "полный", + "create.item_attributes.shulker_level.empty": "пустой", + "create.item_attributes.shulker_level.partial": "частично заполнен", "create.item_attributes.in_tag": "помечен %1$s", "create.item_attributes.in_tag.inverted": "не помечен %1$s", "create.item_attributes.in_item_group": "принадлежит %1$s", "create.item_attributes.in_item_group.inverted": "не принадлежит '%1$s'", "create.item_attributes.added_by": "был добавлен %1$s", "create.item_attributes.added_by.inverted": "не был добавлен %1$s", - "create.item_attributes.shulker_level": "шалкер %1$s", - "create.item_attributes.shulker_level.inverted": "шалкер не %1$s", - "create.item_attributes.shulker_level.full": "полный", - "create.item_attributes.shulker_level.empty": "пустой", - "create.item_attributes.shulker_level.partial": "частично заполнен", "create.item_attributes.has_enchant": "зачарован на %1$s", "create.item_attributes.has_enchant.inverted": "не зачарован на %1$s", "create.item_attributes.color": "Покрашено в %1$s", "create.item_attributes.color.inverted": "Не покрашено в %1$s", - "create.item_attributes.max_enchanted": "Зачаровано за максимальный уровень", - "create.item_attributes.max_enchanted.inverted": "Не зачаровано за максимальный уровень", "create.item_attributes.has_fluid": "содержит %1$s", "create.item_attributes.has_fluid.inverted": "не содержит %1$s", "create.item_attributes.has_name": "имеет нестандартное имя %1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "не копия второго порядка", "create.item_attributes.book_copy_tattered": "полный беспорядок", "create.item_attributes.book_copy_tattered.inverted": "не полный беспорядок", - "create.item_attributes.astralsorcery_crystal": "имеет характеристики кристалла %1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "не имеет характеристики кристалла %1$s", - "create.item_attributes.astralsorcery_constellation": "настроено на %1$s", - "create.item_attributes.astralsorcery_constellation.inverted": "не настроено на %1$s", - "create.item_attributes.astralsorcery_perk_gem": "имеет характеристики перка %1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "не имеет характеристики перка %1$s", "create.item_attributes.astralsorcery_amulet": "исправляет %1$s", "create.item_attributes.astralsorcery_amulet.inverted": "не исправляет %1$s", + "create.item_attributes.astralsorcery_constellation": "настроено на %1$s", + "create.item_attributes.astralsorcery_constellation.inverted": "не настроено на %1$s", + "create.item_attributes.astralsorcery_crystal": "имеет характеристики кристалла %1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "не имеет характеристики кристалла %1$s", + "create.item_attributes.astralsorcery_perk_gem": "имеет характеристики перка %1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "не имеет характеристики перка %1$s", "create.gui.attribute_filter.no_selected_attributes": "Атрибуты не выбраны", "create.gui.attribute_filter.selected_attributes": "Выбранные атрибуты:", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 35a44fa56..1d231dc9e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 5", + "_": "Missing Localizations: 9", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "不可放置", "create.item_attributes.consumable": "可食用", "create.item_attributes.consumable.inverted": "不可食用", - "create.item_attributes.smeltable": "可被熔炉烧制", - "create.item_attributes.smeltable.inverted": "不可被熔炉烧制", - "create.item_attributes.washable": "可被洗涤", - "create.item_attributes.washable.inverted": "不可被洗涤", - "create.item_attributes.smokable": "可被烟熏", - "create.item_attributes.smokable.inverted": "不可被烟熏", - "create.item_attributes.crushable": "可被粉碎", - "create.item_attributes.crushable.inverted": "不可被粉碎", - "create.item_attributes.blastable": "可被高炉冶炼", - "create.item_attributes.blastable.inverted": "不可被高炉冶炼", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "已被附魔", "create.item_attributes.enchanted.inverted": "未被附魔", + "create.item_attributes.max_enchanted": "已达到最高附魔等级", + "create.item_attributes.max_enchanted.inverted": "并未达到最高附魔等级", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "已损坏", "create.item_attributes.damaged.inverted": "未损坏", "create.item_attributes.badly_damaged": "严重受损", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "不可装备", "create.item_attributes.furnace_fuel": "可作为燃料", "create.item_attributes.furnace_fuel.inverted": "不可作为燃料", + "create.item_attributes.washable": "可被洗涤", + "create.item_attributes.washable.inverted": "不可被洗涤", + "create.item_attributes.crushable": "可被粉碎", + "create.item_attributes.crushable.inverted": "不可被粉碎", + "create.item_attributes.smeltable": "可被熔炉烧制", + "create.item_attributes.smeltable.inverted": "不可被熔炉烧制", + "create.item_attributes.smokable": "可被烟熏", + "create.item_attributes.smokable.inverted": "不可被烟熏", + "create.item_attributes.blastable": "可被高炉冶炼", + "create.item_attributes.blastable.inverted": "不可被高炉冶炼", + "create.item_attributes.shulker_level": "潜影盒是%1$s的", + "create.item_attributes.shulker_level.inverted": "潜影盒不是%1$s的", + "create.item_attributes.shulker_level.full": "满", + "create.item_attributes.shulker_level.empty": "空", + "create.item_attributes.shulker_level.partial": "部分填充", "create.item_attributes.in_tag": "标签是%1$s", "create.item_attributes.in_tag.inverted": "标签不是%1$s", "create.item_attributes.in_item_group": "属于%1$s", "create.item_attributes.in_item_group.inverted": "不属于%1$s", "create.item_attributes.added_by": "由%1$s添加", "create.item_attributes.added_by.inverted": "不由%1$s添加", - "create.item_attributes.shulker_level": "潜影盒是%1$s的", - "create.item_attributes.shulker_level.inverted": "潜影盒不是%1$s的", - "create.item_attributes.shulker_level.full": "满", - "create.item_attributes.shulker_level.empty": "空", - "create.item_attributes.shulker_level.partial": "部分填充", "create.item_attributes.has_enchant": "有附魔效果%1$s", "create.item_attributes.has_enchant.inverted": "没有附魔效果%1$s", "create.item_attributes.color": "染色为%1$s", "create.item_attributes.color.inverted": "未被染成%1$s", - "create.item_attributes.max_enchanted": "已达到最高附魔等级", - "create.item_attributes.max_enchanted.inverted": "并未达到最高附魔等级", "create.item_attributes.has_fluid": "含有%1$s", "create.item_attributes.has_fluid.inverted": "不含有%1$s", "create.item_attributes.has_name": "有自定义名称%1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "不是第二代拷贝", "create.item_attributes.book_copy_tattered": "拷贝次数已不可查", "create.item_attributes.book_copy_tattered.inverted": "不是拷贝次数已不可查", - "create.item_attributes.astralsorcery_crystal": "有水晶石属性%1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "没有水晶石属性%1$s", - "create.item_attributes.astralsorcery_constellation": "与%1$s共鸣", - "create.item_attributes.astralsorcery_constellation.inverted": "不与%1$s共鸣", - "create.item_attributes.astralsorcery_perk_gem": "带有有星能力属性%1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "不带有星能力属性%1$s", "create.item_attributes.astralsorcery_amulet": "璀璨棱镜增强%1$s", "create.item_attributes.astralsorcery_amulet.inverted": "璀璨棱镜未增强%1$s", + "create.item_attributes.astralsorcery_constellation": "与%1$s共鸣", + "create.item_attributes.astralsorcery_constellation.inverted": "不与%1$s共鸣", + "create.item_attributes.astralsorcery_crystal": "有水晶石属性%1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "没有水晶石属性%1$s", + "create.item_attributes.astralsorcery_perk_gem": "带有有星能力属性%1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "不带有星能力属性%1$s", "create.gui.attribute_filter.no_selected_attributes": "未选择任何属性", "create.gui.attribute_filter.selected_attributes": "已选择的属性:", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 28e21eea1..e8104a4a5 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 20", + "_": "Missing Localizations: 24", "_": "->------------------------] Game Elements [------------------------<-", @@ -1038,18 +1038,14 @@ "create.item_attributes.placeable.inverted": "不可放置", "create.item_attributes.consumable": "可食用", "create.item_attributes.consumable.inverted": "不可食用", - "create.item_attributes.smeltable": "可被熔爐融煉", - "create.item_attributes.smeltable.inverted": "不可被熔爐融煉", - "create.item_attributes.washable": "可被篩洗", - "create.item_attributes.washable.inverted": "不可被篩洗", - "create.item_attributes.smokable": "可被煙熏", - "create.item_attributes.smokable.inverted": "不可被煙熏", - "create.item_attributes.crushable": "可被粉碎", - "create.item_attributes.crushable.inverted": "不可被粉碎", - "create.item_attributes.blastable": "可被高爐融煉", - "create.item_attributes.blastable.inverted": "不可被高爐融煉", + "create.item_attributes.fluid_container": "UNLOCALIZED: can store fluids", + "create.item_attributes.fluid_container.inverted": "UNLOCALIZED: cannot store fluids", "create.item_attributes.enchanted": "已被附魔", "create.item_attributes.enchanted.inverted": "未被附魔", + "create.item_attributes.max_enchanted": "已達到最高附魔等級", + "create.item_attributes.max_enchanted.inverted": "未達到最高附魔等級", + "create.item_attributes.renamed": "UNLOCALIZED: has a custom name", + "create.item_attributes.renamed.inverted": "UNLOCALIZED: does not have a custom name", "create.item_attributes.damaged": "已損壞", "create.item_attributes.damaged.inverted": "未損壞", "create.item_attributes.badly_damaged": "嚴重受損", @@ -1060,23 +1056,31 @@ "create.item_attributes.equipable.inverted": "不可裝備", "create.item_attributes.furnace_fuel": "是燃料", "create.item_attributes.furnace_fuel.inverted": "不是燃料", + "create.item_attributes.washable": "可被篩洗", + "create.item_attributes.washable.inverted": "不可被篩洗", + "create.item_attributes.crushable": "可被粉碎", + "create.item_attributes.crushable.inverted": "不可被粉碎", + "create.item_attributes.smeltable": "可被熔爐融煉", + "create.item_attributes.smeltable.inverted": "不可被熔爐融煉", + "create.item_attributes.smokable": "可被煙熏", + "create.item_attributes.smokable.inverted": "不可被煙熏", + "create.item_attributes.blastable": "可被高爐融煉", + "create.item_attributes.blastable.inverted": "不可被高爐融煉", + "create.item_attributes.shulker_level": "界伏盒是 %1$s", + "create.item_attributes.shulker_level.inverted": "界伏盒不是 %1$s", + "create.item_attributes.shulker_level.full": "滿的", + "create.item_attributes.shulker_level.empty": "空的", + "create.item_attributes.shulker_level.partial": "有裝東西但沒滿", "create.item_attributes.in_tag": "標籤是%1$s", "create.item_attributes.in_tag.inverted": "標籤不是%1$s", "create.item_attributes.in_item_group": "屬於%1$s", "create.item_attributes.in_item_group.inverted": "不屬於%1$s", "create.item_attributes.added_by": "由%1$s添加", "create.item_attributes.added_by.inverted": "不是由%1$s添加", - "create.item_attributes.shulker_level": "界伏盒是 %1$s", - "create.item_attributes.shulker_level.inverted": "界伏盒不是 %1$s", - "create.item_attributes.shulker_level.full": "滿的", - "create.item_attributes.shulker_level.empty": "空的", - "create.item_attributes.shulker_level.partial": "有裝東西但沒滿", "create.item_attributes.has_enchant": "有附魔效果%1$s", "create.item_attributes.has_enchant.inverted": "沒有附魔效果%1$s", "create.item_attributes.color": "已被染色成 %1$s", "create.item_attributes.color.inverted": "未被染色成 %1$s", - "create.item_attributes.max_enchanted": "已達到最高附魔等級", - "create.item_attributes.max_enchanted.inverted": "未達到最高附魔等級", "create.item_attributes.has_fluid": "包含%1$s", "create.item_attributes.has_fluid.inverted": "不包含%1$s", "create.item_attributes.has_name": "有自定義名稱%1$s", @@ -1091,14 +1095,14 @@ "create.item_attributes.book_copy_second.inverted": "不是第二份複製", "create.item_attributes.book_copy_tattered": "是第三份複製", "create.item_attributes.book_copy_tattered.inverted": "不是第三份複製", - "create.item_attributes.astralsorcery_crystal": "具有晶體屬性%1$s", - "create.item_attributes.astralsorcery_crystal.inverted": "不具有晶體屬性%1$s", - "create.item_attributes.astralsorcery_constellation": "與%1$s調諧", - "create.item_attributes.astralsorcery_constellation.inverted": "未與%1$s調諧", - "create.item_attributes.astralsorcery_perk_gem": "具有特殊屬性%1$s", - "create.item_attributes.astralsorcery_perk_gem.inverted": "不具有特殊屬性%1$s", "create.item_attributes.astralsorcery_amulet": "提升%1$s", "create.item_attributes.astralsorcery_amulet.inverted": "不提升%1$s", + "create.item_attributes.astralsorcery_constellation": "與%1$s調諧", + "create.item_attributes.astralsorcery_constellation.inverted": "未與%1$s調諧", + "create.item_attributes.astralsorcery_crystal": "具有晶體屬性%1$s", + "create.item_attributes.astralsorcery_crystal.inverted": "不具有晶體屬性%1$s", + "create.item_attributes.astralsorcery_perk_gem": "具有特殊屬性%1$s", + "create.item_attributes.astralsorcery_perk_gem.inverted": "不具有特殊屬性%1$s", "create.gui.attribute_filter.no_selected_attributes": "沒有標記任何屬性", "create.gui.attribute_filter.selected_attributes": "已選擇的屬性:", diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index d723cbe38..59a86f429 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:cogwheel", - "create:large_cogwheel" + "create:large_cogwheel", + "create:cogwheel" ] } }, diff --git a/src/main/resources/data/forge/tags/items/stone.json b/src/generated/resources/data/forge/tags/blocks/stone.json similarity index 100% rename from src/main/resources/data/forge/tags/items/stone.json rename to src/generated/resources/data/forge/tags/blocks/stone.json index 2b4996602..5a5395c1f 100644 --- a/src/main/resources/data/forge/tags/items/stone.json +++ b/src/generated/resources/data/forge/tags/blocks/stone.json @@ -5,10 +5,10 @@ "create:polished_limestone", "create:weathered_limestone", "create:polished_weathered_limestone", - "create:gabbro", - "create:polished_gabbro", "create:dolomite", "create:polished_dolomite", + "create:gabbro", + "create:polished_gabbro", "create:scoria", "create:polished_scoria", "create:dark_scoria", diff --git a/src/main/resources/data/forge/tags/blocks/wg_stone.json b/src/generated/resources/data/forge/tags/blocks/wg_stone.json similarity index 100% rename from src/main/resources/data/forge/tags/blocks/wg_stone.json rename to src/generated/resources/data/forge/tags/blocks/wg_stone.json index d49e3fbd6..39e5fd569 100644 --- a/src/main/resources/data/forge/tags/blocks/wg_stone.json +++ b/src/generated/resources/data/forge/tags/blocks/wg_stone.json @@ -3,8 +3,8 @@ "values": [ "create:limestone", "create:weathered_limestone", - "create:gabbro", "create:dolomite", + "create:gabbro", "create:natural_scoria" ] } \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/items/buckets/honey.json b/src/generated/resources/data/forge/tags/items/buckets/honey.json similarity index 97% rename from src/main/resources/data/forge/tags/items/buckets/honey.json rename to src/generated/resources/data/forge/tags/items/buckets/honey.json index 47f91b376..215063f0f 100644 --- a/src/main/resources/data/forge/tags/items/buckets/honey.json +++ b/src/generated/resources/data/forge/tags/items/buckets/honey.json @@ -3,4 +3,4 @@ "values": [ "create:honey_bucket" ] -} +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/blocks/stone.json b/src/generated/resources/data/forge/tags/items/stone.json similarity index 100% rename from src/main/resources/data/forge/tags/blocks/stone.json rename to src/generated/resources/data/forge/tags/items/stone.json index 2b4996602..5a5395c1f 100644 --- a/src/main/resources/data/forge/tags/blocks/stone.json +++ b/src/generated/resources/data/forge/tags/items/stone.json @@ -5,10 +5,10 @@ "create:polished_limestone", "create:weathered_limestone", "create:polished_weathered_limestone", - "create:gabbro", - "create:polished_gabbro", "create:dolomite", "create:polished_dolomite", + "create:gabbro", + "create:polished_gabbro", "create:scoria", "create:polished_scoria", "create:dark_scoria", diff --git a/src/main/java/com/simibubi/create/AllFluids.java b/src/main/java/com/simibubi/create/AllFluids.java index e12816477..5cc52de55 100644 --- a/src/main/java/com/simibubi/create/AllFluids.java +++ b/src/main/java/com/simibubi/create/AllFluids.java @@ -46,6 +46,9 @@ public class AllFluids { .slopeFindDistance(3) .explosionResistance(100f)) .tag(AllFluidTags.HONEY.tag) + .bucket() + .tag(AllTags.forgeItemTag("buckets/honey")) + .build() .register(); public static final FluidEntry CHOCOLATE = diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 19e148d20..7436f3407 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -7,7 +7,6 @@ import static com.simibubi.create.AllTags.NameSpace.TIC; import java.util.function.Function; import com.simibubi.create.foundation.data.CreateRegistrate; -import com.simibubi.create.foundation.utility.EmptyNamedTag; import com.simibubi.create.foundation.utility.Lang; import com.tterrag.registrate.builders.BlockBuilder; import com.tterrag.registrate.builders.ItemBuilder; @@ -28,51 +27,60 @@ import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.Tags; -import net.minecraftforge.fml.ModList; public class AllTags { private static final CreateRegistrate REGISTRATE = Create.registrate() - .itemGroup(() -> Create.BASE_CREATIVE_TAB); + .itemGroup(() -> Create.BASE_CREATIVE_TAB); + + public static ITag.INamedTag tag(Function> wrapperFactory, String namespace, + String path) { + return wrapperFactory.apply(new ResourceLocation(namespace, path)); + } + + public static ITag.INamedTag forgeTag(Function> wrapperFactory, String path) { + return tag(wrapperFactory, "forge", path); + } + + public static ITag.INamedTag forgeBlockTag(String path) { + return forgeTag(BlockTags::createOptional, path); + } + + public static ITag.INamedTag forgeItemTag(String path) { + return forgeTag(ItemTags::createOptional, path); + } + + public static ITag.INamedTag forgeFluidTag(String path) { + return forgeTag(FluidTags::createOptional, path); + } public static NonNullFunction, ItemBuilder>> tagBlockAndItem( - String tagName) { - return b -> b.tag(forgeBlockTag(tagName)) + String path) { + return b -> b.tag(forgeBlockTag(path)) .item() - .tag(forgeItemTag(tagName)); - } - - public static ITag.INamedTag forgeBlockTag(String name) { - return forgeTag(BlockTags::bind, name); - } - - public static ITag.INamedTag forgeItemTag(String name) { - return forgeTag(ItemTags::bind, name); - } - - public static ITag.INamedTag forgeFluidTag(String name) { - return forgeTag(FluidTags::bind, name); - } - - public static ITag.INamedTag forgeTag(Function> wrapperFactory, String name) { - return tag(wrapperFactory, "forge", name); - } - - public static ITag.INamedTag tag(Function> wrapperFactory, String domain, - String name) { - return wrapperFactory.apply(new ResourceLocation(domain, name).toString()); + .tag(forgeItemTag(path)); } public enum NameSpace { - MOD(Create.ID), FORGE("forge"), TIC("tconstruct") + MOD(Create.ID, false, true), + FORGE("forge"), + TIC("tconstruct") ; public final String id; + public final boolean optionalDefault; + public final boolean alwaysDatagenDefault; - private NameSpace(String id) { + NameSpace(String id) { + this(id, true, false); + } + + NameSpace(String id, boolean optionalDefault, boolean alwaysDatagenDefault) { this.id = id; + this.optionalDefault = optionalDefault; + this.alwaysDatagenDefault = alwaysDatagenDefault; } } @@ -90,37 +98,50 @@ public class AllTags { WINDOWABLE, WRENCH_PICKUP, + WG_STONE(FORGE), + SLIMY_LOGS(TIC), ; public final ITag.INamedTag tag; - private AllBlockTags() { - this(MOD, ""); + AllBlockTags() { + this(MOD); } - private AllBlockTags(NameSpace namespace) { - this(namespace, ""); + AllBlockTags(NameSpace namespace) { + this(namespace, namespace.optionalDefault, namespace.alwaysDatagenDefault); } - private AllBlockTags(NameSpace namespace, String path) { - ResourceLocation id = - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())); - if (ModList.get() - .isLoaded(namespace.id)) { - tag = BlockTags.bind(id.toString()); - REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)); + AllBlockTags(NameSpace namespace, String path) { + this(namespace, path, namespace.optionalDefault, namespace.alwaysDatagenDefault); + } + + AllBlockTags(NameSpace namespace, boolean optional, boolean alwaysDatagen) { + this(namespace, null, optional, alwaysDatagen); + } + + AllBlockTags(NameSpace namespace, String path, boolean optional, boolean alwaysDatagen) { + ResourceLocation id = new ResourceLocation(namespace.id, path == null ? Lang.asId(name()) : path); + if (optional) { + tag = BlockTags.createOptional(id); } else { - tag = new EmptyNamedTag<>(id); + tag = BlockTags.bind(id.toString()); + } + if (alwaysDatagen) { + REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)); } } - - public boolean matches(BlockState block) { + public boolean matches(Block block) { return tag.contains(block.getBlock()); } + public boolean matches(BlockState state) { + return matches(state.getBlock()); + } + public void add(Block... values) { REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) .add(values)); @@ -144,12 +165,12 @@ public class AllTags { public enum AllItemTags { - CREATE_INGOTS(), - CRUSHED_ORES(), - SANDPAPER(), - SEATS(), - UPRIGHT_ON_BELT(), - VALVE_HANDLES(), + CREATE_INGOTS, + CRUSHED_ORES, + SANDPAPER, + SEATS, + UPRIGHT_ON_BELT, + VALVE_HANDLES, BEACON_PAYMENT(FORGE), PLATES(FORGE) @@ -158,18 +179,32 @@ public class AllTags { public final ITag.INamedTag tag; - private AllItemTags() { - this(MOD, ""); + AllItemTags() { + this(MOD); } - private AllItemTags(NameSpace namespace) { - this(namespace, ""); + AllItemTags(NameSpace namespace) { + this(namespace, namespace.optionalDefault, namespace.alwaysDatagenDefault); } - private AllItemTags(NameSpace namespace, String path) { - tag = ItemTags.bind( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())).toString()); - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); + AllItemTags(NameSpace namespace, String path) { + this(namespace, path, namespace.optionalDefault, namespace.alwaysDatagenDefault); + } + + AllItemTags(NameSpace namespace, boolean optional, boolean alwaysDatagen) { + this(namespace, null, optional, alwaysDatagen); + } + + AllItemTags(NameSpace namespace, String path, boolean optional, boolean alwaysDatagen) { + ResourceLocation id = new ResourceLocation(namespace.id, path == null ? Lang.asId(name()) : path); + if (optional) { + tag = ItemTags.createOptional(id); + } else { + tag = ItemTags.bind(id.toString()); + } + if (alwaysDatagen) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); + } } public boolean matches(ItemStack stack) { @@ -190,11 +225,16 @@ public class AllTags { includeIn(parent.tag); } + public void includeAll(ITag.INamedTag child) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag) + .addTag(child)); + } + } public enum AllFluidTags { - NO_INFINITE_DRAINING, + NO_INFINITE_DRAINING(MOD, true, false), HONEY(FORGE) @@ -202,28 +242,64 @@ public class AllTags { public final ITag.INamedTag tag; - private AllFluidTags() { - this(MOD, ""); + AllFluidTags() { + this(MOD); } - private AllFluidTags(NameSpace namespace) { - this(namespace, ""); + AllFluidTags(NameSpace namespace) { + this(namespace, namespace.optionalDefault, namespace.alwaysDatagenDefault); } - private AllFluidTags(NameSpace namespace, String path) { - tag = FluidTags.createOptional( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name()))); + AllFluidTags(NameSpace namespace, String path) { + this(namespace, path, namespace.optionalDefault, namespace.alwaysDatagenDefault); + } + + AllFluidTags(NameSpace namespace, boolean optional, boolean alwaysDatagen) { + this(namespace, null, optional, alwaysDatagen); + } + + AllFluidTags(NameSpace namespace, String path, boolean optional, boolean alwaysDatagen) { + ResourceLocation id = new ResourceLocation(namespace.id, path == null ? Lang.asId(name()) : path); + if (optional) { + tag = FluidTags.createOptional(id); + } else { + tag = FluidTags.bind(id.toString()); + } + if (alwaysDatagen) { + REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag)); + } } public boolean matches(Fluid fluid) { return fluid != null && fluid.is(tag); } + public void add(Fluid... values) { + REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag) + .add(values)); + } + + public void includeIn(ITag.INamedTag parent) { + REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(parent) + .addTag(tag)); + } + + public void includeIn(AllFluidTags parent) { + includeIn(parent.tag); + } + + public void includeAll(ITag.INamedTag child) { + REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag) + .addTag(child)); + } + private static void loadClass() {} } public static void register() { + AllFluidTags.loadClass(); + AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT); AllItemTags.CREATE_INGOTS.includeIn(Tags.Items.INGOTS); @@ -249,8 +325,6 @@ public class AllTags { AllBlockTags.WRENCH_PICKUP.add(Blocks.REDSTONE_WIRE, Blocks.REDSTONE_TORCH, Blocks.REPEATER, Blocks.LEVER, Blocks.COMPARATOR, Blocks.OBSERVER, Blocks.REDSTONE_WALL_TORCH, Blocks.PISTON, Blocks.STICKY_PISTON, Blocks.TRIPWIRE, Blocks.TRIPWIRE_HOOK, Blocks.DAYLIGHT_DETECTOR, Blocks.TARGET); - - AllFluidTags.loadClass(); } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/ConfigureSymmetryWandPacket.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/ConfigureSymmetryWandPacket.java new file mode 100644 index 000000000..9484111cc --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/ConfigureSymmetryWandPacket.java @@ -0,0 +1,50 @@ +package com.simibubi.create.content.curiosities.symmetry; + +import java.util.function.Supplier; + +import com.simibubi.create.content.curiosities.symmetry.mirror.SymmetryMirror; +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.Hand; +import net.minecraftforge.fml.network.NetworkEvent.Context; + +public class ConfigureSymmetryWandPacket extends SimplePacketBase { + + protected Hand hand; + protected SymmetryMirror mirror; + + public ConfigureSymmetryWandPacket(Hand hand, SymmetryMirror mirror) { + this.hand = hand; + this.mirror = mirror; + } + + public ConfigureSymmetryWandPacket(PacketBuffer buffer) { + hand = buffer.readEnum(Hand.class); + mirror = SymmetryMirror.fromNBT(buffer.readNbt()); + } + + @Override + public void write(PacketBuffer buffer) { + buffer.writeEnum(hand); + buffer.writeNbt(mirror.writeToNbt()); + } + + @Override + public void handle(Supplier context) { + context.get().enqueueWork(() -> { + ServerPlayerEntity player = context.get().getSender(); + if (player == null) { + return; + } + ItemStack stack = player.getItemInHand(hand); + if (stack.getItem() instanceof SymmetryWandItem) { + SymmetryWandItem.configureSettings(stack, mirror); + } + }); + context.get().setPacketHandled(true); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java index f912de98b..c2a39906a 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java @@ -181,10 +181,15 @@ public class SymmetryWandItem extends Item { public static SymmetryMirror getMirror(ItemStack stack) { checkNBT(stack); - return SymmetryMirror.fromNBT((CompoundNBT) stack.getTag() + return SymmetryMirror.fromNBT(stack.getTag() .getCompound(SYMMETRY)); } + public static void configureSettings(ItemStack stack, SymmetryMirror mirror) { + checkNBT(stack); + stack.getTag().put(SYMMETRY, mirror.writeToNbt()); + } + public static void apply(World world, ItemStack wand, PlayerEntity player, BlockPos pos, BlockState block) { checkNBT(wand); if (!isEnabled(wand)) diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java index 7760f56b2..875326f8b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java @@ -15,17 +15,14 @@ import com.simibubi.create.foundation.gui.widgets.Label; import com.simibubi.create.foundation.gui.widgets.ScrollInput; import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput; import com.simibubi.create.foundation.networking.AllPackets; -import com.simibubi.create.foundation.networking.NbtPacket; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Hand; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3f; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; -import net.minecraftforge.fml.network.PacketDistributor; public class SymmetryWandScreen extends AbstractSimiScreen { @@ -45,8 +42,6 @@ public class SymmetryWandScreen extends AbstractSimiScreen { private Hand hand; public SymmetryWandScreen(ItemStack wand, Hand hand) { - super(); - background = AllGuiTextures.WAND_OF_SYMMETRY; currentElement = SymmetryWandItem.getMirror(wand); @@ -150,19 +145,14 @@ public class SymmetryWandScreen extends AbstractSimiScreen { @Override public void removed() { - ItemStack heldItem = minecraft.player.getItemInHand(hand); - CompoundNBT compound = heldItem.getTag(); - compound.put(SymmetryWandItem.SYMMETRY, currentElement.writeToNbt()); - heldItem.setTag(compound); - AllPackets.channel.send(PacketDistributor.SERVER.noArg(), new NbtPacket(heldItem, hand)); - minecraft.player.setItemInHand(hand, heldItem); - super.removed(); + SymmetryWandItem.configureSettings(wand, currentElement); + AllPackets.channel.sendToServer(new ConfigureSymmetryWandPacket(hand, currentElement)); } @Override public boolean mouseClicked(double x, double y, int button) { if (confirmButton.isHovered()) { - minecraft.player.closeContainer(); + onClose(); return true; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ConfigureZapperPacket.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ConfigureZapperPacket.java new file mode 100644 index 000000000..ee0026820 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ConfigureZapperPacket.java @@ -0,0 +1,51 @@ +package com.simibubi.create.content.curiosities.zapper; + +import java.util.function.Supplier; + +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.Hand; +import net.minecraftforge.fml.network.NetworkEvent.Context; + +public abstract class ConfigureZapperPacket extends SimplePacketBase { + + protected Hand hand; + protected PlacementPatterns pattern; + + public ConfigureZapperPacket(Hand hand, PlacementPatterns pattern) { + this.hand = hand; + this.pattern = pattern; + } + + public ConfigureZapperPacket(PacketBuffer buffer) { + hand = buffer.readEnum(Hand.class); + pattern = buffer.readEnum(PlacementPatterns.class); + } + + @Override + public void write(PacketBuffer buffer) { + buffer.writeEnum(hand); + buffer.writeEnum(pattern); + } + + @Override + public void handle(Supplier context) { + context.get().enqueueWork(() -> { + ServerPlayerEntity player = context.get().getSender(); + if (player == null) { + return; + } + ItemStack stack = player.getItemInHand(hand); + if (stack.getItem() instanceof ZapperItem) { + configureZapper(stack); + } + }); + context.get().setPacketHandled(true); + } + + public abstract void configureZapper(ItemStack stack); + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/PlacementPatterns.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/PlacementPatterns.java index 416400af0..9a8f85b9e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/PlacementPatterns.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/PlacementPatterns.java @@ -21,8 +21,8 @@ public enum PlacementPatterns { Chance50(AllIcons.I_PATTERN_CHANCE_50), Chance75(AllIcons.I_PATTERN_CHANCE_75); - public String translationKey; - public AllIcons icon; + public final String translationKey; + public final AllIcons icon; private PlacementPatterns(AllIcons icon) { this.translationKey = Lang.asId(name()); diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java index c8f895948..a42370581 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java @@ -10,6 +10,7 @@ import com.simibubi.create.CreateClient; import com.simibubi.create.foundation.item.ItemDescription; import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.Lang; +import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.NBTProcessors; import net.minecraft.block.BlockState; @@ -90,7 +91,7 @@ public abstract class ZapperItem extends Item { .isShiftKeyDown()) { if (context.getLevel().isClientSide) { DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - openHandgunGUI(context.getItemInHand(), context.getHand() == Hand.OFF_HAND); + openHandgunGUI(context.getItemInHand(), context.getHand()); }); context.getPlayer() .getCooldowns() @@ -112,7 +113,7 @@ public abstract class ZapperItem extends Item { if (player.isShiftKeyDown()) { if (world.isClientSide) { DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - openHandgunGUI(item, hand == Hand.OFF_HAND); + openHandgunGUI(item, hand); }); player.getCooldowns() .addCooldown(item.getItem(), 10); @@ -187,7 +188,7 @@ public abstract class ZapperItem extends Item { BlockRayTraceResult raytrace, CompoundNBT data); @OnlyIn(Dist.CLIENT) - protected abstract void openHandgunGUI(ItemStack item, boolean b); + protected abstract void openHandgunGUI(ItemStack item, Hand hand); protected abstract int getCooldownDelay(ItemStack item); @@ -212,6 +213,11 @@ public abstract class ZapperItem extends Item { return UseAction.NONE; } + public static void configureSettings(ItemStack stack, PlacementPatterns pattern) { + CompoundNBT nbt = stack.getOrCreateTag(); + NBTHelper.writeEnum(nbt, "Pattern", pattern); + } + public static void setTileData(World world, BlockPos pos, BlockState state, CompoundNBT data, PlayerEntity player) { if (data != null && AllBlockTags.SAFE_NBT.matches(state)) { TileEntity tile = world.getBlockEntity(pos); diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperScreen.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperScreen.java index a546067d2..feaf0561e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperScreen.java @@ -9,8 +9,8 @@ import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.gui.GuiGameElement; import com.simibubi.create.foundation.gui.widgets.IconButton; import com.simibubi.create.foundation.networking.AllPackets; -import com.simibubi.create.foundation.networking.NbtPacket; import com.simibubi.create.foundation.utility.Lang; +import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -22,29 +22,34 @@ import net.minecraft.util.math.vector.Vector3f; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; -public class ZapperScreen extends AbstractSimiScreen { - - protected ItemStack zapper; - protected boolean offhand; - protected float animationProgress; - protected AllGuiTextures background; - private IconButton confirmButton; +public abstract class ZapperScreen extends AbstractSimiScreen { protected final ITextComponent patternSection = Lang.translate("gui.terrainzapper.patternSection"); + protected AllGuiTextures background; + protected ItemStack zapper; + protected Hand hand; + + protected float animationProgress; + protected ITextComponent title; - protected Vector patternButtons; + protected Vector patternButtons = new Vector<>(6); + private IconButton confirmButton; protected int brightColor; protected int fontColor; - public ZapperScreen(AllGuiTextures background, ItemStack zapper, boolean offhand) { - super(); + protected PlacementPatterns currentPattern; + + public ZapperScreen(AllGuiTextures background, ItemStack zapper, Hand hand) { this.background = background; this.zapper = zapper; - this.offhand = offhand; + this.hand = hand; title = StringTextComponent.EMPTY; brightColor = 0xFEFEFE; fontColor = AllGuiTextures.FONT_COLOR; + + CompoundNBT nbt = zapper.getOrCreateTag(); + currentPattern = NBTHelper.readEnum(nbt, "Pattern", PlacementPatterns.class); } @Override @@ -63,9 +68,7 @@ public class ZapperScreen extends AbstractSimiScreen { new IconButton(x + background.width - 33, y + background.height - 24, AllIcons.I_CONFIRM); widgets.add(confirmButton); - CompoundNBT nbt = zapper.getOrCreateTag(); - - patternButtons = new Vector<>(6); + patternButtons.clear(); for (int row = 0; row <= 1; row++) { for (int col = 0; col <= 2; col++) { int id = patternButtons.size(); @@ -77,9 +80,7 @@ public class ZapperScreen extends AbstractSimiScreen { } } - if (nbt.contains("Pattern")) - patternButtons.get(PlacementPatterns.valueOf(nbt.getString("Pattern")) - .ordinal()).active = false; + patternButtons.get(currentPattern.ordinal()).active = false; widgets.addAll(patternButtons); } @@ -108,21 +109,19 @@ public class ZapperScreen extends AbstractSimiScreen { @Override public void removed() { - CompoundNBT nbt = zapper.getTag(); - writeAdditionalOptions(nbt); - AllPackets.channel.sendToServer(new NbtPacket(zapper, offhand ? Hand.OFF_HAND : Hand.MAIN_HAND)); + ConfigureZapperPacket packet = getConfigurationPacket(); + packet.configureZapper(zapper); + AllPackets.channel.sendToServer(packet); } @Override public boolean mouseClicked(double x, double y, int button) { - CompoundNBT nbt = zapper.getTag(); - for (IconButton patternButton : patternButtons) { if (patternButton.isHovered()) { patternButtons.forEach(b -> b.active = true); patternButton.active = false; patternButton.playDownSound(minecraft.getSoundManager()); - nbt.putString("Pattern", PlacementPatterns.values()[patternButtons.indexOf(patternButton)].name()); + currentPattern = PlacementPatterns.values()[patternButtons.indexOf(patternButton)]; } } @@ -159,6 +158,6 @@ public class ZapperScreen extends AbstractSimiScreen { ms.popPose(); } - protected void writeAdditionalOptions(CompoundNBT nbt) {} + protected abstract ConfigureZapperPacket getConfigurationPacket(); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/ConfigureWorldshaperPacket.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/ConfigureWorldshaperPacket.java new file mode 100644 index 000000000..a5b849c85 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/ConfigureWorldshaperPacket.java @@ -0,0 +1,55 @@ +package com.simibubi.create.content.curiosities.zapper.terrainzapper; + +import com.simibubi.create.content.curiosities.zapper.ConfigureZapperPacket; +import com.simibubi.create.content.curiosities.zapper.PlacementPatterns; + +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.Hand; + +public class ConfigureWorldshaperPacket extends ConfigureZapperPacket { + + protected TerrainBrushes brush; + protected int brushParamX; + protected int brushParamY; + protected int brushParamZ; + protected TerrainTools tool; + protected PlacementOptions placement; + + public ConfigureWorldshaperPacket(Hand hand, PlacementPatterns pattern, TerrainBrushes brush, int brushParamX, int brushParamY, int brushParamZ, TerrainTools tool, PlacementOptions placement) { + super(hand, pattern); + this.brush = brush; + this.brushParamX = brushParamX; + this.brushParamY = brushParamY; + this.brushParamZ = brushParamZ; + this.tool = tool; + this.placement = placement; + } + + public ConfigureWorldshaperPacket(PacketBuffer buffer) { + super(buffer); + brush = buffer.readEnum(TerrainBrushes.class); + brushParamX = buffer.readVarInt(); + brushParamY = buffer.readVarInt(); + brushParamZ = buffer.readVarInt(); + tool = buffer.readEnum(TerrainTools.class); + placement = buffer.readEnum(PlacementOptions.class); + } + + @Override + public void write(PacketBuffer buffer) { + super.write(buffer); + buffer.writeEnum(brush); + buffer.writeVarInt(brushParamX); + buffer.writeVarInt(brushParamY); + buffer.writeVarInt(brushParamZ); + buffer.writeEnum(tool); + buffer.writeEnum(placement); + } + + @Override + public void configureZapper(ItemStack stack) { + WorldshaperItem.configureSettings(stack, pattern, brush, brushParamX, brushParamY, brushParamZ, tool, placement); + } + +} diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java index 107aa9a8b..4aa0da531 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.text.ITextComponent; @@ -29,8 +30,8 @@ public class WorldshaperItem extends ZapperItem { @Override @OnlyIn(value = Dist.CLIENT) - protected void openHandgunGUI(ItemStack item, boolean b) { - ScreenOpener.open(new WorldshaperScreen(item, b)); + protected void openHandgunGUI(ItemStack item, Hand hand) { + ScreenOpener.open(new WorldshaperScreen(item, hand)); } @Override @@ -82,4 +83,13 @@ public class WorldshaperItem extends ZapperItem { return true; } + public static void configureSettings(ItemStack stack, PlacementPatterns pattern, TerrainBrushes brush, int brushParamX, int brushParamY, int brushParamZ, TerrainTools tool, PlacementOptions placement) { + ZapperItem.configureSettings(stack, pattern); + CompoundNBT nbt = stack.getOrCreateTag(); + NBTHelper.writeEnum(nbt, "Brush", brush); + nbt.put("BrushParams", NBTUtil.writeBlockPos(new BlockPos(brushParamX, brushParamY, brushParamZ))); + nbt.putString("Tool", tool.name()); + nbt.putString("Placement", placement.name()); + } + } diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperScreen.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperScreen.java index 2203efdca..cc970b875 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperScreen.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Vector; import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.content.curiosities.zapper.ConfigureZapperPacket; import com.simibubi.create.content.curiosities.zapper.ZapperScreen; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; @@ -16,13 +17,14 @@ import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.NBTHelper; -import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; +import net.minecraftforge.common.util.Constants; public class WorldshaperScreen extends ZapperScreen { @@ -36,20 +38,41 @@ public class WorldshaperScreen extends ZapperScreen { protected ScrollInput brushInput; protected Label brushLabel; - protected Vector brushParams; - protected Vector